Gesture
A gesture's data; the kernel reads it, apps compose and attach it.
Utilização
Recognize a directional swipe.
Este tipo é usado por 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]} />;Declaração do tipo
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;
}Membros 7
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
typesó de leitura | GestureType | Sim | — |
kindsó de leitura | GestureKind | Sim | — |
configsó de leitura | Readonly<Record<string, unknown>> | Sim | — |
callbackssó de leitura | Readonly<Callbacks<never, never>> | Sim | — |
releasingsó de leitura | Animation<unknown> | Não | How the motion values following it let go when it ends. |
release | (animation: Animation<unknown>) => Gesture | Sim | 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. |
activesó de leitura | GestureSource | Sim | 1 while it is active, 0 otherwise. |
release — assinaturas de método
Assinaturas
(animation: Animation<unknown>): GestureParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
animation | Animation<unknown> | Sim | — |
Devolve
Gesture
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.