Utilisation

Track raw touch movement over a drawing surface.

Ce type est utilisé par touches

tsx
// Track raw touch movement over a drawing surface.
import { Box, touches } from 'kuito';

export function TouchSurface() {
  const input = touches({ onChange: (event) => console.log(event.changeX, event.changeY) });
  return <Box gestures={[input]} width={240} height={240} backgroundColor="#e2e8f0" />;
}

Déclaration du type

ts
export type TouchesOptions = Common & Callbacks<PanEvent, PanChangeEvent>;

Membres 5

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

Signatures

ts
(event: PanEvent): void

Paramètres

NomTypeRequisDescription
eventPanEventOui—

Retourne

void

onChange — signatures de méthode

Signatures

ts
(event: PanChangeEvent): void

Paramètres

NomTypeRequisDescription
eventPanChangeEventOui—

Retourne

void

onEnd — signatures de méthode

Signatures

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

Paramètres

NomTypeRequisDescription
eventPanEventOui—
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.