rvx
Version:
A signal based rendering library
34 lines (33 loc) • 936 B
TypeScript
import { Query, QueryInit } from "./query.js";
import { Router } from "./router.js";
export interface HistoryRouterOptions {
/**
* The current location is parsed when one of these events occur.
*
* @default ["popstate", "rvx:router:update"]
*/
parseEvents?: string[];
/**
* The leading base path to ignore when matching routes.
*
* @default ""
*/
basePath?: string;
}
/**
* A router that uses the history API.
*/
export declare class HistoryRouter implements Router {
#private;
constructor(options?: HistoryRouterOptions);
/**
* Called to parse & update this router's state from the current browser location.
*/
parse(): void;
get root(): Router;
get parent(): Router | undefined;
get path(): string;
get query(): Query | undefined;
push(path: string, query?: QueryInit): void;
replace(path: string, query?: QueryInit): void;
}