export type Action = 'POP' | 'PUSH' | 'REPLACE'; export type Pathname = string; export type Search = string; export type Hash = string; export type Key = string; export interface Path { pathname: Pathname; search: Search; hash: Hash; } export interface Location extends Path { state: unknown; key: Key; } export interface Update { action: Action; location: Location; } export type Listener = (update: Update) => void; export interface Transition extends Update { retry: () => void; } export type Blocker = (tx: Transition) => void; export type To = string | Partial; export interface History { readonly action: Action; readonly location: Location; createHref: (to: To) => string; push: (to: To, state?: unknown) => void; replace: (to: To, state?: unknown) => void; go: (delta: number) => void; back: () => void; forward: () => void; listen: (listener: Listener) => () => void; block: (blocker: Blocker) => () => void; } export interface BrowserHistory extends History { } export interface HashHistory extends History { } export interface MemoryHistory extends History { readonly index: number; } export type BrowserHistoryOptions = { window?: Window; }; export type HashHistoryOptions = { window?: Window; }; export type InitialEntry = string | Partial; export type MemoryHistoryOptions = { initialEntries?: InitialEntry[]; initialIndex?: number; }; export declare function createPath({ pathname, search, hash }: Partial): string; export declare function parsePath(path: string): Partial; export declare function createBrowserHistory(options?: BrowserHistoryOptions): BrowserHistory; export declare function createHashHistory(options?: HashHistoryOptions): HashHistory; export declare function createMemoryHistory(options?: MemoryHistoryOptions): MemoryHistory;