import { RefObject } from 'react'; export interface DraggablePosition { x: number | null; y: number | null; } export interface UseDraggableOptions { /** Enable dragging (default: true) */ enabled?: boolean; /** Constrain to viewport (default: true) */ constrainToViewport?: boolean; /** Only allow horizontal dragging */ horizontalOnly?: boolean; /** Only allow vertical dragging */ verticalOnly?: boolean; /** Initial position */ initialPosition?: { x?: number; y?: number; }; } export interface UseDraggableReturn { /** Current position */ position: DraggablePosition; /** Whether currently dragging */ isDragging: boolean; /** Mouse down handler for drag handle */ handleMouseDown: (e: React.MouseEvent) => void; /** Reset position to initial/default */ resetPosition: () => void; /** Ref to attach to draggable element */ ref: RefObject; } /** * Hook to make an element draggable * * @example * ```tsx * const { position, isDragging, handleMouseDown, ref } = useDraggable({ * horizontalOnly: true, * }); * * return ( *
*
Drag Handle
*
* ); * ``` */ export declare const useDraggable: (options?: UseDraggableOptions) => UseDraggableReturn; //# sourceMappingURL=useDraggable.d.ts.map