Created
November 12, 2015 02:41
-
-
Save iamdustan/9290ed93a39d16ee3958 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'redux-form' { | |
declare type Errors = Object; | |
declare type ValidationPromise = Promise<?Errors>; | |
declare type MapPropsToValues = (props:Object) => Object; | |
declare type ReduxFormProps = { | |
active: string; | |
asyncValidate: Function; | |
asyncValidating: boolean; | |
destroyForm: Function; | |
dirty: boolean; | |
error: string; | |
fields: {[key:string]: FieldProps}; | |
handleSubmit(eventOrValue:any): ?ValidationPromise|any; | |
initializeForm(data:Object): void; | |
invalid: boolean; | |
pristine: boolean; | |
resetForm(): void; | |
formKey: string; | |
submitting: boolean; | |
touch(...field:Array<string>): void; | |
touchAll(): void; | |
untouch(...field:Array<string>): void; | |
untouchAll(): void; | |
valid: boolean; | |
values: Object; | |
}; | |
declare type FieldProps = { | |
active: boolean; | |
checked: boolean; | |
className: string; | |
dirty: boolean; | |
error: string; | |
invalid: boolean; | |
name: string; | |
onBlur(eventOrValue:any): void; | |
onChange(eventOrValue:any): void; | |
onDragStart(): void; | |
onDrop(): void; | |
onFocus(): void; | |
onUpdate: Function; | |
pristine: boolean; | |
touched: boolean; | |
valid: boolean; | |
value: boolean|string; | |
visited: boolean; | |
}; | |
declare type AsyncValidate = (values:Object, dispatch:Function) => ValidationPromise; | |
declare type ReduxFormOptions = { | |
fields: Array<string>; | |
form: string; | |
asyncBlurFields?: Array<string>; | |
asyncValidate?: AsyncValidate; | |
destroyOnUnmount?: boolean; | |
formKey?: string; | |
initialValues?: Object | MapPropsToValues; | |
onSubmit?: Function; | |
readonly?: boolean; | |
reduxMountPoint?: string; | |
touchOnBlur?: boolean; | |
touchOnChange?: boolean; | |
validate?: (values:Object, props:Object) => Errors; | |
}; | |
declare function reduxForm( | |
options: ReduxFormOptions | |
): (comp: ReactClass|Function) => ReactClass; | |
declare function reducer<U>( | |
action: Object, | |
state: U | |
):U; | |
declare var actionTypes: {[key:string]: string}; | |
declare var blur: () => any; | |
declare var change: () => any; | |
declare var destroy: () => any; | |
declare var focus: () => any; | |
declare var initialize: () => any; | |
declare var initializeWithKey: () => any; | |
declare var reset: () => any; | |
declare var startAsyncValidation: () => any; | |
declare var startSubmit: () => any; | |
declare var stopAsyncValidation: () => any; | |
declare var stopSubmit: () => any; | |
declare var touch: () => any; | |
declare var untouch: () => any; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment