import type { Component, Snippet } from 'svelte'; export type ModalActions = { /** Validates the modal content and closes it when valid. */ save: () => void; /** Closes the modal without validating. */ close: () => void; }; export type Props = { /** Generated internally for the dialog. */ id?: never; /** Modal title, supplied as plain text or a Svelte snippet. */ title: string | Snippet; /** Bind or change to open and close the modal. */ open?: boolean; /** The underlying dialog element. */ element?: HTMLDialogElement; /** Re-render the content after cancellation, discarding unsaved changes. Defaults to true. */ resetOnCancel?: boolean; /** Close the modal when clicking outside of it. */ closeOnBackdropClick?: boolean; /** CSS class added to the modal element. */ class?: string; /** Content rendered inside the modal. */ children?: Snippet; /** Replaces the default Cancel and Save buttons. */ footer?: Snippet<[ModalActions]>; /** Called when the modal opens. */ onOpen?: () => void; /** Called when the modal closes. */ onClose?: () => void; /** Called after the closing transition and any content reset have finished. */ onClosed?: () => void; /** Called after a valid modal save. */ onSave?: () => void; }; /** Exports the imperative API of the modal component. */ type Exports = { /** Shows the modal. */ show: () => Promise; /** Closes the modal. */ close: () => void; }; /** * A modal dialog component. * See [Readme](https://docs.soleil.se/packages/config-svelte/components/modal/). */ declare const Modal: Component; export default Modal;