UNPKG

@thi.ng/router

Version:

Generic trie-based router with support for wildcards, route param validation/coercion, auth

29 lines 1.15 kB
import type { Fn } from "@thi.ng/api"; import type { HTMLRouterOpts } from "./api.js"; import { Router } from "./router.js"; export declare class HTMLRouter<T = any> extends Router<T> { protected currentPath: string; protected popHandler: Fn<PopStateEvent, void>; protected hashHandler: EventListener; protected useFragment: boolean; constructor(config: HTMLRouterOpts); start(): void; release(): void; /** * Like {@link Router.route}, but takes additional arg to control if this * routing operation should manipulate the browser's `history`. * * @remarks * If called from userland, this normally is set to "push" (also the * default). However, we want to adjust this behavior if called internally. * * @param src - * @param ctx - * @param mode - */ route(src: string, ctx?: T, mode?: "push" | "replace" | "none"): import("@thi.ng/api").Maybe<import("./api.js").RouteMatch>; routeTo(route: string, ctx?: T): void; protected handlePopChange(): Fn<PopStateEvent, void>; protected handleHashChange(): EventListener; } //# sourceMappingURL=html.d.ts.map