/** * @license * Copyright 2021 Google LLC * Copyright 2024 Kristoffer Roen-Lie * SPDX-License-Identifier: BSD-3-Clause */ import { Routes } from './routes.ts'; export type NavigationListener = (event: PopStateEvent | PointerEvent) => void; export type SearchListener = (key: string, value: string, previousValue: string, ev: PopStateEvent | PointerEvent) => void; /** * Custom implementation of lib-labs/router Router class. * * Adds the ability to add navigation and search listeners. * * --- * A root-level router that installs global event listeners to intercept * navigation. * * This class extends `Routes` so that it can also have a route configuration. * * There should only be one Router instance on a page, since the Router * installs global event listeners on `window` and `document`. * * Nested routes should be configured with the `Routes` class. */ export declare class Router extends Routes { protected static readonly onSearchChange: NavigationListener; protected static readonly navListeners: Set; protected static readonly searchListeners: Map>; protected static previousSearch: URLSearchParams; static addNavListener(listener: NavigationListener): () => void; static removeNavListener(listener: NavigationListener): boolean; static addSearchListener(key: string, listener: SearchListener): () => void; static removeSearchListener(key: string, listener: SearchListener): boolean; hostConnected(): void; hostDisconnected(): void; protected onClick: (e: MouseEvent) => Promise; protected onPopState: (e: PopStateEvent) => Promise; } //# sourceMappingURL=router.d.ts.map