import { CfgWindowEventManager } from "./CfgWindowEventManager.js"; declare type CfgHistoryManagerMessageData = { initial: boolean; }; /** * How the history is updated. * @param DoNotWrite Only listens to initial URL-values. * @param Replace Replaces the current history frame at updates. * @param Push Adds history frames at updates. * @param ReplaceAndUpdateUrl Replaces the current history frame at updates and updates the browser URL * @param PushAndUpdateUrl Adds history frames at updates and updates the browser URL */ export declare enum HistoryMode { DoNotWrite = 0, Replace = 1, Push = 2, ReplaceAndUpdateUrl = 3, PushAndUpdateUrl = 4 } /** * The collected data used when sending. For history this both contains the message, which is * used as the "state" in the history-frame, and the qsKeyValues, which are query string * key-values used in the URL. * When navigating back and forth the stage (message) is used to restore the old state. When * opening a window with no prior history the Query String will be used. */ export declare type CfgHistoryManagerSendData = { message: D; mode: HistoryMode; qsKeyValues: Map; }; /** * This class is used to coordinate writing and reading to the browser history. * It handles messages sent from the connectors. */ export declare class CfgHistoryManager extends CfgWindowEventManager<"popstate", CfgHistoryManagerSendData> { private static _instance; static get instance(): CfgHistoryManager; private constructor(); private _aggregatedQsKeyValues; private _urlUpdateObservable; /** * @returns The current browser URL updated with the latest updates from * the Connectors. */ getUrl(): string; /** * Listen for updated URL:s. This doesn't have to mean the URL in the * browser has been updated. */ listenForUrl(listener: (url: string) => void): void; /** * Stop listen. */ stopListenForUrl(listener: (url: string) => void): void; /** * Write to the history */ send(messageKey: string, data: CfgHistoryManagerSendData): void; /** * Takes the current in browser URL and updates it with the provided Query String values. * Old Query String is replaced. */ private static _makeUpdatedUrl; /** * Returns the current in browser Query String updated with the key values provided. * If a value is undefined in the passed map it will be deleted from the Query String. */ private static _makeUpdatedQueryString; /** * @returns The current in browser Query String as a Map */ static currentQsKeyValues(): Map; /** * If the passed currentState is a CfgIOContainer it will update it with the * passed message. If not it will create a new CfgIOContainer with the message. */ private static _makeUpdatedState; protected readonly eventType = "popstate"; protected getDataFromEvent(event: PopStateEvent): unknown; static getMessageFromCurrentHistoryState(messageKey: string): unknown | undefined; } export {}; //# sourceMappingURL=CfgHistoryManager.d.ts.map