import { ReactNode } from 'react'; import type { Css } from '@pitrix/portal-ui'; export type BtnType = 'primary' | 'secondary' | 'normal' | 'danger'; export type Type = 'info' | 'error' | 'success' | 'warning'; export interface ModalConfig { title?: ReactNode; content?: ReactNode; footer?: ReactNode | null | undefined; width?: string | number; maskClosable?: boolean; onOk?: () => void | Promise; onCancel?: () => void; okText?: string; okType?: BtnType; cancelText?: string; cancelType?: BtnType; showOk?: boolean; showCancel?: boolean; okDisabled?: boolean; okLoading?: boolean; root?: string | HTMLElement; type?: Type; leftContent?: React.ReactNode; css?: Css; syncClose?: boolean; fixedContent?: React.ReactNode; height?: string | number; } export interface ModalInstance { destroy: () => void; update: (config: Partial) => void; } export interface ModalStatic { open: (config: ModalConfig) => ModalInstance; info: (config: ModalConfig) => ModalInstance; warning: (config: ModalConfig) => ModalInstance; error: (config: ModalConfig) => ModalInstance; success: (config: Omit & { onOk?: () => void; }) => ModalInstance; }