Usage

Type a shared gesture callback.

This type is used by pan

tsx
// 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

ts
export interface PanGesture extends Gesture {
  /** Its translation, added to where the follower was when it activated. */
  readonly x: GestureSource;
  readonly y: GestureSource;
}

Members 9

NameTypeRequiredDescription
xreadonlyGestureSourceYesIts translation, added to where the follower was when it activated.
yreadonlyGestureSourceYes—
typereadonlyGestureTypeYes—
kindreadonlyGestureKindYes—
configreadonlyReadonly<Record<string, unknown>>Yes—
callbacksreadonlyReadonly<Callbacks<never, never>>Yes—
releasingreadonlyAnimation<unknown>NoHow the motion values following it let go when it ends.
release(animation: Animation<unknown>) => PanGestureYesThe 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.
activereadonlyGestureSourceYes1 while it is active, 0 otherwise.
release — method signatures

Signatures

ts
(animation: Animation<unknown>): PanGesture

Parameters

NameTypeRequiredDescription
animationAnimation<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.