Utilisation

Type a shared gesture callback.

Ce type est utilisé par tap

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 })]} />;

Déclaration du type

ts
export interface TapOptions extends Common, Callbacks<TapEvent, TapEvent> {
  /** Taps in a row: 2 for a double tap. */
  count?: number;
  maxDuration?: number;
  maxDistance?: number;
}

Membres 8

NomTypeRequisDescription
countnumberNonTaps in a row: 2 for a double tap.
maxDurationnumberNon—
maxDistancenumberNon—
disabledbooleanNonIgnores touches, like a disabled Pressable.
hitAreaHitAreaNonInsets of the area that takes touches: one for every edge, or by edge.
onStart(event: PositionEvent) => voidNonIt activated.
onChange(event: PositionEvent) => voidNonIt moved, with the change since the last move.
onEnd(event: PositionEvent, success: boolean) => voidNonIt ended after activating: success is false when it was cancelled.
onStart — signatures de méthode

Signatures

ts
(event: PositionEvent): void

Paramètres

NomTypeRequisDescription
eventPositionEventOui—

Retourne

void

onChange — signatures de méthode

Signatures

ts
(event: PositionEvent): void

Paramètres

NomTypeRequisDescription
eventPositionEventOui—

Retourne

void

onEnd — signatures de méthode

Signatures

ts
(event: PositionEvent, success: boolean): void

Paramètres

NomTypeRequisDescription
eventPositionEventOui—
successbooleanOui—

Retourne

void

Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.