/** * Copyright (c) 2019, salesforce.com, inc. * All rights reserved. * SPDX-License-Identifier: MIT * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT */ import { DomRouterImpl } from 'lwr/domRouter'; import type { Router, PageReference } from 'lwr/router'; import type { DomRouterConfig } from 'lwr/domRouterUtils'; import type { NavigateOptions } from '../routerUtils/types.js'; export declare class HistoryRouter extends DomRouterImpl { historyDisabled: boolean; currentUrl: string; /** * Override. * Initialize with the current route and listen to the popstate event for future changes. */ connect(): void; onpopstate(): void; disconnect(): void; /** * Override. * Update the browser history if the preNavigate hooks. * * @param {string} url - The URL to go to * @param {boolean} shouldReplace - True if the current history state should be replaced * @param {boolean} updateHistory - True if the browser history should be updated with the new URL * * @returns {boolean} - True if the processing was NOT blocked by a preNavigate listener */ process(url: string, shouldReplace: boolean, options?: NavigateOptions, updateHistory?: boolean): Promise; /** * Update the root route, and trickle down the router tree. * Redirect to use the base path, if it is missing. * * @param {string} url - The URL to go to */ catchBrowserUpdate(url: string): void; } /** * Create a new root Router, attach to the Window. * This is the public, programmatic API for root router creation. * An application can only have ONE root router. * * @param {object} config - The router config object * * @returns {object} - { addPreNavigate, addPostNavigate, addErrorNavigate, connect, disconnect } */ export declare function createHistoryRouter(config: DomRouterConfig, router: Router, target?: EventTarget): HistoryRouter; //# sourceMappingURL=historyRouter.d.ts.map