Gesture
A gesture's data; the kernel reads it, apps compose and attach it.
Usage
Recognize a directional swipe.
This type is used by fling
// Recognize a directional swipe.
import { Box, fling, signal } from 'kuito';
const page = signal(0);
const swipe = fling({
direction: ['left', 'right'],
onEnd: (event, success) => {
if (success) page.value += 1;
},
});
<Box gestures={[swipe]} />;Type declaration
export interface Gesture {
readonly __kuitoGesture: 'gesture';
readonly type: GestureType;
readonly kind: GestureKind;
readonly config: Readonly<Record<string, unknown>>;
readonly callbacks: Readonly<Callbacks<never, never>>;
/** How the motion values following it let go when it ends. */
readonly releasing?: Animation<unknown>;
/**
* 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.
*/
release(animation: Animation<unknown>): this;
/** 1 while it is active, 0 otherwise. */
readonly active: GestureSource;
}Members 7
| Name | Type | Required | Description |
|---|---|---|---|
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>) => Gesture | 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>): GestureParameters
| Name | Type | Required | Description |
|---|---|---|---|
animation | Animation<unknown> | Yes | — |
Returns
Gesture
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.