UNPKG

1.34 kBTypeScriptView Raw
1export interface ModalInstance {
2 dialog: Element;
3 backdrop: Element;
4}
5export declare type ContainerState = Record<string, any> & {
6 isOverflowing?: boolean;
7 style?: Partial<CSSStyleDeclaration>;
8 modals: ModalInstance[];
9};
10/**
11 * Proper state management for containers and the modals in those containers.
12 *
13 * @internal Used by the Modal to ensure proper styling of containers.
14 */
15declare class ModalManager {
16 readonly hideSiblingNodes: boolean;
17 readonly handleContainerOverflow: boolean;
18 readonly modals: ModalInstance[];
19 readonly containers: HTMLElement[];
20 readonly data: ContainerState[];
21 readonly scrollbarSize: number;
22 constructor({ hideSiblingNodes, handleContainerOverflow, }?: {
23 hideSiblingNodes?: boolean | undefined;
24 handleContainerOverflow?: boolean | undefined;
25 });
26 isContainerOverflowing(modal: ModalInstance): any;
27 containerIndexFromModal(modal: ModalInstance): number;
28 setContainerStyle(containerState: ContainerState, container: HTMLElement): void;
29 removeContainerStyle(containerState: ContainerState, container: HTMLElement): void;
30 add(modal: ModalInstance, container: HTMLElement, className?: string): number;
31 remove(modal: ModalInstance): void;
32 isTopModal(modal: ModalInstance): boolean;
33}
34export default ModalManager;