@@ -186,6 +186,8 @@ declare interface FieldDecoratorOptions {
186
186
preserve ?: boolean ;
187
187
}
188
188
189
+ export type ValidateCallback = ( errors : Error [ ] , values : any ) => void ;
190
+
189
191
export interface WrappedFormUtils {
190
192
/**
191
193
* Two-way binding for form, single file template can be bound using the directive v-decorator.
@@ -240,7 +242,7 @@ export interface WrappedFormUtils {
240
242
* If you don't specify a parameter, all the fields will be reset.
241
243
* @type Function (Function([names: string[]]))
242
244
*/
243
- resetFields ( names : string [ ] ) : void ;
245
+ resetFields ( names ? : string [ ] ) : void ;
244
246
245
247
/**
246
248
* Set value and error state of fields
@@ -259,24 +261,25 @@ export interface WrappedFormUtils {
259
261
* If you don't specify the parameter of fieldNames, you will validate all fields.
260
262
* @type Function
261
263
*/
262
- validateFields (
263
- fieldNames : string [ ] ,
264
- options : ValidateFieldOptions ,
265
- callback : ( erros : Error [ ] , values : any ) => any ,
266
- ) : void ;
264
+ validateFields ( fieldNames : string [ ] , options : ValidateFieldOptions , callback : ValidateCallback ) : void ;
265
+ validateFields ( fieldNames : string [ ] , callback : ValidateCallback ) : void ;
266
+ validateFields ( options : ValidateFieldOptions , callback : ValidateCallback ) : void ;
267
+ validateFields ( callback : ValidateCallback ) : void ;
268
+ validateFields ( ) : void ;
267
269
268
270
/**
269
271
* This function is similar to validateFields, but after validation, if the target field is not in visible area of form,
270
272
* form will be automatically scrolled to the target field area.
271
273
* @type Function
272
274
*/
273
- validateFieldsAndScroll (
274
- fieldNames : string [ ] ,
275
- options : ValidateFieldOptions ,
276
- callback : ( erros : Error [ ] , values : any ) => any ,
277
- ) : void ;
275
+ validateFieldsAndScroll ( fieldNames ?: string [ ] , options ?: Object , callback ?: ValidateCallback ) : void ;
276
+ validateFieldsAndScroll ( fieldNames ? : string [ ] , callback ?: ValidateCallback ) : void ;
277
+ validateFieldsAndScroll ( options ?: Object , callback ?: ValidateCallback ) : void ;
278
+ validateFieldsAndScroll ( callback ?: ValidateCallback ) : void ;
279
+ validateFieldsAndScroll ( ) : void ;
278
280
}
279
281
282
+
280
283
export interface IformCreateOption {
281
284
/**
282
285
* Only supports the use of Form.create({})(CustomizedForm). declare props on form(like vue props)
0 commit comments