import { type Overwrite } from '@augment-vir/common'; import { type FullSpaRoute, type ValidHashBase, type ValidPathsBase, type ValidSearchBase } from './spa-route.js'; /** * A function that sanitizes a route, ensuring that the raw input matches the type safety of a * specific `SpaRouter` implementation. * * @category Internal */ export type RouteSanitizer = (rawRoute: Readonly) => Readonly>; /** * A function that determines whether a sanitized route is allowed to be set on the window URL. * Return `false` to block the route change. * * @category Internal */ export type RouteAllowedCheck = (newRoute: Readonly>) => boolean; /** * Used to verify if an object is a valid `SpaRouterParams` instance. * * @category Internal */ export declare const spaRouterParamsShape: import("object-shape-tester").Shape<{ /** * This can used to provide a base route for the router to consider the root of your SPA. This * must NOT also be a part of your route's valid paths array. * * Example: in GitHub Pages, the root of each page is a relative path: * `.github.io/`. To make this router work in GitHub pages as well as local * development, use the `` part as your `basePath`. * * Concrete example: in `electrovir.github.io/threejs-experiments`, `threejs-experiments` is the * `basePath`. * * @default `''` */ basePath: import("object-shape-tester").Shape>>; /** * Use this to rewrite a route before it makes it to your application. This is necessary to * ensure that the types for your route is maintained. */ sanitizeRoute: RouteSanitizer; /** * Used mostly for debugging purposes to prevent yourself from accidentally adding tons of event * listeners. When left undefined or set to zero, this property isn't used at all and there is * no maximum listener count. When set to a truthy number, the maximum comes into effect. * * @default 1 */ maxListenerCount: import("object-shape-tester").Shape>>; /** Set to `true` to turn off warning logs. */ disableWarnings: import("object-shape-tester").Shape>>; /** * Set this to `true` to disable the router without destroying it. Use this if you have multiple * routers to ensure you only have one running at a time. */ isPaused: import("object-shape-tester").Shape>>; /** * Optionally provide a function to gate whether a sanitized route is allowed to be set. When it * returns `false`, the route change is blocked. */ isRouteAllowed: import("object-shape-tester").Shape>)[]>>>; }>; /** * Construction params for `SpaRouter`. * * @category Internal */ export type SpaRouterParams = Overwrite; /** * Optionally provide a function to gate whether a sanitized route is allowed to be set. * When it returns `false`, the route change is blocked. */ isRouteAllowed?: RouteAllowedCheck | undefined | null; }>;