import type { VNode, CSSProperties } from 'vue';
import type { NamePath, RuleObject } from 'ant-design-vue/lib/form/interface';
import type { ButtonProps as AntdButtonProps } from 'ant-design-vue/es/button';
import { ComponentType, ColEx } from './index';
import type { FormItem } from './formItem';
import type { RowProps } from 'ant-design-vue/lib/grid/Row';
import type { Recordable } from '../../typings/global';
declare type Rule = RuleObject & {
    trigger: 'blur' | 'change' | ['change', 'blur'];
};
export declare type FieldMapToTime = [string, [string, string], string?][];
export declare type FieldMapToRangeValue = [string, [string, string], Function?][];
export interface RenderCallbackParams {
    scheme: FormScheme;
    values: Recordable;
    model: Recordable;
    field: string;
}
export interface ButtonProps extends AntdButtonProps {
    text?: string;
    color?: string;
}
/**
 * 解决方案属性
 */
export interface SearchSolution {
    collectionName?: string;
    switchButtonProps?: Partial<ButtonProps>;
    saveButtonProps?: Partial<ButtonProps>;
    api?: (...args: any[]) => Promise<any>;
    params?: Recordable;
    resultField?: string;
    fieldNames?: SearchSolutionItem;
    delApi?: (...args: any[]) => Promise<any>;
    saveApi?: (...args: any[]) => Promise<any>;
    afterFetch?: (...arg: any[]) => any;
    afterSaved?: (...arg: any[]) => any;
    onError?: (...arg: any[]) => any;
}
export interface SearchSolutionItem {
    text: string;
    event: string;
    id?: string | number;
}
export interface FormActionType {
    submit: () => Promise<void>;
    setFieldsValue: <T>(values: T) => Promise<void>;
    resetFields: () => Promise<void>;
    getFieldsValue: () => Recordable;
    clearValidate: (name?: string | string[]) => Promise<void>;
    updateScheme: (data: Partial<FormScheme> | Partial<FormScheme>[]) => Promise<void>;
    resetScheme: (data: Partial<FormScheme> | Partial<FormScheme>[]) => Promise<void>;
    setProps: (formProps: Partial<FormProps>) => Promise<void>;
    removeSchemeByFiled: (field: string | string[]) => Promise<void>;
    appendSchemeByField: (scheme: FormScheme, prefixField: string | undefined, first?: boolean | undefined) => Promise<void>;
    validateFields: (nameList?: NamePath[]) => Promise<any>;
    validate: (nameList?: NamePath[]) => Promise<any>;
    scrollToField: (name: NamePath, options?: ScrollOptions) => Promise<void>;
    toggleAdvanced: () => void;
}
export declare type RegisterFn = (formInstance: FormActionType) => void;
export declare type UseFormReturnType = [RegisterFn, FormActionType];
export interface FormProps {
    layout?: 'vertical' | 'inline' | 'horizontal';
    model?: Recordable;
    labelWidth?: number | string;
    labelAlign?: 'left' | 'right';
    rowProps?: RowProps;
    submitOnReset?: boolean;
    labelCol?: Partial<ColEx>;
    wrapperCol?: Partial<ColEx>;
    baseRowStyle?: CSSProperties;
    baseColProps?: Partial<ColEx>;
    schemes?: FormScheme[];
    fieldMapToTime?: FieldMapToTime;
    fieldMapToRangeValue?: FieldMapToRangeValue;
    transformDateFunc?: (date: any) => string;
    mergeDynamicData?: Recordable;
    size?: 'middle' | 'small' | 'large';
    disabled?: boolean;
    autoSetPlaceHolder?: boolean;
    autoSubmitOnEnter?: boolean;
    rulesMessageJoinLabel?: boolean;
    autoFocusFirstItem?: boolean;
    showActionButtonGroup?: boolean;
    resetButtonOptions?: Partial<ButtonProps>;
    submitButtonOptions?: Partial<ButtonProps>;
    actionColOptions?: Partial<ColEx>;
    showResetButton?: boolean;
    showSubmitButton?: boolean;
    resetFunc?: () => Promise<void>;
    submitFunc?: () => Promise<void>;
    colon?: boolean;
    showSearchSolution?: boolean;
    searchSolutionProps?: SearchSolution;
    showAdvanced?: boolean;
    advancedButtonProps?: Partial<ButtonProps>;
    autoAdvancedLines?: number;
    t?: (key: string, ...args: any[]) => any;
    simple?: boolean;
    defaultExpandedAdvanced?: boolean;
}
export interface FormScheme {
    field: string;
    valueField?: string;
    changeEvent?: string;
    label: string | VNode;
    subLabel?: string;
    labelWidth?: number | string;
    disabledLabelWidth?: boolean;
    component: ComponentType | string;
    componentProps?: object | ((opt: {
        scheme: FormScheme;
        formModel: Recordable;
    }) => Recordable);
    required?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
    suffix?: string | number | ((renderCallbackParams: RenderCallbackParams) => string | number);
    rules?: Rule[];
    rulesMessageJoinLabel?: boolean;
    itemProps?: Partial<FormItem>;
    colProps?: Partial<ColEx>;
    defaultValue?: any;
    span?: number;
    ifShow?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
    show?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
    render?: (renderCallbackParams: RenderCallbackParams) => VNode | VNode[] | string;
    renderColContent?: (renderCallbackParams: RenderCallbackParams) => VNode | VNode[] | string;
    slot?: string;
    colSlot?: string;
    dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
    dynamicRules?: (renderCallbackParams: RenderCallbackParams) => Rule[];
    renderComponentContent?: ((renderCallbackParams: RenderCallbackParams) => any) | VNode | VNode[] | string;
    helpMessage?: string | string[] | ((renderCallbackParams: RenderCallbackParams) => string | string[]);
    helpComponentProps?: Partial<HelpComponentProps>;
    itemRest?: boolean;
    advanced?: boolean;
}
export interface HelpComponentProps {
    maxWidth: number;
    showIndex: boolean;
    text: any;
    color: string;
    fontSize: number;
}
export {};
