import { Type, type ReflectionParameter } from '../reflection';
import { type Container } from '../di';
import type { EventBus } from '../events';
import type { ClassType } from '../types';
import { type RouteParameterResolverInput, type RouteParameterResolverRegistry } from './decorators';
import type { HttpMiddlewareInput } from './middleware';
import { HttpRequest } from './request';
import type { HttpMethod } from './request';
import { HttpResponse } from './response';
import { type MultipartRequestPolicy } from './uploads';
export interface HttpRoutePlan {
    method: HttpMethod;
    path: string;
    regex: RegExp;
    paramNames: string[];
    controllerClass: ClassType;
    moduleId?: number;
    propertyKey: string | symbol;
    methodName: string;
    description?: string;
    returnType: Type;
    parameters: HttpRouteParameterPlan[];
    middlewares: HttpMiddlewareInput[];
    bodyMode: 'guarded' | 'stream';
    uploadPolicy: MultipartRequestPolicy;
}
export type HttpRouteParameterPlan = {
    kind: 'request';
} | {
    kind: 'requestStream';
} | {
    kind: 'response';
} | {
    kind: 'jwt';
    optional: boolean;
} | {
    kind: 'body';
    name: string;
    type: Type;
    optional: boolean;
} | {
    kind: 'file';
    name: string;
    type: Type;
    optional: boolean;
} | {
    kind: 'queries';
    name: string;
    type: Type;
    optional: boolean;
} | {
    kind: 'query';
    name: string;
    type: Type;
    optional: boolean;
} | {
    kind: 'path';
    name: string;
    type: Type;
    optional: boolean;
} | {
    kind: 'header';
    name: string;
    type: Type;
    optional: boolean;
} | {
    kind: 'custom';
    resolver: RouteParameterResolverInput;
    type: Type;
    reflectionParameter: ReflectionParameter;
    name: string;
    optional: boolean;
};
export declare class HttpRouter {
    private container;
    private events?;
    private routes;
    private readonly unregisteredMiddlewareInstances;
    private readonly httpResolvers;
    constructor(container: Container, events?: EventBus | undefined, httpResolvers?: RouteParameterResolverRegistry);
    registerController(controllerClass: ClassType, moduleId?: number): void;
    listRoutes(): readonly HttpRoutePlan[];
    hasRoute(request: HttpRequest): boolean;
    handle(request: HttpRequest, response?: HttpResponse): Promise<HttpResponse>;
    private match;
    private runMiddlewares;
    private resolveMiddleware;
    private dispatchWorkflow;
    private compileParameters;
    private findGlobalResolver;
    private resolveParameter;
    private resolveCustomParameter;
    private invokeRouteParameterResolver;
    private guardRequestBody;
    private readBody;
    private parseBody;
    private readUploadedFile;
    private writeResult;
    private writeError;
}
//# sourceMappingURL=router.d.ts.map