From 9d698b3631a686df69423fb192721952cabf8e43 Mon Sep 17 00:00:00 2001 From: Oden Date: Mon, 1 May 2017 18:09:33 -0700 Subject: [PATCH] Add RouterState to typings --- examples/typescript/src/reducers/index.ts | 9 ++------- index.d.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/examples/typescript/src/reducers/index.ts b/examples/typescript/src/reducers/index.ts index e0bc9a2a..0bf3923a 100644 --- a/examples/typescript/src/reducers/index.ts +++ b/examples/typescript/src/reducers/index.ts @@ -1,4 +1,5 @@ import { combineReducers } from 'redux' +import { RouterState } from 'connected-react-router' import counterReducer from './counter' const rootReducer = combineReducers({ @@ -7,13 +8,7 @@ const rootReducer = combineReducers({ export interface State { count: number - router: { - location: { - pathname: string - search: string - hash: string - } - } + router: RouterState } export default rootReducer diff --git a/index.d.ts b/index.d.ts index cd60143a..e5e29919 100644 --- a/index.d.ts +++ b/index.d.ts @@ -7,6 +7,16 @@ declare module 'connected-react-router' { history: History } + export interface RouterState { + location: { + pathname: string, + search: string, + hash: string, + key: string, + }, + action: 'POP' | 'PUSH' + } + export const LOCATION_CHANGE: string export const CALL_HISTORY_METHOD: string