DefinitelyTyped/history/createTransitionManager.d.ts
Young Rok Kim a1abf4fd44 [history] update to v4.5 (#13744)
* [history] update to v4.5

- move legacy history to v2 folder
- fix dependent packages' package.json file to use legacy history v2

* [history] change dependents to support old history

* [history] fix updated dependents
2017-01-13 07:18:45 -08:00

16 lines
690 B
TypeScript

import { Location, Action, LocationListener, UnregisterCallback } from './index';
import { getConfirmation } from './DOMUtils';
export type PromptFunction = (location: Location, action: Action) => any;
export type Prompt = PromptFunction | boolean;
export interface TransitionManager {
setPrompt(nextPrompt?: Prompt): UnregisterCallback;
appendListener(listener: LocationListener): UnregisterCallback;
notifyListeners(location: Location, action: Action): void;
confirmTransitionTo(location: Location, action: Action, getUserConfirmation: typeof getConfirmation, callback: (result: boolean) => void): void;
}
export default function createTransitionManager(): TransitionManager;