Gesture
A gesture's data; the kernel reads it, apps compose and attach it.
Verwendung
Recognize a directional swipe.
Dieser Typ wird verwendet von 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]} />;Typdeklaration
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;
}Mitglieder 7
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
typeschreibgeschützt | GestureType | Ja | — |
kindschreibgeschützt | GestureKind | Ja | — |
configschreibgeschützt | Readonly<Record<string, unknown>> | Ja | — |
callbacksschreibgeschützt | Readonly<Callbacks<never, never>> | Ja | — |
releasingschreibgeschützt | Animation<unknown> | Nein | How the motion values following it let go when it ends. |
release | (animation: Animation<unknown>) => Gesture | Ja | 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. |
activeschreibgeschützt | GestureSource | Ja | 1 while it is active, 0 otherwise. |
release — Methodensignaturen
Signaturen
(animation: Animation<unknown>): GestureParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
animation | Animation<unknown> | Ja | — |
Rückgabe
Gesture
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.