PinchOptions
Sets a pinch() gesture's callbacks, and when and where it takes touches.
Utilização
Apply a pinch's change in scale.
Este tipo é usado por pinch
// Apply a pinch's change in scale.
import { Text, pinch, signal, type PinchChangeEvent } from 'kuito';
const fontSize = signal(17);
// Text size follows the pinch, between 12 and 34 points.
const resize = (event: PinchChangeEvent) => {
fontSize.value = Math.min(34, Math.max(12, fontSize.value * event.scaleChange));
};
<Text fontSize={fontSize.value} gestures={[pinch({ onChange: resize })]}>
Pinch to resize
</Text>;Declaração do tipo
export type PinchOptions = Common & Callbacks<PinchEvent, PinchChangeEvent>;Membros 5
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
disabled | boolean | Não | Ignores touches, like a disabled Pressable. |
hitArea | HitArea | Não | Insets of the area that takes touches: one for every edge, or by edge. |
onStart | (event: PinchEvent) => void | Não | It activated. |
onChange | (event: PinchChangeEvent) => void | Não | It moved, with the change since the last move. |
onEnd | (event: PinchEvent, success: boolean) => void | Não | It ended after activating: success is false when it was cancelled. |
onStart — assinaturas de método
Assinaturas
onChange — assinaturas de método
Assinaturas
(event: PinchChangeEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | PinchChangeEvent | Sim | — |
Devolve
void
onEnd — assinaturas de método
Assinaturas
(event: PinchEvent, success: boolean): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | PinchEvent | Sim | — |
success | boolean | Sim | — |
Devolve
void
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.