import { default as React } from 'react'; import { DrawerProps as AntDrawerProps, ModalProps as AntModalProps } from 'antd'; /** * Drawer 配置选项 * @see antd Drawer 使用 size 替代已废弃的 width(size 支持 'default' | 'large' | number) */ export interface DrawerOptions extends Omit { /** 标题 */ title?: React.ReactNode; /** 宽度/尺寸:'default' | 'large' 或具体数值如 600 */ size?: "default" | "large" | number; /** 位置 */ placement?: "left" | "right" | "top" | "bottom"; /** 要渲染的组件(直接传入组件引用) */ component?: React.ComponentType; /** 组件名称(通过 componentResolver 解析) */ componentName?: string; /** 传递给组件的 props */ componentProps?: Record; /** 关闭回调 */ onClose?: () => void; /** 销毁后回调 */ afterClose?: () => void; } /** * Modal 配置选项 */ export interface ModalOptions extends Omit { /** 标题 */ title?: React.ReactNode; /** 宽度 */ width?: number | string; /** 要渲染的组件 */ component?: React.ComponentType; /** 组件名称(通过 componentResolver 解析) */ componentName?: string; /** 传递给组件的 props */ componentProps?: Record; /** 关闭回调 */ onClose?: () => void; /** 确认回调 */ onOk?: () => void | Promise; /** 是否显示底部按钮 */ footer?: React.ReactNode | null; } /** * 显示 Drawer * @param options Drawer 配置选项 */ export declare function showDrawer(options: DrawerOptions): () => void; /** * 显示 Modal * @param options Modal 配置选项 */ export declare function showModal(options: ModalOptions): () => void; /** * 清理所有打开的 Drawer */ export declare function cleanupAllDrawers(): void; /** * 获取当前打开的 Drawer 数量 */ export declare function getDrawerCount(): number; /** * 显示消息 * @param level 消息级别: 'success' | 'error' | 'info' | 'warning' | 'loading' * @param content 消息内容 * @param duration 持续时间(秒) * @param onClose 关闭回调 */ export declare function msg(level: "success" | "error" | "info" | "warning" | "loading", content: string, duration?: number, onClose?: () => void): void; /** * UIUtils 对象 - 统一导出所有工具函数 */ export declare const UIUtils: { showDrawer: typeof showDrawer; showModal: typeof showModal; cleanupAllDrawers: typeof cleanupAllDrawers; getDrawerCount: typeof getDrawerCount; msg: typeof msg; }; export default UIUtils;