export type FocusManagerOptions = { /** * Returns the CSS selector for the element that should receive focus on open. * * **Security note:** this value is passed directly to `querySelector`. It must * come from trusted developer-controlled configuration, never from raw user input. */ getInitialFocusSelector: () => string | undefined; /** * Returns whether focus should be restored to the previously focused element * on close. `undefined` or `true` means restore; `false` means skip. */ getReturnFocus: () => boolean | undefined; /** Host element used for `querySelector` when resolving the initial focus target. */ host: HTMLElement; /** * `AbortSignal` from the component lifecycle. Cancels a pending `applyInitialFocus()` * animation frame automatically on abort — prevents a stray `.focus()` call landing on an * element that's been disconnected in the meantime (e.g. the dialog closes and unmounts * before the deferred focus frame runs). */ signal?: AbortSignal; }; export type FocusManager = { [Symbol.dispose](): void; /** Move focus to the element matching `getInitialFocusSelector` (deferred one frame). */ applyInitialFocus: () => void; /** Cancel a pending `applyInitialFocus` rAF, if any. */ cancelInitialFocus: () => void; /** Capture the currently focused element so it can be restored later. */ captureReturnFocus: () => void; /** Cancels any pending initial-focus frame and clears captured return-focus state. */ dispose(): void; /** `true` after `dispose()` has been called. */ readonly disposed: boolean; /** Restore focus to the element captured by `captureReturnFocus`. */ restoreFocus: () => void; }; /** * Encapsulates the three-step focus lifecycle used by dialogs and drawers: * 1. Capture the element that triggered the open. * 2. Move focus inside the overlay (optionally to a specific element). * 3. Restore focus when the overlay closes. */ export declare function createFocusManager(options: FocusManagerOptions): FocusManager; //# sourceMappingURL=focus.d.ts.map