Verwendung

Type a shared gesture callback.

Dieser Typ wird verwendet von 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 })]} />;

Typdeklaration

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

Mitglieder 8

NameTypErforderlichBeschreibung
countnumberNeinTaps in a row: 2 for a double tap.
maxDurationnumberNein—
maxDistancenumberNein—
disabledbooleanNeinIgnores touches, like a disabled Pressable.
hitAreaHitAreaNeinInsets of the area that takes touches: one for every edge, or by edge.
onStart(event: PositionEvent) => voidNeinIt activated.
onChange(event: PositionEvent) => voidNeinIt moved, with the change since the last move.
onEnd(event: PositionEvent, success: boolean) => voidNeinIt ended after activating: success is false when it was cancelled.
onStart — Methodensignaturen

Signaturen

ts
(event: PositionEvent): void

Parameter

NameTypErforderlichBeschreibung
eventPositionEventJa—

Rückgabe

void

onChange — Methodensignaturen

Signaturen

ts
(event: PositionEvent): void

Parameter

NameTypErforderlichBeschreibung
eventPositionEventJa—

Rückgabe

void

onEnd — Methodensignaturen

Signaturen

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

Parameter

NameTypErforderlichBeschreibung
eventPositionEventJa—
successbooleanJa—

Rückgabe

void

Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.