/** * Single-finger play-surface gesture recognizer for touch controls: taps, * directional flick swipes, and continuous step drags all resolve to action * names from a TouchGestureBindings declaration. Drag steps stream out of * move() as the finger travels; taps and swipes resolve on end(). Timestamps * are injected so the state machine stays pure; the capture layer owns touch * identifiers and pointer capture. */ import type { TouchGestureBindings } from "./touchScheme.js"; export interface GestureSurfaceTuning { /** A finger that moves less than this (px) and lifts quickly is a tap. */ tapMoveThresholdPx: number; tapMaxMs: number; /** Minimum travel (px) for a lift to register as a swipe. */ swipeMinPx: number; /** Minimum lift velocity (px/ms) for a swipe; slower travel is a drag that ends quietly. */ swipeMinVelocity: number; /** Default travel (px) per repeated drag action when the binding sets none. */ dragStepPx: number; } export declare const DEFAULT_GESTURE_TUNING: GestureSurfaceTuning; export interface GestureSurfaceTracker { begin(x: number, y: number, nowMs: number): void; /** Drag-step actions fired by this movement, in travel order. */ move(x: number, y: number): readonly string[]; /** Tap or swipe action resolved by lifting the finger, if any. */ end(x: number, y: number, nowMs: number): readonly string[]; cancel(): void; isActive(): boolean; } export declare function createGestureSurfaceTracker(bindings: TouchGestureBindings, tuning?: GestureSurfaceTuning): GestureSurfaceTracker;