import { ComputedRef, DefineComponent, Directive, Ref } from "vue"; //#region temp/packages/design/src/types.d.ts type FieldSize = 'large' | 'default' | 'small'; interface AutocompleteProps { modelValue?: string; placeholder?: string; clearable?: boolean; disabled?: boolean; triggerOnFocus?: boolean; valueKey?: string; debounce?: number; size?: FieldSize; placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end'; fetchSuggestions?: (queryString: string, callback: (data: any[]) => any) => void; } interface BadgeProps { value?: string | number; type?: 'primary' | 'success' | 'warning' | 'danger' | 'info'; max?: number; isDot?: boolean; hidden?: boolean; } interface AlertProps { title?: string; /** ElAlert 实际支持的 type;与 ButtonProps.type 不同,没有 `primary` / `danger` */ type?: 'success' | 'warning' | 'info' | 'error' | 'primary'; description?: string; closable?: boolean; center?: boolean; closeText?: string; showIcon?: boolean; effect?: 'light' | 'dark'; } interface ButtonProps { type?: string; size?: FieldSize; link?: boolean; text?: boolean; circle?: boolean; icon?: any; variant?: string; bg?: boolean; } interface CardProps { bodyStyle?: Record; shadow?: string; header?: string; /** * 铺平模式:去除卡片自身的视觉(背景 / 阴影 / 边框 / 圆角 / header 分隔线 / header 与 body 内边距)。 * 用于已有外层容器或者使用方希望「无卡片感」的场景,TMagicCard 的折叠等 prop 仍可正常使用。 */ flat?: boolean; } interface CascaderProps { modelValue?: any; placeholder?: string; disabled?: boolean; clearable?: boolean; filterable?: boolean; options?: CascaderPropsOption[]; size?: FieldSize; /** 弹出内容的自定义类名 */ popperClass?: string; props: { expandTrigger?: 'click' | 'hover'; multiple?: boolean; checkStrictly?: boolean; emitPath?: boolean; lazy?: boolean; }; } interface CheckboxProps { modelValue?: string | number | boolean; value?: string | number | boolean; label?: any; trueValue?: string | number; falseValue?: string | number; disabled?: boolean; size?: FieldSize; } interface CheckboxGroupProps { modelValue?: any[]; label?: string; disabled?: boolean; size?: FieldSize; } interface ColProps { span?: number; } interface CollapseProps { modelValue?: string | string[]; accordion?: boolean; } interface CollapseItemProps { name?: string | number; title?: string; disabled?: boolean; } interface ColorPickerProps { modelValue?: string; disabled?: boolean; showAlpha?: boolean; size?: FieldSize; flat?: boolean; } interface DatePickerProps { type?: string; modelValue?: any; disabled?: boolean; placeholder?: string; rangeSeparator?: string; startPlaceholder?: string; endPlaceholder?: string; format?: string; dateFormat?: string; timeFormat?: string; /** 可选,绑定值的格式。 不指定则绑定值为 Date 对象 */ valueFormat?: string; /** 在范围选择器里取消两个日期面板之间的联动 */ unlinkPanels?: boolean; defaultTime?: any; size?: FieldSize; } interface DialogProps { modelValue?: boolean; appendToBody?: boolean; beforeClose?: any; title?: string; width?: string | number; fullscreen?: boolean; closeOnClickModal?: boolean; closeOnPressEscape?: boolean; destroyOnClose?: boolean; showClose?: boolean; } interface DividerProps { direction?: string; borderStyle?: string; contentPosition?: string; } interface DrawerProps { modelValue?: boolean; appendToBody?: boolean; beforeClose?: any; title?: string; size?: string | number; fullscreen?: boolean; closeOnClickModal?: boolean; closeOnPressEscape?: boolean; direction?: 'rtl' | 'ltr' | 'ttb' | 'bt'; } interface DropdownProps { type?: string; size?: string; maxHeight?: string | number; splitButton?: boolean; disable?: boolean; placement?: string; trigger?: string; hideOnClick?: boolean; showTimeout?: number; role?: string; tabindex?: number; popperClass?: string; popperOptions?: any; } interface DropdownItemProps { command?: any; disabled?: boolean; divided?: boolean; icon?: any; } interface FormProps { model?: any; labelWidth?: string | number; disabled?: boolean; inline?: boolean; labelPosition?: string; } interface FormItemProps { prop?: string; labelWidth?: string | number; rules?: any; extra?: string; extraTips?: string; labelPosition?: 'top' | 'left' | 'right'; text?: string; } interface InputProps { modelValue?: string | number; clearable?: boolean; disabled?: boolean; placeholder?: string; rows?: number; type?: string; size?: FieldSize; autosize?: boolean | { minRows: number; maxRows: number; }; } interface InputNumberProps { modelValue?: string | number | boolean; clearable?: boolean; controlsPosition?: string; disabled?: boolean; placeholder?: string; step?: number; min?: number; max?: number; size?: FieldSize; } interface OptionProps { value?: any; label?: string; disabled?: boolean; } interface OptionGroupProps { label?: string; disabled?: boolean; } interface PaginationProps { layout?: string; hideOnSinglePage?: boolean; curPage?: number; pageSizes?: number[]; pageSize?: number; total?: number; size?: 'large' | 'default' | 'small'; } interface PopconfirmProps { title?: string; width?: string | number; /** 浮层是否插入到 body,默认 true。设为 false 时浮层内联渲染,便于嵌套在 hover 浮层中避免父级因 mouseleave 收起。 */ teleported?: boolean; placement?: 'top' | 'left' | 'right' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom'; } interface RadioProps { modelValue?: string | number | boolean; value?: string | number | boolean; label?: string | number | boolean; } interface RadioButtonProps { value?: string | number | boolean; label?: string | number | boolean; disabled?: boolean; name?: string; } interface RadioGroupProps { modelValue?: string | number | boolean; disabled?: boolean; size?: FieldSize; } interface SelectProps { modelValue?: any; clearable?: boolean; filterable?: boolean; popperClass?: string; disabled?: boolean; placeholder?: string; remote?: boolean; multiple?: boolean; allowCreate?: boolean; valueKey?: string; remoteMethod?: any; loading?: boolean; size?: FieldSize; onSearch?: any; } interface StepProps { title?: string; active?: number; props?: any; status?: any; } interface StepsProps { active?: number; space?: number | string; } interface SwitchProps { modelValue?: string | number | boolean; label?: any; activeValue?: string | number | boolean; inactiveValue?: string | number | boolean; disabled?: boolean; size?: FieldSize; } interface TableProps { columns?: TableColumnOptions[]; data?: any[]; border?: boolean; maxHeight?: number | string; defaultExpandAll?: boolean; showHeader?: boolean; rowKey?: string; treeProps?: Record; emptyText?: string; tooltipEffect?: string; tooltipOptions?: any; showOverflowTooltip?: boolean; spanMethod?: (data: any) => any; } interface TableColumnOptions { props: { class?: string; label?: string; fixed?: 'left' | 'right' | boolean; width?: number | string; type?: 'default' | 'selection' | 'index' | 'expand'; prop?: string; align?: string; headerAlign?: string; sortable?: boolean | string; sortOrders?: Array<'ascending' | 'descending'>; selectable?: (row: T, index: number) => boolean; }; cell?: (scope: { row: T; $index: number; }) => any; title?: (scope?: any) => any; } interface TabPaneProps { name?: string; label?: string; lazy?: boolean; } interface TabsProps { type?: string; editable?: boolean; tabPosition?: 'left' | 'right' | 'top' | 'bottom'; modelValue?: string | number; } interface TagProps { type?: string; disableTransition?: boolean; } interface TimePickerProps { modelValue?: any; disabled?: boolean; placeholder?: string; size?: FieldSize; } interface TooltipProps { placement?: string; disabled?: boolean; content?: string; effect?: string; transition?: string; offset?: number; } interface UploadProps { action?: string; autoUpload?: boolean; disabled?: boolean; } interface CascaderPropsOption { /** 指定选项的值为选项对象的某个属性值 */ value: any; /** 指定选项标签为选项对象的某个属性值 */ label: string; /** 指定选项的子选项为选项对象的某个属性值 */ children?: CascaderPropsOption[]; } interface IconProps { size?: string; } interface ExtraApi { success: (msg: string) => void; warning: (msg: string) => void; info: (msg: string) => void; error: (msg: string) => void; closeAll: () => void; } type TMagicMessage = ExtraApi & ((options: { type?: 'info' | 'success' | 'warning' | 'error'; message?: string; dangerouslyUseHTMLString?: boolean; duration?: number; }) => void); type ElMessageBoxShortcutMethod = ((message: string, title: string, options?: any, appContext?: any | null) => Promise) & ((message: string, options?: any, appContext?: any | null) => Promise); interface TMagicMessageBox { alert: ElMessageBoxShortcutMethod; confirm: ElMessageBoxShortcutMethod; prompt: ElMessageBoxShortcutMethod; close(): void; } type LoadingBinding = boolean; declare const INSTANCE_KEY: unique symbol; interface ElementLoading extends HTMLElement { [INSTANCE_KEY]?: { instance: any; }; } interface Components { badge: { component: DefineComponent | string; props: (props: BadgeProps) => BadgeProps; }; alert: { component: DefineComponent | string; props: (props: AlertProps) => AlertProps; }; autocomplete: { component: DefineComponent | string; props: (props: AutocompleteProps) => AutocompleteProps; }; button: { component: DefineComponent | string; props: (props: ButtonProps) => ButtonProps; }; card: { component: DefineComponent | string; props: (props: CardProps) => CardProps; }; cascader: { component: DefineComponent | string; props: (props: CascaderProps) => CascaderProps; }; checkbox: { component: DefineComponent | string; props: (props: CheckboxProps) => CheckboxProps; }; checkboxGroup: { component: DefineComponent | string; props: (props: CheckboxGroupProps) => CheckboxGroupProps; }; col: { component: DefineComponent | string; props: (props: ColProps) => ColProps; }; collapse: { component: DefineComponent | string; props: (props: CollapseProps) => CollapseProps; }; collapseItem: { component: DefineComponent | string; props: (props: CollapseItemProps) => CollapseItemProps; }; colorPicker: { component: DefineComponent | string; props: (props: ColorPickerProps) => ColorPickerProps; }; datePicker: { component: DefineComponent | string; props: (props: DatePickerProps) => DatePickerProps; }; dialog: { component: DefineComponent | string; props: (props: DialogProps) => DialogProps; }; divider: { component: DefineComponent | string; props: (props: DividerProps) => DividerProps; }; drawer: { component: DefineComponent void; }, any> | string; props: (props: DrawerProps) => DrawerProps; }; dropdown: { component: DefineComponent | string; props: (props: DropdownProps) => DropdownProps; }; dropdownItem: { component: DefineComponent | string; props: (props: DropdownItemProps) => DropdownItemProps; }; dropdownMenu: { component: DefineComponent<{}, {}, any> | string; props: () => {}; }; form: { component: DefineComponent | string; props: (props: FormProps) => FormProps; }; formItem: { component: DefineComponent | string; props: (props: FormItemProps) => FormItemProps; }; icon: { component: DefineComponent | string; props: (props: IconProps) => IconProps; }; input: { component: DefineComponent HTMLInputElement | undefined; getTextarea: () => HTMLTextAreaElement | undefined; }, any> | string; props: (props: InputProps) => InputProps; }; inputNumber: { component: DefineComponent | string; props: (props: InputNumberProps) => InputNumberProps; }; option: { component: DefineComponent | string; props: (props: OptionProps) => OptionProps; }; optionGroup: { component: DefineComponent | string; props: (props: OptionGroupProps) => OptionGroupProps; }; pagination: { component: DefineComponent | string; props: (props: PaginationProps) => PaginationProps; }; radio: { component: DefineComponent | string; props: (props: RadioProps) => RadioProps; }; radioButton: { component: DefineComponent | string; props: (props: RadioButtonProps) => RadioButtonProps; }; radioGroup: { component: DefineComponent | string; props: (props: RadioGroupProps) => RadioGroupProps; }; row: { component: DefineComponent<{}, {}, any> | string; props: () => {}; }; scrollbar: { component: DefineComponent<{}, {}, any> | string; props: () => {}; }; select: { component: DefineComponent void; setPreviousQuery: (v: string) => void; setSelectedLabel: (v: string) => void; setSelected: () => void; }, any> | string; props: (props: SelectProps) => SelectProps; }; step: { component: DefineComponent | string; props: (props: StepProps) => StepProps; }; steps: { component: DefineComponent | string; props: (props: StepsProps) => StepsProps; }; switch: { component: DefineComponent | string; props: (props: SwitchProps) => SwitchProps; }; table: { component: DefineComponent HTMLElement | undefined; getTableRef: () => any; clearSelection: (...args: any[]) => void; toggleRowSelection: (...args: any[]) => void; toggleRowExpansion: (...args: any[]) => void; }, any> | string; props: (props: TableProps) => TableProps; }; tabPane: { component: DefineComponent | string; props: (props: TabPaneProps) => TabPaneProps; }; tabs: { component: DefineComponent | string; props: (props: TabsProps) => TabsProps; }; tag: { component: DefineComponent | string; props: (props: TagProps) => TagProps; }; timePicker: { component: DefineComponent | string; props: (props: TimePickerProps) => TimePickerProps; }; tooltip: { component: DefineComponent | string; props: (props: TooltipProps) => TooltipProps; }; upload: { component: DefineComponent any; }, any> | string; props: (props: UploadProps) => UploadProps; }; popconfirm: { component: DefineComponent | string; props: (props: PopconfirmProps) => PopconfirmProps; }; } interface DesignPluginOptions { flat?: boolean; adapterType?: string; message?: TMagicMessage; messageBox?: TMagicMessageBox; components?: Components; loading?: Directive; useZIndex?: (zIndexOverrides?: Ref) => { initialZIndex: ComputedRef; currentZIndex: ComputedRef; nextZIndex: () => number; }; [key: string]: any; } //#endregion //#region temp/packages/design/src/config.d.ts declare const setDesignConfig: (options: DesignPluginOptions) => void; declare const getDesignConfig: (key: K) => DesignPluginOptions[K]; //#endregion //#region temp/packages/design/src/formValidateMessage.d.ts /** * 校验错误文案中,「主错误描述」与「修改建议」之间的分隔符。 * * 约定:typeMatch 等校验器产出的文案形如 * `主错误描述${VALIDATE_SUGGESTION_SEPARATOR}修改建议`。 * - 行内 form-item 错误、组件树 tooltip 仅展示「主错误描述」; * - 错误汇总(如属性面板报错弹窗)展示完整文案(含修改建议)。 * * 该常量为「主错误描述 / 修改建议」这一隐式协议的唯一真源, * 所有生产/消费该文案的位置都应复用这里的常量与 helper,避免魔法字符串散落。 */ export declare const VALIDATE_SUGGESTION_SEPARATOR = "\n\n"; /** * 在「主错误描述」后追加「修改建议」;无建议时原样返回主错误描述。 * * @param message 主错误描述 * @param suggestion 可选的修改建议(示例值等) */ export declare const appendValidateSuggestion: (message: string, suggestion?: string) => string; /** * 去掉校验文案中的「修改建议」部分,仅保留「主错误描述」。 * * @param text 完整校验文案(可能形如 `主错误描述\n\n修改建议`) */ export declare const stripValidateSuggestion: (text?: string) => string; //#endregion export { type DesignPluginOptions, getDesignConfig, setDesignConfig };