/** * @license * Copyright 2023 Nuraly, Laabidi Aymen * SPDX-License-Identifier: MIT */ /** * Modal stack item interface */ export interface ModalStackItem { modal: any; previousFocus: Element | null; zIndex: number; id: string; } /** * Modal Manager - Singleton class to handle nested modals * Manages the modal stack, z-index allocation, and focus management */ declare class ModalManagerClass { private modalStack; private baseZIndex; private zIndexIncrement; private bodyScrollDisabled; private originalBodyOverflow; /** * Opens a modal and adds it to the stack */ openModal(modal: any): number; /** * Closes a modal and removes it from the stack */ closeModal(modal: any): void; /** * Gets the current z-index for a modal */ getModalZIndex(modal: any): number; /** * Checks if a modal is the top modal in the stack */ isTopModal(modal: any): boolean; /** * Gets the number of open modals */ getStackDepth(): number; /** * Closes all modals */ closeAllModals(): void; /** * Gets all open modal IDs */ getOpenModalIds(): string[]; /** * Checks if any modals are open */ hasOpenModals(): boolean; private generateModalId; private updateModalZIndex; private disableBodyScroll; private restoreBodyScroll; /** * Handle Escape key for nested modals - only close the top modal */ handleEscapeKey(): boolean; /** * Handle backdrop clicks - only close if it's the top modal */ handleBackdropClick(modal: any): boolean; } export declare const ModalManager: ModalManagerClass; export {}; //# sourceMappingURL=modal-manager.d.ts.map