/**
 * Touch and gesture utilities for web components
 * @countermeasure/web-components/utils/touch
 *
 * Provides swipe detection, touch-or-click handling,
 * and pinch-to-zoom support for mobile accessibility.
 */
export type SwipeDirection = 'left' | 'right' | 'up' | 'down';
export interface SwipeOptions {
    /** Minimum distance in pixels to trigger a swipe (default: 50) */
    threshold?: number;
    /** Maximum time in ms for a swipe gesture (default: 300) */
    timeout?: number;
    /** Callback when swipe is detected */
    onSwipe?: (direction: SwipeDirection, event: TouchEvent) => void;
    /** Callback when swipe starts */
    onSwipeStart?: (event: TouchEvent) => void;
    /** Callback when swipe ends without triggering */
    onSwipeEnd?: (event: TouchEvent) => void;
    /** Whether to prevent default behavior during swipe */
    preventDefault?: boolean;
}
export interface SwipeDetector {
    /** Enable swipe detection */
    enable: () => void;
    /** Disable swipe detection */
    disable: () => void;
    /** Check if detection is enabled */
    isEnabled: () => boolean;
    /** Clean up event listeners */
    destroy: () => void;
}
export interface PinchOptions {
    /** Minimum scale change to trigger callback (default: 0.1) */
    threshold?: number;
    /** Callback when pinch is detected */
    onPinch?: (scale: number, event: TouchEvent) => void;
    /** Callback when pinch starts */
    onPinchStart?: (event: TouchEvent) => void;
    /** Callback when pinch ends */
    onPinchEnd?: (event: TouchEvent) => void;
}
export interface PinchDetector {
    /** Enable pinch detection */
    enable: () => void;
    /** Disable pinch detection */
    disable: () => void;
    /** Get the current pinch scale */
    getScale: () => number;
    /** Reset scale to 1 */
    resetScale: () => void;
    /** Clean up event listeners */
    destroy: () => void;
}
export interface PanOptions {
    /** Callback when pan occurs */
    onPan?: (deltaX: number, deltaY: number, event: TouchEvent) => void;
    /** Callback when pan starts */
    onPanStart?: (event: TouchEvent) => void;
    /** Callback when pan ends */
    onPanEnd?: (event: TouchEvent) => void;
    /** Whether to prevent default behavior during pan */
    preventDefault?: boolean;
}
export interface PanDetector {
    /** Enable pan detection */
    enable: () => void;
    /** Disable pan detection */
    disable: () => void;
    /** Clean up event listeners */
    destroy: () => void;
}
/**
 * Create a swipe gesture detector for an element.
 * Detects horizontal and vertical swipes with configurable threshold.
 */
export declare function detectSwipe(element: HTMLElement, options?: SwipeOptions): SwipeDetector;
/**
 * Handle both touch and click events without double-firing.
 * Uses touch events on touch devices, click events otherwise.
 */
export declare function handleTouchOrClick(element: HTMLElement, callback: (event: TouchEvent | MouseEvent) => void): () => void;
/**
 * Add a touchstart handler that also works with mouse for accessibility.
 * Returns a cleanup function.
 */
export declare function onPointerDown(element: HTMLElement, callback: (event: PointerEvent | TouchEvent | MouseEvent) => void): () => void;
/**
 * Create a pinch-to-zoom detector for an element.
 */
export declare function detectPinch(element: HTMLElement, options?: PinchOptions): PinchDetector;
/**
 * Create a pan (single-finger drag) detector for an element.
 */
export declare function detectPan(element: HTMLElement, options?: PanOptions): PanDetector;
export interface LongPressOptions {
    /** Duration in ms to trigger long press (default: 500) */
    duration?: number;
    /** Callback when long press is triggered */
    onLongPress?: (event: TouchEvent) => void;
    /** Movement threshold in pixels to cancel long press (default: 10) */
    moveThreshold?: number;
}
export interface LongPressDetector {
    /** Enable detection */
    enable: () => void;
    /** Disable detection */
    disable: () => void;
    /** Clean up */
    destroy: () => void;
}
/**
 * Create a long press detector for context menu or similar actions.
 */
export declare function detectLongPress(element: HTMLElement, options?: LongPressOptions): LongPressDetector;
/**
 * Check if the device supports touch events.
 */
export declare function isTouchDevice(): boolean;
/**
 * Check if the device is likely a mobile device based on screen size.
 */
export declare function isMobileViewport(): boolean;
/**
 * Check if the device is in portrait orientation.
 */
export declare function isPortrait(): boolean;
/**
 * Get the safe area insets for notched devices.
 */
export declare function getSafeAreaInsets(): {
    top: number;
    right: number;
    bottom: number;
    left: number;
};
//# sourceMappingURL=touch.d.ts.map