UNPKG

615 BTypeScriptView Raw
1import { History, Location, LocationState } from './index';
2import { getConfirmation } from './DOMUtils';
3
4export interface MemoryHistoryBuildOptions {
5 getUserConfirmation?: typeof getConfirmation;
6 initialEntries?: string[];
7 initialIndex?: number;
8 keyLength?: number;
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>;