import { type RefObject } from 'react'; export interface UseFocusTrapOptions { /** Called when Escape is pressed while focus is inside the container. * When omitted, Escape passes through untouched so document-level * listeners still fire. */ onEscape?: () => void; /** * When false, Tab/Shift+Tab are NOT cycled within the container — for * non-modal dialogs (e.g. SlidingSidebar, whose z-50 header stays clickable * above the open drawer). Escape / initial focus / guarded restore still apply. * @default true */ contain?: boolean; } /** * Focus management for overlay surfaces (mobile nav panel, sliding sidebar, * burger menu, modals): initial focus on activate, container-scoped Tab * cycling + Escape, and guarded focus restore on deactivate. * * CONTRACT: the container element MUST have `tabIndex={-1}`. After a * click/tap on a non-focusable area inside the surface, browsers move focus * to the nearest focusable ancestor — with the container script-focusable * that ancestor is the container itself, so this keydown listener keeps * hearing Escape/Tab. Without it, focus falls to `body` and the trap goes * deaf. * * The listener being container-scoped makes it stacking-safe: it only fires * while focus is inside the surface, so a modal open above never leaks its * Escape into the surface below. */ export declare function useFocusTrap(containerRef: RefObject, active: boolean, { onEscape, contain }?: UseFocusTrapOptions): void; //# sourceMappingURL=use-focus-trap.d.ts.map