import { CSSProperties } from 'vue';
import { FormItemRule } from 'element-plus';
export interface BaseFieldConfig {
    field: string;
    label: string;
    type: FieldType;
    placeholder?: string;
    disabled?: boolean;
    rules?: FormItemRule | FormItemRule[];
    colSpan?: number;
    formItemProps?: Record<string, any>;
    style?: CSSProperties;
    events?: Record<string, (...args: any[]) => void>;
}
export type FieldType = 'input' | 'textarea' | 'password' | 'number' | 'select' | 'radio' | 'checkbox' | 'switch' | 'date' | 'time' | 'datetime' | 'upload' | 'cascader' | 'treeSelect' | 'slider' | 'rate' | 'color' | 'html' | 'custom';
export interface InputConfig extends BaseFieldConfig {
    type: 'input' | 'textarea' | 'password';
    inputType?: 'text' | 'password';
    maxlength?: number;
    showWordLimit?: boolean;
    clearable?: boolean;
    rows?: number;
    autosize?: boolean | {
        minRows: number;
        maxRows: number;
    };
}
export interface NumberConfig extends BaseFieldConfig {
    type: 'number';
    min?: number;
    max?: number;
    step?: number;
    precision?: number;
    controls?: boolean;
}
export interface SelectConfig extends BaseFieldConfig {
    type: 'select';
    options?: {
        label: string;
        value: any;
        disabled?: boolean;
    }[];
    filterable?: boolean;
    remote?: boolean;
    remoteMethod?: (query: string) => Promise<void> | void;
    loading?: boolean;
    multiple?: boolean;
    clearable?: boolean;
}
export interface RadioConfig extends BaseFieldConfig {
    type: 'radio';
    options?: {
        label: string;
        value: any;
        disabled?: boolean;
    }[];
    radioType?: 'radio' | 'button';
}
export interface CheckboxConfig extends BaseFieldConfig {
    type: 'checkbox';
    options?: {
        label: string;
        value: any;
        disabled?: boolean;
    }[];
    min?: number;
    max?: number;
}
export interface SwitchConfig extends BaseFieldConfig {
    type: 'switch';
    activeText?: string;
    inactiveText?: string;
    activeValue?: any;
    inactiveValue?: any;
    inlinePrompt?: boolean;
}
export interface DateConfig extends BaseFieldConfig {
    type: 'date' | 'time' | 'datetime';
    format?: string;
    valueFormat?: string;
    clearable?: boolean;
    editable?: boolean;
    isRange?: boolean;
    dateType?: 'date' | 'week' | 'month' | 'year';
}
export interface UploadConfig extends BaseFieldConfig {
    type: 'upload';
    accept?: string;
    maxSize?: number;
    maxCount?: number;
    customRequest?: (option: Promise<unknown> | XMLHttpRequest) => void;
    autoUpload?: boolean;
    uploadTrigger?: 'button' | 'dragger';
    listType?: 'text' | 'picture' | 'picture-card';
    buttonText?: string;
    draggerSlot?: string;
    fileCardSlot?: string;
    buttonStyle?: CSSProperties;
    buttonPosition?: 'left' | 'center' | 'right';
    clearValidateOnSuccess?: boolean;
}
export interface CascaderConfig extends BaseFieldConfig {
    type: 'cascader';
    options?: any[];
    props?: Record<string, any>;
    filterable?: boolean;
    clearable?: boolean;
    showAllLevels?: boolean;
}
export interface TreeSelectConfig extends BaseFieldConfig {
    type: 'treeSelect';
    data?: any[];
    props?: Record<string, any>;
    filterable?: boolean;
    checkStrictly?: boolean;
    multiple?: boolean;
    clearable?: boolean;
}
export interface SliderConfig extends BaseFieldConfig {
    type: 'slider';
    min?: number;
    max?: number;
    step?: number;
    showInput?: boolean;
    range?: boolean;
}
export interface RateConfig extends BaseFieldConfig {
    type: 'rate';
    max?: number;
    allowHalf?: boolean;
    showText?: boolean;
    texts?: string[];
}
export interface ColorConfig extends BaseFieldConfig {
    type: 'color';
    showAlpha?: boolean;
    colorFormat?: 'hsl' | 'hsv' | 'hex' | 'rgb';
    predefine?: string[];
}
export interface HtmlConfig extends BaseFieldConfig {
    type: 'html';
    htmlContent: string;
}
export interface CustomConfig extends BaseFieldConfig {
    type: 'custom';
    customSlot: string;
}
export type FormFieldConfig = InputConfig | NumberConfig | SelectConfig | RadioConfig | CheckboxConfig | SwitchConfig | DateConfig | UploadConfig | CascaderConfig | TreeSelectConfig | SliderConfig | RateConfig | ColorConfig | HtmlConfig | CustomConfig;
