diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 84af82e8e0..4821bdb061 100755 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -75,7 +75,7 @@ export type ValidationRule = { validator?: (rule: any, value: any, callback: any, source?: any, options?: any) => any; }; -export type ValidateCallback = (errors: any, values: any) => void; +export type ValidateCallback = (errors: any, values: V) => void; export type GetFieldDecoratorOptions = { /** 子节点的值的属性,如 Checkbox 的是 'checked' */ @@ -134,7 +134,7 @@ export type ValidateFieldsOptions = { }; // function create -export type WrappedFormUtils = { +export type WrappedFormUtils = { /** 获取一组输入控件的值,如不传入参数,则获取全部组件的值 */ getFieldsValue(fieldNames?: Array): { [field: string]: any }; /** 获取一个输入控件的值 */ @@ -147,26 +147,26 @@ export type WrappedFormUtils = { validateFields( fieldNames: Array, options: ValidateFieldsOptions, - callback: ValidateCallback, + callback: ValidateCallback, ): void; - validateFields(options: ValidateFieldsOptions, callback: ValidateCallback): void; - validateFields(fieldNames: Array, callback: ValidateCallback): void; + validateFields(options: ValidateFieldsOptions, callback: ValidateCallback): void; + validateFields(fieldNames: Array, callback: ValidateCallback): void; validateFields(fieldNames: Array, options: ValidateFieldsOptions): void; validateFields(fieldNames: Array): void; - validateFields(callback: ValidateCallback): void; + validateFields(callback: ValidateCallback): void; validateFields(options: ValidateFieldsOptions): void; validateFields(): void; /** 与 `validateFields` 相似,但校验完后,如果校验不通过的菜单域不在可见范围内,则自动滚动进可见范围 */ validateFieldsAndScroll( fieldNames: Array, options: ValidateFieldsOptions, - callback: ValidateCallback, + callback: ValidateCallback, ): void; - validateFieldsAndScroll(options: ValidateFieldsOptions, callback: ValidateCallback): void; - validateFieldsAndScroll(fieldNames: Array, callback: ValidateCallback): void; + validateFieldsAndScroll(options: ValidateFieldsOptions, callback: ValidateCallback): void; + validateFieldsAndScroll(fieldNames: Array, callback: ValidateCallback): void; validateFieldsAndScroll(fieldNames: Array, options: ValidateFieldsOptions): void; validateFieldsAndScroll(fieldNames: Array): void; - validateFieldsAndScroll(callback: ValidateCallback): void; + validateFieldsAndScroll(callback: ValidateCallback): void; validateFieldsAndScroll(options: ValidateFieldsOptions): void; validateFieldsAndScroll(): void; /** 获取某个输入控件的 Error */ @@ -185,8 +185,8 @@ export type WrappedFormUtils = { ): (node: React.ReactNode) => React.ReactNode; }; -export interface FormComponentProps { - form: WrappedFormUtils; +export interface FormComponentProps { + form: WrappedFormUtils; } export interface RcBaseFormProps {