mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
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:
parent
6eacfd7ebc
commit
611909514c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user