@kerebron/extension-server-hono 0.4.5 → 0.4.6
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/esm/HonoYjsMemAdapter.d.ts +2 -1
- package/esm/HonoYjsMemAdapter.d.ts.map +1 -1
- package/esm/HonoYjsMemAdapter.js +1 -0
- package/esm/_dnt.polyfills.d.ts +7 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -0
- package/esm/_dnt.polyfills.js +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/compose.d.ts +15 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/compose.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/compose.js +64 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/context.d.ts +452 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/context.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/context.js +513 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/helper/websocket/index.d.ts +70 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/helper/websocket/index.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/helper/websocket/index.js +95 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/hono-base.d.ts +221 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/hono-base.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/hono-base.js +498 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/http-exception.d.ts +60 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/http-exception.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/http-exception.js +71 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/request/constants.d.ts +2 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/request/constants.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/request/constants.js +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/request.d.ts +314 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/request.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/request.js +370 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/router.d.ts +98 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/router.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/router.js +25 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/types.d.ts +563 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/types.js +11 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/body.d.ts +80 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/body.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/body.js +111 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/constants.d.ts +5 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/constants.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/constants.js +4 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/headers.d.ts +9 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/headers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/headers.js +5 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/html.d.ts +45 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/html.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/html.js +122 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/http-status.d.ts +33 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/http-status.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/http-status.js +5 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/mime.d.ts +71 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/mime.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/mime.js +83 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/types.d.ts +75 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/types.js +5 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/url.d.ts +30 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/url.d.ts.map +1 -0
- package/esm/deps/jsr.io/@hono/hono/4.10.7/src/utils/url.js +255 -0
- package/esm/mod.d.ts +2 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* This module provides types definitions and variables for the routers.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Constant representing all HTTP methods in uppercase.
|
|
7
|
+
*/
|
|
8
|
+
export declare const METHOD_NAME_ALL: "ALL";
|
|
9
|
+
/**
|
|
10
|
+
* Constant representing all HTTP methods in lowercase.
|
|
11
|
+
*/
|
|
12
|
+
export declare const METHOD_NAME_ALL_LOWERCASE: "all";
|
|
13
|
+
/**
|
|
14
|
+
* Array of supported HTTP methods.
|
|
15
|
+
*/
|
|
16
|
+
export declare const METHODS: readonly ["get", "post", "put", "delete", "options", "patch"];
|
|
17
|
+
/**
|
|
18
|
+
* Error message indicating that a route cannot be added because the matcher is already built.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
|
|
21
|
+
/**
|
|
22
|
+
* Interface representing a router.
|
|
23
|
+
*
|
|
24
|
+
* @template T - The type of the handler.
|
|
25
|
+
*/
|
|
26
|
+
export interface Router<T> {
|
|
27
|
+
/**
|
|
28
|
+
* The name of the router.
|
|
29
|
+
*/
|
|
30
|
+
name: string;
|
|
31
|
+
/**
|
|
32
|
+
* Adds a route to the router.
|
|
33
|
+
*
|
|
34
|
+
* @param method - The HTTP method (e.g., 'get', 'post').
|
|
35
|
+
* @param path - The path for the route.
|
|
36
|
+
* @param handler - The handler for the route.
|
|
37
|
+
*/
|
|
38
|
+
add(method: string, path: string, handler: T): void;
|
|
39
|
+
/**
|
|
40
|
+
* Matches a route based on the given method and path.
|
|
41
|
+
*
|
|
42
|
+
* @param method - The HTTP method (e.g., 'get', 'post').
|
|
43
|
+
* @param path - The path to match.
|
|
44
|
+
* @returns The result of the match.
|
|
45
|
+
*/
|
|
46
|
+
match(method: string, path: string): Result<T>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Type representing a map of parameter indices.
|
|
50
|
+
*/
|
|
51
|
+
export type ParamIndexMap = Record<string, number>;
|
|
52
|
+
/**
|
|
53
|
+
* Type representing a stash of parameters.
|
|
54
|
+
*/
|
|
55
|
+
export type ParamStash = string[];
|
|
56
|
+
/**
|
|
57
|
+
* Type representing a map of parameters.
|
|
58
|
+
*/
|
|
59
|
+
export type Params = Record<string, string>;
|
|
60
|
+
/**
|
|
61
|
+
* Type representing the result of a route match.
|
|
62
|
+
*
|
|
63
|
+
* The result can be in one of two formats:
|
|
64
|
+
* 1. An array of handlers with their corresponding parameter index maps, followed by a parameter stash.
|
|
65
|
+
* 2. An array of handlers with their corresponding parameter maps.
|
|
66
|
+
*
|
|
67
|
+
* Example:
|
|
68
|
+
*
|
|
69
|
+
* [[handler, paramIndexMap][], paramArray]
|
|
70
|
+
* ```typescript
|
|
71
|
+
* [
|
|
72
|
+
* [
|
|
73
|
+
* [middlewareA, {}], // '*'
|
|
74
|
+
* [funcA, {'id': 0}], // '/user/:id/*'
|
|
75
|
+
* [funcB, {'id': 0, 'action': 1}], // '/user/:id/:action'
|
|
76
|
+
* ],
|
|
77
|
+
* ['123', 'abc']
|
|
78
|
+
* ]
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* [[handler, params][]]
|
|
82
|
+
* ```typescript
|
|
83
|
+
* [
|
|
84
|
+
* [
|
|
85
|
+
* [middlewareA, {}], // '*'
|
|
86
|
+
* [funcA, {'id': '123'}], // '/user/:id/*'
|
|
87
|
+
* [funcB, {'id': '123', 'action': 'abc'}], // '/user/:id/:action'
|
|
88
|
+
* ]
|
|
89
|
+
* ]
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export type Result<T> = [[T, ParamIndexMap][], ParamStash] | [[T, Params][]];
|
|
93
|
+
/**
|
|
94
|
+
* Error class representing an unsupported path error.
|
|
95
|
+
*/
|
|
96
|
+
export declare class UnsupportedPathError extends Error {
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@hono/hono/4.10.7/src/router.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,EAAG,KAAc,CAAA;AAC7C;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAG,KAAc,CAAA;AACvD;;GAEG;AACH,eAAO,MAAM,OAAO,+DAAgE,CAAA;AACpF;;GAEG;AACH,eAAO,MAAM,gCAAgC,4DACc,CAAA;AAE3D;;;;GAIG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;;;;OAMG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAA;IAEnD;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;CAC/C;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAClD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,EAAE,CAAA;AACjC;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;AAE5E;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;CAAG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* This module provides types definitions and variables for the routers.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Constant representing all HTTP methods in uppercase.
|
|
7
|
+
*/
|
|
8
|
+
export const METHOD_NAME_ALL = 'ALL';
|
|
9
|
+
/**
|
|
10
|
+
* Constant representing all HTTP methods in lowercase.
|
|
11
|
+
*/
|
|
12
|
+
export const METHOD_NAME_ALL_LOWERCASE = 'all';
|
|
13
|
+
/**
|
|
14
|
+
* Array of supported HTTP methods.
|
|
15
|
+
*/
|
|
16
|
+
export const METHODS = ['get', 'post', 'put', 'delete', 'options', 'patch'];
|
|
17
|
+
/**
|
|
18
|
+
* Error message indicating that a route cannot be added because the matcher is already built.
|
|
19
|
+
*/
|
|
20
|
+
export const MESSAGE_MATCHER_IS_ALREADY_BUILT = 'Can not add a route since the matcher is already built.';
|
|
21
|
+
/**
|
|
22
|
+
* Error class representing an unsupported path error.
|
|
23
|
+
*/
|
|
24
|
+
export class UnsupportedPathError extends Error {
|
|
25
|
+
}
|