import { InteractionBox, ResizeHandleId, SnapLine, SnapSibling } from 'pptx-viewer-shared'; /** * Pointer gesture driver for the editing overlay: move / resize / rotate. * * All geometry math comes from the shared `element-interaction` helpers * (`applyDragDelta`, `applyResize`, `computeRotation`, `snapAngle`) plus the * shared `computeSnapToShape` snap model during moves; this module only owns * the pointer-event lifecycle (dead-zone, window listeners, cancel). It is * framework-agnostic (no Svelte), matching the vanilla binding's driver. */ export type GestureKind = 'move' | 'resize' | 'rotate'; /** Live geometry emitted during and at the end of a gesture (element px). */ export interface GestureTransform { id: string; x: number; y: number; width: number; height: number; rotation: number; } export interface GestureDeps { /** Current stage scale (screen px per element px). */ getScale(): number; /** Element geometry at gesture start (element px). */ getElementBox(id: string): InteractionBox | undefined; /** Sibling boxes on the same slide, for snap-to-shape during a move. */ getSiblings(): SnapSibling[]; getSnapToGrid?(): boolean; getSnapToShape?(): boolean; getGridSize?(): number; getGuides?(): readonly { axis: 'h' | 'v'; position: number; }[]; /** Overlay origin in client coordinates, for rotation pointer mapping. */ getStageOrigin(): { left: number; top: number; }; /** First movement past the dead zone (push history, mark interaction). */ onStart(id: string, kind: GestureKind): void; /** Live preview: apply the geometry and render `lines` as snap guides. */ onPreview(transform: GestureTransform, lines: readonly SnapLine[]): void; /** Gesture finished. `moved` is false for a plain tap (no dead-zone exit). */ onEnd(transform: GestureTransform | null, moved: boolean, id: string): void; } export interface GestureController { /** Begin a gesture from a `pointerdown`. `handle` only for `resize`. */ begin(kind: GestureKind, id: string, event: PointerEvent, handle?: ResizeHandleId): void; isActive(): boolean; /** Abort listeners without emitting an end transform (teardown). */ dispose(): void; } export declare function createGestureController(deps: GestureDeps): GestureController; //# sourceMappingURL=editor-gestures.d.ts.map