From 28d96a9ec99af437e09c7357bf065f9848af0ea8 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Tue, 10 Jan 2017 19:31:57 +0000 Subject: [PATCH] Fix redux-form typings (#13867) * Patch FormErrors and FormWarnings * Allow passing ReactElement values to FormErrors and FormWarnings * Add typescript version to the end of the header --- redux-form/index.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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.