import type { RuleObject } from 'ant-design-vue/es/form/interface';
declare global {
  type Rule = RuleObject & {
    trigger?: 'blur' | 'change' | ['change', 'blur'];
  };

  interface FormSchema {
    field: string;
    label?: string;
    changeEvent?: string; //表单更新事件名称
    valueField?: string;
    component?: string; // 不定义，则为隐藏发送参数
    rules?: Recordable[];
    defaultValue?: any;
    componentProps?: any;
    formItemProps?: any;
    viewOnly?: Boolean; // 是否只展示，不发送参数
    ifShow?: Boolean | Function; //dom隐藏
    show?: Boolean | Function; //css隐藏
    // disabled?: Boolean; //是否禁用 （已废弃、和动态有重复部分）
    dynamicDisabled?: Boolean | Function; //是否禁用
    fieldMap?: Array<string> | Boolean | Props; //把一个值分割成多个值
    keepField?: Boolean; //映射时是否保留原值
    defaultParams?: Object; // 默认接口参数
    dynamicParams?: String | Array<string> | Recordable | Function; //动态接口参数，合并defaultParams赋值给params
    requiredParams?: Boolean | String | Array<string> | Recordable;
    addModel?: Array<string> | Props; // 额外发送参数，例如select中
    autoAddLink?: Boolean; //把需要联动的值映射到 formModel.fieldLink.field
    displayFormItem?: Boolean; //是否显示formItem (label)
    autoLink?: true; //是否使用规则自动绑定
    class?: String; //添加额外样式
    autoSubmit: Boolean; //是否操作后提交表单
    format: Function;
    extra: string;
    style: Object;
  }
}
