ovr 5.0.0 → 6.0.0

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.
Files changed (86) hide show
  1. package/dist/LICENSE.md +26 -0
  2. package/dist/app/index.d.ts +49 -83
  3. package/dist/app/index.d.ts.map +1 -1
  4. package/dist/app/index.js +40 -92
  5. package/dist/context/index.d.ts +138 -0
  6. package/dist/context/index.d.ts.map +1 -0
  7. package/dist/context/index.js +218 -0
  8. package/dist/cookie/index.d.ts +121 -0
  9. package/dist/cookie/index.d.ts.map +1 -0
  10. package/dist/cookie/index.js +56 -0
  11. package/dist/index.d.ts +6 -7
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +4 -6
  14. package/dist/jsx/{intrinsic-elements.d.ts → elements.d.ts} +14 -7
  15. package/dist/jsx/elements.d.ts.map +1 -0
  16. package/dist/jsx/index.d.ts +37 -52
  17. package/dist/jsx/index.d.ts.map +1 -1
  18. package/dist/jsx/index.js +71 -200
  19. package/dist/middleware/index.d.ts +22 -0
  20. package/dist/middleware/index.d.ts.map +1 -0
  21. package/dist/multipart/index.d.ts +122 -0
  22. package/dist/multipart/index.d.ts.map +1 -0
  23. package/dist/multipart/index.js +341 -0
  24. package/dist/render/index.d.ts +78 -0
  25. package/dist/render/index.d.ts.map +1 -0
  26. package/dist/render/index.js +248 -0
  27. package/dist/route/index.d.ts +147 -0
  28. package/dist/route/index.d.ts.map +1 -0
  29. package/dist/route/index.js +126 -0
  30. package/dist/trie/index.d.ts +30 -30
  31. package/dist/trie/index.d.ts.map +1 -1
  32. package/dist/trie/index.js +67 -82
  33. package/dist/util/index.d.ts +38 -0
  34. package/dist/util/index.d.ts.map +1 -0
  35. package/dist/util/index.js +88 -0
  36. package/package.json +3 -3
  37. package/src/app/index.ts +99 -224
  38. package/src/context/index.ts +262 -0
  39. package/src/cookie/index.ts +189 -0
  40. package/src/index.ts +6 -7
  41. package/src/jsx/{intrinsic-elements.ts → elements.ts} +14 -7
  42. package/src/jsx/index.ts +81 -223
  43. package/src/middleware/index.ts +29 -0
  44. package/src/multipart/index.ts +486 -0
  45. package/src/render/index.ts +300 -0
  46. package/src/route/index.ts +332 -0
  47. package/src/trie/index.ts +87 -111
  48. package/src/util/index.ts +112 -0
  49. package/dist/app/context.d.ts +0 -149
  50. package/dist/app/context.d.ts.map +0 -1
  51. package/dist/app/context.js +0 -246
  52. package/dist/app/helper/get.d.ts +0 -30
  53. package/dist/app/helper/get.d.ts.map +0 -1
  54. package/dist/app/helper/get.js +0 -33
  55. package/dist/app/helper/index.d.ts +0 -51
  56. package/dist/app/helper/index.d.ts.map +0 -1
  57. package/dist/app/helper/index.js +0 -82
  58. package/dist/app/helper/post.d.ts +0 -35
  59. package/dist/app/helper/post.d.ts.map +0 -1
  60. package/dist/app/helper/post.js +0 -15
  61. package/dist/app/memo/index.d.ts +0 -12
  62. package/dist/app/memo/index.d.ts.map +0 -1
  63. package/dist/app/memo/index.js +0 -34
  64. package/dist/jsx/chunk/index.d.ts +0 -38
  65. package/dist/jsx/chunk/index.d.ts.map +0 -1
  66. package/dist/jsx/chunk/index.js +0 -69
  67. package/dist/jsx/intrinsic-elements.d.ts.map +0 -1
  68. package/dist/jsx/merge-async-generators.d.ts +0 -14
  69. package/dist/jsx/merge-async-generators.d.ts.map +0 -1
  70. package/dist/jsx/merge-async-generators.js +0 -42
  71. package/dist/types/index.d.ts +0 -17
  72. package/dist/types/index.d.ts.map +0 -1
  73. package/dist/util/hash.d.ts +0 -11
  74. package/dist/util/hash.d.ts.map +0 -1
  75. package/dist/util/hash.js +0 -16
  76. package/src/app/context.ts +0 -303
  77. package/src/app/helper/get.ts +0 -46
  78. package/src/app/helper/index.ts +0 -156
  79. package/src/app/helper/post.ts +0 -54
  80. package/src/app/memo/index.ts +0 -40
  81. package/src/jsx/chunk/index.ts +0 -79
  82. package/src/jsx/merge-async-generators.ts +0 -47
  83. package/src/types/index.ts +0 -42
  84. package/src/util/hash.ts +0 -17
  85. /package/dist/jsx/{intrinsic-elements.js → elements.js} +0 -0
  86. /package/dist/{types → middleware}/index.js +0 -0
