diff --git a/redux-form/index.d.ts b/redux-form/index.d.ts index 4c73f3e489..590fe3a633 100644 --- a/redux-form/index.d.ts +++ b/redux-form/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/erikras/redux-form // Definitions by: Carson Full , Daniel Lytkin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// @@ -16,9 +17,13 @@ export type FieldType = 'Field' | 'FieldArray'; export type DataShape = {[fieldName:string]: FieldValue}; -export type FormErrors = FormData & { _error?: string }; +export type FormErrors = { + [P in keyof FormData]?: React.ReactElement | string; +} & { _error?: string }; -export type FormWarnings = FormData & { _warning?: string }; +export type FormWarnings = { + [P in keyof FormData]?: React.ReactElement | string; +} & { _warning?: string }; /** * A component class or stateless function component.