import { TSchema } from "@sinclair/typebox"; import * as LambdaProxy from "./lambda-proxy"; import { ParameterDefinition } from "./parameter"; import { RoutingContext } from "./routing-context"; import { Middleware, MiddlewareConstructor } from "./middleware"; export type HttpMethod = "GET" | "PUT" | "POST" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD"; export type RouteHandler; }, U extends { [P in keyof U]: TSchema; }> = (this: RoutingContext) => Promise; export type RouteMetadata = Map; export declare class Route; }, U extends { [P in keyof U]: TSchema; }> { static GET; }, U extends { [P in keyof U]: TSchema; }>(path: string, options: RouteSimplifiedOptions, params: T, handler: RouteHandler): Route; static PUT; }, U extends { [P in keyof U]: TSchema; }>(path: string, options: RouteSimplifiedOptions, params: T, handler: RouteHandler): Route; static POST; }, U extends { [P in keyof U]: TSchema; }>(path: string, options: RouteSimplifiedOptions, params: T, handler: RouteHandler): Route; static PATCH; }, U extends { [P in keyof U]: TSchema; }>(path: string, options: RouteSimplifiedOptions, params: T, handler: RouteHandler): Route; static DELETE; }, U extends { [P in keyof U]: TSchema; }>(path: string, options: RouteSimplifiedOptions, params: T, handler: RouteHandler): Route; static OPTIONS; }, U extends { [P in keyof U]: TSchema; }>(path: string, options: RouteSimplifiedOptions, params: T, handler: RouteHandler): Route; static HEAD; }, U extends { [P in keyof U]: TSchema; }>(path: string, options: RouteSimplifiedOptions, params: T, handler: RouteHandler): Route; private static _factory; readonly path: string; readonly method: HttpMethod; readonly description: string | undefined; readonly handler: RouteHandler; readonly params: T; readonly operationId: string; readonly responses: Map | undefined; readonly metadata: RouteMetadata; constructor(options: RouteOptions); getMetadata(klass: MiddlewareConstructor>): Metadata | undefined; } export interface RouteSimplifiedOptions { desc?: string; operationId: string; responses?: { [statusCode: number]: ResponseSchema; }; metadata?: RouteMetadata; } export interface RouteOptions; }, U extends { [P in keyof U]: TSchema; }> { path: string; method: HttpMethod; desc?: string; operationId: string; responses?: { [statusCode: number]: ResponseSchema; }; metadata?: RouteMetadata; params?: T; handler: RouteHandler; } export interface ResponseSchema { desc?: string; schema: JSONSchema; } /** * Actual JSON Schema in JSON representation */ export type JSONSchema = object;