PanGesture
The gesture pan() makes, with x and y translation sources that motion values follow.
Usage
Type a shared gesture callback.
This type is used by pan
// Type a shared gesture callback.
import { Box, pan, tap, type GestureEvent } from 'kuito';
// Any gesture's event carries how many fingers it involves.
const logFingers = (event: GestureEvent) => console.log(`${event.numberOfPointers} finger(s)`);
<Box gestures={[tap({ onEnd: logFingers }), pan({ onStart: logFingers })]} />;Type declaration
export interface PanGesture extends Gesture {
/** Its translation, added to where the follower was when it activated. */
readonly x: GestureSource;
readonly y: GestureSource;
}Members 9
| Name | Type | Required | Description |
|---|---|---|---|
xreadonly | GestureSource | Yes | Its translation, added to where the follower was when it activated. |
yreadonly | GestureSource | Yes | — |
typereadonly | GestureType | Yes | — |
kindreadonly | GestureKind | Yes | — |
configreadonly | Readonly<Record<string, unknown>> | Yes | — |
callbacksreadonly | Readonly<Callbacks<never, never>> | Yes | — |
releasingreadonly | Animation<unknown> | No | How the motion values following it let go when it ends. |
release | (animation: Animation<unknown>) => PanGesture | Yes | The same gesture, letting go with animation: each follower runs it with
the gesture's velocity, toward its own home (its first value) unless the
animation names a target. |
activereadonly | GestureSource | Yes | 1 while it is active, 0 otherwise. |
release — method signatures
Signatures
(animation: Animation<unknown>): PanGestureParameters
| Name | Type | Required | Description |
|---|---|---|---|
animation | Animation<unknown> | Yes | — |
Returns
PanGesture
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.