ovr 0.0.1 → 0.0.2

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/README.md CHANGED
@@ -1 +1 @@
1
- # oru
1
+ # ovr
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Escapes strings of HTML.
3
+ *
4
+ * @param v value to escape
5
+ * @param attr set to `true` if the value is an attribute, otherwise it's a string of HTML content
6
+ * @returns escaped string of HTML
7
+ */
8
+ export declare const escape: (v: unknown, attr?: boolean) => string;
@@ -0,0 +1,33 @@
1
+ // Copied and adapted from https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/escaping.js
2
+ const attrRegex = /[&"<]/g;
3
+ const contentRegex = /[&<]/g;
4
+ /**
5
+ * Escapes strings of HTML.
6
+ *
7
+ * @param v value to escape
8
+ * @param attr set to `true` if the value is an attribute, otherwise it's a string of HTML content
9
+ * @returns escaped string of HTML
10
+ */
11
+ export const escape = (v, attr) => {
12
+ const s = String(v ?? "");
13
+ const regex = attr ? attrRegex : contentRegex;
14
+ // search starts at beginning of the string
15
+ regex.lastIndex = 0;
16
+ // tracks the position of the last successful match in the input string
17
+ let start = 0;
18
+ let result = "";
19
+ // since `g` flag is used, regex maintains state with each loop,
20
+ // checking from the lastIndex onward each time
21
+ while (regex.test(s)) {
22
+ // index of the match
23
+ const i = regex.lastIndex - 1;
24
+ const match = s[i];
25
+ result +=
26
+ // everything that didn't match during this test
27
+ s.slice(start, i) +
28
+ // replacement
29
+ (match === "&" ? "&amp;" : match === '"' ? "&quot;" : "&lt;");
30
+ start = regex.lastIndex;
31
+ }
32
+ return result + s.slice(start);
33
+ };
package/dist/index.d.ts CHANGED
@@ -1 +1,5 @@
1
- export {};
1
+ export { Context } from "./router/context.js";
2
+ export { Router, type Middleware, type Params } from "./router/index.js";
3
+ export { Node, Route } from "./trie/index.js";
4
+ export { escape } from "./escape/index.js";
5
+ export { jsx, jsx as jsxs, jsx as jsxDEV, Fragment, toGenerator, toString, type FC, type JSX, } from "./jsx/index.js";
package/dist/index.js CHANGED
@@ -1 +1,5 @@
1
- export {};
1
+ export { Context } from "./router/context.js";
2
+ export { Router } from "./router/index.js";
3
+ export { Node, Route } from "./trie/index.js";
4
+ export { escape } from "./escape/index.js";
5
+ export { jsx, jsx as jsxs, jsx as jsxDEV, Fragment, toGenerator, toString, } from "./jsx/index.js";
@@ -0,0 +1,562 @@
1
+ import type { JSX, ElementProps } from "./index.js";
2
+ type Attributes<T extends ElementProps = ElementProps> = Partial<{
3
+ children: JSX.Element;
4
+ accesskey: string;
5
+ anchor: string;
6
+ autocapitalize: "on" | "off" | "characters" | "words" | "sentences";
7
+ autocorrect: "on" | "off";
8
+ autofocus: boolean;
9
+ class: string;
10
+ className: string;
11
+ contenteditable: string;
12
+ dir: string;
13
+ draggable: boolean;
14
+ enterkeyhint: string;
15
+ exportparts: string;
16
+ hidden: boolean;
17
+ id: string;
18
+ inert: boolean;
19
+ inputmode: string;
20
+ is: string;
21
+ itemid: string;
22
+ itemprop: string;
23
+ itemref: string;
24
+ itemscope: boolean;
25
+ itemtype: string;
26
+ lang: string;
27
+ nonce: string;
28
+ part: string;
29
+ popover: string;
30
+ role: "alert" | "alertdialog" | "application" | "article" | "banner" | "button" | "cell" | "checkbox" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "dialog" | "directory" | "document" | "feed" | "figure" | "form" | "grid" | "gridcell" | "group" | "heading" | "img" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "marquee" | "math" | "menu" | "menubar" | "menuitem" | "menuitemcheckbox" | "menuitemradio" | "navigation" | "none" | "note" | "option" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "search" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "textbox" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem";
31
+ slot: string;
32
+ spellcheck: "true" | "false";
33
+ style: string;
34
+ tabindex: number;
35
+ title: string;
36
+ translate: string;
37
+ virtualkeyboardpolicy: string;
38
+ writingsuggestions: boolean;
39
+ "aria-atomic": "true" | "false";
40
+ "aria-busy": "true" | "false";
41
+ "aria-controls": string;
42
+ "aria-current": "page" | "step" | "location" | "date" | "time" | "true" | "false";
43
+ "aria-describedby": string;
44
+ "aria-description": string;
45
+ "aria-details": string;
46
+ "aria-disabled": "true" | "false";
47
+ "aria-dropeffect": "none" | "copy" | "execute" | "link" | "move" | "popup";
48
+ "aria-errormessage": string;
49
+ "aria-flowto": string;
50
+ "aria-grabbed": "true" | "false";
51
+ "aria-haspopup": "menu" | "listbox" | "tree" | "grid" | "dialog" | "true" | "false";
52
+ "aria-hidden": "true" | "false";
53
+ "aria-invalid": "grammar" | "false" | "spelling" | "true";
54
+ "aria-keyshortcuts": string;
55
+ "aria-label": string;
56
+ "aria-labelledby": string;
57
+ "aria-live": "assertive" | "off" | "polite";
58
+ "aria-owns": string;
59
+ "aria-relevant": "additions" | "all" | "removals" | "text" | "additions text";
60
+ "aria-roledescription": string;
61
+ }> & ElementProps & Partial<T>;
62
+ type VoidAttributes<T extends ElementProps = ElementProps> = Omit<Attributes<T>, "children">;
63
+ type SharedAttributes = {
64
+ autocomplete: "on" | "off" | (string & {});
65
+ blocking: "render";
66
+ crossorigin: "anonymous" | "use-credentials";
67
+ referrerpolicy: "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
68
+ target: "_self" | "_blank" | "_parent" | "_top";
69
+ preload: "none" | "metadata" | "auto";
70
+ controlslist: "nodownload" | "nofullscreen" | "noremoteplayback" | (string & {});
71
+ enctype: "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
72
+ method: "get" | "post" | "dialog";
73
+ loading: "eager" | "lazy";
74
+ fetchpriority: "high" | "low" | "auto";
75
+ popovertargetaction: "hide" | "show" | "toggle";
76
+ };
77
+ type AAttributes = Attributes<{
78
+ download: string | boolean;
79
+ href: string;
80
+ hreflang: string;
81
+ ping: string;
82
+ referrerpolicy: SharedAttributes["referrerpolicy"];
83
+ rel: "alternate" | "author" | "bookmark" | "external" | "help" | "license" | "me" | "next" | "nofollow" | "noopener" | "noreferrer" | "opener" | "prev" | "privacy-policy" | "search" | "tag" | "terms-of-service" | (string & {});
84
+ target: SharedAttributes["target"];
85
+ type: string;
86
+ }>;
87
+ type AreaAttributes = VoidAttributes<{
88
+ alt: string;
89
+ coords: "rect" | "circle" | "poly";
90
+ download: string | boolean;
91
+ href: string;
92
+ ping: string;
93
+ referrerpolicy: SharedAttributes["referrerpolicy"];
94
+ rel: AAttributes["rel"];
95
+ shape: "rect" | "circle" | "poly" | "default";
96
+ target: SharedAttributes["target"];
97
+ }>;
98
+ type AudioAttributes = Attributes<{
99
+ autoplay: boolean;
100
+ controls: boolean;
101
+ controlslist: SharedAttributes["controlslist"];
102
+ crossorigin: SharedAttributes["crossorigin"];
103
+ disableremoteplayback: boolean;
104
+ loop: boolean;
105
+ muted: boolean;
106
+ preload: SharedAttributes["preload"];
107
+ src: string;
108
+ }>;
109
+ type BaseAttributes = VoidAttributes<{
110
+ href: string;
111
+ target: SharedAttributes["target"];
112
+ }>;
113
+ type BlockquoteAttributes = Attributes<{
114
+ cite: string;
115
+ }>;
116
+ type BodyAttributes = Attributes<{
117
+ onafterprint: string;
118
+ onbeforeprint: string;
119
+ onbeforeunload: string;
120
+ onblur: string;
121
+ onerror: string;
122
+ onfocus: string;
123
+ onhashchange: string;
124
+ onlanguagechange: string;
125
+ onload: string;
126
+ onmessage: string;
127
+ onmessageerror: string;
128
+ onoffline: string;
129
+ ononline: string;
130
+ onpageswap: string;
131
+ onpagehide: string;
132
+ onpagereveal: string;
133
+ onpageshow: string;
134
+ onpopstate: string;
135
+ onresize: string;
136
+ onrejectionhandled: string;
137
+ onstorage: string;
138
+ onunhandledrejection: string;
139
+ onunload: string;
140
+ }>;
141
+ type ButtonAttributes = Attributes<{
142
+ command: string;
143
+ commandfor: string;
144
+ disabled: boolean;
145
+ form: string;
146
+ formaction: string;
147
+ formenctype: SharedAttributes["enctype"];
148
+ formmethod: SharedAttributes["method"];
149
+ formnovalidate: boolean;
150
+ formtarget: SharedAttributes["target"];
151
+ name: string;
152
+ popovertarget: string;
153
+ popovertargetaction: SharedAttributes["popovertargetaction"];
154
+ type: "button" | "submit" | "reset";
155
+ value: string;
156
+ }>;
157
+ type CanvasAttributes = Attributes<{
158
+ height: string;
159
+ ["moz-opaque"]: boolean;
160
+ width: string;
161
+ }>;
162
+ type ColAttributes = VoidAttributes<{
163
+ span: string;
164
+ }>;
165
+ type ColgroupAttributes = Attributes<{
166
+ span: string;
167
+ }>;
168
+ type DataAttributes = Attributes<{
169
+ value: string;
170
+ }>;
171
+ type DelAttributes = Attributes<{
172
+ cite: string;
173
+ datetime: string;
174
+ }>;
175
+ type DetailsAttributes = Attributes<{
176
+ open: boolean;
177
+ name: string;
178
+ }>;
179
+ type DialogAttributes = Attributes<{
180
+ open: boolean;
181
+ }>;
182
+ type EmbedAttributes = VoidAttributes<{
183
+ height: string;
184
+ src: string;
185
+ type: string;
186
+ width: string;
187
+ }>;
188
+ type FieldsetAttributes = Attributes<{
189
+ disabled: boolean;
190
+ form: string;
191
+ name: string;
192
+ }>;
193
+ type FormAttributes = Attributes<{
194
+ ["accept-charset"]: string;
195
+ autocomplete: SharedAttributes["autocomplete"];
196
+ name: string;
197
+ rel: "external" | "help" | "license" | "next" | "nofollow" | "noopener" | "noreferrer" | "opener" | "prev" | "search";
198
+ action: string;
199
+ enctype: SharedAttributes["enctype"];
200
+ method: SharedAttributes["method"];
201
+ novalidate: boolean;
202
+ target: SharedAttributes["target"];
203
+ }>;
204
+ type HtmlAttributes = Attributes<{
205
+ xmlns: string;
206
+ }>;
207
+ type IframeAttributes = Attributes<{
208
+ allow: string;
209
+ allowfullscreen: boolean;
210
+ height: string;
211
+ loading: SharedAttributes["loading"];
212
+ name: string;
213
+ referrerpolicy: SharedAttributes["referrerpolicy"];
214
+ sandbox: string;
215
+ src: string;
216
+ srcdoc: string;
217
+ width: string;
218
+ }>;
219
+ type ImgAttributes = VoidAttributes<{
220
+ alt: string;
221
+ crossorigin: SharedAttributes["crossorigin"];
222
+ decoding: "sync" | "async" | "auto";
223
+ elementtiming: string;
224
+ fetchpriority: SharedAttributes["fetchpriority"];
225
+ height: string;
226
+ ismap: boolean;
227
+ loading: SharedAttributes["loading"];
228
+ referrerpolicy: SharedAttributes["referrerpolicy"];
229
+ sizes: string;
230
+ src: string;
231
+ srcset: string;
232
+ width: string;
233
+ usemap: string;
234
+ }>;
235
+ type InputAttributes = VoidAttributes<{
236
+ accept: string;
237
+ alt: string;
238
+ autocomplete: SharedAttributes["autocomplete"];
239
+ capture: string;
240
+ checked: boolean;
241
+ dirname: string;
242
+ disabled: boolean;
243
+ form: string;
244
+ formaction: string;
245
+ formenctype: SharedAttributes["enctype"];
246
+ formmethod: SharedAttributes["method"];
247
+ formnovalidate: boolean;
248
+ formtarget: SharedAttributes["target"];
249
+ height: string;
250
+ list: string;
251
+ max: string;
252
+ maxlength: string;
253
+ min: string;
254
+ minlength: string;
255
+ multiple: boolean;
256
+ name: string;
257
+ pattern: string;
258
+ placeholder: string;
259
+ popovertarget: string;
260
+ popovertargetaction: SharedAttributes["popovertargetaction"];
261
+ readonly: boolean;
262
+ required: boolean;
263
+ size: string;
264
+ src: string;
265
+ step: string;
266
+ type: "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week";
267
+ value: string;
268
+ width: string;
269
+ }>;
270
+ type InsAttributes = Attributes<{
271
+ cite: string;
272
+ datetime: string;
273
+ }>;
274
+ type LabelAttributes = Attributes<{
275
+ for: string;
276
+ htmlFor: string;
277
+ }>;
278
+ type LiAttributes = Attributes<{
279
+ value: string;
280
+ }>;
281
+ type LinkAttributes = VoidAttributes<{
282
+ as: "audio" | "document" | "embed" | "fetch" | "font" | "image" | "object" | "script" | "style" | "track" | "video" | "worker";
283
+ blocking: SharedAttributes["blocking"];
284
+ crossorigin: SharedAttributes["crossorigin"];
285
+ disabled: boolean;
286
+ fetchpriority: SharedAttributes["fetchpriority"];
287
+ href: string;
288
+ hreflang: string;
289
+ imagesizes: string;
290
+ imagesrcset: string;
291
+ integrity: string;
292
+ media: string;
293
+ referrerpolicy: "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "unsafe-url";
294
+ rel: "alternate" | "author" | "canonical" | "dns-prefetch" | "expect" | "help" | "icon" | "license" | "manifest" | "me" | "modulepreload" | "next" | "pingback" | "preconnect" | "prefetch" | "preload" | "prerender" | "prev" | "privacy-policy" | "search" | "stylesheet" | "terms-of-service" | (string & {});
295
+ sizes: string;
296
+ type: string;
297
+ }>;
298
+ type MapAttributes = Attributes<{
299
+ name: string;
300
+ }>;
301
+ type MetaAttributes = VoidAttributes<{
302
+ charset: "utf-8";
303
+ content: string;
304
+ "http-equiv": "content-security-policy" | "content-type" | "default-style" | "x-ua-compatible" | "refresh";
305
+ media: string;
306
+ name: "application-name" | "author" | "description" | "generator" | "keywords" | "theme-color" | "viewport" | (string & {});
307
+ }>;
308
+ type MeterAttributes = Attributes<{
309
+ value: string;
310
+ min: string;
311
+ max: string;
312
+ low: string;
313
+ high: string;
314
+ optimum: string;
315
+ form: string;
316
+ }>;
317
+ type ObjectAttributes = Attributes<{
318
+ data: string;
319
+ form: string;
320
+ height: string;
321
+ name: string;
322
+ type: string;
323
+ width: string;
324
+ }>;
325
+ type OlAttributes = Attributes<{
326
+ reversed: boolean;
327
+ start: string;
328
+ type: "a" | "A" | "i" | "I" | "1";
329
+ }>;
330
+ type OptgroupAttributes = Attributes<{
331
+ disabled: boolean;
332
+ label: string;
333
+ }>;
334
+ type OptionAttributes = Attributes<{
335
+ disabled: boolean;
336
+ label: string;
337
+ selected: boolean;
338
+ value: string;
339
+ }>;
340
+ type OutputAttributes = Attributes<{
341
+ for: string;
342
+ htmlFor: string;
343
+ form: string;
344
+ name: string;
345
+ }>;
346
+ type ProgressAttributes = Attributes<{
347
+ max: string;
348
+ value: string;
349
+ }>;
350
+ type QAttributes = Attributes<{
351
+ cite: string;
352
+ }>;
353
+ type ScriptAttributes = Attributes<{
354
+ async: boolean;
355
+ blocking: SharedAttributes["blocking"];
356
+ crossorigin: SharedAttributes["crossorigin"];
357
+ defer: boolean;
358
+ fetchpriority: SharedAttributes["fetchpriority"];
359
+ integrity: string;
360
+ nomodule: boolean;
361
+ referrerpolicy: SharedAttributes["referrerpolicy"];
362
+ src: string;
363
+ type: "module" | "importmap" | "speculationrules";
364
+ }>;
365
+ type SelectAttributes = Attributes<{
366
+ autocomplete: SharedAttributes["autocomplete"];
367
+ disabled: boolean;
368
+ form: string;
369
+ multiple: boolean;
370
+ name: string;
371
+ required: boolean;
372
+ size: string;
373
+ }>;
374
+ type SlotAttributes = Attributes<{
375
+ name: string;
376
+ }>;
377
+ type SourceAttributes = VoidAttributes<{
378
+ type: string;
379
+ src: string;
380
+ srcset: string;
381
+ sizes: string;
382
+ media: string;
383
+ height: string;
384
+ width: string;
385
+ }>;
386
+ type StyleAttributes = Attributes<{
387
+ blocking: SharedAttributes["blocking"];
388
+ media: string;
389
+ }>;
390
+ type TdAttributes = Attributes<{
391
+ colspan: string;
392
+ headers: string;
393
+ rowspan: string;
394
+ }>;
395
+ type TemplateAttributes = Attributes<{
396
+ shadowrootmode: "open" | "closed";
397
+ shadowrootclonable: boolean;
398
+ shadowrootdelegatesfocus: boolean;
399
+ shadowrootserializable: boolean;
400
+ }>;
401
+ type TextareaAttributes = Attributes<{
402
+ autocomplete: SharedAttributes["autocomplete"];
403
+ cols: string;
404
+ dirname: string;
405
+ disabled: boolean;
406
+ form: string;
407
+ maxlength: string;
408
+ minlength: string;
409
+ name: string;
410
+ placeholder: string;
411
+ readonly: boolean;
412
+ required: boolean;
413
+ rows: string;
414
+ wrap: "hard" | "soft" | "off";
415
+ }>;
416
+ type ThAttributes = Attributes<{
417
+ abbr: string;
418
+ colspan: string;
419
+ headers: string;
420
+ rowspan: string;
421
+ scope: "row" | "col" | "rowgroup" | "colgroup" | (string & {});
422
+ }>;
423
+ type TimeAttributes = Attributes<{
424
+ datetime: string;
425
+ }>;
426
+ type TrackAttributes = VoidAttributes<{
427
+ default: boolean;
428
+ kind: "subtitles" | "captions" | "chapters" | "metadata";
429
+ label: string;
430
+ src: string;
431
+ srclang: string;
432
+ }>;
433
+ type VideoAttributes = Attributes<{
434
+ autoplay: boolean;
435
+ controls: boolean;
436
+ controlslist: SharedAttributes["controlslist"];
437
+ crossorigin: SharedAttributes["crossorigin"];
438
+ disablepictureinpicture: boolean;
439
+ disableremoteplayback: boolean;
440
+ height: string;
441
+ loop: boolean;
442
+ muted: boolean;
443
+ playsinline: boolean;
444
+ poster: string;
445
+ preload: SharedAttributes["preload"];
446
+ src: string;
447
+ width: string;
448
+ }>;
449
+ export type Elements = Record<string, Attributes> & {
450
+ a: AAttributes;
451
+ abbr: Attributes;
452
+ address: Attributes;
453
+ area: AreaAttributes;
454
+ article: Attributes;
455
+ aside: Attributes;
456
+ audio: AudioAttributes;
457
+ base: BaseAttributes;
458
+ bdi: Attributes;
459
+ bdo: Attributes;
460
+ blockquote: BlockquoteAttributes;
461
+ body: BodyAttributes;
462
+ br: VoidAttributes;
463
+ button: ButtonAttributes;
464
+ canvas: CanvasAttributes;
465
+ caption: Attributes;
466
+ cite: Attributes;
467
+ code: Attributes;
468
+ col: ColAttributes;
469
+ colgroup: ColgroupAttributes;
470
+ data: DataAttributes;
471
+ datalist: Attributes;
472
+ dd: Attributes;
473
+ del: DelAttributes;
474
+ details: DetailsAttributes;
475
+ dfn: Attributes;
476
+ dialog: DialogAttributes;
477
+ div: Attributes;
478
+ dl: Attributes;
479
+ dt: Attributes;
480
+ em: Attributes;
481
+ embed: EmbedAttributes;
482
+ fieldset: FieldsetAttributes;
483
+ figcaption: Attributes;
484
+ figure: Attributes;
485
+ footer: Attributes;
486
+ form: FormAttributes;
487
+ h1: Attributes;
488
+ h2: Attributes;
489
+ h3: Attributes;
490
+ h4: Attributes;
491
+ h5: Attributes;
492
+ h6: Attributes;
493
+ head: Attributes;
494
+ header: Attributes;
495
+ hgroup: Attributes;
496
+ hr: VoidAttributes;
497
+ html: HtmlAttributes;
498
+ iframe: IframeAttributes;
499
+ i: Attributes;
500
+ img: ImgAttributes;
501
+ input: InputAttributes;
502
+ ins: InsAttributes;
503
+ kbd: Attributes;
504
+ label: LabelAttributes;
505
+ legend: Attributes;
506
+ li: LiAttributes;
507
+ link: LinkAttributes;
508
+ main: Attributes;
509
+ map: MapAttributes;
510
+ mark: Attributes;
511
+ menu: Attributes;
512
+ meta: MetaAttributes;
513
+ meter: MeterAttributes;
514
+ nav: Attributes;
515
+ noscript: Attributes;
516
+ object: ObjectAttributes;
517
+ ol: OlAttributes;
518
+ optgroup: OptgroupAttributes;
519
+ option: OptionAttributes;
520
+ output: OutputAttributes;
521
+ p: Attributes;
522
+ picture: Attributes;
523
+ pre: Attributes;
524
+ progress: ProgressAttributes;
525
+ q: QAttributes;
526
+ rp: Attributes;
527
+ rt: Attributes;
528
+ ruby: Attributes;
529
+ s: Attributes;
530
+ samp: Attributes;
531
+ script: ScriptAttributes;
532
+ search: Attributes;
533
+ section: Attributes;
534
+ select: SelectAttributes;
535
+ slot: SlotAttributes;
536
+ small: Attributes;
537
+ source: SourceAttributes;
538
+ span: Attributes;
539
+ strong: Attributes;
540
+ style: StyleAttributes;
541
+ sub: Attributes;
542
+ summary: Attributes;
543
+ sup: Attributes;
544
+ table: Attributes;
545
+ tbody: Attributes;
546
+ td: TdAttributes;
547
+ template: TemplateAttributes;
548
+ textarea: TextareaAttributes;
549
+ tfoot: Attributes;
550
+ th: ThAttributes;
551
+ thead: Attributes;
552
+ time: TimeAttributes;
553
+ title: Attributes;
554
+ tr: Attributes;
555
+ track: TrackAttributes;
556
+ u: Attributes;
557
+ ul: Attributes;
558
+ var: Attributes;
559
+ video: VideoAttributes;
560
+ wbr: VoidAttributes;
561
+ };
562
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,46 @@
1
+ import type { MaybePromise } from "../types.js";
2
+ import type { Elements } from "./elements.js";
3
+ type MaybeFunction<T> = T | (() => T);
4
+ export declare namespace JSX {
5
+ type IntrinsicElements = Elements;
6
+ type Element = MaybeFunction<MaybePromise<string | number | bigint | boolean | object | null | undefined | Symbol | Iterable<Element> | AsyncIterable<Element>>>;
7
+ }
8
+ export type ElementProps = Record<string, JSX.Element>;
9
+ export type Props = Record<string, unknown>;
10
+ export type FC<P = Props> = (props: P) => JSX.Element;
11
+ /**
12
+ * The main function of the jsx transform cycle, each time jsx is encountered
13
+ * it is passed into this function to be resolved.
14
+ *
15
+ * @param tag string or function that refers to the component or element type
16
+ * @param props object containing all the properties and attributes passed to the element or component
17
+ * @returns an async generator that yields parts of HTML
18
+ */
19
+ export declare const jsx: {
20
+ (tag: FC, props: Props): Awaited<JSX.Element>;
21
+ (tag: string, props: ElementProps): Awaited<JSX.Element>;
22
+ };
23
+ /**
24
+ * jsx requires a `Fragment` export to resolve <></>
25
+ *
26
+ * @param props containing `children` to render
27
+ * @returns async generator that yields concatenated children
28
+ */
29
+ export declare function Fragment(props?: {
30
+ children?: JSX.Element;
31
+ }): AsyncGenerator<string, void, unknown>;
32
+ /**
33
+ * @param element
34
+ * @returns async generator that yields concatenated children
35
+ */
36
+ export declare function toGenerator(element: JSX.Element): AsyncGenerator<string, void, unknown>;
37
+ /**
38
+ * Converts a `JSX.Element` into its fully concatenated string representation.
39
+ *
40
+ * WARNING - this negates streaming benefits and buffers the result into a string.
41
+ *
42
+ * @param element
43
+ * @returns A promise that resolves to the concatenated string.
44
+ */
45
+ export declare const toString: (element: JSX.Element) => Promise<string>;
46
+ export {};