import type { IComponentRoute, IRedirectRoute, IResolverRoute, IRoute, IRouteMatch, IRouterSlot, PageComponent, PathFragment, RouterTree, IRoutingInfo } from '../model.js'; /** * Determines whether the path is active. * If the full path starts with the path and is followed by the end of the string or a "/" the path is considered active. * @param {string | PathFragment} path - The path to check. * @param {string} [fullPath] - The full path to check against. * @returns {boolean} True if the path is active. */ export declare function isPathActive(path: string | PathFragment, fullPath?: string): boolean; /** * Matches a route. * @template D * @param {IRoute} route - The route to match. * @param {string | PathFragment} path - The path to match against. * @returns {IRouteMatch | null} The route match, or null if it doesn't match. */ export declare function matchRoute(route: IRoute, path: string | PathFragment): IRouteMatch | null; /** * Matches the first route that matches the given path. * @template D * @param {IRoute[]} routes - The routes to match against. * @param {string | PathFragment} path - The path to match. * @returns {IRouteMatch | null} The first matching route, or null if none matches. */ export declare function matchRoutes(routes: IRoute[], path: string | PathFragment): IRouteMatch | null; /** * Returns the page from the route. * If the component provided is a function (and not a class) call the function to get the promise. * @param {IComponentRoute} route - The route to resolve the component from. * @param {IRoutingInfo} info - The routing info to set up the component with. * @returns {Promise} The resolved page component. */ export declare function resolvePageComponent(route: IComponentRoute, info: IRoutingInfo): Promise; /** * Determines if a route is a redirect route. * @param {IRoute} route - The route to check. * @returns {boolean} True if the route is a redirect route. */ export declare function isRedirectRoute(route: IRoute): route is IRedirectRoute; /** * Determines if a route is a resolver route. * @param {IRoute} route - The route to check. * @returns {boolean} True if the route is a resolver route. */ export declare function isResolverRoute(route: IRoute): route is IResolverRoute; /** * Traverses the router tree up to the root route. * @param {IRouterSlot} slot - The router slot to start traversing from. * @returns {{ tree: RouterTree; depth: number }} The router tree and its depth. */ export declare function traverseRouterTree(slot: IRouterSlot): { tree: RouterTree; depth: number; }; /** * Generates a path based on the router tree. * @param {RouterTree} tree - The router tree to generate the path from. * @param {number} depth - The depth to traverse the tree. * @returns {PathFragment[]} The path fragments. */ export declare function getFragments(tree: RouterTree, depth: number): PathFragment[]; /** * Constructs the correct absolute path based on a router. * - Handles relative paths: "mypath" * - Handles absolute paths: "/mypath" * - Handles traversing paths: "../../mypath" * @template D * @template P * @param {IRouterSlot} slot - The router slot to construct the path for. * @param {string | PathFragment} [path] - The path to make absolute. * @returns {string} The absolute path. */ export declare function constructAbsolutePath(slot: IRouterSlot, path?: string | PathFragment): string; /** * Handles a redirect. * @param {IRouterSlot} slot - The router slot to redirect. * @param {IRedirectRoute} route - The redirect route to handle. */ export declare function handleRedirect(slot: IRouterSlot, route: IRedirectRoute): void; /** * Determines whether the navigation should start based on the current match and the new match. * @template D * @param {IRouteMatch | null} currentMatch - The current route match. * @param {IRouteMatch} newMatch - The new route match. * @returns {boolean} True if the navigation should start. */ export declare function shouldNavigate(currentMatch: IRouteMatch | null, newMatch: IRouteMatch): boolean;