DefinitelyTyped/types/redux-test-utils/index.d.ts
Huw Martin 937cfc12f1 [redux-test-utils] typing for version 0.2
Add type definitions for redux-test-utils
2018-03-10 18:45:38 +00:00

24 lines
761 B
TypeScript

// Type definitions for redux-test-utils 0.2
// Project: https://github.com/Knegusen/redux-test-utils#readme
// Definitions by: Huw Martin <https://github.com/huwmartin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { AnyAction, Store, Dispatch } from 'redux';
export function createMockStore(
state?: any
): mockStore<any>;
export function createMockDispatch(): mockDispatch<any>;
export interface mockStore<S> extends Store<S>, mockDispatch<S> {}
export interface mockDispatch<S> {
dispatch: Dispatch<S>;
getActions: () => AnyAction[];
getAction: (type: any) => AnyAction | undefined;
isActionTypeDispatched: (type: any) => boolean;
isActionDispatched: (action: AnyAction) => boolean;
}