/**
 * Whether any focus-trap Escape handler is currently active (i.e. a popover
 * layer is open). Other overlay primitives that manage their own Escape (e.g.
 * Dialog) can consult this to defer to a popover layered on top of them,
 * giving topmost-only dismissal until a full layer stack exists.
 */
export declare function hasActiveFocusTrapEscape(): boolean;
/**
 * Whether an Escape keydown should be ignored because it is cancelling an
 * in-progress IME composition. CJK/IME users press Escape to cancel
 * composition; that must not close the surrounding overlay. `keyCode === 229`
 * covers browsers that fire keydown before `isComposing` is set. Exported so
 * other overlays (Dialog, Drawer, CommandPalette) share one definition.
 */
export declare function isImeKeyEvent(event: {
    isComposing?: boolean;
    keyCode?: number;
}): boolean;
/**
 * Configuration for focus trap behavior
 */
export interface UseFocusTrapOptions {
    /**
     * Whether the focus trap is currently active.
     */
    isActive: boolean;
    /**
     * Callback when Escape key is pressed.
     */
    onEscape?: () => void;
}
/**
 * Return type for useFocusTrap hook
 */
export interface UseFocusTrapReturn<T extends HTMLElement = HTMLElement> {
    /**
     * Ref to attach to the container element that should trap focus.
     */
    containerRef: React.RefObject<T | null>;
    /**
     * Focus the first focusable element in the container.
     */
    focusFirst: () => void;
}
/**
 * Hook for trapping focus within a container element.
 *
 * Implements the WAI-ARIA dialog focus trap pattern:
 * - Listens to focus events on the document
 * - Redirects focus back into the container if it escapes
 * - Handles both Tab and Shift+Tab navigation
 * - Restores focus to the element that was focused before activation when the
 *   trap deactivates or unmounts, unless focus was already moved elsewhere
 *   (so consumers that restore focus themselves are unaffected)
 *
 * @example
 * ```
 * const {containerRef, focusFirst} = useFocusTrap({
 *   isActive: isOpen,
 *   onEscape: () => setIsOpen(false),
 * });
 *
 * useEffect(() => {
 *   if (isOpen) {
 *     focusFirst();
 *   }
 * }, [isOpen, focusFirst]);
 *
 * <div ref={containerRef}>
 *   <button>First</button>
 *   <button>Last</button>
 * </div>
 * ```
 */
export declare function useFocusTrap<T extends HTMLElement = HTMLElement>(options: UseFocusTrapOptions): UseFocusTrapReturn<T>;
//# sourceMappingURL=useFocusTrap.d.ts.map