import { h } from 'vue'; export declare interface ActiveDialog extends DialogProps { deferred?: Deferred; onConfirm?: () => void; onCancel?: () => void; slots?: Record; } declare class Deferred { promise: Promise; reject: (value: T | PromiseLike) => void; resolve: (value: T | PromiseLike) => void; constructor(); } declare interface DialogProps { /** * Shows or hides the dialog. * Usage: v-model:open="isOpen" */ open?: boolean; /** * Whether the confirmation button is enabled or not. */ disabled?: boolean; /** * Is this a dangerous action? Will turn the confirmation button red. */ dangerZone?: boolean; /** * Header text. */ header?: string; /** * Description text. */ description?: string; /** * Cancel button text. */ cancelText?: string; /** * Confirm button text. */ confirmText?: string; /** * Callback function when the confirm button is clicked. */ onConfirm?: (event: Event) => Promise | void; /** * Treats it like an Alert Dialog, with only the confirmation button showing. * * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/alert} */ alert?: boolean; /** * Adds a top accent border and icon next to the header. * This behaves similarly to the Alert component in respect to the levels, icons, and colors * passing `error` will treat the dialog the same as `dangerZone` */ status?: StatusSeverity; } export declare interface Result { isConfirmed?: boolean; isCanceled?: boolean; } declare enum StatusSeverities { Error = "error", Warning = "warning", Info = "info", Success = "success" } declare type StatusSeverity = `${StatusSeverities}`; declare function useDialog(): { active: { readonly deferred?: { readonly promise: Promise<{ readonly isConfirmed?: boolean | undefined; readonly isCanceled?: boolean | undefined; }>; readonly reject: (value: Result | PromiseLike) => void; readonly resolve: (value: Result | PromiseLike) => void; } | undefined; readonly onConfirm?: (() => void) | undefined; readonly onCancel?: (() => void) | undefined; readonly slots?: { readonly [x: string]: typeof h; } | undefined; readonly open?: boolean | undefined; readonly disabled?: boolean | undefined; readonly dangerZone?: boolean | undefined; readonly header?: string | undefined; readonly description?: string | undefined; readonly cancelText?: string | undefined; readonly confirmText?: string | undefined; readonly alert?: boolean | undefined; readonly status?: "error" | "warning" | "info" | "success" | undefined; } | undefined; open: (dialog: Omit) => Promise | undefined; close: () => void; }; export default useDialog; export { }