Skip to content
Myr

fix(types): replace Hono with HonoBase to get better consistency of types (#3580)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by m-shaka · committed by GitHub · parent 0e0b473 · Browse files · 1 file+73 added−69 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+73 added−69 removed

  • other:+73 added−69 removed

1 file+73 added−69 removed

modified:src/types.ts+73 added-69 removed
4 unmodified lines
56/* eslint-disable @typescript-eslint/no-unused-vars */7/* eslint-disable @typescript-eslint/no-explicit-any */8import type { Context } from './context'9import type { Hono } from './hono'9import type { HonoBase } from './hono-base'10import type { CustomHeader, RequestHeader } from './utils/headers'11import type { StatusCode } from './utils/http-status'12import type {13 IfAnyThenEmptyObject,
104 unmodified lines
118 R extends HandlerResponse<any> = any,119 E2 extends Env = E120 >(121 handler: H<E2, P, I, R>122 ): Hono<IntersectNonAnyTypes<[E, E2]>, S & ToSchema<M, P, I, MergeTypedResponse<R>>, BasePath>122 ): HonoBase<IntersectNonAnyTypes<[E, E2]>, S & ToSchema<M, P, I, MergeTypedResponse<R>>, BasePath>123124 // app.get(handler x2)125 <126 P extends string = ExtractStringKey<S> extends never ? BasePath : ExtractStringKey<S>,
3 unmodified lines
130 E2 extends Env = E,131 E3 extends Env = IntersectNonAnyTypes<[E, E2]>132 >(133 ...handlers: [H<E2, P, I>, H<E3, P, I2, R>]134 ): Hono<134 ): HonoBase<135 IntersectNonAnyTypes<[E, E2, E3]>,136 S & ToSchema<M, P, I2, MergeTypedResponse<R>>,137 BasePath138 >
7 unmodified lines
146 E2 extends Env = E147 >(148 path: P,149 handler: H<E2, MergedPath, I, R>150 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>150 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>151152 // app.get(handler x 3)153 <154 P extends string = ExtractStringKey<S> extends never ? BasePath : ExtractStringKey<S>,
5 unmodified lines
160 E3 extends Env = E,161 E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>162 >(163 ...handlers: [H<E2, P, I>, H<E3, P, I2>, H<E4, P, I3, R>]164 ): Hono<164 ): HonoBase<165 IntersectNonAnyTypes<[E, E2, E3, E4]>,166 S & ToSchema<M, P, I3, MergeTypedResponse<R>>,167 BasePath168 >
9 unmodified lines
178 E3 extends Env = IntersectNonAnyTypes<[E, E2]>179 >(180 path: P,181 ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2, R>]182 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I2, MergeTypedResponse<R>>, BasePath>182 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I2, MergeTypedResponse<R>>, BasePath>183184 // app.get(handler x 4)185 <186 P extends string = ExtractStringKey<S> extends never ? BasePath : ExtractStringKey<S>,
7 unmodified lines
194 E4 extends Env = E,195 E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>196 >(197 ...handlers: [H<E2, P, I>, H<E3, P, I2>, H<E4, P, I3>, H<E5, P, I4, R>]198 ): Hono<198 ): HonoBase<199 IntersectNonAnyTypes<[E, E2, E3, E4, E5]>,200 S & ToSchema<M, P, I4, MergeTypedResponse<R>>,201 BasePath202 >
11 unmodified lines
214 E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>215 >(216 path: P,217 ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2>, H<E4, MergedPath, I3, R>]218 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I3, MergeTypedResponse<R>>, BasePath>218 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I3, MergeTypedResponse<R>>, BasePath>219220 // app.get(handler x 5)221 <222 P extends string = ExtractStringKey<S> extends never ? BasePath : ExtractStringKey<S>,
9 unmodified lines
232 E5 extends Env = E,233 E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>234 >(235 ...handlers: [H<E2, P, I>, H<E3, P, I2>, H<E4, P, I3>, H<E5, P, I4>, H<E6, P, I5, R>]236 ): Hono<236 ): HonoBase<237 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>,238 S & ToSchema<M, P, I5, MergeTypedResponse<R>>,239 BasePath240 >
18 unmodified lines
259 H<E3, MergedPath, I2>,260 H<E4, MergedPath, I3>,261 H<E5, MergedPath, I4, R>262 ]263 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I4, MergeTypedResponse<R>>, BasePath>263 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I4, MergeTypedResponse<R>>, BasePath>264265 // app.get(handler x 6)266 <267 P extends string = ExtractStringKey<S> extends never ? BasePath : ExtractStringKey<S>,
18 unmodified lines
286 H<E5, P, I4>,287 H<E6, P, I5>,288 H<E7, P, I6, R>289 ]290 ): Hono<290 ): HonoBase<291 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>,292 S & ToSchema<M, P, I6, MergeTypedResponse<R>>,293 BasePath294 >
21 unmodified lines
316 H<E4, MergedPath, I3>,317 H<E5, MergedPath, I4>,318 H<E6, MergedPath, I5, R>319 ]320 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I5, MergeTypedResponse<R>>, BasePath>320 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I5, MergeTypedResponse<R>>, BasePath>321322 // app.get(handler x 7)323 <324 P extends string = ExtractStringKey<S> extends never ? BasePath : ExtractStringKey<S>,
21 unmodified lines
346 H<E6, P, I5>,347 H<E7, P, I6>,348 H<E8, P, I7, R>349 ]350 ): Hono<350 ): HonoBase<351 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>,352 S & ToSchema<M, P, I7, MergeTypedResponse<R>>,353 BasePath354 >
24 unmodified lines
379 H<E5, MergedPath, I4>,380 H<E6, MergedPath, I5>,381 H<E7, MergedPath, I6, R>382 ]383 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I6, MergeTypedResponse<R>>, BasePath>383 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I6, MergeTypedResponse<R>>, BasePath>384385 // app.get(handler x 8)386 <387 P extends string = ExtractStringKey<S> extends never ? BasePath : ExtractStringKey<S>,
24 unmodified lines
412 H<E7, P, I6>,413 H<E8, P, I7>,414 H<E9, P, I8, R>415 ]416 ): Hono<416 ): HonoBase<417 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>,418 S & ToSchema<M, P, I8, MergeTypedResponse<R>>,419 BasePath420 >
27 unmodified lines
448 H<E6, MergedPath, I5>,449 H<E7, MergedPath, I6>,450 H<E8, MergedPath, I7, R>451 ]452 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I7, MergeTypedResponse<R>>, BasePath>452 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I7, MergeTypedResponse<R>>, BasePath>453454 // app.get(handler x 9)455 <456 P extends string = ExtractStringKey<S> extends never ? BasePath : ExtractStringKey<S>,
27 unmodified lines
484 H<E8, P, I7>,485 H<E9, P, I8>,486 H<E10, P, I9, R>487 ]488 ): Hono<488 ): HonoBase<489 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>,490 S & ToSchema<M, P, I9, MergeTypedResponse<R>>,491 BasePath492 >
30 unmodified lines
523 H<E7, MergedPath, I6>,524 H<E8, MergedPath, I7>,525 H<E9, MergedPath, I8, R>526 ]527 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I8, MergeTypedResponse<R>>, BasePath>527 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I8, MergeTypedResponse<R>>, BasePath>528529 // app.get(handler x 10)530 <531 P extends string = ExtractStringKey<S> extends never ? BasePath : ExtractStringKey<S>,
30 unmodified lines
562 H<E9, P, I8>,563 H<E10, P, I9>,564 H<E11, P, I10, R>565 ]566 ): Hono<566 ): HonoBase<567 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>,568 S & ToSchema<M, P, I10, MergeTypedResponse<R>>,569 BasePath570 >
33 unmodified lines
604 H<E8, MergedPath, I7>,605 H<E9, MergedPath, I8>,606 H<E10, MergedPath, I9, R>607 ]608 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I9, MergeTypedResponse<R>>, BasePath>608 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I9, MergeTypedResponse<R>>, BasePath>609610 // app.get(path, handler x10)611 <612 P extends string,
32 unmodified lines
645 H<E9, MergedPath, I8>,646 H<E10, MergedPath, I9>,647 H<E11, MergedPath, I10, R>648 ]649 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I10, MergeTypedResponse<R>>, BasePath>649 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I10, MergeTypedResponse<R>>, BasePath>650651 // app.get(...handlers[])652 <653 P extends string = ExtractStringKey<S> extends never ? BasePath : ExtractStringKey<S>,654 I extends Input = BlankInput,655 R extends HandlerResponse<any> = any656 >(657 ...handlers: H<E, P, I, R>[]658 ): Hono<E, S & ToSchema<M, P, I, MergeTypedResponse<R>>, BasePath>658 ): HonoBase<E, S & ToSchema<M, P, I, MergeTypedResponse<R>>, BasePath>659660 // app.get(path, ...handlers[])661 <P extends string, I extends Input = BlankInput, R extends HandlerResponse<any> = any>(662 path: P,663 ...handlers: H<E, MergePath<BasePath, P>, I, R>[]664 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>664 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>665666 // app.get(path)667 <P extends string, R extends HandlerResponse<any> = any, I extends Input = BlankInput>(668 path: P669 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>669 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>670}671672////////////////////////////////////////673////// //////
8 unmodified lines
682> {683 //// app.use(...handlers[])684 <E2 extends Env = E>(685 ...handlers: MiddlewareHandler<E2, MergePath<BasePath, ExtractStringKey<S>>>[]686 ): Hono<IntersectNonAnyTypes<[E, E2]>, S, BasePath>686 ): HonoBase<IntersectNonAnyTypes<[E, E2]>, S, BasePath>687688 // app.use(handler)689 <E2 extends Env = E>(690 handler: MiddlewareHandler<E2, MergePath<BasePath, ExtractStringKey<S>>>691 ): Hono<IntersectNonAnyTypes<[E, E2]>, S, BasePath>691 ): HonoBase<IntersectNonAnyTypes<[E, E2]>, S, BasePath>692693 // app.use(handler x2)694 <695 E2 extends Env = E,696 E3 extends Env = IntersectNonAnyTypes<[E, E2]>,697 P extends string = MergePath<BasePath, ExtractStringKey<S>>698 >(699 ...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>]700 ): Hono<IntersectNonAnyTypes<[E, E2, E3]>, S, BasePath>700 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3]>, S, BasePath>701702 // app.get(path, handler)703 <704 P extends string,
1 unmodified line
706 E2 extends Env = E707 >(708 path: P,709 handler: MiddlewareHandler<E2, MergedPath>710 ): Hono<IntersectNonAnyTypes<[E, E2]>, ChangePathOfSchema<S, MergedPath>, BasePath>710 ): HonoBase<IntersectNonAnyTypes<[E, E2]>, ChangePathOfSchema<S, MergedPath>, BasePath>711712 // app.use(handler x3)713 <714 E2 extends Env = E,
1 unmodified line
716 E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>,717 P extends string = MergePath<BasePath, ExtractStringKey<S>>718 >(719 ...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>, MiddlewareHandler<E4, P>]720 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4]>, S, BasePath>720 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3, E4]>, S, BasePath>721722 // app.get(path, handler x2)723 <724 P extends string,
2 unmodified lines
727 E3 extends Env = IntersectNonAnyTypes<[E, E2]>728 >(729 path: P,730 ...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>]731 ): Hono<IntersectNonAnyTypes<[E, E2, E3]>, ChangePathOfSchema<S, MergedPath>, BasePath>731 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3]>, ChangePathOfSchema<S, MergedPath>, BasePath>732733 // app.use(handler x4)734 <735 E2 extends Env = E,
7 unmodified lines
743 MiddlewareHandler<E3, P>,744 MiddlewareHandler<E4, P>,745 MiddlewareHandler<E5, P>746 ]747 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, S, BasePath>747 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, S, BasePath>748749 // app.get(path, handler x3)750 <751 P extends string,
3 unmodified lines
755 E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>756 >(757 path: P,758 ...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>, MiddlewareHandler<E4, P>]759 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4]>, ChangePathOfSchema<S, MergedPath>, BasePath>759 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3, E4]>, ChangePathOfSchema<S, MergedPath>, BasePath>760761 // app.use(handler x5)762 <763 E2 extends Env = E,
9 unmodified lines
773 MiddlewareHandler<E4, P>,774 MiddlewareHandler<E5, P>,775 MiddlewareHandler<E6, P>776 ]777 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, S, BasePath>777 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, S, BasePath>778779 // app.get(path, handler x4)780 <781 P extends string,
9 unmodified lines
791 MiddlewareHandler<E3, P>,792 MiddlewareHandler<E4, P>,793 MiddlewareHandler<E5, P>794 ]795 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, ChangePathOfSchema<S, MergedPath>, BasePath>795 ): HonoBase<796 IntersectNonAnyTypes<[E, E2, E3, E4, E5]>,797 ChangePathOfSchema<S, MergedPath>,798 BasePath799 >800801 // app.use(handler x6)802 <803 E2 extends Env = E,
11 unmodified lines
815 MiddlewareHandler<E5, P>,816 MiddlewareHandler<E6, P>,817 MiddlewareHandler<E7, P>818 ]815 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, S, BasePath>819 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, S, BasePath>820821 // app.get(path, handler x5)822 <823 P extends string,
11 unmodified lines
835 MiddlewareHandler<E4, P>,836 MiddlewareHandler<E5, P>,837 MiddlewareHandler<E6, P>838 ]835 ): Hono<839 ): HonoBase<840 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>,841 ChangePathOfSchema<S, MergedPath>,842 BasePath843 >
17 unmodified lines
861 MiddlewareHandler<E6, P>,862 MiddlewareHandler<E7, P>,863 MiddlewareHandler<E8, P>864 ]861 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, S, BasePath>865 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, S, BasePath>866867 // app.get(path, handler x6)868 <869 P extends string,
13 unmodified lines
883 MiddlewareHandler<E5, P>,884 MiddlewareHandler<E6, P>,885 MiddlewareHandler<E7, P>886 ]883 ): Hono<887 ): HonoBase<888 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>,889 ChangePathOfSchema<S, MergedPath>,890 BasePath891 >
19 unmodified lines
911 MiddlewareHandler<E7, P>,912 MiddlewareHandler<E8, P>,913 MiddlewareHandler<E9, P>914 ]911 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, S, BasePath>915 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, S, BasePath>916917 // app.get(path, handler x7)918 <919 P extends string,
15 unmodified lines
935 MiddlewareHandler<E6, P>,936 MiddlewareHandler<E7, P>,937 MiddlewareHandler<E8, P>938 ]935 ): Hono<939 ): HonoBase<940 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>,941 ChangePathOfSchema<S, MergedPath>,942 BasePath943 >
21 unmodified lines
965 MiddlewareHandler<E8, P>,966 MiddlewareHandler<E9, P>,967 MiddlewareHandler<E10, P>968 ]965 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, S, BasePath>969 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, S, BasePath>970971 // app.get(path, handler x8)972 <973 P extends string,
17 unmodified lines
991 MiddlewareHandler<E7, P>,992 MiddlewareHandler<E8, P>,993 MiddlewareHandler<E9, P>994 ]991 ): Hono<995 ): HonoBase<996 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>,997 ChangePathOfSchema<S, MergedPath>,998 BasePath999 >
23 unmodified lines
1023 MiddlewareHandler<E9, P>,1024 MiddlewareHandler<E10, P>,1025 MiddlewareHandler<E11, P>1026 ]1023 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>, S, BasePath>1027 ): HonoBase<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>, S, BasePath>10281029 // app.get(path, handler x9)1030 <1031 P extends string,
19 unmodified lines
1051 MiddlewareHandler<E8, P>,1052 MiddlewareHandler<E9, P>,1053 MiddlewareHandler<E10, P>1054 ]1051 ): Hono<1055 ): HonoBase<1056 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>,1057 ChangePathOfSchema<S, MergedPath>,1058 BasePath1059 >
1 unmodified line
1061 //// app.use(path, ...handlers[])1062 <P extends string, E2 extends Env = E>(1063 path: P,1064 ...handlers: MiddlewareHandler<E2, MergePath<BasePath, P>>[]1061 ): Hono<E, S, BasePath>1065 ): HonoBase<E, S, BasePath>1066}10671068////////////////////////////////////////1069////// //////
17 unmodified lines
1087 >(1088 method: M,1089 path: P,1090 handler: H<E2, MergedPath, I, R>1087 ): Hono<1091 ): HonoBase<1092 IntersectNonAnyTypes<[E, E2]>,1093 S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>,1094 BasePath1095 >
11 unmodified lines
1107 >(1108 method: M,1109 path: P,1110 ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2, R>]1107 ): Hono<1111 ): HonoBase<1112 IntersectNonAnyTypes<[E, E2, E3]>,1113 S & ToSchema<M, MergePath<BasePath, P>, I2, MergeTypedResponse<R>>,1114 BasePath1115 >
13 unmodified lines
1129 >(1130 method: M,1131 path: P,1132 ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2>, H<E4, MergedPath, I3, R>]1129 ): Hono<1133 ): HonoBase<1134 IntersectNonAnyTypes<[E, E2, E3, E4]>,1135 S & ToSchema<M, MergePath<BasePath, P>, I3, MergeTypedResponse<R>>,1136 BasePath1137 >
20 unmodified lines
1158 H<E3, MergedPath, I2>,1159 H<E4, MergedPath, I3>,1160 H<E5, MergedPath, I4, R>1161 ]1158 ): Hono<1162 ): HonoBase<1163 IntersectNonAnyTypes<[E, E2, E3, E4, E5]>,1164 S & ToSchema<M, MergePath<BasePath, P>, I4, MergeTypedResponse<R>>,1165 BasePath1166 >
23 unmodified lines
1190 H<E4, MergedPath, I3>,1191 H<E5, MergedPath, I4>,1192 H<E6, MergedPath, I5, R>1193 ]1190 ): Hono<1194 ): HonoBase<1195 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>,1196 S & ToSchema<M, MergePath<BasePath, P>, I5, MergeTypedResponse<R>>,1197 BasePath1198 >
26 unmodified lines
1225 H<E5, MergedPath, I4>,1226 H<E6, MergedPath, I5>,1227 H<E7, MergedPath, I6, R>1228 ]1225 ): Hono<1229 ): HonoBase<1230 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>,1231 S & ToSchema<M, MergePath<BasePath, P>, I6, MergeTypedResponse<R>>,1232 BasePath1233 >
29 unmodified lines
1263 H<E6, MergedPath, I5>,1264 H<E7, MergedPath, I6>,1265 H<E8, MergedPath, I7, R>1266 ]1263 ): Hono<1267 ): HonoBase<1268 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>,1269 S & ToSchema<M, MergePath<BasePath, P>, I7, MergeTypedResponse<R>>,1270 BasePath1271 >
32 unmodified lines
1304 H<E7, MergedPath, I6>,1305 H<E8, MergedPath, I7>,1306 H<E9, MergedPath, I8, R>1307 ]1304 ): Hono<1308 ): HonoBase<1309 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>,1310 S & ToSchema<M, MergePath<BasePath, P>, I8, MergeTypedResponse<R>>,1311 BasePath1312 >
35 unmodified lines
1348 H<E8, MergedPath, I7>,1349 H<E9, MergedPath, I8>,1350 H<E10, MergedPath, I9, R>1351 ]1348 ): Hono<1352 ): HonoBase<1353 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>,1354 S & ToSchema<M, MergePath<BasePath, P>, I9, MergeTypedResponse<R>>,1355 BasePath1356 >
37 unmodified lines
1394 H<E9, MergedPath, I8>,1395 H<E10, MergedPath, I9>,1396 H<E11, MergedPath, I10>1397 ]1394 ): Hono<1398 ): HonoBase<1399 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>,1400 S & ToSchema<M, MergePath<BasePath, P>, I10, MergeTypedResponse<HandlerResponse<any>>>,1401 BasePath1402 >
7 unmodified lines
1410 >(1411 method: M,1412 path: P,1413 ...handlers: H<E, MergePath<BasePath, P>, I, R>[]1410 ): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>1414 ): HonoBase<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>14151416 // app.get(method[], path, handler)1417 <1418 Ms extends string[],
5 unmodified lines
1424 >(1425 methods: Ms,1426 path: P,1427 handler: H<E2, MergedPath, I, R>1424 ): Hono<1428 ): HonoBase<1429 IntersectNonAnyTypes<[E, E2]>,1430 S & ToSchema<Ms[number], MergePath<BasePath, P>, I, MergeTypedResponse<R>>,1431 BasePath1432 >
11 unmodified lines
1444 >(1445 methods: Ms,1446 path: P,1447 ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2, R>]1444 ): Hono<1448 ): HonoBase<1449 IntersectNonAnyTypes<[E, E2, E3]>,1450 S & ToSchema<Ms[number], MergePath<BasePath, P>, I2, MergeTypedResponse<R>>,1451 BasePath1452 >
13 unmodified lines
1466 >(1467 methods: Ms,1468 path: P,1469 ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2>, H<E4, MergedPath, I3, R>]1466 ): Hono<1470 ): HonoBase<1471 IntersectNonAnyTypes<[E, E2, E3, E4]>,1472 S & ToSchema<Ms[number], MergePath<BasePath, P>, I3, MergeTypedResponse<R>>,1473 BasePath1474 >
20 unmodified lines
1495 H<E3, MergedPath, I2>,1496 H<E4, MergedPath, I3>,1497 H<E5, MergedPath, I4, R>1498 ]1495 ): Hono<1499 ): HonoBase<1500 IntersectNonAnyTypes<[E, E2, E3, E4, E5]>,1501 S & ToSchema<Ms[number], MergePath<BasePath, P>, I4, MergeTypedResponse<R>>,1502 BasePath1503 >
23 unmodified lines
1527 H<E4, MergedPath, I3>,1528 H<E5, MergedPath, I4>,1529 H<E6, MergedPath, I5, R>1530 ]1527 ): Hono<1531 ): HonoBase<1532 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>,1533 S & ToSchema<Ms[number], MergePath<BasePath, P>, I5, MergeTypedResponse<R>>,1534 BasePath1535 >
26 unmodified lines
1562 H<E5, MergedPath, I4>,1563 H<E6, MergedPath, I5>,1564 H<E7, MergedPath, I6, R>1565 ]1562 ): Hono<1566 ): HonoBase<1567 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>,1568 S & ToSchema<Ms[number], MergePath<BasePath, P>, I6, MergeTypedResponse<R>>,1569 BasePath1570 >
29 unmodified lines
1600 H<E6, MergedPath, I5>,1601 H<E7, MergedPath, I6>,1602 H<E8, MergedPath, I7, R>1603 ]1600 ): Hono<1604 ): HonoBase<1605 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>,1606 S & ToSchema<Ms[number], MergePath<BasePath, P>, I7, MergeTypedResponse<R>>,1607 BasePath1608 >
32 unmodified lines
1641 H<E7, MergedPath, I6>,1642 H<E8, MergedPath, I7>,1643 H<E9, MergedPath, I8, R>1644 ]1641 ): Hono<1645 ): HonoBase<1646 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>,1647 S & ToSchema<Ms[number], MergePath<BasePath, P>, I8, MergeTypedResponse<R>>,1648 BasePath1649 >
34 unmodified lines
1684 H<E8, MergedPath, I7>,1685 H<E9, MergedPath, I8>,1686 H<E10, MergedPath, I9>1687 ]1684 ): Hono<1688 ): HonoBase<1689 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>,1690 S & ToSchema<Ms[number], MergePath<BasePath, P>, I9, MergeTypedResponse<HandlerResponse<any>>>,1691 BasePath1692 >
37 unmodified lines
1730 H<E9, MergedPath, I8>,1731 H<E10, MergedPath, I9>,1732 H<E11, MergedPath, I10>1733 ]1730 ): Hono<1734 ): HonoBase<1735 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>,1736 S & ToSchema<Ms[number], MergePath<BasePath, P>, I10, MergeTypedResponse<HandlerResponse<any>>>,1737 BasePath1738 >
2 unmodified lines
1741 <P extends string, R extends HandlerResponse<any> = any, I extends Input = BlankInput>(1742 methods: string[],1743 path: P,1744 ...handlers: H<E, MergePath<BasePath, P>, I, R>[]1741 ): Hono<E, S & ToSchema<string, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>1745 ): HonoBase<E, S & ToSchema<string, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>17461747 // app.on(method | method[], path[], ...handlers[])1748 <I extends Input = BlankInput, R extends HandlerResponse<any> = any>(1749 methods: string | string[],1750 paths: string[],1751 ...handlers: H<E, any, I, R>[]1748 ): Hono<E, S & ToSchema<string, string, I, MergeTypedResponse<R>>, BasePath>1752 ): HonoBase<E, S & ToSchema<string, string, I, MergeTypedResponse<R>>, BasePath>1753}17541755type ExtractStringKey<S> = keyof S & string1756
223 unmodified lines
1980////// //////1981////////////////////////////////////////19821983export type ExtractSchema<T> = UnionToIntersection<1980 T extends Hono<infer _, infer S, any> ? S : never1984 T extends HonoBase<infer _, infer S, any> ? S : never1985>19861987type EnvOrEmpty<T> = T extends Env ? (Env extends T ? {} : T) : T1988type IntersectNonAnyTypes<T extends any[]> = T extends [infer Head, ...infer Rest]
15 unmodified lines