import { InferParamPath, InferParamWildCard, IsEmptyObject, Prettify, UnionToIntersection } from "./helper.mjs"; import { StandardSchemaV1 } from "./standard-schema.mjs"; import { Status, statusCodes } from "./error.mjs"; import { CookieOptions, CookiePrefixOptions } from "./cookies.mjs"; import { Middleware, MiddlewareOptions } from "./middleware.mjs"; import { EndpointOptions } from "./endpoint.mjs"; //#region src/context.d.ts type HTTPMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH"; type Method = HTTPMethod | "*"; type InferBodyInput : undefined)> = undefined extends Body ? { body?: Body; } : { body: Body; }; type InferBody = Options["metadata"] extends { $Infer: { body: infer Body; }; } ? Body : Options["body"] extends StandardSchemaV1 ? StandardSchemaV1.InferOutput : any; type InferQueryInput : Record | undefined)> = undefined extends Query ? { query?: Query; } : { query: Query; }; type InferQuery = Options["metadata"] extends { $Infer: { query: infer Query; }; } ? Query : Options["query"] extends StandardSchemaV1 ? StandardSchemaV1.InferOutput : Record | undefined; type InferMethod = Options["method"] extends Array ? Options["method"][number] : Options["method"] extends "*" ? HTTPMethod : Options["method"]; type InferInputMethod ? Options["method"][number] | undefined : Options["method"] extends "*" ? HTTPMethod : Options["method"] | undefined)> = undefined extends Method ? { method?: Method; } : { method: Method; }; type InferParam = [Path] extends [never] ? Record | undefined : IsEmptyObject & InferParamWildCard> extends true ? Record | undefined : Prettify & InferParamWildCard>; type InferParamInput = [Path] extends [never] ? { params?: Record; } : IsEmptyObject & InferParamWildCard> extends true ? { params?: Record; } : { params: Prettify & InferParamWildCard>; }; type InferRequest