import { ReactNode } from 'react'; import { ButtonType } from '../Button/types'; export type Action = 'cancel' | 'confirm' | 'close'; export type MessageBoxBeforeCloseFn = (action?: Action) => void; export interface MessageBoxEvents { onConfirm?: () => void; onCancel?: () => void; onClose?: () => void; } export interface MessageBoxOptions extends MessageBoxEvents { title?: string; type?: string; content?: ReactNode; message?: ReactNode; modal?: boolean; showClose?: boolean; callback?: MessageBoxBeforeCloseFn | null; duration?: number; cancelText?: string; confirmText?: string; center?: boolean; showInput?: boolean; inputValue?: string; inputPlaceholder?: string; zIndex?: number; remove?: () => void; children?: ReactNode; /** Target element to mount the dialog into. Defaults to fullscreen element or document.body. */ appendTo?: HTMLElement; } export interface MessageBoxProps extends MessageBoxOptions { visible: boolean; onVisibleChange: (visible: boolean) => void; } export interface MessageBoxHandle { close: () => void; } export interface IMessageBoxButton { type?: ButtonType; text?: string; customClasses?: string[]; action?: () => void; disabled?: boolean; }