RotateOptions
Sets a rotate() gesture's callbacks, and when and where it takes touches.
Utilização
Set a value from a rotation gesture.
Este tipo é usado por rotate
// Set a value from a rotation gesture.
import { Box, motion, rotate, spring, type RotationEvent } from 'kuito';
function Dial(props: { onSet: (degrees: number) => void }) {
const turn = rotate().release(spring());
const angle = motion(0).follows(turn.rotation);
const settle = (event: RotationEvent) => props.onSet(Math.round(event.rotation / 15) * 15);
return (
<Box rotate={angle} gestures={[rotate({ onEnd: settle }), turn]} width={120} height={120} />
);
}Declaração do tipo
export type RotateOptions = Common & Callbacks<RotationEvent, RotationChangeEvent>;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: RotationEvent) => void | Não | It activated. |
onChange | (event: RotationChangeEvent) => void | Não | It moved, with the change since the last move. |
onEnd | (event: RotationEvent, success: boolean) => void | Não | It ended after activating: success is false when it was cancelled. |
onStart — assinaturas de método
Assinaturas
(event: RotationEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | RotationEvent | Sim | — |
Devolve
void
onChange — assinaturas de método
Assinaturas
(event: RotationChangeEvent): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | RotationChangeEvent | Sim | — |
Devolve
void
onEnd — assinaturas de método
Assinaturas
(event: RotationEvent, success: boolean): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | RotationEvent | 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.