import type { HttpMiddleware } from "@egomobile/http-server"; import type { AnySchema } from "joi"; import type { Schema } from "../types/index.js"; import type { Nilable } from "../types/internal.js"; /** * A possible value for a 1st argument of a decorator * that sets up a route for a HTTP method that does not * accept a body. */ export type HttpMethodDecoratorArg1 = IHttpMethodDecoratorOptions | HttpMiddleware[] | HttpMethodDecoratorRoutePath; /** * A possible value for a 2nd argument of a decorator * that sets up a route for a HTTP method that does not * accept a body. */ export type HttpMethodDecoratorArg2 = HttpMiddleware[]; /** * A possible value for a 3rd argument of a decorator * that sets up a route for a HTTP method that does not * accept a body. */ export type HttpMethodDecoratorArg3 = any; /** * A possible value for a 1st argument of a decorator * that sets up a route for a HTTP method that also * accepts a body. */ export type HttpMethodDecoratorWithBodyArg1 = IHttpMethodDecoratorWithBodyOptions | HttpMiddleware[] | HttpMethodDecoratorRoutePath | AnySchema; /** * A possible value for a 2nd argument of a decorator * that sets up a route for a HTTP method that also * accepts a body. */ export type HttpMethodDecoratorWithBodyArg2 = HttpMiddleware[] | Schema; /** * A possible value for a 3rd argument of a decorator * that sets up a route for a HTTP method that also * accepts a body. */ export type HttpMethodDecoratorWithBodyArg3 = any; /** * A possible, known value for an input format, that is supported * by a route, setuped by a HTTP method decorator. */ export type HttpMethodDecoratorWithBodyInputFormat = "buffer" | "json" | "json5" | "text" | "yaml"; /** * A possible value for a path of a controller route. */ export type HttpMethodDecoratorRoutePath = string; /** * Options for a decorator, that sets up a route for a HTTP method * that does not accept a body. */ export interface IHttpMethodDecoratorOptions { /** * Indicates, if default behavior of closing request connection automatically, should be * deactivated or not. */ noAutoEnd?: Nilable; /** * Indicates, if default behavior of automatically setup parameters, should be * deactivated or not. */ noAutoParams?: Nilable; /** * If `true`, do not parse query parameters automatically in this handler. */ noAutoQuery?: Nilable; /** * The custom (relative) path of the route. */ path?: Nilable; /** * List of one or more additional middlewares. */ use?: Nilable[]>; } /** * Options for a decorator, that sets up a route for a HTTP method * that also accepts a body. */ export interface IHttpMethodDecoratorWithBodyOptions extends IHttpMethodDecoratorOptions { /** * The input format. * * @default "json" */ bodyFormat?: Nilable; /** * The schema to validate the body with. */ schema?: Nilable; } export * from "./CONNECT.js"; export * from "./Controller.js"; export * from "./DELETE.js"; export * from "./Describe.js"; export * from "./GET.js"; export * from "./HEAD.js"; export * from "./Import.js"; export * from "./It.js"; export * from "./OPTIONS.js"; export * from "./PATCH.js"; export * from "./POST.js"; export * from "./PUT.js"; export * from "./TRACE.js"; export * from "./Use.js";