From 9a0e11328b418a7c0b56dff9ff6f61e22831f66c Mon Sep 17 00:00:00 2001 From: remojansen Date: Wed, 17 Feb 2016 20:42:26 +0000 Subject: [PATCH] added tests case and fixed issue --- redux-router/redux-router-tests.ts | 8 +++++++- redux-router/redux-router.d.ts | 18 +++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/redux-router/redux-router-tests.ts b/redux-router/redux-router-tests.ts index 081f94d71..24274f4cd 100644 --- a/redux-router/redux-router-tests.ts +++ b/redux-router/redux-router-tests.ts @@ -1,2 +1,8 @@ /// -import { reduxReactRouter, routerStateReducer, ReduxRouter } from 'redux-router'; +import { reduxReactRouter, routerStateReducer, ReduxRouter, pushState } from 'redux-router'; + +export function someAsyncReduxAction(someArg: Object) { + return function(dispatch: (action: Object) => void) { + dispatch(pushState(null, someArg)); + }; +} \ No newline at end of file diff --git a/redux-router/redux-router.d.ts b/redux-router/redux-router.d.ts index f8cff8f8e..757f5f80b 100644 --- a/redux-router/redux-router.d.ts +++ b/redux-router/redux-router.d.ts @@ -34,7 +34,7 @@ declare namespace __ReduxRouter { export function routerDidChange(state: any): ReduxRouterAction; export function initRoutes(routes: any): ReduxRouterAction; export function replaceRoutes(routes: any): ReduxRouterAction; - export function historyAPI(method: any): (...args: any[]) => ReduxRouterAction; + export function historyAPI(method: any): (...args: Object[]) => ReduxRouterAction; } declare module "redux-router/lib/routerStateReducer" { @@ -59,14 +59,14 @@ declare module "redux-router/lib/actionCreators" { export const initRoutes: typeof __ReduxRouter.initRoutes; export const replaceRoutes: typeof __ReduxRouter.replaceRoutes; export const historyAPI: typeof __ReduxRouter.historyAPI; - export const pushState: __ReduxRouter.historyAPI; - export const push: __ReduxRouter.historyAPI; - export const replaceState: __ReduxRouter.historyAPI; - export const replace: __ReduxRouter.historyAPI; - export const setState: __ReduxRouter.historyAPI; - export const go: __ReduxRouter.historyAPI; - export const goBack: __ReduxRouter.historyAPI; - export const goForward: __ReduxRouter.historyAPI; + export const pushState: (...args: Object[]) => __ReduxRouter.ReduxRouterAction; + export const push: (...args: Object[]) => __ReduxRouter.ReduxRouterAction; + export const replaceState: (...args: Object[]) => __ReduxRouter.ReduxRouterAction; + export const replace: (...args: Object[]) => __ReduxRouter.ReduxRouterAction; + export const setState: (...args: Object[]) => __ReduxRouter.ReduxRouterAction; + export const go: (...args: Object[]) => __ReduxRouter.ReduxRouterAction; + export const goBack: (...args: Object[]) => __ReduxRouter.ReduxRouterAction; + export const goForward: (...args: Object[]) => __ReduxRouter.ReduxRouterAction; } declare module "redux-router" {