import { State, HistoryState, Blocker, Location, ResolvedPath, PathRecord, Path, Action } from '../types'; /** * A POP indicates a change to an arbitrary index in the history stack, such * as a back or forward navigation. It does not describe the direction of the * navigation, only that the current index changed. * * Note: This is the default action for newly created history objects. */ export declare const ACTION_POP: Action; /** * A Push indicates a new entry being added to the history stack, such as when * a link is clicked and a new page loads. When this happens, all subsequent * entries in the stack are lost. */ export declare const ACTION_PUSH: Action; /** * A REPLACE indicates the entry at the current index in the history stack * being replaced by a new one. */ export declare const ACTION_REPLACE: Action; export interface TransitionOptions { state?: State; action?: Action; redirectedFrom?: Path; /** * skipGuards means this route transition will be straightforwardly executed without any before guard */ skipGuards?: boolean; onTransition(event: { location: Location; state: HistoryState; url: string; }): void; onAbort?(): void; } export interface PushOptions { state?: object | null | undefined; redirectedFrom?: Path; skipGuards?: boolean; } export type BaseHistoryOptions = { basename?: string; }; export default abstract class BaseHistory { action: Action; location: Location; basename: string; constructor({ basename }?: BaseHistoryOptions); doTransition: (to: PathRecord, onComplete: Function, onAbort?: Function, skipGuards?: boolean, isReplace?: boolean, redirectedFrom?: Path) => void; protected _index: number; protected _blockers: import("../utils").Events>; protected abstract getIndexAndLocation(): [number, Location]; /** setup will be called at `onTransition` and `onAbort` */ abstract setup(): void; /** * Jump to the specified route * ```ts * router.push("/list"); * router.push("/list?a=b"); * router.push({ * pathname: "/list", * search: "?a=b" * }) * ``` */ abstract push(to: PathRecord, options: PushOptions): void; /** * Jump to the specified route and replace the current history record */ abstract replace(to: PathRecord, options?: PushOptions): void; /** * Jump to the specified route by number */ abstract go(delta: number): void; abstract block(blocker: Blocker): () => void; back(): void; forward(): void; resolve(to: any, from?: any): ResolvedPath; transitionTo(to: PathRecord, { onTransition, onAbort, action, state, redirectedFrom, skipGuards }: TransitionOptions): void; private _updateState; }