import { UsePopoverPositioningOptions } from './usePopoverPositioning'; export interface UseDropdownPositioningOptions extends UsePopoverPositioningOptions { /** Whether the dropdown is open */ isOpen: boolean; /** Called when the dropdown should close */ onClose?: () => void; /** Whether to close on click outside */ closeOnClickOutside?: boolean; /** Whether to close on escape key */ closeOnEscape?: boolean; } export interface UseDropdownPositioningReturn { /** Current position result */ position: import('../utils/positioning-enhanced').PositionResult | null; /** Update position manually. Pass `{ silent: true }` to skip the isPositioning flag. */ updatePosition: (options?: { silent?: boolean; }) => Promise; /** Whether positioning is currently being calculated */ isPositioning: boolean; /** Ref to attach to the anchor element */ anchorRef: React.RefObject; /** Ref to attach to the popover element for size measurement */ popoverRef: React.RefObject; /** Function to create and show the overlay with content */ showOverlay: (content: React.ReactElement, overrides?: { width?: number | string; maxHeight?: number | string; zIndex?: number; /** * Interaction that opened the overlay. `'hover'` is meaningful to the * renderer: hover overlays are exempt from outside-click dismissal, since * they close when the pointer leaves instead. */ trigger?: 'click' | 'hover' | 'contextmenu' | 'manual'; /** Defaults to `'fixed'`; pass `'portal'` for a native modal-hosted overlay. */ strategy?: 'absolute' | 'fixed' | 'portal'; }) => void; /** Function to hide the overlay */ hideOverlay: () => void; } /** * Hook for managing dropdown positioning and overlay lifecycle. * * This hook combines usePopoverPositioning with useOverlay to provide a complete * dropdown solution that handles: * - Intelligent positioning with viewport constraints * - Automatic flipping and shifting * - Overlay lifecycle management * - Click outside and escape key handling * * Used by both AutoComplete and ColorInput components to ensure consistent * dropdown behavior across the component library. * * @example * ```tsx * const { anchorRef, popoverRef, showOverlay, position } = useDropdownPositioning({ * isOpen: dropdownOpen, * placement: 'bottom-start', * flip: true, * shift: true, * onClose: () => setDropdownOpen(false), * }); * * // When ready to show dropdown * if (position) { * showOverlay(); * } * ``` */ export declare function useDropdownPositioning(options: UseDropdownPositioningOptions): UseDropdownPositioningReturn;