1 | import type { AnyAction } from 'redux';
|
2 | import type { ThunkMiddleware } from 'redux-thunk';
|
3 | import type { ActionCreatorInvariantMiddlewareOptions } from './actionCreatorInvariantMiddleware';
|
4 | import type { ImmutableStateInvariantMiddlewareOptions } from './immutableStateInvariantMiddleware';
|
5 | import type { SerializableStateInvariantMiddlewareOptions } from './serializableStateInvariantMiddleware';
|
6 | import type { ExcludeFromTuple } from './tsHelpers';
|
7 | import { MiddlewareArray } from './utils';
|
8 | interface ThunkOptions<E = any> {
|
9 | extraArgument: E;
|
10 | }
|
11 | interface GetDefaultMiddlewareOptions {
|
12 | thunk?: boolean | ThunkOptions;
|
13 | immutableCheck?: boolean | ImmutableStateInvariantMiddlewareOptions;
|
14 | serializableCheck?: boolean | SerializableStateInvariantMiddlewareOptions;
|
15 | actionCreatorCheck?: boolean | ActionCreatorInvariantMiddlewareOptions;
|
16 | }
|
17 | export declare type ThunkMiddlewareFor<S, O extends GetDefaultMiddlewareOptions = {}> = O extends {
|
18 | thunk: false;
|
19 | } ? never : O extends {
|
20 | thunk: {
|
21 | extraArgument: infer E;
|
22 | };
|
23 | } ? ThunkMiddleware<S, AnyAction, E> : ThunkMiddleware<S, AnyAction>;
|
24 | export declare type CurriedGetDefaultMiddleware<S = any> = <O extends Partial<GetDefaultMiddlewareOptions> = {
|
25 | thunk: true;
|
26 | immutableCheck: true;
|
27 | serializableCheck: true;
|
28 | actionCreatorCheck: true;
|
29 | }>(options?: O) => MiddlewareArray<ExcludeFromTuple<[ThunkMiddlewareFor<S, O>], never>>;
|
30 | export declare function curryGetDefaultMiddleware<S = any>(): CurriedGetDefaultMiddleware<S>;
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export declare function getDefaultMiddleware<S = any, O extends Partial<GetDefaultMiddlewareOptions> = {
|
44 | thunk: true;
|
45 | immutableCheck: true;
|
46 | serializableCheck: true;
|
47 | actionCreatorCheck: true;
|
48 | }>(options?: O): MiddlewareArray<ExcludeFromTuple<[ThunkMiddlewareFor<S, O>], never>>;
|
49 | export {};
|