import { ReactNode, CSSProperties } from 'react'; /** * @title Toast */ /** * @title Toast */ export interface ToastProps { style?: CSSProperties; className?: string | string[]; /** * 消息弹出动画的类名,见 react-transition-group 的 `classNames` */ transitionClassNames?: string; /** * 动画持续时间,见 react-transition-group 的 `timeout` * @defaultValue {enter: 100, exit: 300} */ transitionTimeout?: { enter?: number; exit?: number; }; /** * 消息内容 */ content: ReactNode | string; /** * 是否显示图标 * @defaultValue true */ showIcon?: boolean; /** * 自定义图标 */ icon?: ReactNode; /** * 自动关闭的时间,单位为 `ms` * @defaultValue 3000 */ duration?: number; /** * 关闭时的回调 */ onClose?: () => void; /** * 当前消息的唯一标识,可以用来更新消息 */ id?: string; /** * 消息的位置,分为 `top` 上方和 `bottom` 下方 */ position?: 'top' | 'bottom'; /** * 是否显示关闭按钮 * @defaultValue true */ closable?: boolean; /** * 自定义右上角关闭按钮 */ closeIcon?: ReactNode; type?: string; }