import type { ReflectionParameter } from '../reflection';
import type { ClassType } from '../types';
import type { HttpResponse } from './response';
import type { HttpRequest } from './request';
import type { HttpMethod } from './request';
import type { HttpMiddlewareInput } from './middleware';
export interface ControllerMetadata {
    path: string;
    middlewares: HttpMiddlewareInput[];
}
export interface FallbackControllerMetadata {
    middlewares: HttpMiddlewareInput[];
}
export interface HttpFallbackController {
    handle(request: HttpRequest, response: HttpResponse): unknown | Promise<unknown>;
}
export interface RouteMetadata {
    method: HttpMethod;
    path: string;
    propertyKey: string | symbol;
    middlewares: HttpMiddlewareInput[];
}
export interface RouteParameterResolverContext {
    token?: ClassType | string | symbol | unknown;
    route?: unknown;
    request: HttpRequest;
    response: HttpResponse;
    name: string;
    value: unknown;
    query: HttpRequest['query'];
    parameters: Record<string, unknown>;
    type: ReflectionParameter;
}
export type RouteParameterResolverFunction<T = unknown> = (context: RouteParameterResolverContext) => T | Promise<T>;
export interface RouteParameterResolver<T = unknown> {
    resolve(context: RouteParameterResolverContext): T | Promise<T>;
}
export type RouteParameterResolverObject<T = unknown> = RouteParameterResolver<T>;
export type RouteParameterResolverInput<T = unknown> = RouteParameterResolverFunction<T> | RouteParameterResolver<T> | ClassType<RouteParameterResolver<T>>;
export interface RouteParameterResolverMetadata {
    type: ClassType;
    resolver: RouteParameterResolverInput;
}
export type RouteParameterResolverRegistry = Record<string, RouteParameterResolverInput>;
type ControllerDecorator = ClassDecorator & {
    middleware: (..._middlewares: HttpMiddlewareInput[]) => ClassDecorator;
};
type FallbackControllerDecorator = ClassDecorator & {
    middleware: (..._middlewares: HttpMiddlewareInput[]) => ClassDecorator;
};
type RouteDecorator = MethodDecorator & {
    use: (..._middlewares: HttpMiddlewareInput[]) => MethodDecorator;
    middleware: (..._middlewares: HttpMiddlewareInput[]) => MethodDecorator;
};
declare function controller(path?: string): ControllerDecorator;
declare function fallback(): FallbackControllerDecorator;
declare function middleware(...items: HttpMiddlewareInput[]): ClassDecorator & MethodDecorator;
declare function resolveParameter(type: ClassType, resolver: RouteParameterResolverInput): ClassDecorator;
export declare const http: {
    controller: typeof controller;
    fallback: typeof fallback;
    middleware: typeof middleware;
    resolveParameter: typeof resolveParameter;
    GET: (path?: string) => RouteDecorator;
    POST: (path?: string) => RouteDecorator;
    PUT: (path?: string) => RouteDecorator;
    PATCH: (path?: string) => RouteDecorator;
    DELETE: (path?: string) => RouteDecorator;
    OPTIONS: (path?: string) => RouteDecorator;
    HEAD: (path?: string) => RouteDecorator;
};
export declare function getControllerMetadata(controllerClass: ClassType): ControllerMetadata | undefined;
export declare function getFallbackControllerMetadata(controllerClass: ClassType): FallbackControllerMetadata | undefined;
export declare function getRouteMetadata(controllerClass: ClassType): RouteMetadata[];
export declare function getRouteParameterResolverMetadata(controllerClass: ClassType): RouteParameterResolverMetadata[];
export {};
//# sourceMappingURL=decorators.d.ts.map