export type EventArgs = any[]; export type InternalNamePath = (string | number)[]; export type NamePath = string | number | InternalNamePath; export type ValidateFields = (nameList?: NamePath[]) => Promise; export type StoreValue = any; export type Store = Record; export interface Meta { touched: boolean; validating: boolean; errors: string[]; warnings: string[]; name: InternalNamePath; } export interface InternalFieldData extends Meta { value: StoreValue; } export interface FieldData extends Partial> { name: NamePath; } export interface Callbacks { onValuesChange?: (changedValues: any, values: Values) => void; onFieldsChange?: (changedFields: FieldData[], allFields: FieldData[]) => void; onFinish?: (values: Values) => void; onFinishFailed?: (errorInfo: ValidateErrorEntity) => void; } export interface ValidateErrorEntity { values: Values; errorFields: { name: InternalNamePath; errors: string[]; }[]; outOfDate: boolean; } type RecursivePartial = T extends object ? { [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial[] : T[P] extends object ? RecursivePartial : T[P]; } : any; export interface FieldError { name: InternalNamePath; errors: string[]; warnings: string[]; } export interface FormInstance { getFieldValue: (name: NamePath) => StoreValue; getFieldsValue(): Values; getFieldsValue(nameList: NamePath[] | true, filterFunc?: (meta: Meta) => boolean): any; getFieldError: (name: NamePath) => string[]; getFieldsError: (nameList?: NamePath[]) => FieldError[]; getFieldWarning: (name: NamePath) => string[]; isFieldsTouched(nameList?: NamePath[], allFieldsTouched?: boolean): boolean; isFieldsTouched(allFieldsTouched?: boolean): boolean; isFieldTouched: (name: NamePath) => boolean; isFieldValidating: (name: NamePath) => boolean; isFieldsValidating: (nameList: NamePath[]) => boolean; resetFields: (fields?: NamePath[]) => void; setFields: (fields: FieldData[]) => void; setFieldsValue: (values: RecursivePartial) => void; validateFields: ValidateFields; submit: () => void; } export {};