fix(forms): improve field error method type defs

Change `getFieldError` and `getFieldsError` to return actual types, instead of very restrictive `Object` type (which should be avoided in general, in favour of `unknown`, `object`, or `Record` depending on actual use).
This commit is contained in:
Victor Repkow 2019-05-10 15:22:55 -04:00 committed by GitHub
parent 6eacfd7ebc
commit 611909514c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -171,8 +171,8 @@ export type WrappedFormUtils<V = any> = {
validateFieldsAndScroll(options: ValidateFieldsOptions): void;
validateFieldsAndScroll(): void;
/** 获取某个输入控件的 Error */
getFieldError(name: string): Object[];
getFieldsError(names?: Array<string>): Object;
getFieldError(name: string): string[] | undefined;
getFieldsError(names?: Array<string>): Record<string, string[] | undefined>;
/** 判断一个输入控件是否在校验状态 */
isFieldValidating(name: string): boolean;
isFieldTouched(name: string): boolean;