import * as React from 'react'; import { type AutoFocusEvent } from './dismissal.js'; import { type FocusTargetFamily } from './focus-targets.js'; /** Consumer overrides for the two focus moves the trap makes on the overlay's behalf. */ export interface FocusTrapOptions { /** Fired before focus moves into the container; `preventDefault()` leaves focus where it is. */ onOpenAutoFocus?: ((event: AutoFocusEvent) => void) | undefined; /** Fired before focus returns to the previously focused element; `preventDefault()` suppresses the return. */ onCloseAutoFocus?: ((event: AutoFocusEvent) => void) | undefined; /** CSS selector for the element inside the container that takes initial focus, ahead of the first tabbable one. */ initialFocus?: string | undefined; /** CSS selector, resolved against the document, for the element focus returns to instead of the opener. */ finalFocus?: string | undefined; /** Which overlay family the trap serves, for the console warning a missed selector prints. */ family?: FocusTargetFamily | undefined; } /** * Traps Tab focus inside `containerRef` while `enabled`: focuses the first * tabbable element (or the container) on mount, restores focus on unmount — * each move first announced as a cancelable `open-auto-focus`/`close-auto-focus` * event, so a consumer can redirect initial focus or take over the return * (the WAI-ARIA modal pattern's two escape hatches). */ export declare function useFocusTrap(containerRef: React.RefObject, enabled: boolean, options?: FocusTrapOptions): void;