Module

x/hono/types.ts>OnHandlerInterface

Web Framework built on Web Standards
Extremely Popular
Go to Latest
interface OnHandlerInterface
import { type OnHandlerInterface } from "https://dotland.deno.dev/x/hono@v4.3.2/types.ts";

Type Parameters

optional
E extends Env = Env
optional
S extends Schema = { }
optional
BasePath extends string = "/"

Call Signatures

<M extends string, P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, E2 extends Env = E>(
method: M,
path: P,
handler: H<E2, MergedPath, I, R>,
): Hono<IntersectNonAnyTypes<[E, E2]>, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(
method: M,
path: P,
...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2, R>],
): Hono<IntersectNonAnyTypes<[E, E2, E3]>, S & ToSchema<M, MergePath<BasePath, P>, I2, MergeTypedResponse<R>>, BasePath>
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = E, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(
method: M,
path: P,
...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2>, H<E4, MergedPath, I3, R>],
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
]
>, S & ToSchema<M, MergePath<BasePath, P>, I3, MergeTypedResponse<R>>, BasePath>
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
]
>
>
(
method: M,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
]
>, S & ToSchema<M, MergePath<BasePath, P>, I4, MergeTypedResponse<R>>, BasePath>
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
]
>
>
(
method: M,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
]
>, S & ToSchema<M, MergePath<BasePath, P>, I5, MergeTypedResponse<R>>, BasePath>
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, I6 extends Input =
& I
& I2
& I3
& I4
& I5
, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = E, E7 extends Env = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
]
>
>
(
method: M,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5>,
H<E7, MergedPath, I6, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
]
>, S & ToSchema<M, MergePath<BasePath, P>, I6, MergeTypedResponse<R>>, BasePath>
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, I6 extends Input =
& I
& I2
& I3
& I4
& I5
, I7 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
, 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 = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
]
>
>
(
method: M,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5>,
H<E7, MergedPath, I6>,
H<E8, MergedPath, I7, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
]
>, S & ToSchema<M, MergePath<BasePath, P>, I7, MergeTypedResponse<R>>, BasePath>
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, I6 extends Input =
& I
& I2
& I3
& I4
& I5
, I7 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
, I8 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
, 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 = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
]
>
>
(
method: M,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5>,
H<E7, MergedPath, I6>,
H<E8, MergedPath, I7>,
H<E9, MergedPath, I8, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
]
>, S & ToSchema<M, MergePath<BasePath, P>, I8, MergeTypedResponse<R>>, BasePath>
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, I6 extends Input =
& I
& I2
& I3
& I4
& I5
, I7 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
, I8 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
, I9 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
& I8
, 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 = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
]
>
>
(
method: M,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5>,
H<E7, MergedPath, I6>,
H<E8, MergedPath, I7>,
H<E9, MergedPath, I8>,
H<E10, MergedPath, I9, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
E10,
]
>, S & ToSchema<M, MergePath<BasePath, P>, I9, MergeTypedResponse<R>>, BasePath>
<M extends string, P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, I6 extends Input =
& I
& I2
& I3
& I4
& I5
, I7 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
, I8 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
, I9 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
& I8
, I10 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
& I8
& I9
, 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, E11 extends Env = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
E10,
]
>
>
(
method: M,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5>,
H<E7, MergedPath, I6>,
H<E8, MergedPath, I7>,
H<E9, MergedPath, I8>,
H<E10, MergedPath, I9>,
H<E11, MergedPath, I10>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
E10,
E11,
]
>, S & ToSchema<M, MergePath<BasePath, P>, I10, MergeTypedResponse<HandlerResponse<any>>>, BasePath>
<M extends string, P extends string, R extends HandlerResponse<any> = any, I extends Input = { }>(
method: M,
path: P,
...handlers: H<E, MergePath<BasePath, P>, I, R>[],
): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>
<Ms extends string[], P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, E2 extends Env = E>(
methods: Ms,
path: P,
handler: H<E2, MergedPath, I, R>,
): Hono<IntersectNonAnyTypes<[E, E2]>, S & ToSchema<Ms[number], MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>
<Ms extends string[], P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(
methods: Ms,
path: P,
...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2, R>],
): Hono<IntersectNonAnyTypes<[E, E2, E3]>, S & ToSchema<Ms[number], MergePath<BasePath, P>, I2, MergeTypedResponse<R>>, BasePath>
<Ms extends string[], P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = E, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(
methods: Ms,
path: P,
...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2>, H<E4, MergedPath, I3, R>],
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
]
>, S & ToSchema<Ms[number], MergePath<BasePath, P>, I3, MergeTypedResponse<R>>, BasePath>
<Ms extends string[], P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
]
>
>
(
methods: Ms,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
]
>, S & ToSchema<Ms[number], MergePath<BasePath, P>, I4, MergeTypedResponse<R>>, BasePath>
<Ms extends string[], P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
]
>
>
(
methods: Ms,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
]
>, S & ToSchema<Ms[number], MergePath<BasePath, P>, I5, MergeTypedResponse<R>>, BasePath>
<Ms extends string[], P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, I6 extends Input =
& I
& I2
& I3
& I4
& I5
, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = E, E7 extends Env = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
]
>
>
(
methods: Ms,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5>,
H<E7, MergedPath, I6, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
]
>, S & ToSchema<Ms[number], MergePath<BasePath, P>, I6, MergeTypedResponse<R>>, BasePath>
<Ms extends string[], P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, I6 extends Input =
& I
& I2
& I3
& I4
& I5
, I7 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
, 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 = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
]
>
>
(
methods: Ms,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5>,
H<E7, MergedPath, I6>,
H<E8, MergedPath, I7, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
]
>, S & ToSchema<Ms[number], MergePath<BasePath, P>, I7, MergeTypedResponse<R>>, BasePath>
<Ms extends string[], P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, I6 extends Input =
& I
& I2
& I3
& I4
& I5
, I7 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
, I8 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
, 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 = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
]
>
>
(
methods: Ms,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5>,
H<E7, MergedPath, I6>,
H<E8, MergedPath, I7>,
H<E9, MergedPath, I8, R>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
]
>, S & ToSchema<Ms[number], MergePath<BasePath, P>, I8, MergeTypedResponse<R>>, BasePath>
<Ms extends string[], P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, I6 extends Input =
& I
& I2
& I3
& I4
& I5
, I7 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
, I8 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
, I9 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
& I8
, 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 = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
]
>
>
(
methods: Ms,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5>,
H<E7, MergedPath, I6>,
H<E8, MergedPath, I7>,
H<E9, MergedPath, I8>,
H<E10, MergedPath, I9>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
E10,
]
>, S & ToSchema<Ms[number], MergePath<BasePath, P>, I9, MergeTypedResponse<HandlerResponse<any>>>, BasePath>
<Ms extends string[], P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input =
& I
& I2
& I3
& I4
, I6 extends Input =
& I
& I2
& I3
& I4
& I5
, I7 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
, I8 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
, I9 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
& I8
, I10 extends Input =
& I
& I2
& I3
& I4
& I5
& I6
& I7
& I8
& I9
, 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, E11 extends Env = IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
E10,
]
>
>
(
methods: Ms,
path: P,
...handlers:
[
H<E2, MergedPath, I>,
H<E3, MergedPath, I2>,
H<E4, MergedPath, I3>,
H<E5, MergedPath, I4>,
H<E6, MergedPath, I5>,
H<E7, MergedPath, I6>,
H<E8, MergedPath, I7>,
H<E9, MergedPath, I8>,
H<E10, MergedPath, I9>,
H<E11, MergedPath, I10>,
]
,
): Hono<IntersectNonAnyTypes<
[
E,
E2,
E3,
E4,
E5,
E6,
E7,
E8,
E9,
E10,
E11,
]
>, S & ToSchema<Ms[number], MergePath<BasePath, P>, I10, MergeTypedResponse<HandlerResponse<any>>>, BasePath>
<P extends string, R extends HandlerResponse<any> = any, I extends Input = { }>(
methods: string[],
path: P,
...handlers: H<E, MergePath<BasePath, P>, I, R>[],
): Hono<E, S & ToSchema<string, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>
<I extends Input = BlankInput, R extends HandlerResponse<any> = any>(
methods: string | string[],
paths: string[],
...handlers: H<E, any, I, R>[],
): Hono<E, S & ToSchema<string, string, I, MergeTypedResponse<R>>, BasePath>