export type OverlayConfig = { /** Whether the overlay is currently open. */ open: () => boolean; /** The dialog panel element (component owns `bind:this`, passes a getter). */ getDialog: () => HTMLElement | null; /** Close the overlay (set your `open` state false + notify). */ onClose: () => void; /** Allow Escape to close. Default true. */ closeOnEsc?: () => boolean; /** Allow an outside/backdrop click to close. Default true. */ closeOnBackdrop?: () => boolean; /** Run once each time the overlay opens - reset transient state (drag, resize, * swipe offset) before the trap/lock/layer are wired. */ onOpen?: () => void; /** Trap focus inside the dialog while open. Default true. */ trapFocus?: () => boolean; /** Lock body scroll while open. Default true. */ scrollLock?: () => boolean; /** Element to focus first when the dialog opens (e.g. a search input). * Defaults to the trap's first focusable. */ initialFocus?: () => HTMLElement | null; }; export type DialogProps = { role: 'dialog'; 'aria-modal': 'true'; 'aria-labelledby': string | undefined; 'aria-label': string | undefined; tabindex: -1; }; export declare function createOverlay(config: OverlayConfig): { /** Spread onto the dialog panel element. Pass `labelledBy` (an id, when there * is a visible title) or `label` (an accessible name when there isn't). */ dialogProps: (opts?: { labelledBy?: string; label?: string; }) => DialogProps; }; export type Overlay = ReturnType;