1 | import * as Redux from "redux";
|
2 |
|
3 | export interface MockStore<S = any, A extends Redux.Action = Redux.AnyAction> extends Redux.Store<S, A> {
|
4 | getActions(): any[];
|
5 | clearActions(): void;
|
6 | }
|
7 |
|
8 | export type MockStoreEnhanced<S = {}, DispatchExts = {}> = MockStore<S> & { dispatch: DispatchExts };
|
9 |
|
10 | export type MockStoreCreator<S = {}, DispatchExts = {}> = (
|
11 | state?: S | MockGetState<S>,
|
12 | ) => MockStoreEnhanced<S, DispatchExts>;
|
13 |
|
14 | export type MockGetState<S = {}> = (actions: Redux.AnyAction[]) => S;
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | declare function createMockStore<S, DispatchExts = {}>(
|
25 | middlewares?: Redux.Middleware[],
|
26 | ): MockStoreCreator<S, DispatchExts>;
|
27 |
|
28 | export default createMockStore;
|