Improve types of mobx-react-form

This commit is contained in:
Eric Schultz 2018-10-01 14:55:05 -05:00
parent a282e12c64
commit 2b5b4b40c1

View file

@ -171,7 +171,7 @@ interface FieldHandlers {
onError?(e:Field):any onError?(e:Field):any
} }
interface FieldDefinition { interface FieldDefinition<TInputType=any> {
name: string name: string
key?: string key?: string
label?: string label?: string
@ -190,6 +190,8 @@ interface FieldDefinition {
rules?: string rules?: string
id?:string, id?:string,
validators?: Validation | Array<Validation> validators?: Validation | Array<Validation>
input?: (input:TInputType) => string
output?: (value:string) => TInputType
} }