Skip to content

Commit

Permalink
fix(types): Calculate Context<Env> type for each handler (#3587)
Browse files Browse the repository at this point in the history
  • Loading branch information
sushichan044 committed Nov 15, 2024
1 parent a15bec3 commit 1af264b
Show file tree
Hide file tree
Showing 2 changed files with 244 additions and 244 deletions.
72 changes: 36 additions & 36 deletions src/helper/factory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
I3 extends Input = I & I2,
R extends HandlerResponse<any> = any,
E2 extends Env = E,
E3 extends Env = E,
E3 extends Env = IntersectNonAnyTypes<[E, E2]>,
E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>
>(
handler1: H<E2, P, I, R>,
Expand All @@ -56,8 +56,8 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
I4 extends Input = I & I2 & I3,
R extends HandlerResponse<any> = any,
E2 extends Env = E,
E3 extends Env = E,
E4 extends Env = E,
E3 extends Env = IntersectNonAnyTypes<[E, E2]>,
E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>,
E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>
>(
handler1: H<E2, P, I, R>,
Expand All @@ -75,9 +75,9 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
I5 extends Input = I & I2 & I3 & I4,
R extends HandlerResponse<any> = any,
E2 extends Env = E,
E3 extends Env = E,
E4 extends Env = E,
E5 extends Env = E,
E3 extends Env = IntersectNonAnyTypes<[E, E2]>,
E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>,
E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>,
E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>
>(
handler1: H<E2, P, I, R>,
Expand All @@ -97,10 +97,10 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
I6 extends Input = I & I2 & I3 & I4 & I5,
R extends HandlerResponse<any> = any,
E2 extends Env = E,
E3 extends Env = E,
E4 extends Env = E,
E5 extends Env = E,
E6 extends Env = E,
E3 extends Env = IntersectNonAnyTypes<[E, E2]>,
E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>,
E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>,
E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>,
E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>
>(
handler1: H<E2, P, I, R>,
Expand Down Expand Up @@ -129,11 +129,11 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
I7 extends Input = I & I2 & I3 & I4 & I5 & I6,
R extends HandlerResponse<any> = any,
E2 extends Env = E,
E3 extends Env = E,
E4 extends Env = E,
E5 extends Env = E,
E6 extends Env = E,
E7 extends Env = E,
E3 extends Env = IntersectNonAnyTypes<[E, E2]>,
E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>,
E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>,
E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>,
E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>,
E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>
>(
handler1: H<E2, P, I, R>,
Expand Down Expand Up @@ -165,12 +165,12 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7,
R extends HandlerResponse<any> = any,
E2 extends Env = E,
E3 extends Env = E,
E4 extends Env = E,
E5 extends Env = E,
E6 extends Env = E,
E7 extends Env = E,
E8 extends Env = E,
E3 extends Env = IntersectNonAnyTypes<[E, E2]>,
E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>,
E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>,
E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>,
E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>,
E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>,
E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>
>(
handler1: H<E2, P, I, R>,
Expand Down Expand Up @@ -205,13 +205,13 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8,
R extends HandlerResponse<any> = any,
E2 extends Env = E,
E3 extends Env = E,
E4 extends Env = E,
E5 extends Env = E,
E6 extends Env = E,
E7 extends Env = E,
E8 extends Env = E,
E9 extends Env = E,
E3 extends Env = IntersectNonAnyTypes<[E, E2]>,
E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>,
E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>,
E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>,
E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>,
E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>,
E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>,
E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>
>(
handler1: H<E2, P, I, R>,
Expand Down Expand Up @@ -249,14 +249,14 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9,
R extends HandlerResponse<any> = any,
E2 extends Env = E,
E3 extends Env = E,
E4 extends Env = E,
E5 extends Env = E,
E6 extends Env = E,
E7 extends Env = E,
E8 extends Env = E,
E9 extends Env = E,
E10 extends Env = E,
E3 extends Env = IntersectNonAnyTypes<[E, E2]>,
E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>,
E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>,
E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>,
E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>,
E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>,
E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>,
E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>,
E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>
>(
handler1: H<E2, P, I, R>,
Expand Down
Loading

0 comments on commit 1af264b

Please sign in to comment.