diff --git a/redux-mock-store/redux-mock-store-tests.ts b/redux-mock-store/redux-mock-store-tests.ts index 373a3f8fd1..15d51d1f23 100644 --- a/redux-mock-store/redux-mock-store-tests.ts +++ b/redux-mock-store/redux-mock-store-tests.ts @@ -41,3 +41,7 @@ store.dispatch({ type: 'INCREMENT' }); var actions: Array = store.getActions(); store.clearActions(); + +// actions access without the need to cast +var actions2 = store.getActions(); +actions2[10].payload.id; \ No newline at end of file diff --git a/redux-mock-store/redux-mock-store.d.ts b/redux-mock-store/redux-mock-store.d.ts index ad37ad4e06..9183423bfd 100644 --- a/redux-mock-store/redux-mock-store.d.ts +++ b/redux-mock-store/redux-mock-store.d.ts @@ -8,16 +8,16 @@ declare module 'redux-mock-store' { import * as Redux from 'redux' - function createMockStore(middlewares?:Redux.Middleware[]):mockStore + function createMockStore(middlewares?: Redux.Middleware[]): mockStore; - export type mockStore = (state?:T) => IStore; + export type mockStore = (state?: T) => IStore; - export type IStore = { - dispatch(action: any):any - getState():T - getActions():Object[] - clearActions():void - subscribe(listener: Function):Function + export interface IStore { + dispatch(action: any): any; + getState(): T; + getActions(): any[]; + clearActions(): void; + subscribe(listener: Function): Function; } export default createMockStore