diff --git a/types/redux-form/index.d.ts b/types/redux-form/index.d.ts index 25d342c8c2..3ecfe65cd4 100644 --- a/types/redux-form/index.d.ts +++ b/types/redux-form/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for redux-form 7.0 +// Type definitions for redux-form 7.2 // Project: https://github.com/erikras/redux-form // Definitions by: Carson Full // Daniel Lytkin @@ -6,6 +6,7 @@ // Luka Zakrajsek // Alex Young // Anton Novik +// Huw Martin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/redux-form/lib/Field.d.ts b/types/redux-form/lib/Field.d.ts index aa3036b713..7a3c11af3f 100644 --- a/types/redux-form/lib/Field.d.ts +++ b/types/redux-form/lib/Field.d.ts @@ -14,7 +14,7 @@ import { Dispatch } from "redux"; export type Normalizer = (value: any, previousValue?: any, allValues?: any, previousAllValues?: any) => any; export type Formatter = (value: any, name: string) => any; export type Parser = (value: any, name: string) => any; -export type Validator = (value: any, allValues?: any, props?: any) => any; +export type Validator = (value: any, allValues?: any, props?: any, name?: any) => any; export type EventHandler = (event: Event) => void; export type EventWithDataHandler = (event?: Event, newValue?: any, previousValue?: any) => void; diff --git a/types/redux-form/lib/FieldArray.d.ts b/types/redux-form/lib/FieldArray.d.ts index 7dd9564472..44ca7806ca 100644 --- a/types/redux-form/lib/FieldArray.d.ts +++ b/types/redux-form/lib/FieldArray.d.ts @@ -47,11 +47,11 @@ interface FieldsProps { interface FieldArrayMetaProps { dirty: boolean; - error?: string; + error?: any; form: string; invalid: boolean; pristine: boolean; submitting: boolean; valid: boolean; - warning?: string; + warning?: any; } diff --git a/types/redux-form/lib/actionTypes.d.ts b/types/redux-form/lib/actionTypes.d.ts index ce1ba5d208..ac0256456c 100644 --- a/types/redux-form/lib/actionTypes.d.ts +++ b/types/redux-form/lib/actionTypes.d.ts @@ -15,6 +15,7 @@ export interface ActionTypes { CLEAR_SUBMIT: string; CLEAR_SUBMIT_ERRORS: string; CLEAR_ASYNC_ERROR: string; + CLEAR_FIELDS: string; DESTROY: string; FOCUS: string; INITIALIZE: string; diff --git a/types/redux-form/lib/actions.d.ts b/types/redux-form/lib/actions.d.ts index 7918b94350..80fbc3a234 100644 --- a/types/redux-form/lib/actions.d.ts +++ b/types/redux-form/lib/actions.d.ts @@ -41,6 +41,7 @@ export declare function submit(form: string): FormAction; export declare function clearSubmit(form: string): FormAction; export declare function clearSubmitErrors(form: string): FormAction; export declare function clearAsyncError(form: string, field: string): FormAction; +export declare function clearFields(form: string, keepTouched: boolean, persistentSubmitErrors: boolean, ...fields: string[]): FormAction; export declare function touch(form: string, ...fields: string[]): FormAction; export declare function unregisterField(form: string, name: string): FormAction; export declare function untouch(form: string, ...fields: string[]): FormAction; @@ -64,6 +65,7 @@ declare const actions: { clearSubmit: typeof clearSubmit, clearSubmitErrors: typeof clearSubmitErrors, clearAsyncError: typeof clearAsyncError, + clearFields: typeof clearFields, destroy: typeof destroy, focus: typeof focus, initialize: typeof initialize, diff --git a/types/redux-form/lib/reduxForm.d.ts b/types/redux-form/lib/reduxForm.d.ts index 5989e248cc..2c6dd40c5d 100644 --- a/types/redux-form/lib/reduxForm.d.ts +++ b/types/redux-form/lib/reduxForm.d.ts @@ -116,6 +116,8 @@ export interface ConfigProps { propNamespace?: string; pure?: boolean; shouldValidate?(params: ValidateCallback): boolean; + shouldError?(params: ValidateCallback): boolean; + shouldWarn?(params: ValidateCallback): boolean; shouldAsyncValidate?(params: AsyncValidateCallback): boolean; touchOnBlur?: boolean; touchOnChange?: boolean; diff --git a/types/redux-form/lib/selectors.d.ts b/types/redux-form/lib/selectors.d.ts index ee79f4b137..4d224b5b82 100644 --- a/types/redux-form/lib/selectors.d.ts +++ b/types/redux-form/lib/selectors.d.ts @@ -11,6 +11,7 @@ export const getFormMeta: DataSelector; export const getFormAsyncErrors: ErrorSelector; export const getFormSyncWarnings: ErrorSelector; export const getFormSubmitErrors: ErrorSelector; +export const getFormError: ErrorSelector; export function getFormNames(state: any): string[]; export const isDirty: BooleanSelector; export const isPristine: BooleanSelector;