メインコンテンツまでスキップ

Pinch event

Pinch values

PropertydefaultDescription
deviceType of device
activefalseWhether drag is active.
_activefalseWhether drag is active.
value[0, 0]Current position
_value[0, 0]Previous position
delta[0, 0]Delta of position
offset[0, 0]Offset of position
movement[0, 0]Movement of position
targetnullTarget element

Pinch events

Event nameArgumentDescription
onPinchPinchStateCalled on all pinch events. Mainly events specified
onPinchStartEvenrtCalled on pinch start event.
onPinchingEventCalled on every pinch event.
onPinchEndEventCalled on pinch end event.
onMountElementCalled when the component is mounted
onCleannullCalled when the component is removed

Pinch state

export type Vec2 = [x: number, y: number]

export interface PinchState<El extends Element = Element> {
_active: boolean
active: boolean
device: 'mouse' | 'pointer' | 'touch'
_value: Vec2
value: Vec2
delta: Vec2
offset: Vec2
movement: Vec2
event: Event
target: El
isPinchStart: boolean
isPinching: boolean
isPinchEnd: boolean
onPinch: (self: PinchState) => void
onPinchStart(e: Event): void
onPinching(e: Event): void
onPinchEnd(e: Event): void
onMount(target: El): void
onClean(target?: El): void
ref(target: El | null): void
}