import { Ref } from 'vue'; import { ProFormSchema, ProFormProps, FormActionType } from '../types'; export interface UseFormProps extends ProFormProps { schemas?: ProFormSchema[]; } /** 支持 ref/computed 的 props(参考 Vben Admin:参数 props 内的值可以是 computed 或者 ref 类型) */ export type UseFormPropsReactive = UseFormProps | Ref; export interface UseFormReturn { /** 用于 @register,接收表单实例的 formAction */ register: (formAction: FormActionType) => void; formAction: { value: FormActionType | null; }; getFieldsValue: () => Record; setFieldsValue: (values: Record) => Promise; resetFields: () => Promise; validate: (nameList?: string[]) => Promise | { errors: Record; }>; validateFields: (nameList?: string[]) => Promise; submit: () => Promise; scrollToField: (name: string, options?: import('../types').ScrollToFieldOptions) => Promise; clearValidate: (name?: string | string[]) => void; updateSchema: (data: Partial | Partial[]) => Promise; appendSchemaByField: (schema: ProFormSchema, prefixField?: string, first?: boolean) => Promise; removeSchemaByField: (field: string | string[]) => Promise; setProps: (props: Partial) => Promise; getComponentInstance: FormActionType['getComponentInstance']; getFieldOptions: FormActionType['getFieldOptions']; isFieldLoading: FormActionType['isFieldLoading']; } export declare function useForm(props?: UseFormPropsReactive): [UseFormReturn['register'], Omit];