/** * @fileoverview MfwPopup 弹窗组件 * @description 提供命令式弹窗 API,支持 Dialog 和 Drawer 两种形式 */ import './style.scss'; import { type Component } from 'vue'; import type { DialogProps, DrawerProps } from 'element-plus'; /** 弹窗类型 */ export type PopupType = 'dialog' | 'drawer'; /** 弹窗位置 */ export type PopupPosition = 'ltr' | 'rtl' | 'ttb' | 'btt'; /** 页脚配置 */ export interface PopupFooter { showCancel?: boolean; showConfirm?: boolean; cancelText?: string; confirmText?: string; confirmLoading?: boolean; } /** 弹窗事件监听器 */ export interface PopupListeners { confirm?: (data: any) => void | Promise; close?: (data: any) => void; cancel?: () => void; change?: (data: any) => void; } /** 弹窗实例 */ export interface PopupInstance { uuid: string; open: () => void; close: () => void; confirm: () => void; update: (options: Partial) => void; } /** 打开弹窗选项 */ export interface OpenPopupOptions { uuid?: string; title?: string; type?: PopupType; component: Component; data?: T; provides?: Record; popupProps?: Partial; footer?: PopupFooter | boolean; on?: PopupListeners; position?: PopupPosition; cache?: boolean; } /** 弹窗项 */ export interface PopupItem { uuid: string; title: string; type: PopupType; component: Component; data?: any; provides?: Record; popupProps: Partial; footer?: PopupFooter | boolean; on: PopupListeners; visible: boolean; cache: boolean; position?: PopupPosition; } /** * MfwPopup 命令式 API */ export declare class MfwPopupClass { static open(options: OpenPopupOptions): PopupInstance; static close(uuid: string): void; static closeAll(): void; static get popups(): PopupItem[]; } export declare const MfwPopup: typeof MfwPopupClass; /** * 弹窗管理器组件,整改项目只允许定义一个弹窗管理器 * 在布局页面,统一定义一个弹窗管理器,其他组件通过弹窗管理器打开弹窗 * 弹窗管理器会根据弹窗类型,选择合适的弹窗组件(Dialog 或 Drawer)打开 */ export declare const MfwPopupManager: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; export default MfwPopup; //# sourceMappingURL=index.d.ts.map