From ee0a7ce3bb37df62a18ff1701349f35fc1cc7d25 Mon Sep 17 00:00:00 2001 From: Sebastian Busch Date: Mon, 11 Jun 2018 11:22:34 +0200 Subject: [PATCH] Form: add missing type definition for form create option validateMessages (Docs for validateMessages had been added in rev https://github.com/ant-design/ant-design/commit/16133aac65d0a4771999808d70e9b8f4e40206ae ) --- components/form/Form.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 73d5f91def..22cca11217 100755 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -9,10 +9,20 @@ import FormItem from './FormItem'; import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants'; import { Omit } from '../_util/type'; +type FormCreateOptionMessagesCallback = (...args: any[]) => string; + +interface FormCreateOptionMessages { + [messageId: string]: + | string + | FormCreateOptionMessagesCallback + | FormCreateOptionMessages; +} + export interface FormCreateOption { onFieldsChange?: (props: T, fields: Array, allFields: any, add: string) => void; onValuesChange?: (props: T, changedValues: any, allValues: any) => void; mapPropsToFields?: (props: T) => void; + validateMessages?: FormCreateOptionMessages; withRef?: boolean; }