declare const NODE_TYPES: { NORMAL: 0; WILDCARD: 1; PLACEHOLDER: 2; }; type _NODE_TYPES = typeof NODE_TYPES; type NODE_TYPE = _NODE_TYPES[keyof _NODE_TYPES]; type _RadixNodeDataObject = { params?: never; [key: string]: any; }; type RadixNodeData = T; type MatchedRoute = Omit & { params?: Record; }; interface RadixNode { type: NODE_TYPE; maxDepth: number; parent: RadixNode | null; children: Map>; data: RadixNodeData | null; paramName: string | null; wildcardChildNode: RadixNode | null; placeholderChildren: RadixNode[]; } interface RadixRouterOptions { strictTrailingSlash?: boolean; routes?: Record; } interface RadixRouterContext { options: RadixRouterOptions; rootNode: RadixNode; staticRoutesMap: Record; } interface RadixRouter { ctx: RadixRouterContext; /** * Perform lookup of given path in radix tree * @param path - the path to search for * * @returns The data that was originally inserted into the tree */ lookup(path: string): MatchedRoute | null; /** * Perform an insert into the radix tree * @param path - the prefix to match * @param data - the associated data to path * */ insert(path: string, data: T): void; /** * Perform a remove on the tree * @param { string } data.path - the route to match * * @returns A boolean signifying if the remove was successful or not */ remove(path: string): boolean; } interface MatcherExport { dynamic: Map; wildcard: Map; static: Map; } declare function createRouter(options?: RadixRouterOptions): RadixRouter; interface RouteTable { static: Map; wildcard: Map; dynamic: Map; } interface RouteMatcher { ctx: { table: RouteTable; }; matchAll: (path: string) => RadixNodeData[]; } declare function toRouteMatcher(router: RadixRouter): RouteMatcher; declare function exportMatcher(matcher: RouteMatcher): MatcherExport; declare function createMatcherFromExport(matcherExport: MatcherExport): RouteMatcher; export { type MatchedRoute, type MatcherExport, type NODE_TYPE, NODE_TYPES, type RadixNode, type RadixNodeData, type RadixRouter, type RadixRouterContext, type RadixRouterOptions, type RouteMatcher, type RouteTable, createMatcherFromExport, createRouter, exportMatcher, toRouteMatcher };