/** * Stacking-order manager for layered elements such as overlays, dialogs and toasts. */ interface ZIndexOptions { /** * Reads the inline `z-index` of an element, or `0` when it is unset or the element is missing. */ get(element?: HTMLElement): number; /** * Assigns the next `z-index` in the global stack to an element's inline style and records it under `key`. The value * is one above the highest currently tracked index, plus `baseZIndex` whenever the previous entry belongs to a * different layer, which keeps layer groups separated. * * @param key Layer name, for example `'modal'` or `'overlay'`. * @param element Target element. * @param baseZIndex Gap applied when switching layers. Defaults to `999`. */ set(key: string, element: HTMLElement, baseZIndex?: number): void; /** * Releases the element's tracked index and clears its inline `z-index`. Call on unmount, otherwise the stack keeps * growing. */ clear(element: HTMLElement): void; /** * Highest `z-index` currently tracked for a layer, or `0` when the layer is empty. */ getCurrent(key: string): number; } /** * Shared stacking-order manager. State is module-scoped, so every consumer of this module competes for one stack. * * @example * ```ts * ZIndex.set('modal', dialogEl); // dialogEl.style.zIndex === '1000' * ZIndex.getCurrent('modal'); // 1000 * ZIndex.clear(dialogEl); // releases the slot * ``` */ declare const ZIndex: ZIndexOptions; export { ZIndex, type ZIndexOptions };