import { Views } from '@singularsystems/neo-core'; import { RoutingState } from './RoutingState'; import { IViewBase } from "../Views/ViewBase"; import { IRouteChangedProps, RouteChangedLeavePrompt } from "./IRouteChangedProps"; export interface IPageLeaveHandler { /** * Called after `ViewBase.beforeRouteChanged` and `ViewBase.onLeave` are called. * @param changeProps */ beforeLeavePage(changeProps: IRouteChangedProps): void; /** * Called when the user tries to leave the page, and the page / leave handler has indicated the user must be prompted. * @returns A boolean promise with a value indicating whether the user wants to leave the page. */ onLeavePage(view: Views.IViewBase | null, leavePrompt: RouteChangedLeavePrompt): Promise; /** * Called when the windows beforeunload event fires, and the page / leave handler has indicated the user must be prompted. * @param view The currently active view. * @param e beforeunload event. */ onWindowUnload(view: IViewBase | null, leavePrompt: RouteChangedLeavePrompt, e: BeforeUnloadEvent): void; } export declare class PageLeaveHandler implements IPageLeaveHandler { private routingState; constructor(routingState: RoutingState); beforeLeavePage(changeProps: IRouteChangedProps): void; onLeavePage(view: Views.IViewBase | null, leavePrompt: RouteChangedLeavePrompt): Promise; onWindowUnload(view: Views.IViewBase | null, leavePrompt: RouteChangedLeavePrompt, e: BeforeUnloadEvent): void; protected showDefaultConfirmation(view: Views.IViewBase | null, prompt: string): Promise; }