import type { IPathFragments, IRoute, IRouteMatch, IRouterSlot, IRoutingInfo, Params, PathFragment } from './model.js'; /** * Slot for a node in the router tree. * @slot - Default content. * @event changestate - Dispatched when the router slot state changes. */ export declare class RouterSlot extends HTMLElement implements IRouterSlot { /** * Method to cancel navigation if changed. */ private _cancelNavigation?; /** * Listeners on the router. */ private listeners; /** * The available routes. */ private _routes; get routes(): IRoute[]; set routes(routes: IRoute[]); /** * The parent router. * Is REQUIRED if this router is a child. * When set, the relevant listeners are added or teared down because they depend on the parent. */ _parent: IRouterSlot

| null | undefined; get parent(): IRouterSlot

| null | undefined; set parent(router: IRouterSlot

| null | undefined); private _lockParent; private _setParent; /** * Whether the router is a root router. * @returns {boolean} True if the router has no parent. */ get isRoot(): boolean; /** * The current route match. */ private _routeMatch; get match(): IRouteMatch | null; /** * The current route of the match. * @returns {IRoute | null} The current route, or null if there is no match. */ get route(): IRoute | null; /** * The current path fragment of the match * @returns {IPathFragments | null} The current path fragments, or null if there is no match. */ get fragments(): IPathFragments | null; /** * The current params of the match. * @returns {Params | null} The current params, or null if there is no match. */ get params(): Params | null; /** * Hooks up the element. */ constructor(); /** * Query the parent router slot when the router slot is connected. */ connectedCallback(): void; /** * Tears down the element. */ disconnectedCallback(): void; /** * Queries the parent router. * @returns {IRouterSlot

| null} The parent router slot, or null if none was found. */ queryParentRouterSlot(): IRouterSlot

| null; /** * Returns an absolute path relative to the router slot. * @param {PathFragment} path - The path fragment to make absolute. * @returns {string} The absolute path. */ constructAbsolutePath(path: PathFragment): string; /** * Adds routes to the router. * Navigates automatically if the router slot is the root and is connected. * @param {IRoute[]} routes - The routes to add. * @param {boolean} [navigate] - Whether to navigate after adding the routes. */ add(routes: IRoute[], navigate?: boolean): void; /** * Removes all routes. */ clear(): void; /** * Each time the path changes, load the new path. */ render(): Promise; protected getPathFragment(): string; protected getRouteMatch(): IRouteMatch | null; /** * Attaches listeners, either globally or on the parent router. */ protected attachListeners(): void; /** * Clears the children in the DOM. */ protected clearChildren(): void; /** * Detaches the listeners. */ protected detachListeners(): void; /** * Notify the listeners. * @param {IRoutingInfo} info - The routing info to notify with. */ notifyChildRouters(info: IRoutingInfo): void; private getRedirectDelay; /** * Loads a new path based on the routes. * Returns true if a navigation was made to a new page. * @param {string | PathFragment} path - The path to render. * @returns {Promise} True if a navigation was made. */ protected renderPath(path: string | PathFragment): Promise; } declare global { interface HTMLElementTagNameMap { 'router-slot': RouterSlot; } }