import { RefObject } from 'react'; import { ResizeHandleSide } from '../components/ResizeHandle'; export interface UseResizeHandleOptions { initialWidth: number; initialHeight: number; /** Default width to reset to on double-click. Falls back to initialWidth if not provided. */ defaultWidth?: number; /** Default height to reset to on double-click. Falls back to initialHeight if not provided. */ defaultHeight?: number; minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number; /** When true, horizontal resize maintains aspect ratio. Default: true */ maintainAspectRatio?: boolean; disabled?: boolean; onResize: (width: number, height: number) => void; /** Called on double-click after onResize, for additional cleanup (e.g., clearing stored null values) */ onReset?: () => void; } export interface UseResizeHandleResult { width: number; height: number; aspectRatio: number; isDragging: boolean; handleResizeStart: (side: ResizeHandleSide) => (e: React.PointerEvent) => void; } /** * Hook to manage drag-to-resize functionality. * Uses direct DOM manipulation during drag for smooth performance. * * Double-click detection: * - Native `dblclick` events don't fire reliably with `preventDefault()` on `pointerdown` * - Instead, we track timestamps: if two `pointerdown` events occur within DOUBLE_CLICK_THRESHOLD, it's a double-click * - On double-click, dimensions reset to defaults, `onResize` is called to persist, then `onReset` for cleanup * - We also track `hasMovedRef` to avoid persisting on click-without-drag (allows clean double-click UX) */ export declare function useResizeHandle(containerRef: RefObject, options: UseResizeHandleOptions): UseResizeHandleResult;