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
This commit is contained in:
Jordan Hornblow
2017-05-26 09:16:53 +08:00
committed by Benjy Cui
parent 03504446b5
commit 720a3d30b4
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -5,7 +5,7 @@ import shallowequal from 'shallowequal';
import Icon from '../icon';
export interface MentionProps {
prefixCls: string;
prefixCls?: string;
suggestionStyle?: React.CSSProperties;
suggestions?: Array<any>;
onSearchChange?: Function;