/// import { UnregisterCallback } from '../App'; export declare type TransitionPromptHook = (location: ILocation, action: RouterAction) => string | false | void; export declare type Path = string; export declare type LocationState = any; export interface ILocation { pathname: string; state: S; key: string; } export interface IPartialLocation { pathname: ILocation['pathname']; state?: S; key?: ILocation['key']; } export declare enum RouterAction { PUSH = "PUSH", REPLACE = "REPLACE", POP = "POP", RESET = "RESET" } export declare enum RouterEventType { LocationChange = "locationchange", LocationStateChange = "locationstatechange" } export declare type LocationChangeEvent = { readonly type: RouterEventType.LocationChange; readonly action: RouterAction; readonly index: number; readonly entries: Array>; readonly length: number; readonly location: ILocation; }; export declare type LocationStateChangeEvent = { readonly type: RouterEventType.LocationStateChange; readonly key: string; readonly state: EventLocationState; }; export declare type RouterEvent = LocationChangeEvent | LocationStateChangeEvent; export declare type RouterEventHandler = (event: T extends RouterEventType.LocationChange ? LocationChangeEvent : T extends RouterEventType.LocationStateChange ? LocationStateChangeEvent : RouterEvent) => void; declare function addEventListener(type: T, handler: RouterEventHandler): UnregisterCallback; declare function addEventListener(handler: RouterEventHandler): UnregisterCallback; declare function removeEventListener(type: RouterEventType, handler: RouterEventHandler): void; declare function removeEventListener(handler: RouterEventHandler): void; export interface IRouter { readonly action: RouterAction; readonly index: number; readonly entries: Array>; readonly length: number; readonly location: ILocation; addEventListener: typeof addEventListener; removeEventListener: typeof removeEventListener; reset(entries: IPartialLocation[], index?: IRouter['index']): void; canGo(n: number): boolean; push(path: Path, state?: RouterLocationState): void; push(location: IPartialLocation): void; replace(path: Path, state?: RouterLocationState): void; replace(location: IPartialLocation): void; go(n: number): void; goBack(): void; goForward(): void; setLocationState(key: string, state?: RouterLocationState): void; block(prompt?: boolean | string | TransitionPromptHook): UnregisterCallback; } export interface IRoute

| React.ComponentType> { Component?: P | null; path: string | string[]; } export declare type MatchParams = { [key: string]: any; }; export interface IMatch { params: Params; path: string; } export {};