import { ExtractPropTypes, InjectionKey, PropType, Ref } from 'vue'; declare const dialogProps: { /** * 是否显示 Dialog */ readonly modelValue: { readonly type: BooleanConstructor; readonly default: false; }; /** * Dialog 挂载到哪个 DOM 元素 */ readonly appendTo: { readonly type: PropType; readonly default: "body"; }; /** * 是否显示遮罩层 */ readonly mask: { readonly type: BooleanConstructor; readonly default: true; }; /** * 关闭时是否销毁 DOM 元素 */ readonly destroyOnClose: { readonly type: BooleanConstructor; readonly default: false; }; /** * 弹框距离顶部的距离 */ readonly top: { readonly type: PropType; readonly validator: (value: number | string) => boolean; readonly default: "15vh"; }; /** * 弹框的宽度,默认值为 fit-content */ readonly width: { readonly type: PropType; readonly validator: (value: number | string) => boolean; readonly default: "fit-content"; }; /** * 弹框内边距 */ readonly padding: { readonly type: PropType | number | string>; readonly validator: (value: number | string | Array) => boolean; readonly default: () => number[]; }; /** * 是否显示关闭按钮 */ readonly showClose: { readonly type: BooleanConstructor; readonly default: true; }; /** * 弹框的标题 */ readonly title: { readonly type: StringConstructor; readonly default: ""; }; /** * 是否设置弹框的位置居中 */ readonly alignCenter: { readonly type: BooleanConstructor; readonly default: false; }; /** * 是否可以通过点击 modal 关闭 Dialog */ readonly closeOnClickModal: { readonly type: BooleanConstructor; readonly default: true; }; /** * 关闭前的回调函数。 * 当用户尝试关闭 Dialog 时,会触发此回调。 * 回调函数返回一个 Promise,只有当 Promise 被解析(resolve)时,Dialog 才会关闭。 * 如果 Promise 被拒绝(reject),Dialog 不会关闭。 * 这可以用于在关闭前执行异步操作,例如确认用户意图或保存数据。 */ readonly beforeClose: { readonly type: PropType<() => Promise>; readonly default: () => Promise; }; /** * 弹框的背景色 */ readonly background: { readonly type: StringConstructor; readonly default: "#fff"; }; /** * 设置z-index */ readonly zIndex: { readonly type: NumberConstructor; }; /** * 是否为全屏 Dialog */ readonly fullscreen: { readonly type: BooleanConstructor; readonly default: false; }; }; export { dialogProps }; export type DialogProps = ExtractPropTypes; interface DialogContext { visible: Ref; } declare const DialogKey: InjectionKey; export { DialogKey, }; export interface DialogExpose { close: () => void; }