import { ReactNode, CSSProperties, HTMLAttributes } from 'react';
import { ButtonProps } from '@/button/interface';
export interface ModalProps extends Omit, 'title' | 'content'> {
classNames?: {
header?: string;
content?: string;
footer?: string;
mask?: string;
wrapper?: string;
};
styles?: {
header?: CSSProperties;
content?: CSSProperties;
footer?: CSSProperties;
mask?: CSSProperties;
wrapper?: CSSProperties;
};
title?: string | ReactNode;
open?: boolean;
mask?: boolean;
maskClosable?: boolean;
footer?: ReactNode | ((cancelButtonNode: ReactNode, okButtonNode: ReactNode) => ReactNode);
closable?: boolean;
closeIcon?: ReactNode;
okText?: ReactNode;
cancelText?: ReactNode;
okButtonProps?: ButtonProps;
cancelButtonProps?: ButtonProps;
confirmLoading?: boolean;
mountOnEnter?: boolean;
unmountOnExit?: boolean;
escToExit?: boolean;
autoFocus?: boolean;
center?: boolean;
onCancel?: (e?: MouseEvent) => void;
onOk?: (e?: MouseEvent | Event) => Promise | void;
afterOpen?: () => void;
afterClose?: () => void;
getPopupContainer?: () => HTMLElement;
modalRender?: (modalNode: ReactNode) => ReactNode;
disabledOnPromise?: boolean;
}
export type ModalReturnProps = {
close: () => void;
update: (config: ConfirmProps) => void;
};
export interface ConfirmProps extends ModalProps {
content?: ReactNode;
icon?: ReactNode | null;
isNotice?: boolean;
noticeType?: string;
}
export declare enum ModalType {
'confirm' = 0,
'info' = 1,
'success' = 2,
'warning' = 3,
'error' = 4
}
export type ModalHookReturnType = {
-readonly [key in Exclude]: (config: ConfirmProps) => ModalReturnProps;
};