import { type RouteBinding, type RouteBindingResolver } from './route-binding.js'; import { type Groupable, type MiddlewareGroupable, type Routable, type RouteGroupOptions, type RouteScope } from './route-group.js'; import { MiddlewareRegistry, type MiddlewareInput } from './middleware-registry.js'; import type { HttpMethod, RouteHandler, RouteParams } from './types.js'; export declare class RouteNotFoundException extends Error { constructor(method: string, path: string); } export interface RouteCacheManifest { version: 1; routes: Array<{ method: HttpMethod; pattern: string; name?: string; middleware: string[]; action: string; paramNames: string[]; }>; } export interface RouteListEntry { method: HttpMethod; uri: string; name?: string; middleware: string[]; action: string; domain?: string; } export declare class Router implements Routable { private routes; private namedRoutes; private globalMiddleware; private scopeStack; private urlDefaults; private readonly bindings; private readonly implicitBindings; private compiledCache; private readonly middlewareRegistry; private handlerNormalizer; private jsonFastPathEnabled; private early404Enabled; private requestPoolingEnabled; private readonly requestPool; constructor(middlewareRegistry?: MiddlewareRegistry); getMiddlewareRegistry(): MiddlewareRegistry; setHandlerNormalizer(normalizer: (handler: RouteHandler) => RouteHandler): this; setJsonFastPath(enabled: boolean): this; isJsonFastPathEnabled(): boolean; setEarly404(enabled: boolean): this; isEarly404Enabled(): boolean; setRequestPooling(enabled: boolean): this; isRequestPoolingEnabled(): boolean; bind(parameter: string, binding: RouteBinding | RouteBindingResolver): this; registerImplicitBinding(parameter: string, binding: RouteBinding | RouteBindingResolver): this; getBindings(): ReadonlyMap; prefix(prefix: string): MiddlewareGroupable; namePrefix(prefix: string): MiddlewareGroupable; group(options: RouteGroupOptions, callback: (routes: Groupable) => void): Routable; group(callback: (routes: Groupable) => void): Routable; middleware(...middleware: MiddlewareInput[]): MiddlewareGroupable; runInScope(scope: RouteScope, callback: () => void): void; hasActiveScope(): boolean; get(pattern: string, handler: RouteHandler): Routable; post(pattern: string, handler: RouteHandler): Routable; put(pattern: string, handler: RouteHandler): Routable; patch(pattern: string, handler: RouteHandler): Routable; delete(pattern: string, handler: RouteHandler): Routable; use(...middleware: MiddlewareInput[]): Routable; add(method: HttpMethod, pattern: string, handler: RouteHandler, middleware?: MiddlewareInput[]): Routable; addScoped(scope: RouteScope, method: HttpMethod, pattern: string, handler: RouteHandler, middleware?: MiddlewareInput[]): Routable; name(name: string): Routable; throttle(preset: string): Routable; listRoutes(filters?: { middleware?: string; name?: string; action?: string; }): RouteListEntry[]; exportRouteCache(): RouteCacheManifest; warmRouteCache(): this; clearRouteCache(): this; resetRoutes(): this; setUrlDefaults(defaults: RouteParams): this; mergeUrlDefaults(defaults: RouteParams): this; getUrlDefaults(): RouteParams; url(name: string, params?: RouteParams | Record): string; dispatch(request: Request, pathname?: string): Promise; private dispatchRoute; private collectAllowedMethods; private shortCircuitNotFound; private shortCircuitNotAllowed; private resolveRouteMiddleware; private buildPipelineMiddleware; private mergeScopes; private resolveBindings; private invalidateCompiledCache; private compile; private matchDynamicRoute; private buildCompiledRoutes; private extractParams; } export declare function createRouter(middlewareRegistry?: MiddlewareRegistry): Router; export type { Groupable, MiddlewareGroupable, Routable, RouteScope, ScopedRouteRegistrar, } from './route-group.js'; //# sourceMappingURL=router.d.ts.map