PanOptions
Restricts a pan() gesture to one axis or a distance before it starts, and sets its callbacks.
Utilisation
Type a shared gesture callback.
Ce type est utilisé par pan
// 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
export interface PanOptions extends Common, Callbacks<PanEvent, PanChangeEvent> {
/** Only along one axis: it starts after 10 along it and fails after 10 across. */
axis?: 'x' | 'y';
/** How far it moves before it activates. */
minDistance?: number;
}Membres 7
| Nom | Type | Requis | Description |
|---|---|---|---|
axis | "x" | "y" | Non | Only along one axis: it starts after 10 along it and fails after 10 across. |
minDistance | number | Non | How far it moves before it activates. |
disabled | boolean | Non | Ignores touches, like a disabled Pressable. |
hitArea | HitArea | Non | Insets of the area that takes touches: one for every edge, or by edge. |
onStart | (event: PanEvent) => void | Non | It activated. |
onChange | (event: PanChangeEvent) => void | Non | It moved, with the change since the last move. |
onEnd | (event: PanEvent, success: boolean) => void | Non | It ended after activating: success is false when it was cancelled. |
onStart — signatures de méthode
Signatures
onChange — signatures de méthode
Signatures
(event: PanChangeEvent): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | PanChangeEvent | Oui | — |
Retourne
void
onEnd — signatures de méthode
Signatures
(event: PanEvent, success: boolean): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | PanEvent | Oui | — |
success | boolean | Oui | — |
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.