mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
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:
Vendored
+7
-6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user