Added SubmissionError into export for immutabable

Added SubmissionError into export in redux-from/immutable/index.d.ts
in order to be able to use SubmissionError with immutable store state.

In redux-form/lib/SubmissionError.d.ts changed default generic from void
to any, in order to be able to use it as is state redux-form docs.

http://redux-form.com/7.0.3/examples/submitValidation/

Because there is no way to pass anoter type into generic constructor
from real project.
This commit is contained in:
Jozef Bíroš
2017-08-23 07:55:33 +02:00
parent 8fa336c4a9
commit 16caa8fc42
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -20,4 +20,5 @@ export {
isPristine,
isSubmitting,
isValid,
SubmissionError
} from "redux-form";
+2 -2
View File
@@ -1,7 +1,7 @@
import { FormErrors } from "redux-form";
export interface SubmissionErrorConstructor<T = void> {
export interface SubmissionErrorConstructor<T> {
new (errors?: FormErrors<T>): Error;
}
declare const SubmissionError: SubmissionErrorConstructor;
declare const SubmissionError: SubmissionErrorConstructor<any>;