Form: add missing type definition for form create option validateMessages

(Docs for validateMessages had been added in rev 16133aac65 )
pull/10883/head
Sebastian Busch 7 years ago committed by 偏右
parent 619b0ed628
commit ee0a7ce3bb

@ -9,10 +9,20 @@ import FormItem from './FormItem';
import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants'; import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants';
import { Omit } from '../_util/type'; import { Omit } from '../_util/type';
type FormCreateOptionMessagesCallback = (...args: any[]) => string;
interface FormCreateOptionMessages {
[messageId: string]:
| string
| FormCreateOptionMessagesCallback
| FormCreateOptionMessages;
}
export interface FormCreateOption<T> { export interface FormCreateOption<T> {
onFieldsChange?: (props: T, fields: Array<any>, allFields: any, add: string) => void; onFieldsChange?: (props: T, fields: Array<any>, allFields: any, add: string) => void;
onValuesChange?: (props: T, changedValues: any, allValues: any) => void; onValuesChange?: (props: T, changedValues: any, allValues: any) => void;
mapPropsToFields?: (props: T) => void; mapPropsToFields?: (props: T) => void;
validateMessages?: FormCreateOptionMessages;
withRef?: boolean; withRef?: boolean;
} }

Loading…
Cancel
Save