TapOptions
Sets how many taps in a row a tap() gesture needs and how quick and still they must be, and its callbacks.
Usage
Type a shared gesture callback.
This type is used by tap
// 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
export interface TapOptions extends Common, Callbacks<TapEvent, TapEvent> {
/** Taps in a row: 2 for a double tap. */
count?: number;
maxDuration?: number;
maxDistance?: number;
}Members 8
| Name | Type | Required | Description |
|---|---|---|---|
count | number | No | Taps in a row: 2 for a double tap. |
maxDuration | number | No | — |
maxDistance | number | No | — |
disabled | boolean | No | Ignores touches, like a disabled Pressable. |
hitArea | HitArea | No | Insets of the area that takes touches: one for every edge, or by edge. |
onStart | (event: PositionEvent) => void | No | It activated. |
onChange | (event: PositionEvent) => void | No | It moved, with the change since the last move. |
onEnd | (event: PositionEvent, success: boolean) => void | No | It ended after activating: success is false when it was cancelled. |
onStart — method signatures
Signatures
(event: PositionEvent): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
event | PositionEvent | Yes | — |
Returns
void
onChange — method signatures
Signatures
(event: PositionEvent): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
event | PositionEvent | Yes | — |
Returns
void
onEnd — method signatures
Signatures
(event: PositionEvent, success: boolean): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
event | PositionEvent | Yes | — |
success | boolean | Yes | — |
Returns
void
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.