/** A fixed return target or a live target resolved after modal resources have been released. */ export type OverlayRestoreFocusTarget=HTMLElement|null|(()=>HTMLElement|null);export interface OverlayActivationOptions{ /** The custom-element host that owns this overlay. */ host:HTMLElement; /** Resolves the current dialog/panel element after each render. */ panel:()=>HTMLElement|null; /** * Resolves the subtree that remains interactive while this entry is modal. Defaults to `host`. * Use this when the stack-owning host also contains application siblings outside the panel. */ modalRoot?:()=>HTMLElement|null; /** Dismisses the overlay with its component-specific Escape reason/event. */ onEscape:()=>void; /** Dismisses the overlay with its component-specific backdrop reason/event. */ onBackdrop?:()=>void; /** Optional component-specific initial target, such as an intentionally safe default action. */ preferredInitialFocus?:()=>HTMLElement|null; /** One-shot veto immediately before the manager's first automatic focus movement. */ beforeInitialFocus?:()=>boolean; /** Override the captured focus-return target with a fixed element or post-cleanup resolver. */ restoreFocusTo?:OverlayRestoreFocusTarget; /** Defaults to true. Nonmodal popups share ordering without inerting the page. */ modal?:boolean; /** Defaults to true. Set false for popups that allow native Tab to leave. */ trapFocus?:boolean; /** Optional non-trapping Tab lifecycle, called without preventing the event. */ onTab?:()=>void; /** Temporarily releases stack ownership while the resolved panel generates no layout box. */ suspendWhenUnrendered?:boolean; /** Ref-counts a document scroll lock for exactly as long as this entry is registered. */ lockScroll?:boolean;}export interface OverlayDeactivateOptions{ /** Defaults to true. Explicit outside-pointer paths can suppress restoration. */ restoreFocus?:boolean; /** Defaults to false. Skips releasing this entry's scroll lock as part of deactivation and * returns the release function instead, so a component with a visible exit animation can hold * the lock until that animation actually finishes rather than the instant it starts closing. * Ignored (returns `undefined`) when this entry never requested `lockScroll`. */ deferScrollLockRelease?:boolean;}export interface OverlayHandle{ /** Moves focus inside unless focus is already within the current panel. */ focusInitial():void; /** Moves focus only when the panel contains an `[autofocus]` target. Returns whether it did, so * a nonmodal overlay that deliberately leaves focus alone can still honour an explicit * `autofocus` in its content without stealing focus in every other case. */ focusAutofocus():boolean; /** Replaces the eventual focus-return target without unregistering or reordering the overlay. */ updateRestoreFocusTo(target:OverlayRestoreFocusTarget):void; /** Removes the overlay permanently. Safe to call repeatedly. Returns the deferred scroll-lock * release function when `deferScrollLockRelease` was requested and a lock was actually held. */ deactivate(options?:OverlayDeactivateOptions):(()=>void)|undefined; /** Temporarily unregisters during disconnect, preserving the original return target. */ suspend():void; /** Re-registers a suspended overlay in its current `ownerDocument`. */ resume():void; /** Whether this overlay currently owns Escape, Tab, and backdrop dismissal. */ isTopmost():boolean; /** Whether this handle still represents an active or temporarily suspended overlay. */ isActive():boolean; /** Runs the backdrop callback only when this overlay is topmost. */ dismissBackdrop():boolean;} /** * Adds an overlay to the document stack. Modal entries load inerting, rendered-state tracking, and * optional scroll locking; `modal: false` retains the historical API while using the lean adapter. */ export declare function activateOverlay(options:OverlayActivationOptions):OverlayHandle; /** * Temporarily yields Lyra's modal stack to a third-party modal rooted at `externalModal`. * The returned release function is idempotent and scoped to the root's current document. */ export declare function suspendLyraModalsFor(externalModal:HTMLElement):()=>void;export{collectAutofocusElements,collectFocusableElements,composedContains,deepActiveElement,}from'./overlay-stack.js';