Webroute

@webroute/routeInterfaces

HandlerFunction

Extends

  • DecoratedRequestHandler<TParams["InferredParams"] extends never ? TParams["ParamsOut"] : MergeObjectsShallow<TParams["InferredParams"], TParams["ParamsOut"]>, TParams["QueryOut"], TParams["BodyOut"], TParams["HeadersReqOut"], TParams["OutputIn"], TParams["State"], TParams["Providers"]>

Type Parameters

Type Parameter
TParams extends RouteParams

HandlerFunction(request, ctx): Awaitable<Response | TParams["OutputIn"]>

Parameters

ParameterType
requestRequest
ctxobject
ctx.parseParseInputsFn<unknown extends TParams["InferredParams"] extends never ? TParams["ParamsOut"] : { [KeyType in string | number | symbol]: ({ [K in string | number | symbol]: K extends keyof (...)[(...)] ? (...)[(...)][K<(...)>] : (...)[(...)][K] } & TParams["ParamsOut"])[KeyType] } ? Record<string, undefined | string> : TParams["InferredParams"] extends never ? TParams["ParamsOut"] : { [KeyType in string | number | symbol]: ({ [K in string | number | symbol]: K extends keyof (...)[(...)] ? (...)[(...)][K<(...)>] : (...)[(...)][K] } & TParams["ParamsOut"])[KeyType] }, unknown extends TParams["QueryOut"] ? Record<string, undefined | string> : TParams["QueryOut"], unknown extends TParams["BodyOut"] ? TParams["BodyOut"] : TParams["BodyOut"], unknown extends TParams["HeadersReqOut"] ? Record<string, undefined | string> : TParams["HeadersReqOut"]>
ctx.servicesServiceMap<TParams["Providers"]>
ctx.state{ [KeyType in string | number | symbol]: TParams["State"][KeyType] }

Returns

Awaitable<Response | TParams["OutputIn"]>

On this page