UNPKG

588 BTypeScriptView Raw
1import { Ref } from 'react';
2/**
3 * Handle the order of the modals.
4 * Inspired by the material-ui implementation.
5 */
6export declare const modalManager: {
7 /**
8 * Register a new modal
9 */
10 add: (newModal: Ref<Element>) => void;
11 /**
12 * Remove a modal
13 */
14 remove: (oldModal: Ref<Element>) => void;
15 /**
16 * When multiple modals are rendered will return true if current modal is the last one
17 */
18 isTopModal: (modal: Ref<Element>) => boolean;
19};
20export declare function useModalManager(ref: Ref<Element>, open: boolean): void;