import { Base, KeyServiceProps } from '@studiometa/js-toolkit'; import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit'; type ModalStates = Partial>>; type ModalStylesOption = Partial>; export interface ModalProps extends BaseProps { $refs: { close: HTMLElement[]; container: HTMLElement; content: HTMLElement; modal: HTMLElement; open: HTMLElement[]; overlay: HTMLElement; }; $options: { /** * A selector where to move the modal to. */ move: string; /** * A selector for the element to set the focus to when the modal opens. */ autofocus: string; /** * Lock or allow scroll in the documentElement. */ scrollLock: boolean; /** * The styles for the different state of the modal. */ styles: ModalStylesOption; }; } /** * Modal class. * @link https://ui.studiometa.dev/components/Modal/ */ export declare class Modal extends Base { /** * Config. */ static config: BaseConfig; /** * Wether the modal is open or not. */ isOpen: boolean; /** * @private */ __refsBackup: (T & ModalProps)['$refs']; /** * @private */ __refModalPlaceholder: Comment; /** * @private */ __refModalParentBackup: HTMLElement; /** * @private */ __refModalUnbindGetRefFilter: () => void; /** * Open the modal on click on the `open` ref. */ get onOpenClick(): () => Promise; /** * Close the modal on click on the `close` ref. */ get onCloseClick(): () => Promise; /** * Close the modal on click on the `overlay` ref. * @returns {Function} The component's `close` method. */ get onOverlayClick(): () => Promise; /** * Initialize the component's behaviours. */ mounted(): void; /** * Add the moved refs to `this.$refs` when using the `move` options. */ get $refs(): (T & ModalProps)["$refs"] & import("@studiometa/js-toolkit").BaseRefs; /** * Unbind all events on destroy. */ destroyed(): this; /** * Close the modal on `ESC` and trap the tabulation. */ keyed({ event, isUp, isDown, ESC }: KeyServiceProps): void; /** * Open the modal. */ open(): Promise; /** * Close the modal. */ close(): Promise; } export {};