mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #29951 from javnov/master
Expose globalHistory field as @reach/router does
This commit is contained in:
Vendored
+12
-4
@@ -8,16 +8,22 @@ 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 interface 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 HistoryListener = () => void;
|
||||
export type HistoryUnsubscribe = () => void;
|
||||
|
||||
export class Router extends React.Component<RouterProps> { }
|
||||
|
||||
export interface RouterProps {
|
||||
@@ -147,3 +153,5 @@ export interface RedirectRequest {
|
||||
export function isRedirect(error: any): error is RedirectRequest;
|
||||
|
||||
export function redirectTo(uri: string): void;
|
||||
|
||||
export const globalHistory: History;
|
||||
|
||||
Reference in New Issue
Block a user