From cac153ab84c29f9b92178caadbda360e708dd291 Mon Sep 17 00:00:00 2001 From: Valbrand Date: Fri, 23 Jun 2017 15:44:04 -0300 Subject: [PATCH] Replaced self-implemented definition for history with actual definition --- types/redux-first-router/index.d.ts | 18 +----------------- types/redux-first-router/package.json | 3 ++- .../redux-first-router-tests.ts | 3 ++- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/types/redux-first-router/index.d.ts b/types/redux-first-router/index.d.ts index eb0b8e56c1..e1f62e1014 100644 --- a/types/redux-first-router/index.d.ts +++ b/types/redux-first-router/index.d.ts @@ -11,6 +11,7 @@ import { Middleware, GenericStoreEnhancer } from 'redux'; +import { History } from 'history'; export type Nullable = T | null | undefined; @@ -104,23 +105,6 @@ export type HistoryAction = string; export type Listener = (location: HistoryLocation, action: HistoryAction) => void; -export interface History { - listen(listener: Listener): void; - push(pathname: string): void; - replace(pathname: string): void; - goBack(): void; - goForward(): void; - go(n: number): void; - canGo(n: number): boolean; - - entries: Array<{ pathname: string }>; - index: number; - length: number; - location: { - pathname: string; - }; -} - export type ScrollBehavior = object; export interface Router { diff --git a/types/redux-first-router/package.json b/types/redux-first-router/package.json index f31f265c53..c8b6f7eb50 100644 --- a/types/redux-first-router/package.json +++ b/types/redux-first-router/package.json @@ -1,5 +1,6 @@ { "dependencies": { - "redux": "^3.7.0" + "redux": "^3.7.0", + "history": "^4.6.2" } } \ No newline at end of file diff --git a/types/redux-first-router/redux-first-router-tests.ts b/types/redux-first-router/redux-first-router-tests.ts index 82d8d5366c..aab3f8c2a0 100644 --- a/types/redux-first-router/redux-first-router-tests.ts +++ b/types/redux-first-router/redux-first-router-tests.ts @@ -1,4 +1,4 @@ -import { connectRoutes, History, LocationState, RoutesMap } from 'redux-first-router'; +import { connectRoutes, LocationState, RoutesMap } from 'redux-first-router'; import { createStore, applyMiddleware, @@ -11,6 +11,7 @@ import { GenericStoreEnhancer, StoreEnhancerStoreCreator } from 'redux'; +import { History } from 'history'; declare var console: any; declare var history: History;