import type { Hook } from './runTransitionHook'; import type { CreateHistory, History, HistoryOptions, LTFromCH, LocationTypeMap, BaseLocation, Location, Unlisten, LocationType } from './index'; export interface ListenBeforeUnload { (hook: Hook): Unlisten; } export interface HistoryWithBFOL extends History { listenBeforeUnload: ListenBeforeUnload; } export interface CreateHistoryWithBFOL { (options?: HistoryOptions): HistoryWithBFOL; } export interface GetPromptMessage { (): unknown; } export interface StopListener { (): void; } /** * Returns a new createHistory function that can be used to create * history objects that know how to use the beforeunload event in web * browsers to cancel navigation. */ export default function useBeforeUnload>(createHistory: CH): CreateHistoryWithBFOL>;