/** * Keeps keyboard focus inside an open card, and remembers who opened it. * * The cards float above a dimmed host page, but the dim is only visual: Tab * happily walks out of the card and into controls the reporter can no longer * see or reach with a pointer. Cycling within the card is what the dialog role * promises assistive tech, and restoring the opener afterwards puts a keyboard * user back where they were instead of at the top of the document. * * The Tab handler lives on the card element, not on document or window: it can * only ever see keys typed while focus is inside the card, and removing the * card's own listener is a teardown the host page cannot be stranded by. */ export interface FocusTrap { /** * Detach the Tab handler without moving focus — for when the element is * handed to a successor (the clarify continuation) that installs its own * trap and must not have focus yanked out from under it. */ release(): void; /** Put focus back on whatever had it when the trap was installed. */ restoreFocus(): void; } export declare function trapFocus(card: HTMLElement): FocusTrap; //# sourceMappingURL=focus-trap.d.ts.map