import { ReactNode } from 'react'; /** 弹窗模式:抽屉(drawer)、弹窗(modal)*/ export type UnifiedModalMode = 'drawer' | 'modal'; /** 组合弹窗组件实例ref */ export interface UnifiedModalRef { /** 显示弹窗 */ show: () => void; /** 隐藏弹窗 */ hide: () => void; /** 切换到抽屉模式 */ switchMode: (mode: UnifiedModalMode) => void; /** 切换到全屏模式 */ requestFullscreen: () => void; /** 退出全屏 */ exitFullscreen: () => void; } /** 组合弹窗组件props */ export interface UnifiedModalProps { /** 默认展示模式 */ defaultMode?: UnifiedModalMode; /** 是否显示蒙层 */ showMask?: boolean; /** 点击蒙层是否关闭 */ maskCloseable?: boolean; /** 抽屉模式时的参数 */ drawerProps?: { /** 抽屉宽度 */ width?: string; /** 抽屉最大宽度 */ maxWidth?: string; }; /** 弹窗模式时的参数 */ modalProps?: { /** 弹窗宽度 */ width?: string; /** 弹窗高度 */ height?: string; /** 弹窗最大宽度 */ maxWidth?: string; /** 弹窗最大高度 */ maxHeight?: string; }; /** 弹窗拖拽句柄CSS选择器 */ modalDragHandle?: string; /** 关闭回调 */ onClose?: () => void; /** 显示状态变化回调 */ onVisibleChange?: (visible: boolean) => void; /** 模式变化回调 */ onModeChange?: (mode: UnifiedModalMode) => void; /** 全屏状态变化回调 */ onFullscreenChange?: (isFullscreen: boolean) => void; className?: string; style?: React.CSSProperties; children: ReactNode; }