/** * @author Hanz * @date 2021/8/5 下午8:04 * @description message 全局提示 */ import React from 'react'; import './index.scss'; type MsgType = 'info' | 'warn' | 'error' | 'success'; interface InternalMsgConfig { /** 消息id */ id?: string; /** 是否启用html渲染内容 */ html?: boolean; /** 是否强制显示关闭按钮,默认自动当延迟关闭事件为0或null时自动显示 */ close?: boolean; /** 消息文本 */ text: string; /** 图标 */ icon?: any; /** 内部消息类型 */ type: MsgType; /** 最大显示数 */ maxCount?: number; /** 描述 */ desc?: string; /** 是否隐藏图标 */ hideIcon?: boolean; /** 样式类名 */ className?: string; /** 样式 */ style?: React.CSSProperties; } interface MsgGlobalConfig { /** * 最大显示数 */ maxCount?: number; /** * 时长 */ duration?: number; } export declare const MessageBar: React.FC; declare const _default: () => import("react/jsx-runtime").JSX.Element; export default _default; export type MsgTypeProps = { /** * 消息文本 */ text?: string; /** * 图标 */ icon?: any; /** * 最大显示数 */ maxCount?: number; /** * 描述 */ desc?: string; /** * 隐藏默认图标 */ hideIcon?: boolean; /** * cls */ className?: string; /** * style */ style?: React.CSSProperties; /**是否启用html渲染内容*/ html?: boolean; /**是否强制显示关闭按钮,默认自动当延迟关闭事件为0或null时自动显示*/ close?: boolean; }; interface MsgPorps { (config: string | MsgTypeProps, duration?: number): void; } export interface MessageObject { /**信息*/ info: MsgPorps; /**警告*/ warn: MsgPorps; /**错误*/ error: MsgPorps; /**成功*/ success: MsgPorps; /** 清除所有 */ clear?: () => void; /** 销毁所有,兼容写法 */ destroyAll?: () => void; /** 全局配置 */ config?: (config: MsgGlobalConfig) => void; } export declare const Message: MessageObject;