Extract action types to its own type.

Change Histotyl.location property type from string to HistoryLocation to be accurate to current API
This commit is contained in:
Nelson Javier Novoa Tellez
2018-10-22 15:29:23 -05:00
parent a1f9b81264
commit 1340339ce9
+7 -6
View File
@@ -8,18 +8,19 @@ import * as React from "react";
import { Location as HLocation } from "history";
export type WindowLocation = Window["location"] & HLocation;
export type HistoryActionType = "PUSH" | "POP";
export type HistoryLocation = WindowLocation & { state?: any };
export type HistoryListenerParameter = { location: HistoryLocation, action: HistoryActionType };
export type HistoryListener = (parameter: HistoryListenerParameter) => void;
export type HistoryUnsubscribe = () => void;
export interface History {
readonly location: string;
readonly location: HistoryLocation;
readonly transitioning: boolean;
listen: (listener: HistoryListener) => HistoryUnsubscribe;
navigate: NavigateFn;
}
export type HistoryListenerLocation = WindowLocation & { state?: any };
export type HistoryListenerParameter = { location: HistoryListenerLocation, action: "PUSH" | "POP" };
export type HistoryListener = (parameter: HistoryListenerParameter) => void;
export type HistoryUnsubscribe = () => void;
export class Router extends React.Component<RouterProps> { }
export interface RouterProps {