express-contextualized-router
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -15,20 +15,20 @@ import { NextFunction, Request, Response, Router } from 'express'; | ||
*/ | ||
export type ContextualizedRequestHandler<InputContext extends Record<string, any> = Record<string, any>, OutputContext = Record<string, any>, P extends Record<string, any> = {}, ResBody = any, ReqBody = any, ReqQuery extends ParsedQs = any> = (req: ContextualizedRequest<InputContext, P, ResBody, ReqBody, ReqQuery>, res: Response<ResBody>, next: NextFunction) => ContextCreator<OutputContext> | undefined | Send | Response<ResBody> | void | Promise<ContextCreator<OutputContext> | undefined | Send | Response<ResBody> | void>; | ||
export type ContextualizedRequestHandlerParams<InputContext extends Record<string, any> = Record<string, any>, OutputContext = Record<string, any>, P extends Record<string, any> = {}, ResBody = any, ReqBody = any, ReqQuery extends ParsedQs = any> = ContextualizedRequestHandler<InputContext, OutputContext, P, ResBody, ReqBody, ReqQuery> | Array<ContextualizedRequestHandler<InputContext, OutputContext, P>>; | ||
export type ContextualizedRequestHandler<InputContext extends Record<string, any> = Record<string, any>, OutputContext extends Record<string, any> = Record<string, any>, P extends Record<string, any> = {}, ResBody = any, ReqBody = any, ReqQuery extends ParsedQs = any> = (req: ContextualizedRequest<InputContext, P, ResBody, ReqBody, ReqQuery>, res: Response<ResBody>, next: NextFunction) => ContextCreator<OutputContext> | undefined | Send | Response<ResBody> | void | Promise<ContextCreator<OutputContext> | undefined | Send | Response<ResBody> | void>; | ||
export type ContextualizedRequestHandlerParams<InputContext extends Record<string, any> = Record<string, any>, OutputContext extends Record<string, any> = Record<string, any>, P extends Record<string, any> = {}, ResBody = any, ReqBody = any, ReqQuery extends ParsedQs = any> = ContextualizedRequestHandler<InputContext, OutputContext, P, ResBody, ReqBody, ReqQuery> | Array<ContextualizedRequestHandler<InputContext, OutputContext, P>>; | ||
/** | ||
* The equivalent of Express RouterMatcher but which takes a ContextualizedRequestHandler and returns a ContextualizedRouter | ||
*/ | ||
export interface ContextualizedRouterMatcher<Context, BasePath extends string, P extends Record<string, any> = {}, ResBody = any, ReqBody = any, ReqQuery extends ParsedQs = any> { | ||
<OutputContext, Route extends string>(path: Route, ...handlers: Array<ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext, P & RouteParameters<Route>, ResBody, ReqBody, ReqQuery>>): Context & OutputContext extends Record<string, never> ? ContextualizedRouterWithExpressRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, Route, P & RouteParameters<Route>> : IContextualizedRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, Route, P & RouteParameters<Route>>; | ||
<OutputContext, Route extends string>(path: Route, ...handlers: Array<Array<ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext, P & RouteParameters<Route>, ResBody, ReqBody, ReqQuery>>>): Context & OutputContext extends Record<string, never> ? ContextualizedRouterWithExpressRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, Route, P & RouteParameters<Route>> : IContextualizedRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, Route, P & RouteParameters<Route>>; | ||
<OutputContext1, OutputContext2, Route extends string>(path: Route, handler1: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 : Context & OutputContext1 & OutputContext2, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, Route extends string>(path: Route, handler1: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 : Context & OutputContext1 & OutputContext2 & OutputContext3, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4, Route extends string>(path: Route, handler1: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4, OutputContext5, Route extends string>(path: Route, handler1: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>, handler5: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, OutputContext5, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4, OutputContext5, OutputContext6, Route extends string>(path: Route, handler1: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>, handler5: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, OutputContext5, P, ResBody, ReqBody, ReqQuery>, handle6: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5, OutputContext6, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 & OutputContext6 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 & OutputContext6, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, Route extends string>(path: Route, handlers: [ | ||
export interface ContextualizedRouterMatcher<Context extends Record<string, any>, BasePath extends string, P extends Record<string, any> = {}, ResBody = any, ReqBody = any, ReqQuery extends ParsedQs = any> { | ||
<OutputContext extends Record<string, any>, Route extends string>(path: Route, ...handlers: Array<ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext, P & RouteParameters<Route>, ResBody, ReqBody, ReqQuery>>): Context & OutputContext extends Record<string, never> ? ContextualizedRouterWithExpressRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, Route, P & RouteParameters<Route>> : IContextualizedRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, Route, P & RouteParameters<Route>>; | ||
<OutputContext extends Record<string, any>, Route extends string>(path: Route, ...handlers: Array<Array<ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext, P & RouteParameters<Route>, ResBody, ReqBody, ReqQuery>>>): Context & OutputContext extends Record<string, never> ? ContextualizedRouterWithExpressRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, Route, P & RouteParameters<Route>> : IContextualizedRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, Route, P & RouteParameters<Route>>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, Route extends string>(path: Route, handler1: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 : Context & OutputContext1 & OutputContext2, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, Route extends string>(path: Route, handler1: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 : Context & OutputContext1 & OutputContext2 & OutputContext3, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>, Route extends string>(path: Route, handler1: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>, OutputContext5 extends Record<string, any>, Route extends string>(path: Route, handler1: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>, handler5: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, OutputContext5, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>, OutputContext5 extends Record<string, any>, OutputContext6 extends Record<string, any>, Route extends string>(path: Route, handler1: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>, handler5: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, OutputContext5, P, ResBody, ReqBody, ReqQuery>, handle6: ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5, OutputContext6, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 & OutputContext6 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 & OutputContext6, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, Route extends string>(path: Route, handlers: [ | ||
ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, | ||
ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery> | ||
]): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 : Context & OutputContext1 & OutputContext2, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, Route extends string>(path: Route, handlers: [ | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, Route extends string>(path: Route, handlers: [ | ||
ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, | ||
@@ -38,3 +38,3 @@ ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, | ||
]): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 : Context & OutputContext1 & OutputContext2 & OutputContext3, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4, Route extends string>(path: Route, handlers: [ | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>, Route extends string>(path: Route, handlers: [ | ||
ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, | ||
@@ -45,3 +45,3 @@ ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, | ||
]): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4, OutputContext5, Route extends string>(path: Route, handlers: [ | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>, OutputContext5 extends Record<string, any>, Route extends string>(path: Route, handlers: [ | ||
ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, | ||
@@ -53,3 +53,3 @@ ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, | ||
]): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5, Route, P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4, OutputContext5, OutputContext6, Route extends string>(path: Route, handlers: [ | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>, OutputContext5 extends Record<string, any>, OutputContext6 extends Record<string, any>, Route extends string>(path: Route, handlers: [ | ||
ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, | ||
@@ -66,14 +66,14 @@ ContextualizedRequestHandler<ChildRouterContext<Route, BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, | ||
*/ | ||
export interface ContextualizedRouterHandler<Context, BasePath extends string, P extends Record<string, any> = {}, ResBody = any, ReqBody = any, ReqQuery extends ParsedQs = any> { | ||
<OutputContext>(...handlers: Array<ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext, P, ResBody, ReqBody, ReqQuery>>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2>(handler1: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 : Context & OutputContext1 & OutputContext2, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3>(handler1: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 : Context & OutputContext1 & OutputContext2 & OutputContext3, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4>(handler1: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4, OutputContext5>(handler1: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>, handler5: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, OutputContext5, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4, OutputContext5, OutputContext6>(handler1: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>, handler5: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, OutputContext5, P, ResBody, ReqBody, ReqQuery>, handle6: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5, OutputContext6, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 & OutputContext6 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 & OutputContext6, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2>(handlers: [ | ||
export interface ContextualizedRouterHandler<Context extends Record<string, any>, BasePath extends string, P extends Record<string, any> = {}, ResBody = any, ReqBody = any, ReqQuery extends ParsedQs = any> { | ||
<OutputContext extends Record<string, any>>(...handlers: Array<ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext, P, ResBody, ReqBody, ReqQuery>>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>>(handler1: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 : Context & OutputContext1 & OutputContext2, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>>(handler1: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 : Context & OutputContext1 & OutputContext2 & OutputContext3, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>>(handler1: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>, OutputContext5 extends Record<string, any>>(handler1: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>, handler5: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, OutputContext5, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>, OutputContext5 extends Record<string, any>, OutputContext6 extends Record<string, any>>(handler1: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, handler2: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, handler3: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2, OutputContext3, P, ResBody, ReqBody, ReqQuery>, handler4: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3, OutputContext4, P, ResBody, ReqBody, ReqQuery>, handler5: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, OutputContext5, P, ResBody, ReqBody, ReqQuery>, handle6: ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5, OutputContext6, P, ResBody, ReqBody, ReqQuery>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 & OutputContext6 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 & OutputContext6, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>>(handlers: [ | ||
ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, | ||
ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery> | ||
]): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 : Context & OutputContext1 & OutputContext2, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3>(handlers: [ | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>>(handlers: [ | ||
ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, | ||
@@ -83,3 +83,3 @@ ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, | ||
]): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 : Context & OutputContext1 & OutputContext2 & OutputContext3, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4>(handlers: [ | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>>(handlers: [ | ||
ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, | ||
@@ -90,3 +90,3 @@ ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, | ||
]): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4, OutputContext5>(handlers: [ | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>, OutputContext5 extends Record<string, any>>(handlers: [ | ||
ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, | ||
@@ -98,3 +98,3 @@ ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, | ||
]): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4, OutputContext5, OutputContext6>(handlers: [ | ||
<OutputContext1 extends Record<string, any>, OutputContext2 extends Record<string, any>, OutputContext3 extends Record<string, any>, OutputContext4 extends Record<string, any>, OutputContext5 extends Record<string, any>, OutputContext6 extends Record<string, any>>(handlers: [ | ||
ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext1, P, ResBody, ReqBody, ReqQuery>, | ||
@@ -107,3 +107,3 @@ ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context> & OutputContext1, OutputContext2, P, ResBody, ReqBody, ReqQuery>, | ||
]): IContextualizedRouter<Context extends Record<string, never> ? OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 & OutputContext6 : Context & OutputContext1 & OutputContext2 & OutputContext3 & OutputContext4 & OutputContext5 & OutputContext6, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext>(...handlers: Array<Array<ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext, P, ResBody, ReqBody, ReqQuery>>>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, '', P, ResBody, ReqBody, ReqQuery>; | ||
<OutputContext extends Record<string, any>>(...handlers: Array<Array<ContextualizedRequestHandler<ChildRouterContext<'', BasePath, Context>, OutputContext, P, ResBody, ReqBody, ReqQuery>>>): IContextualizedRouter<Context extends Record<string, never> ? OutputContext : Context & OutputContext, '', P, ResBody, ReqBody, ReqQuery>; | ||
} | ||
@@ -113,3 +113,3 @@ /** | ||
*/ | ||
export interface IContextualizedRouter<Context extends Record<string, any>, BasePath extends string, P, ResBody = any, ReqBody = any, ReqQuery extends ParsedQs = any> extends Omit<Router, 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options' | 'head' | 'use'>, ContextualizedRequestHandler<Context, Record<string, never>, P, ResBody, ReqBody, ReqQuery> { | ||
export interface IContextualizedRouter<Context extends Record<string, any>, BasePath extends string, P extends Record<string, any>, ResBody = any, ReqBody = any, ReqQuery extends ParsedQs = any> extends Omit<Router, 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options' | 'head' | 'use'>, ContextualizedRequestHandler<Context, Record<string, never>, P, ResBody, ReqBody, ReqQuery> { | ||
get: ContextualizedRouterMatcher<Context, BasePath, P, ResBody, ReqBody, ReqQuery>; | ||
@@ -116,0 +116,0 @@ post: ContextualizedRouterMatcher<Context, BasePath, P, ResBody, ReqBody, ReqQuery>; |
{ | ||
"name": "express-contextualized-router", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"type": "module", | ||
@@ -37,18 +37,18 @@ "exports": { | ||
"devDependencies": { | ||
"@commitlint/config-conventional": "17.6.3", | ||
"@commitlint/config-conventional": "17.6.6", | ||
"@rollup/plugin-typescript": "11.1.1", | ||
"@types/express": "4.17.17", | ||
"@types/node": "18.15.11", | ||
"@types/node": "18.16.19", | ||
"@types/supertest": "2.0.12", | ||
"@typescript-eslint/eslint-plugin": "5.59.7", | ||
"@typescript-eslint/parser": "5.59.7", | ||
"@vitest/coverage-c8": "0.30.1", | ||
"@typescript-eslint/eslint-plugin": "5.61.0", | ||
"@typescript-eslint/parser": "5.61.0", | ||
"@vitest/coverage-c8": "0.31.4", | ||
"builtin-modules": "3.3.0", | ||
"c8": "7.13.0", | ||
"commitlint": "17.6.3", | ||
"eslint": "8.38.0", | ||
"c8": "8.0.0", | ||
"commitlint": "17.6.6", | ||
"eslint": "8.41.0", | ||
"eslint-config-prettier": "8.8.0", | ||
"eslint-config-standard-with-typescript": "27.0.1", | ||
"eslint-plugin-import": "2.27.5", | ||
"eslint-plugin-n": "15.7.0", | ||
"eslint-plugin-n": "16.0.1", | ||
"eslint-plugin-node": "11.1.0", | ||
@@ -62,5 +62,5 @@ "eslint-plugin-prettier": "4.2.1", | ||
"supertest": "6.3.3", | ||
"typescript": "5.0.4", | ||
"vite": "4.2.1", | ||
"vitest": "0.30.1" | ||
"typescript": "5.1.6", | ||
"vite": "4.3.9", | ||
"vitest": "0.31.4" | ||
}, | ||
@@ -67,0 +67,0 @@ "peerDependencies": { |
@@ -32,3 +32,3 @@ import { NextFunction, Router } from 'express' | ||
const contextualizedRouterMatcher = < | ||
OutputContext, | ||
OutputContext extends Record<string, any>, | ||
Route extends string = '', | ||
@@ -35,0 +35,0 @@ >( |
@@ -36,3 +36,3 @@ import { NextFunction, Request, Response, Router } from 'express' | ||
InputContext extends Record<string, any> = Record<string, any>, | ||
OutputContext = Record<string, any>, | ||
OutputContext extends Record<string, any> = Record<string, any>, | ||
P extends Record<string, any> = {}, | ||
@@ -64,3 +64,3 @@ ResBody = any, | ||
InputContext extends Record<string, any> = Record<string, any>, | ||
OutputContext = Record<string, any>, | ||
OutputContext extends Record<string, any> = Record<string, any>, | ||
P extends Record<string, any> = {}, | ||
@@ -85,3 +85,3 @@ ResBody = any, | ||
export interface ContextualizedRouterMatcher< | ||
Context, | ||
Context extends Record<string, any>, | ||
BasePath extends string, | ||
@@ -93,3 +93,3 @@ P extends Record<string, any> = {}, | ||
> { | ||
<OutputContext, Route extends string>( | ||
<OutputContext extends Record<string, any>, Route extends string>( | ||
path: Route, | ||
@@ -121,3 +121,3 @@ ...handlers: Array< | ||
> | ||
<OutputContext, Route extends string>( | ||
<OutputContext extends Record<string, any>, Route extends string>( | ||
path: Route, | ||
@@ -154,3 +154,7 @@ ...handlers: Array< | ||
<OutputContext1, OutputContext2, Route extends string>( | ||
< | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
Route extends string, | ||
>( | ||
path: Route, | ||
@@ -184,3 +188,8 @@ handler1: ContextualizedRequestHandler< | ||
<OutputContext1, OutputContext2, OutputContext3, Route extends string>( | ||
< | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
Route extends string, | ||
>( | ||
path: Route, | ||
@@ -225,6 +234,6 @@ handler1: ContextualizedRequestHandler< | ||
< | ||
OutputContext1, | ||
OutputContext2, | ||
OutputContext3, | ||
OutputContext4, | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
Route extends string, | ||
@@ -286,7 +295,7 @@ >( | ||
< | ||
OutputContext1, | ||
OutputContext2, | ||
OutputContext3, | ||
OutputContext4, | ||
OutputContext5, | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
OutputContext5 extends Record<string, any>, | ||
Route extends string, | ||
@@ -365,8 +374,8 @@ >( | ||
< | ||
OutputContext1, | ||
OutputContext2, | ||
OutputContext3, | ||
OutputContext4, | ||
OutputContext5, | ||
OutputContext6, | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
OutputContext5 extends Record<string, any>, | ||
OutputContext6 extends Record<string, any>, | ||
Route extends string, | ||
@@ -459,3 +468,7 @@ >( | ||
<OutputContext1, OutputContext2, Route extends string>( | ||
< | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
Route extends string, | ||
>( | ||
path: Route, | ||
@@ -491,3 +504,8 @@ handlers: [ | ||
<OutputContext1, OutputContext2, OutputContext3, Route extends string>( | ||
< | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
Route extends string, | ||
>( | ||
path: Route, | ||
@@ -534,6 +552,6 @@ handlers: [ | ||
< | ||
OutputContext1, | ||
OutputContext2, | ||
OutputContext3, | ||
OutputContext4, | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
Route extends string, | ||
@@ -597,7 +615,7 @@ >( | ||
< | ||
OutputContext1, | ||
OutputContext2, | ||
OutputContext3, | ||
OutputContext4, | ||
OutputContext5, | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
OutputContext5 extends Record<string, any>, | ||
Route extends string, | ||
@@ -679,8 +697,8 @@ >( | ||
< | ||
OutputContext1, | ||
OutputContext2, | ||
OutputContext3, | ||
OutputContext4, | ||
OutputContext5, | ||
OutputContext6, | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
OutputContext5 extends Record<string, any>, | ||
OutputContext6 extends Record<string, any>, | ||
Route extends string, | ||
@@ -779,3 +797,3 @@ >( | ||
export interface ContextualizedRouterHandler< | ||
Context, | ||
Context extends Record<string, any>, | ||
BasePath extends string, | ||
@@ -787,3 +805,3 @@ P extends Record<string, any> = {}, | ||
> { | ||
<OutputContext>( | ||
<OutputContext extends Record<string, any>>( | ||
...handlers: Array< | ||
@@ -810,3 +828,6 @@ ContextualizedRequestHandler< | ||
<OutputContext1, OutputContext2>( | ||
< | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
>( | ||
handler1: ContextualizedRequestHandler< | ||
@@ -839,3 +860,7 @@ ChildRouterContext<'', BasePath, Context>, | ||
<OutputContext1, OutputContext2, OutputContext3>( | ||
< | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
>( | ||
handler1: ContextualizedRequestHandler< | ||
@@ -878,3 +903,8 @@ ChildRouterContext<'', BasePath, Context>, | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4>( | ||
< | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
>( | ||
handler1: ContextualizedRequestHandler< | ||
@@ -933,7 +963,7 @@ ChildRouterContext<'', BasePath, Context>, | ||
< | ||
OutputContext1, | ||
OutputContext2, | ||
OutputContext3, | ||
OutputContext4, | ||
OutputContext5, | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
OutputContext5 extends Record<string, any>, | ||
>( | ||
@@ -1010,8 +1040,8 @@ handler1: ContextualizedRequestHandler< | ||
< | ||
OutputContext1, | ||
OutputContext2, | ||
OutputContext3, | ||
OutputContext4, | ||
OutputContext5, | ||
OutputContext6, | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
OutputContext5 extends Record<string, any>, | ||
OutputContext6 extends Record<string, any>, | ||
>( | ||
@@ -1102,3 +1132,6 @@ handler1: ContextualizedRequestHandler< | ||
<OutputContext1, OutputContext2>( | ||
< | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
>( | ||
handlers: [ | ||
@@ -1133,3 +1166,7 @@ ContextualizedRequestHandler< | ||
<OutputContext1, OutputContext2, OutputContext3>( | ||
< | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
>( | ||
handlers: [ | ||
@@ -1174,3 +1211,8 @@ ContextualizedRequestHandler< | ||
<OutputContext1, OutputContext2, OutputContext3, OutputContext4>( | ||
< | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
>( | ||
handlers: [ | ||
@@ -1231,7 +1273,7 @@ ContextualizedRequestHandler< | ||
< | ||
OutputContext1, | ||
OutputContext2, | ||
OutputContext3, | ||
OutputContext4, | ||
OutputContext5, | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
OutputContext5 extends Record<string, any>, | ||
>( | ||
@@ -1311,8 +1353,8 @@ handlers: [ | ||
< | ||
OutputContext1, | ||
OutputContext2, | ||
OutputContext3, | ||
OutputContext4, | ||
OutputContext5, | ||
OutputContext6, | ||
OutputContext1 extends Record<string, any>, | ||
OutputContext2 extends Record<string, any>, | ||
OutputContext3 extends Record<string, any>, | ||
OutputContext4 extends Record<string, any>, | ||
OutputContext5 extends Record<string, any>, | ||
OutputContext6 extends Record<string, any>, | ||
>( | ||
@@ -1405,3 +1447,3 @@ handlers: [ | ||
<OutputContext>( | ||
<OutputContext extends Record<string, any>>( | ||
...handlers: Array< | ||
@@ -1437,3 +1479,3 @@ Array< | ||
BasePath extends string, | ||
P, | ||
P extends Record<string, any>, | ||
ResBody = any, | ||
@@ -1440,0 +1482,0 @@ ReqBody = any, |
102587
2617