import type { HttpMethod, Middleware, RequestContext } from './types.js'; export interface MatchResult { handler: (ctx: RequestContext) => unknown; params: Record; bodyLimit: number | false; compiledPipeline?: Middleware; } export interface AddRouteOptions { middlewares?: Middleware[]; /** * Skip all globally-registered guards (via `app.useGuard()`) for this route. * Global middleware from `app.use()` still applies - this opts out of guards only. * Used by @miiajs/swagger so UI stays reachable when the app has global auth. */ skipGlobalGuards?: boolean; /** * Specific global guard classes to skip for this route. Populated from `@SkipGuard` * metadata by RouterExplorer. Routes with `skipGlobalGuards: true` ignore this set * (they skip everything). */ skippedGuardClasses?: Set | null; /** * Max request body size in bytes for this route (checked against the declared * Content-Length after matching). Defaults to `Router.defaultBodyLimit`. * `false` disables the check for this route. */ bodyLimit?: number | false; /** * Skip the app-level global prefix for this route. Used by @miiajs/swagger so the UI and * spec endpoints stay at their configured path, and available as an escape hatch for * routes that must live outside the prefix (health checks, probes). */ skipGlobalPrefix?: boolean; } export interface GlobalGuardBinding { guardClass: unknown; middleware: Middleware; } export declare class Router { private staticRoutes; private tries; private allEntries; /** * App default for routes registered without an explicit bodyLimit. * Set by Miia from `MiiaOptions.maxBodySize` before any route registration. */ defaultBodyLimit: number | false; private maxRouteBodyLimit; private globalGuardClasses; private prefix; /** * App-level path prefix prepended to every route registered without * `skipGlobalPrefix`. Set by Miia from `MiiaOptions.globalPrefix`; must be * assigned before any route is registered. */ get globalPrefix(): string; set globalPrefix(value: string); /** Guard classes registered via `app.useGuard()`, captured at compile time. */ get globalGuards(): readonly unknown[]; /** * Adapter-level body cap: max(default, all per-route limits); `false` when * the app default is disabled. Read by Miia.listen() after init. */ get adapterBodyCeiling(): number | false; add(method: HttpMethod, pattern: string, handler: (ctx: RequestContext) => unknown, options?: AddRouteOptions): void; match(method: string, pathname: string): MatchResult | null; compileAll(globalGuards: GlobalGuardBinding[]): void; private matchTrie; } //# sourceMappingURL=router.d.ts.map