UNPKG

663 BTypeScriptView Raw
1import { History, Location, LocationState } from './index';
2import { getConfirmation } from './DOMUtils';
3
4export interface MemoryHistoryBuildOptions {
5 getUserConfirmation?: typeof getConfirmation | undefined;
6 initialEntries?: string[] | undefined;
7 initialIndex?: number | undefined;
8 keyLength?: number | undefined;
9}
10
11export interface MemoryHistory<HistoryLocationState = LocationState> extends History<HistoryLocationState> {
12 index: number;
13 entries: Location<HistoryLocationState>[];
14 canGo(n: number): boolean;
15}
16
17export default function createMemoryHistory<S = LocationState>(options?: MemoryHistoryBuildOptions): MemoryHistory<S>;