Skip to main content

Interfaces

TPointersType

type TPointersType = 'mouse' | 'touch';

Used by type-aware props (buttons, minPointers, maxPointers).
Resolved from PointerEvent.pointerType on the first pointer of a gesture; unknown values fall back to 'mouse'.

IPointersMove

Aggregated gesture state passed to the move callback and exposed via the move accessor.

interface IPointersMove {
center: IPointersVec2; // Average of current pointer positions (pan origin).
prevCenter: IPointersVec2; // Previous move center.
startCenter: IPointersVec2; // Center on the first move after start.
distance: number; // Average span between pointers (px).
prevDistance: number; // Span on the previous move.
startDistance: number; // Span on the first move after start.
scale: number; // distance / startDistance — pinch multiplier since start.
prevScale: number; // Previous scale value.
angle: number; // Cumulative rotation since start (deg, unwrapped).
prevAngle: number; // Previous angle value.
}

Pan delta: center.x - prevCenter.x, center.y - prevCenter.y
Pinch step: scale / prevScale (multiplicative)
Rotate delta: angle - prevAngle

scale and angle update only when at least two pointers are active.

IPointersItem

interface IPointersItem {
id: number; // Native pointerId from the browser.
index: number; // Index assigned to the pointer.
start: IPointersVec2; // Coordinates recorded on pointerdown.
prev: IPointersVec2; // Coordinates from the previous update cycle.
current: IPointersVec2; // Latest coordinates of the pointer.
diff: IPointersVec2; // Difference between current and start positions.
step: IPointersVec2; // Movement delta between current and prev.
accum: IPointersVec2; // Total accumulated movement across all updates.
}

IPointersVec2

interface IPointersVec2 {
x: number; // X-coordinate relative to the container.
y: number; // Y-coordinate relative to the container.
}