hono 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hono.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ interface Route<P extends string = string, E extends Partial<Environment> = Envi
|
|
|
14
14
|
handler: Handler<P, E, S>;
|
|
15
15
|
}
|
|
16
16
|
declare const Hono_base: new <E_1 extends Partial<Environment> = Environment, P_1 extends string = string, S_1 = unknown, U = Hono<E_1, P_1, S_1>>() => {
|
|
17
|
-
get: HandlerInterface<P_1, E_1, S_1, U>;
|
|
18
17
|
all: HandlerInterface<P_1, E_1, S_1, U>;
|
|
18
|
+
get: HandlerInterface<P_1, E_1, S_1, U>;
|
|
19
19
|
post: HandlerInterface<P_1, E_1, S_1, U>;
|
|
20
20
|
put: HandlerInterface<P_1, E_1, S_1, U>;
|
|
21
21
|
delete: HandlerInterface<P_1, E_1, S_1, U>;
|
|
@@ -23,7 +23,7 @@ declare const Hono_base: new <E_1 extends Partial<Environment> = Environment, P_
|
|
|
23
23
|
options: HandlerInterface<P_1, E_1, S_1, U>;
|
|
24
24
|
patch: HandlerInterface<P_1, E_1, S_1, U>;
|
|
25
25
|
};
|
|
26
|
-
export declare class Hono<E extends Partial<Environment> = Environment, P extends string =
|
|
26
|
+
export declare class Hono<E extends Partial<Environment> = Environment, P extends string = string, S = unknown> extends Hono_base<E, P, S, Hono<E, P, S>> {
|
|
27
27
|
readonly router: Router<Handler<P, E, S>>;
|
|
28
28
|
readonly strict: boolean;
|
|
29
29
|
private _tempPath;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ServeStaticOptions } from './serve-static';
|
|
2
|
-
declare const module: (options?: ServeStaticOptions) => import("../..").MiddlewareHandler<string, import("../../types").Environment,
|
|
2
|
+
declare const module: (options?: ServeStaticOptions) => import("../..").MiddlewareHandler<string, import("../../types").Environment, any>;
|
|
3
3
|
export { module as serveStatic };
|
package/dist/types.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export declare type Environment = {
|
|
|
7
7
|
Bindings: Bindings;
|
|
8
8
|
Variables: Variables;
|
|
9
9
|
};
|
|
10
|
-
export declare type Handler<P extends string = string, E extends Partial<Environment> = Environment, S =
|
|
11
|
-
export declare type MiddlewareHandler<P extends string = string, E extends Partial<Environment> = Environment, S =
|
|
10
|
+
export declare type Handler<P extends string = string, E extends Partial<Environment> = Environment, S = any> = (c: Context<P, E, S>, next: Next) => Response | Promise<Response | undefined | void>;
|
|
11
|
+
export declare type MiddlewareHandler<P extends string = string, E extends Partial<Environment> = Environment, S = any> = (c: Context<P, E, S>, next: Next) => Promise<Response | undefined | void>;
|
|
12
12
|
export declare type NotFoundHandler<E extends Partial<Environment> = Environment> = (c: Context<string, E>) => Response | Promise<Response>;
|
|
13
13
|
export declare type ErrorHandler<E extends Partial<Environment> = Environment> = (err: Error, c: Context<string, E>) => Response;
|
|
14
14
|
export declare type Next = () => Promise<void>;
|
|
@@ -2,6 +2,6 @@ import type { VString, VNumber, VBoolean, VObject, VNumberArray, VStringArray, V
|
|
|
2
2
|
export declare type Schema = {
|
|
3
3
|
[key: string]: VString | VNumber | VBoolean | VStringArray | VNumberArray | VBooleanArray | Schema | VObject<Schema> | VArray<Schema>;
|
|
4
4
|
};
|
|
5
|
-
export declare type SchemaToProp<T> = {
|
|
6
|
-
[K in keyof T]: T[K] extends VNumberArray ? number[] : T[K] extends VBooleanArray ? boolean[] : T[K] extends VStringArray ? string[] : T[K] extends
|
|
5
|
+
export declare type SchemaToProp<T> = T extends VArray<infer R> ? SchemaToProp<R>[] : T extends VObject<infer R> ? SchemaToProp<R> : {
|
|
6
|
+
[K in keyof T]: T[K] extends VNumberArray ? number[] : T[K] extends VBooleanArray ? boolean[] : T[K] extends VStringArray ? string[] : T[K] extends VString ? string : T[K] extends VNumber ? number : T[K] extends VBoolean ? boolean : T[K] extends VObjectBase<Schema> ? T[K]['container'] extends VNumber ? number : T[K]['container'] extends VString ? string : T[K]['container'] extends VBoolean ? boolean : T[K] extends VArray<infer R> ? SchemaToProp<R>[] : T[K] extends VObject<infer R> ? SchemaToProp<R> : T[K] extends Schema ? SchemaToProp<T[K]> : never : SchemaToProp<T[K]>;
|
|
7
7
|
};
|