@@ -0,0 +1,218 @@
1
+ import { Cookie } from "../cookie/index.js";
2
+ import {} from "../middleware/index.js";
3
+ import { Multipart } from "../multipart/index.js";
4
+ import { Render } from "../render/index.js";
5
+ import { Route } from "../route/index.js";
6
+ import {} from "../trie/index.js";
7
+ import { Hash, Header } from "../util/index.js";
8
+ /** Properties to build the final `Response` with once middleware has run. */
9
+ class PreparedResponse {
10
+ /**
11
+ * `body` used to create the `Response`.
12
+ *
13
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#body)
14
+ */
15
+ body;
16
+ /**
17
+ * `status` used to create the `Response`.
18
+ *
19
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
20
+ */
21
+ status;
22
+ /**
23
+ * `Headers` used to create the `Response`.
24
+ *
25
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Headers)
26
+ */
27
+ headers = new Headers();
28
+ }
29
+ /**
30
+ * Request context.
31
+ *
32
+ * @template Params Parameters created from a route match
33
+ */
34
+ export class Context {
35
+ /**
36
+ * Incoming `Request` to the server.
37
+ *
38
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Request)
39
+ */
40
+ req;
41
+ /**
42
+ * Parsed `URL` created from `req.url`.
43
+ *
44
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/URL)
45
+ */
46
+ url;
47
+ /** Route pattern parameters */
48
+ params = {}; // set after match
49
+ /** Matched `Route` instance */
50
+ route;
51
+ /** Contains the arguments to used create the final `Response` */
52
+ res = new PreparedResponse();
53
+ /** Get, set, and delete cookies. */
54
+ cookie = new Cookie(this);
55
+ /** Forwarded app options */
56
+ #options;
57
+ // for reuse across methods
58
+ static #textHtml = "text/html";
59
+ static #utf8 = "charset=utf-8";
60
+ static #htmlType = `${Context.#textHtml}; ${Context.#utf8}`;
61
+ /**
62
+ * Creates a new `Context` with the current `Request`.
63
+ *
64
+ * @param req Request
65
+ */
66
+ constructor(req, options = {}) {
67
+ this.req = req;
68
+ this.url = new URL(req.url);
69
+ this.#options = options;
70
+ }
71
+ /**
72
+ * Creates an HTML response.
73
+ *
74
+ * @param body HTML body
75
+ * @param status [HTTP response status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
76
+ */
77
+ html(body, status) {
78
+ this.res.body = body;
79
+ this.res.status = status;
80
+ this.res.headers.set(Header.contentType, Context.#htmlType);
81
+ }
82
+ /**
83
+ * Creates a JSON response.
84
+ *
85
+ * @param data passed into JSON.stringify to create the body
86
+ * @param status [HTTP response status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
87
+ */
88
+ json(data, status) {
89
+ this.res.body = JSON.stringify(data);
90
+ this.res.status = status;
91
+ this.res.headers.set(Header.contentType, "application/json");
92
+ }
93
+ /**
94
+ * Creates a plain text response.
95
+ *
96
+ * @param body response body
97
+ * @param status [HTTP response status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
98
+ */
99
+ text(body, status) {
100
+ this.res.body = body;
101
+ this.res.status = status;
102
+ this.res.headers.set(Header.contentType, `text/plain; ${Context.#utf8}`);
103
+ }
104
+ /**
105
+ * Creates a redirect response.
106
+ *
107
+ * @param location redirect `Location` header
108
+ * @param status HTTP status code
109
+ *
110
+ * - [301 Moved Permanently](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/301)
111
+ * - [302 Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302) (default)
112
+ * - [303 See Other](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/303)
113
+ * - [307 Temporary Redirect](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/307)
114
+ * - [308 Permanent Redirect](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308)
115
+ */
116
+ redirect(location, status = 302) {
117
+ this.res.body = null;
118
+ this.res.status = status;
119
+ this.res.headers.set("location", String(location));
120
+ }
121
+ /**
122
+ * Generates an etag from a hash of the string provided.
123
+ * If the etag matches, sets the response to not modified.
124
+ *
125
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag)
126
+ *
127
+ * @param string string to hash
128
+ * @returns `true` if the etag matches, `false` otherwise
129
+ */
130
+ etag(string) {
131
+ const etag = `"${Hash.djb2(string)}"`;
132
+ this.res.headers.set("etag", etag);
133
+ if (this.req.headers.get("if-none-match") === etag) {
134
+ this.res.body = null;
135
+ this.res.status = 304;
136
+ return true;
137
+ }
138
+ return false;
139
+ }
140
+ /**
141
+ * Parse multipart requests.
142
+ *
143
+ * @yields Multipart request `Part`(s)
144
+ *
145
+ * @example
146
+ *
147
+ * ```ts
148
+ * import { Route } from "ovr";
149
+ *
150
+ * const post = Route.post(async (c) => {
151
+ * for await (const part of c.form()) {
152
+ * if (part.name === "email") {
153
+ * // ...
154
+ * }
155
+ * }
156
+ * })
157
+ * ```
158
+ */
159
+ form(options) {
160
+ return new Multipart(this.req, Object.assign({}, this.#options.form, options));
161
+ }
162
+ /**
163
+ * Dispatches the stack of `middleware` provided.
164
+ *
165
+ * @param middleware stack to run
166
+ * @param i current middleware index (default `0`)
167
+ * @returns return value of `middleware[i]`
168
+ */
169
+ async #run(middleware, i = 0) {
170
+ const mw = middleware[i];
171
+ if (!mw)
172
+ return; // end of stack
173
+ const r = await mw(this, // c
174
+ () => this.#run(middleware, i + 1));
175
+ // resolve the return value
176
+ if (r instanceof Response) {
177
+ // overwrite
178
+ this.res.body = r.body;
179
+ this.res.status = r.status;
180
+ // merge
181
+ for (const [name, header] of r.headers) {
182
+ this.res.headers.set(name, header);
183
+ }
184
+ }
185
+ else if (r !== undefined) {
186
+ // something to stream
187
+ const type = this.res.headers.get(Header.contentType);
188
+ this.res.body = Render.stream(r, {
189
+ // other defined types are safe
190
+ safe: Boolean(type && !type.startsWith(Context.#textHtml)),
191
+ });
192
+ if (!type) {
193
+ // default to HTML
194
+ this.res.headers.set(Header.contentType, Context.#htmlType);
195
+ }
196
+ // do not overwrite/remove status - that way user can set it before returning
197
+ }
198
+ }
199
+ /**
200
+ * Composes a stack of `middleware` into a `Response`.
201
+ *
202
+ * @param c Context
203
+ * @param middleware stack to compose
204
+ * @returns constructed `Response`
205
+ */
206
+ static async compose(c, middleware) {
207
+ await c.#run(middleware);
208
+ if (c.req.method === "HEAD") {
209
+ if (c.res.body instanceof ReadableStream) {
210
+ // cancel unused stream to prevent leaks
211
+ await c.res.body.cancel("HEAD");
212
+ }
213
+ c.res.body = null;
214
+ }
215
+ Object.freeze(c.res);
216
+ return new Response(c.res.body, c.res);
217
+ }
218
+ }
@@ -0,0 +1,121 @@
1
+ import type { Context } from "../context/index.js";
2
+ export declare namespace Cookie {
3
+ type BaseOptions = {
4
+ /**
5
+ * Specifies the domain for which the cookie is valid.
6
+ * If not specified, this defaults to the host portion of the current document location.
7
+ */
8
+ readonly domain?: string;
9
+ /**
10
+ * The maximum lifetime of the cookie as an HTTP-date timestamp.
11
+ * If unspecified, the cookie becomes a session cookie.
12
+ */
13
+ readonly expires?: Date;
14
+ /**
15
+ * If true, the cookie is inaccessible to the JavaScript `Document.cookie` API.
16
+ * Used to help prevent cross-site scripting (XSS) attacks.
17
+ */
18
+ readonly httpOnly?: boolean;
19
+ /**
20
+ * The number of **seconds** until the cookie expires.
21
+ * A zero or negative number will expire the cookie immediately.
22
+ */
23
+ readonly maxAge?: number;
24
+ /**
25
+ * Specifies the path that must exist in the requested URL for the browser
26
+ * to send the Cookie header.
27
+ *
28
+ * @default "/"
29
+ */
30
+ readonly path?: string;
31
+ /** Determines which cookies to keep when the browser limit is exceeded. */
32
+ readonly priority?: "Low" | "Medium" | "High";
33
+ };
34
+ type HostPrefixOptions = BaseOptions & {
35
+ /**
36
+ * Limits the scope of the cookie to a secure context (HTTPS).
37
+ * **Requirement:** `__Host-` cookies must be Secure.
38
+ */
39
+ readonly secure: true;
40
+ /**
41
+ * Specifies the path that must exist in the requested URL.
42
+ * **Requirement:** `__Host-` cookies must use the path "/".
43
+ */
44
+ readonly path?: "/";
45
+ /**
46
+ * Specifies the domain for which the cookie is valid.
47
+ * **Requirement:** `__Host-` cookies must not have a defined domain.
48
+ */
49
+ readonly domain?: never;
50
+ /** Controls whether the cookie is sent with cross-site requests. */
51
+ readonly sameSite?: "Lax" | "Strict" | "None";
52
+ /** Indicates that the cookie should be stored using partitioned storage (CHIPS). */
53
+ readonly partitioned?: boolean;
54
+ };
55
+ type SecurePrefixOptions = BaseOptions & {
56
+ /**
57
+ * Limits the scope of the cookie to a secure context (HTTPS).
58
+ * **Requirement:** `__Secure-` cookies must be Secure.
59
+ */
60
+ readonly secure: true;
61
+ /** Controls whether the cookie is sent with cross-site requests. */
62
+ readonly sameSite?: "Lax" | "Strict" | "None";
63
+ /** Indicates that the cookie should be stored using partitioned storage (CHIPS). */
64
+ readonly partitioned?: boolean;
65
+ };
66
+ type SecureOptions = BaseOptions & {
67
+ /** Limits the scope of the cookie to a secure context (HTTPS). */
68
+ readonly secure: true;
69
+ /** Controls whether the cookie is sent with cross-site requests. */
70
+ readonly sameSite?: "Lax" | "Strict" | "None";
71
+ /** Indicates that the cookie should be stored using partitioned storage (CHIPS). */
72
+ readonly partitioned?: boolean;
73
+ };
74
+ type InsecureOptions = BaseOptions & {
75
+ /** Limits the scope of the cookie to a secure context (HTTPS). */
76
+ readonly secure?: false;
77
+ /**
78
+ * Controls whether the cookie is sent with cross-site requests.
79
+ * **Note:** `"none"` is not allowed unless `secure` is true.
80
+ */
81
+ readonly sameSite?: "Lax" | "Strict";
82
+ /**
83
+ * Indicates that the cookie should be stored using partitioned storage (CHIPS).
84
+ * **Note:** `true` is not allowed unless `secure` is true.
85
+ */
86
+ readonly partitioned?: false;
87
+ };
88
+ /**
89
+ * Configuration options for setting a cookie.
90
+ *
91
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie)
92
+ */
93
+ export type Options<Name extends string = string> = Name extends `__${"host" | "secure"}-${string}` ? never : Name extends `__Host-${string}` ? HostPrefixOptions : Name extends `__Secure-${string}` ? SecurePrefixOptions : SecureOptions | InsecureOptions;
94
+ export {};
95
+ }
96
+ /** HTTP cookie manager */
97
+ export declare class Cookie {
98
+ #private;
99
+ /**
100
+ * Create a new cookie manager.
101
+ *
102
+ * @param c Request context
103
+ */
104
+ constructor(c: Context);
105
+ /**
106
+ * Retrieves a specific cookie value from the request headers.
107
+ *
108
+ * @param name Name of the cookie to retrieve
109
+ * @returns Value of the cookie, or `undefined` if not found
110
+ */
111
+ get(name: string): string | undefined;
112
+ /**
113
+ * Sets a cookie on the response using the `Set-Cookie` header.
114
+ *
115
+ * @param name Name of the cookie
116
+ * @param value Value to store
117
+ * @param options Options configuration
118
+ */
119
+ set<Name extends string>(name: Name, value: string, ...[options,]: Name extends `__${"Secure" | "secure" | "Host" | "host"}-${string}` ? [options: Cookie.Options<Name>] : [options?: Cookie.Options<Name>]): void;
120
+ }
121
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cookie/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAGnD,yBAAiB,MAAM,CAAC;IACvB,KAAK,WAAW,GAAG;QAClB;;;WAGG;QACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAEzB;;;WAGG;QACH,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;QAExB;;;WAGG;QACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAE5B;;;WAGG;QACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAEzB;;;;;WAKG;QACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAEvB,2EAA2E;QAC3E,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAA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OAAO,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,IAC/C,IAAI,SAAS,KAAK,MAAM,GAAG,QAAQ,IAAI,MAAM,EAAE,GAC5C,KAAK,GACL,IAAI,SAAS,UAAU,MAAM,EAAE,GAC9B,iBAAiB,GACjB,IAAI,SAAS,YAAY,MAAM,EAAE,GAChC,mBAAmB,GACnB,aAAa,GAAG,eAAe,CAAC;;CACtC;AAED,0BAA0B;AAC1B,qBAAa,MAAM;;IAOlB;;;;OAIG;gBACS,CAAC,EAAE,OAAO;IAItB;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM;IAMhB;;;;;;OAMG;IACH,GAAG,CAAC,IAAI,SAAS,MAAM,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,EACb,GAAG,CACF,OAAO,EACP,EAAE,IAAI,SAAS,KAAK,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,IAAI,MAAM,EAAE,GACnE,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAC/B,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;CAqBpC"}
@@ -0,0 +1,56 @@
1
+ import { Header } from "../util/index.js";
2
+ /** HTTP cookie manager */
3
+ export class Cookie {
4
+ /** Current context */
5
+ #c;
6
+ /** Lazily parsed cookie map */
7
+ #parsed;
8
+ /**
9
+ * Create a new cookie manager.
10
+ *
11
+ * @param c Request context
12
+ */
13
+ constructor(c) {
14
+ this.#c = c;
15
+ }
16
+ /**
17
+ * Retrieves a specific cookie value from the request headers.
18
+ *
19
+ * @param name Name of the cookie to retrieve
20
+ * @returns Value of the cookie, or `undefined` if not found
21
+ */
22
+ get(name) {
23
+ return (this.#parsed ??= Header.params(this.#c.req.headers.get("cookie")))[name];
24
+ }
25
+ /**
26
+ * Sets a cookie on the response using the `Set-Cookie` header.
27
+ *
28
+ * @param name Name of the cookie
29
+ * @param value Value to store
30
+ * @param options Options configuration
31
+ */
32
+ set(name, value, ...[options,]) {
33
+ options ??= {};
34
+ const cookie = [
35
+ `${name}=${encodeURIComponent(value)}`,
36
+ `Path=${options.path ?? "/"}`,
37
+ ];
38
+ if (options.secure)
39
+ cookie.push("Secure");
40
+ if (options.httpOnly)
41
+ cookie.push("HttpOnly");
42
+ if (options.partitioned)
43
+ cookie.push("Partitioned");
44
+ if (options.domain)
45
+ cookie.push(`Domain=${options.domain}`);
46
+ if (options.priority)
47
+ cookie.push(`Priority=${options.priority}`);
48
+ if (options.sameSite)
49
+ cookie.push(`SameSite=${options.sameSite}`);
50
+ if (options.maxAge !== undefined)
51
+ cookie.push(`Max-Age=${options.maxAge}`);
52
+ if (options.expires)
53
+ cookie.push(`Expires=${options.expires.toUTCString()}`);
54
+ this.#c.res.headers.append("set-cookie", cookie.join("; "));
55
+ }
56
+ }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- export { jsx, toGenerator, toStream, toString, type JSX } from "./jsx/index.js";
2
- export { Chunk } from "./jsx/chunk/index.js";
3
- export { Trie, Route } from "./trie/index.js";
4
- export { App, type Middleware, type Next } from "./app/index.js";
5
- export { Context } from "./app/context.js";
6
- export { Get } from "./app/helper/get.js";
7
- export { Post } from "./app/helper/post.js";
1
+ export { App } from "./app/index.js";
2
+ export { Route } from "./route/index.js";
3
+ export { Multipart } from "./multipart/index.js";
4
+ export { JSX } from "./jsx/index.js";
5
+ export { Render } from "./render/index.js";
6
+ export type { Middleware } from "./middleware/index.js";
8
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,5 @@
1
- export { jsx, toGenerator, toStream, toString } from "./jsx/index.js";
2
- export { Chunk } from "./jsx/chunk/index.js";
3
- export { Trie, Route } from "./trie/index.js";
4
1
  export { App } from "./app/index.js";
5
- export { Context } from "./app/context.js";
6
- export { Get } from "./app/helper/get.js";
7
- export { Post } from "./app/helper/post.js";
2
+ export { Route } from "./route/index.js";
3
+ export { Multipart } from "./multipart/index.js";
4
+ export { JSX } from "./jsx/index.js";
5
+ export { Render } from "./render/index.js";
@@ -1,5 +1,11 @@
1
- import type { JSX, Props } from "./index.js";
2
- type Attributes<P extends Props = Props, Children = JSX.Element> = Partial<{
1
+ import type { JSX } from "./index.js";
2
+ /**
3
+ * HTML Attributes
4
+ *
5
+ * @template P Additional props
6
+ * @template Children For void elements - `undefined` is passed in here
7
+ */
8
+ type Attributes<P extends JSX.Props = JSX.Props, Children = JSX.Element> = Partial<{
3
9
  children: Children;
4
10
  accesskey: string;
5
11
  anchor: string;
@@ -57,7 +63,7 @@ type Attributes<P extends Props = Props, Children = JSX.Element> = Partial<{
57
63
  "aria-owns": string;
58
64
  "aria-relevant": "additions" | "all" | "removals" | "text" | "additions text";
59
65
  "aria-roledescription": string;
60
- }> & Props & Partial<P>;
66
+ }> & JSX.Props & Partial<P>;
61
67
  type SharedAttributes = {
62
68
  autocomplete: "on" | "off" | (string & {});
63
69
  blocking: "render";
@@ -444,6 +450,7 @@ type VideoAttributes = Attributes<{
444
450
  src: string;
445
451
  width: string | number;
446
452
  }>;
453
+ /** Standard HTML elements */
447
454
  export type IntrinsicElements = Record<string, Attributes> & {
448
455
  a: AAttributes;
449
456
  abbr: Attributes;
@@ -457,7 +464,7 @@ export type IntrinsicElements = Record<string, Attributes> & {
457
464
  bdo: Attributes;
458
465
  blockquote: BlockquoteAttributes;
459
466
  body: BodyAttributes;
460
- br: Attributes<Props, undefined>;
467
+ br: Attributes<JSX.Props, undefined>;
461
468
  button: ButtonAttributes;
462
469
  canvas: CanvasAttributes;
463
470
  caption: Attributes;
@@ -491,7 +498,7 @@ export type IntrinsicElements = Record<string, Attributes> & {
491
498
  head: Attributes;
492
499
  header: Attributes;
493
500
  hgroup: Attributes;
494
- hr: Attributes<Props, undefined>;
501
+ hr: Attributes<JSX.Props, undefined>;
495
502
  html: HtmlAttributes;
496
503
  iframe: IframeAttributes;
497
504
  i: Attributes;
@@ -555,7 +562,7 @@ export type IntrinsicElements = Record<string, Attributes> & {
555
562
  ul: Attributes;
556
563
  var: Attributes;
557
564
  video: VideoAttributes;
558
- wbr: Attributes<Props, undefined>;
565
+ wbr: Attributes<JSX.Props, undefined>;
559
566
  };
560
567
  export {};
561
- //# sourceMappingURL=intrinsic-elements.d.ts.map
568
+ //# sourceMappingURL=elements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/jsx/elements.ts"],"names":[],"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EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,eAAe,CAAC;IACvB,GAAG,EAAE,UAAU,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC;IACpB,GAAG,EAAE,UAAU,CAAC;IAChB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAClB,EAAE,EAAE,YAAY,CAAC;IACjB,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,KAAK,EAAE,UAAU,CAAC;IAClB,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,eAAe,CAAC;IACvB,CAAC,EAAE,UAAU,CAAC;IACd,EAAE,EAAE,UAAU,CAAC;IACf,GAAG,EAAE,UAAU,CAAC;IAChB,KAAK,EAAE,eAAe,CAAC;IACvB,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CACtC,CAAC"}
@@ -1,58 +1,43 @@
1
- import type { MaybeFunction, MaybePromise } from "../types/index.js";
2
- import { Chunk } from "./chunk/index.js";
3
- import type { IntrinsicElements as IE } from "./intrinsic-elements.js";
4
- /** ovr JSX namespace */
1
+ import type { Util } from "../util/index.js";
2
+ import type { IntrinsicElements as IE } from "./elements.js";
5
3
  export declare namespace JSX {
6
4
  /** Standard HTML elements */
7
5
  interface IntrinsicElements extends IE {
8
6
  }
9
- /** ovr Element */
10
- type Element = MaybeFunction<MaybePromise<string | number | bigint | boolean | object | null | undefined | Symbol | Iterable<Element> | AsyncIterable<Element>>>;
7
+ /** JSX Element */
8
+ type Element = Util.MaybeFunction<Util.MaybePromise<string | number | bigint | boolean | object | null | undefined | Symbol | Iterable<Element> | AsyncIterable<Element>>>;
9
+ /** Unknown component props */
10
+ type Props = Record<string, JSX.Element>;
11
11
  }
12
- /** Unknown component props */
13
- export type Props = Record<string, JSX.Element>;
14
- /**
15
- * The main function of the JSX transform cycle, each time JSX is encountered
16
- * it is passed into this function to be resolved. This function doesn't need to be
17
- * called recursively, JSX will be transformed into these `jsx()` function calls.
18
- *
19
- * @param tag string or function component
20
- * @param props object containing all the properties and attributes passed to the element or component
21
- * @returns `AsyncGenerator` that yields `Chunk`s of HTML
22
- */
23
- export declare function jsx<P extends Props = Props>(tag: ((props: P) => JSX.Element) | string, props: P): AsyncGenerator<Chunk, void, unknown>;
24
- /**
25
- * JSX requires a `Fragment` export to resolve `<></>`
26
- *
27
- * @param props containing `children` to render
28
- * @returns async generator that yields concatenated children
29
- */
30
- export declare function Fragment(props?: {
31
- children?: JSX.Element;
32
- }): AsyncGenerator<Chunk, void, unknown>;
33
- /**
34
- * @param element
35
- * @yields `Chunk`s of HTML as the `Element` resolves
36
- */
37
- export declare function toGenerator(element: JSX.Element): AsyncGenerator<Chunk, void, unknown>;
38
- /**
39
- * Converts a `JSX.Element` into a fully concatenated string of HTML.
40
- *
41
- * ### WARNING
42
- *
43
- * This negates streaming benefits and buffers the result into a string.
44
- * Use `toGenerator` whenever possible.
45
- *
46
- * @param element
47
- * @returns Concatenated HTML
48
- */
49
- export declare const toString: (element: JSX.Element) => Promise<string>;
50
- /**
51
- * `toGenerator` piped into a `ReadableStream`.
52
- * Use `toGenerator` when possible to avoid the overhead of the stream.
53
- *
54
- * @param element
55
- * @returns `ReadableStream` of HTML
56
- */
57
- export declare const toStream: (element: JSX.Element) => ReadableStream<Uint8Array<ArrayBufferLike>>;
12
+ /** ovr JSX */
13
+ export declare class JSX {
14
+ #private;
15
+ /**
16
+ * The main function of the JSX transform cycle, each time JSX is encountered
17
+ * it is passed into `jsx` to be resolved.
18
+ *
19
+ * @param tag tag name or function component
20
+ * @param props object containing all the properties and attributes passed to the element or component
21
+ * @yields `Chunk`s of HTML
22
+ */
23
+ static jsx<P extends JSX.Props = JSX.Props>(tag: ((props: P) => JSX.Element) | string, props: P): AsyncGenerator<{
24
+ "__#private@#value": string;
25
+ toString(): string;
26
+ concat(chunk: /*elided*/ any): void;
27
+ }, void, unknown>;
28
+ /**
29
+ * JSX requires a `Fragment` export to resolve `<></>`
30
+ *
31
+ * @param props containing `children` to render
32
+ * @yields concatenated children
33
+ */
34
+ static Fragment(props: {
35
+ children?: JSX.Element;
36
+ }): AsyncGenerator<{
37
+ "__#private@#value": string;
38
+ toString(): string;
39
+ concat(chunk: /*elided*/ any): void;
40
+ }, void, unknown>;
41
+ }
42
+ export declare const jsx: typeof JSX.jsx, Fragment: typeof JSX.Fragment;
58
43
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jsx/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,IAAI,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAGvE,wBAAwB;AACxB,yBAAiB,GAAG,CAAC;IACpB,6BAA6B;IAC7B,UAAiB,iBAAkB,SAAQ,EAAE;KAAG;IAEhD,kBAAkB;IAClB,KAAY,OAAO,GAAG,aAAa,CAClC,YAAY,CACT,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,IAAI,GACJ,SAAS,GACT,MAAM,GACN,QAAQ,CAAC,OAAO,CAAC,GACjB,aAAa,CAAC,OAAO,CAAC,CACxB,CACD,CAAC;CACF;AAED,8BAA8B;AAC9B,MAAM,MAAM,KAAK,GAAG,MAAM,CA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