import type { Handler } from "../types"; /** * Result of a route match operation */ export interface MatchResult { handlers: Handler[]; params: Record; path: string; keys: string[]; } /** * FastMatcher - High-performance route matcher using hybrid strategy * * Strategy: * 1. Static routes (no params/wildcards) -> O(1) hashmap lookup * 2. Dynamic routes -> Single compiled regex matching * * This approach mirrors Hono's RegExpRouter for maximum performance. */ export declare class FastMatcher { private staticRoutes; private dynamicRoutes; private compiledMatchers; private regexRoutes; private needsRebuild; private _strict; setStrict(strict: boolean): void; /** * Add a route to the matcher */ add(method: string, path: string, handlers: Handler[]): void; /** * Add a regex route (user-provided RegExp pattern) */ addRegexRoute(method: string, regex: RegExp, keys: string[], handlers: Handler[]): void; /** * Check if a path is static (no parameters or wildcards) */ private isStaticPath; /** * Add a static route to the hashmap */ private addStaticRoute; /** * Add a dynamic route to be compiled later */ private addDynamicRoute; /** * Convert a path pattern to regex components */ private pathToPattern; /** * Build compiled matchers for all methods */ private buildMatchers; /** * Match a request path against registered routes */ match(method: string, pathname: string): MatchResult | null; private _match; /** * Match against static routes - O(1) */ private matchStatic; /** * Match against dynamic routes using compiled regex */ private matchDynamic; /** * Match against regex routes (user-provided RegExp patterns) */ private matchRegex; /** * Get all routes that match the pathname (for 405 detection) */ getMatchingMethods(pathname: string): string[]; hasRoutes(): boolean; clear(): void; } //# sourceMappingURL=fast-matcher.d.ts.map