@@ -186,6 +186,8 @@ declare interface FieldDecoratorOptions {
186186 preserve ?: boolean ;
187187}
188188
189+ export type ValidateCallback = ( errors : Error [ ] , values : any ) => void ;
190+
189191export interface WrappedFormUtils {
190192 /**
191193 * Two-way binding for form, single file template can be bound using the directive v-decorator.
@@ -240,7 +242,7 @@ export interface WrappedFormUtils {
240242 * If you don't specify a parameter, all the fields will be reset.
241243 * @type Function (Function([names: string[]]))
242244 */
243- resetFields ( names : string [ ] ) : void ;
245+ resetFields ( names ? : string [ ] ) : void ;
244246
245247 /**
246248 * Set value and error state of fields
@@ -259,24 +261,25 @@ export interface WrappedFormUtils {
259261 * If you don't specify the parameter of fieldNames, you will validate all fields.
260262 * @type Function
261263 */
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 ;
267269
268270 /**
269271 * This function is similar to validateFields, but after validation, if the target field is not in visible area of form,
270272 * form will be automatically scrolled to the target field area.
271273 * @type Function
272274 */
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 ;
278280}
279281
282+
280283export interface IformCreateOption {
281284 /**
282285 * Only supports the use of Form.create({})(CustomizedForm). declare props on form(like vue props)
0 commit comments