import { ComponentSize } from '../../../hooks'; import { AppContext, CSSProperties, VNode } from 'vue'; import { Action, Callback, MessageBoxData, MessageBoxInputValidator, MessageBoxState, MessageBoxType, MessageType } from './MessageBox'; /** Options used in MessageBox */ export interface FzMessageBoxOptions { /** Callback before MessageBox closes, and it will prevent MessageBox from closing */ beforeClose?: (action: Action, instance: MessageBoxState, done: () => void) => void; /** Custom class name for MessageBox */ customClass?: string; /** Custom inline style for MessageBox */ customStyle?: CSSProperties; /** MessageBox closing callback if you don't prefer Promise */ callback?: Callback; /** Text content of cancel button */ cancelButtonText?: string; /** Text content of confirm button */ confirmButtonText?: string; /** Custom class name of cancel button */ cancelButtonClass?: string; /** Custom class name of confirm button */ confirmButtonClass?: string; /** Whether to align the content in center */ center?: boolean; /** Whether MessageBox can be drag */ draggable?: boolean; /** Content of the MessageBox */ message?: string | VNode; /** Title of the MessageBox */ title?: string; /** Message type, used for icon display */ type?: MessageType; /** Message box type */ boxType?: MessageBoxType; /** Custom icon component */ icon?: string; /** Whether message is treated as HTML string */ dangerouslyUseHTMLString?: boolean; /** Whether to distinguish canceling and closing */ distinguishCancelAndClose?: boolean; /** Whether to lock body scroll when MessageBox prompts */ lockScroll?: boolean; /** Whether to show a cancel button */ showCancelButton?: boolean; /** Whether to show a confirm button */ showConfirmButton?: boolean; /** Whether to show a close button */ showClose?: boolean; /** Whether to use round button */ roundButton?: boolean; /** Whether MessageBox can be closed by clicking the mask */ closeOnClickModal?: boolean; /** Whether MessageBox can be closed by pressing the ESC */ closeOnPressEscape?: boolean; /** Whether to close MessageBox when hash changes */ closeOnHashChange?: boolean; /** Whether to show an input */ showInput?: boolean; /** Placeholder of input */ inputPlaceholder?: string; /** Initial value of input */ inputValue?: string; /** Regexp for the input */ inputPattern?: RegExp; /** Input Type: text, textArea, password or number */ inputType?: string; /** Validation function for the input. Should returns a boolean or string. If a string is returned, it will be assigned to inputErrorMessage */ inputValidator?: MessageBoxInputValidator; /** Error message when validation fails */ inputErrorMessage?: string; /** Custom size of confirm and cancel buttons */ buttonSize?: ComponentSize; } export declare type FzMessageBoxShortcutMethod = ((message: FzMessageBoxOptions['message'], title: FzMessageBoxOptions['title'], options?: FzMessageBoxOptions, appContext?: AppContext | null) => Promise) & ((message: FzMessageBoxOptions['message'], options?: FzMessageBoxOptions, appContext?: AppContext | null) => Promise); export interface IFzMessageBox { _context: AppContext | null; /** Show a message box */ /** Show a message box */ (options: FzMessageBoxOptions, appContext?: AppContext | null): Promise; /** Show an alert message box */ alert: FzMessageBoxShortcutMethod; /** Show a confirm message box */ confirm: FzMessageBoxShortcutMethod; /** Show a prompt message box */ prompt: FzMessageBoxShortcutMethod; /** Close current message box */ close(): void; } declare const _default: IFzMessageBox; export default _default;