From 720a3d30b4359c908469dc3362052770f8b3ae81 Mon Sep 17 00:00:00 2001 From: Jordan Hornblow Date: Fri, 26 May 2017 11:16:53 +1000 Subject: [PATCH] fix: Form and Mention TypeScript definition (#6268) * Add source and options params to Form.ValidationRule.validator function As per rules section of async-validation readme: https://github.com/yiminghe/async-validator#rules * Make prefixCls optional in MentionProps interface --- components/form/Form.tsx | 2 +- components/mention/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 8bf5f2675..1419a226b 100755 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -52,7 +52,7 @@ export type ValidationRule = { /** transform a value before validation */ transform?: (value: any) => any; /** custom validate function (Note: callback must be called) */ - validator?: (rule: any, value: any, callback: any) => any; + validator?: (rule: any, value: any, callback: any, source?: any, options?: any) => any; }; export type ValidateCallback = (erros: any, values: any) => void; diff --git a/components/mention/index.tsx b/components/mention/index.tsx index d6adbab34..ce56231ed 100644 --- a/components/mention/index.tsx +++ b/components/mention/index.tsx @@ -5,7 +5,7 @@ import shallowequal from 'shallowequal'; import Icon from '../icon'; export interface MentionProps { - prefixCls: string; + prefixCls?: string; suggestionStyle?: React.CSSProperties; suggestions?: Array; onSearchChange?: Function;