mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
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
This commit is contained in:
Vendored
+7
-2
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/erikras/redux-form
|
||||
// Definitions by: Carson Full <https://github.com/carsonf>, Daniel Lytkin <https://github.com/aikoven>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
///<reference types="react" />
|
||||
|
||||
@@ -16,9 +17,13 @@ export type FieldType = 'Field' | 'FieldArray';
|
||||
|
||||
export type DataShape = {[fieldName:string]: FieldValue};
|
||||
|
||||
export type FormErrors<FormData extends DataShape> = FormData & { _error?: string };
|
||||
export type FormErrors<FormData extends DataShape> = {
|
||||
[P in keyof FormData]?: React.ReactElement<any> | string;
|
||||
} & { _error?: string };
|
||||
|
||||
export type FormWarnings<FormData extends DataShape> = FormData & { _warning?: string };
|
||||
export type FormWarnings<FormData extends DataShape> = {
|
||||
[P in keyof FormData]?: React.ReactElement<any> | string;
|
||||
} & { _warning?: string };
|
||||
|
||||
/**
|
||||
* A component class or stateless function component.
|
||||
|
||||
Reference in New Issue
Block a user