import { AllowedComponentProps, VNodeProps } from '../common' import type { ButtonType } from '../components/button' // 对话框类型 declare type DialogType = 'alert' | 'confirm' | 'prompt' | 'success' | 'error' | 'warning' | 'info' | 'html' | 'custom' // 对话框组件 Props declare interface DialogProps { // 显示控制 show?: boolean modelValue?: boolean // 对话框类型 type?: DialogType // 标题和内容 title?: string subtitle?: string content?: string // 头部配置 showHeader?: boolean showSubtitle?: boolean showIcon?: boolean // 内容样式 contentStyle?: Record // Prompt 类型配置 promptLabel?: string promptPlaceholder?: string inputType?: 'text' | 'number' | 'password' | 'textarea' maxlength?: number showCharCount?: boolean inputDisabled?: boolean // 按钮配置 showFooter?: boolean showCancel?: boolean showConfirm?: boolean cancelText?: string confirmText?: string cancelType?: ButtonType // 'default' | 'primary' | 'warning' | 'error' confirmType?: ButtonType // 'default' | 'primary' | 'warning' | 'error' cancelDisabled?: boolean confirmDisabled?: boolean cancelLoading?: boolean confirmLoading?: boolean buttonSize?: 'small' | 'medium' | 'large' // 弹窗配置 position?: 'center' | 'top' | 'bottom' | 'left' | 'right' animation?: 'fade' | 'slide' | 'zoom' | 'none' duration?: number showOverlay?: boolean overlayColor?: string overlayOpacity?: number closeOnClickOverlay?: boolean lockScroll?: boolean width?: string borderRadius?: string backgroundColor?: string zIndex?: number showClose?: boolean safeAreaInsetBottom?: boolean customClass?: string closeOnClickAction?: boolean // 验证函数 validator?: (value: string) => string | boolean // 自动关闭 autoClose?: boolean autoCloseDelay?: number // 输入框初始值 defaultValue?: string } declare interface DialogEmits { (e: 'update:show', value: boolean): void (e: 'update:modelValue', value: boolean): void (e: 'open'): void (e: 'opened'): void (e: 'close'): void (e: 'closed'): void (e: 'click-overlay'): void (e: 'confirm', value?: string): void (e: 'cancel'): void (e: 'input', value: string): void (e: 'focus'): void (e: 'blur'): void } // 对话框组件方法 declare interface DialogMethods { // 打开对话框 open: (options?: Partial) => void // 关闭对话框 close: () => void // 切换显示状态 toggle: () => void // 清空输入 clearInput: () => void } declare interface _Dialog { new(): { $props: AllowedComponentProps & VNodeProps & DialogProps $emit: DialogEmits } & DialogMethods } export declare const Dialog: _Dialog export default Dialog export type { DialogType, DialogProps, DialogEmits, DialogMethods }