import { Component, Expression, View } from "../core/index.js"; import { Router } from "./router.js"; export interface RouteMatchResult { /** * The normalized matched path. */ path: string; /** * The parameters extracted from the matched path. */ params?: unknown; } export interface RouteMatchFn { /** * Check if this route matches the specified path. * * @param path The path to match against. * @returns The match result or undefined if the path doesn't match. */ (path: string): RouteMatchResult | undefined; } export interface Route { /** * The paths this route matches. */ match?: string | RegExp | RouteMatchFn; } export interface ParentRouteMatch { /** * The route that has been matched. */ route: T; /** * The normalized matched path. */ path: string; /** * The parameters extracted from the matched path. */ params?: unknown; } export interface RouteMatch extends ParentRouteMatch { /** * The normalized remaining rest path. */ rest: string; } /** * Match a route against the specified path. * * @param path The {@link normalize normalized} path to match against. Non normalized paths result in undefined behavior. * @param route The route to match. * @returns A match or undefined if the route doesn't match. */ export declare function matchRoute(path: string, route: T): RouteMatch | undefined; export interface ComputedRoutes { match: () => ParentRouteMatch | undefined; rest: () => string; } /** * @deprecated Use {@link ComputedRoutes} instead. */ export type WatchedRoutes = ComputedRoutes; /** * Match routes against an expression. * * @param path The normalized path. * @param routes The routes to match. * @returns An object with individually computable route match and the unmatched rest path. */ export declare function computedRoutes(path: Expression, routes: Expression>): ComputedRoutes; /** * @deprecated Use {@link computedRoutes} instead. */ export declare const watchRoutes: typeof computedRoutes; /** * Props passed to the root component of a {@link ComponentRoute}. */ export interface RouteProps

{ /** Matched route parameters. */ params: P; } /** * A route where the content is a component to render. */ export interface ComponentRoute

extends Route { content: Component>; } /** * Match and render routes in the current context. * * A {@link ChildRouter} is provided as a replacement for the current router when rendering route content. */ export declare function routes(routes: Expression>>): View; /** * Match and render routes in the current context. * * A {@link ChildRouter} is provided as a replacement for the current router when rendering route content. */ export declare function Routes(props: { /** * The routes to match. */ routes: Expression>>; }): View; /** * Check if the specified pattern matches the current router's rest path. */ export declare function isCurrent(match: Route["match"], router?: Router): boolean; //# sourceMappingURL=route.d.ts.map