Replaced self-implemented definition for history with actual definition

This commit is contained in:
Valbrand
2017-06-23 15:44:04 -03:00
parent 7590200fb4
commit cac153ab84
3 changed files with 5 additions and 19 deletions
+1 -17
View File
@@ -11,6 +11,7 @@ import {
Middleware,
GenericStoreEnhancer
} from 'redux';
import { History } from 'history';
export type Nullable<T> = 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 {
+2 -1
View File
@@ -1,5 +1,6 @@
{
"dependencies": {
"redux": "^3.7.0"
"redux": "^3.7.0",
"history": "^4.6.2"
}
}
@@ -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;