/**
 * Gesture Resolver — Types
 *
 * Gesture intent vocabulary and context types for the canvas.
 *
 * Core principle: Pencil draws/selects, fingers navigate, mouse does both.
 *
 * @see ./gesture-rules.ts for the composable rule-based resolution system.
 */

import type { InputSource } from './input-classifier';

// =============================================================================
// Gesture Intent Types
// =============================================================================

/** High-level canvas gesture intents */
export type GestureIntent =
    | 'select'            // Tap on a node/edge to select it
    | 'move-node'         // Drag a node to reposition it
    | 'pan'               // Drag the background to pan the viewport
    | 'lasso-select'      // Draw a freeform selection path on background
    | 'rect-select'       // Draw a rectangular selection box on background
    | 'zoom'              // Pinch or scroll to zoom
    | 'context-menu'      // Long-press or right-click for context menu
    | 'edit-node'         // Double-tap/click to enter edit/lock mode
    | 'create-edge'       // Drag from a port to create an edge
    | 'split-node'        // Two-finger diverge to split a node into two copies
    | 'none';             // No action (ignore gesture)

/** Context about where a gesture occurred */
export type GestureTarget =
    | 'node'
    | 'edge'
    | 'port'
    | 'resize-handle'
    | 'background';

/** Gesture type description */
export type GestureType =
    | 'tap'
    | 'double-tap'
    | 'triple-tap'
    | 'drag'
    | 'long-press'
    | 'right-click'
    | 'pinch'
    | 'scroll';

/** Input for intent resolution */
export interface GestureContext {
    /** What input device is being used */
    source: InputSource;
    /** What type of gesture is being performed */
    type: GestureType;
    /** What the gesture is targeting */
    target: GestureTarget;
    /** Whether a modifier key is held (Shift, Cmd/Ctrl) */
    modifierKey?: boolean;
    /** Whether a stylus is currently active (for palm rejection) */
    isStylusActive?: boolean;
}
