@typesafe-html5/typescript 0.2.58

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 (117) hide show
  1. package/README.md +166 -0
  2. package/block/article/article.ts +506 -0
  3. package/block/aside/aside.ts +522 -0
  4. package/block/audio/audio.ts +506 -0
  5. package/block/blockquote/blockquote.ts +522 -0
  6. package/block/body/body.ts +458 -0
  7. package/block/canvas/canvas.ts +538 -0
  8. package/block/caption/caption.ts +506 -0
  9. package/block/colgroup/colgroup.ts +154 -0
  10. package/block/datalist/datalist.ts +506 -0
  11. package/block/dd/dd.ts +506 -0
  12. package/block/del/del.ts +538 -0
  13. package/block/details/details.ts +586 -0
  14. package/block/dialog/dialog.ts +586 -0
  15. package/block/div/div.ts +586 -0
  16. package/block/dl/dl.ts +506 -0
  17. package/block/dt/dt.ts +506 -0
  18. package/block/embed/embed.ts +317 -0
  19. package/block/fieldset/fieldset.ts +570 -0
  20. package/block/figcaption/figcaption.ts +506 -0
  21. package/block/figure/figure.ts +506 -0
  22. package/block/footer/footer.ts +522 -0
  23. package/block/form/form.ts +490 -0
  24. package/block/h1/h1.ts +490 -0
  25. package/block/h2/h2.ts +490 -0
  26. package/block/h3/h3.ts +490 -0
  27. package/block/h4/h4.ts +490 -0
  28. package/block/h5/h5.ts +490 -0
  29. package/block/h6/h6.ts +490 -0
  30. package/block/header/header.ts +298 -0
  31. package/block/hgroup/hgroup.ts +506 -0
  32. package/block/hr/hr.ts +189 -0
  33. package/block/html/html.ts +106 -0
  34. package/block/iframe/iframe.ts +538 -0
  35. package/block/ins/ins.ts +538 -0
  36. package/block/legend/legend.ts +506 -0
  37. package/block/li/li.ts +602 -0
  38. package/block/main/main.ts +538 -0
  39. package/block/map/map.ts +522 -0
  40. package/block/menu/menu.ts +554 -0
  41. package/block/nav/nav.ts +554 -0
  42. package/block/noscript/noscript.ts +282 -0
  43. package/block/object/object.ts +618 -0
  44. package/block/ol/ol.ts +618 -0
  45. package/block/optgroup/optgroup.ts +522 -0
  46. package/block/option/option.ts +618 -0
  47. package/block/p/p.ts +506 -0
  48. package/block/picture/picture.ts +506 -0
  49. package/block/pre/pre.ts +506 -0
  50. package/block/section/section.ts +538 -0
  51. package/block/summary/summary.ts +570 -0
  52. package/block/table/table.ts +570 -0
  53. package/block/tbody/tbody.ts +506 -0
  54. package/block/td/td.ts +666 -0
  55. package/block/template/template.ts +506 -0
  56. package/block/tfoot/tfoot.ts +506 -0
  57. package/block/th/th.ts +682 -0
  58. package/block/thead/thead.ts +506 -0
  59. package/block/tr/tr.ts +682 -0
  60. package/block/ul/ul.ts +570 -0
  61. package/block/video/video.ts +666 -0
  62. package/index.ts +126 -0
  63. package/inline/a/a.ts +682 -0
  64. package/inline/abbr/abbr.ts +490 -0
  65. package/inline/address/address.ts +474 -0
  66. package/inline/b/b.ts +506 -0
  67. package/inline/bdi/bdi.ts +490 -0
  68. package/inline/bdo/bdo.ts +506 -0
  69. package/inline/button/button.ts +826 -0
  70. package/inline/cite/cite.ts +506 -0
  71. package/inline/code/code.ts +506 -0
  72. package/inline/data/data.ts +522 -0
  73. package/inline/dfn/dfn.ts +506 -0
  74. package/inline/em/em.ts +506 -0
  75. package/inline/i/i.ts +506 -0
  76. package/inline/img/img.ts +445 -0
  77. package/inline/input/input.ts +1197 -0
  78. package/inline/kbd/kbd.ts +506 -0
  79. package/inline/label/label.ts +538 -0
  80. package/inline/mark/mark.ts +506 -0
  81. package/inline/meter/meter.ts +554 -0
  82. package/inline/output/output.ts +426 -0
  83. package/inline/progress/progress.ts +490 -0
  84. package/inline/q/q.ts +522 -0
  85. package/inline/rp/rp.ts +506 -0
  86. package/inline/rt/rt.ts +506 -0
  87. package/inline/ruby/ruby.ts +506 -0
  88. package/inline/s/s.ts +506 -0
  89. package/inline/samp/samp.ts +506 -0
  90. package/inline/select/select.ts +810 -0
  91. package/inline/slot/slot.ts +522 -0
  92. package/inline/small/small.ts +506 -0
  93. package/inline/span/span.ts +506 -0
  94. package/inline/strong/strong.ts +506 -0
  95. package/inline/sub/sub.ts +506 -0
  96. package/inline/sup/sup.ts +506 -0
  97. package/inline/svg/svg.ts +618 -0
  98. package/inline/textarea/textarea.ts +874 -0
  99. package/inline/time/time.ts +522 -0
  100. package/inline/u/u.ts +506 -0
  101. package/inline/var/var.ts +506 -0
  102. package/package.json +32 -0
  103. package/tsconfig.json +26 -0
  104. package/void/area/area.ts +397 -0
  105. package/void/base/base.ts +61 -0
  106. package/void/br/br.ts +77 -0
  107. package/void/col/col.ts +77 -0
  108. package/void/head/head.ts +58 -0
  109. package/void/link/link.ts +253 -0
  110. package/void/meta/meta.ts +157 -0
  111. package/void/param/param.ts +93 -0
  112. package/void/script/script.ts +250 -0
  113. package/void/source/source.ts +125 -0
  114. package/void/style/style.ts +154 -0
  115. package/void/title/title.ts +58 -0
  116. package/void/track/track.ts +157 -0
  117. package/void/wbr/wbr.ts +61 -0
@@ -0,0 +1,474 @@
1
+ /**
2
+ * THIS FILE IS AUTOGENERATED. DO NOT EDIT IT.
3
+ *
4
+ * @generated December 28, 2025 12:26:31
5
+ * @component Address
6
+ * @description
7
+ */
8
+
9
+ export interface AddressProps {
10
+ /**
11
+ * Child content or elements
12
+ */
13
+ children?: string | HTMLElement | (string | HTMLElement)[];
14
+ /**
15
+ * specifies a shortcut key (or keys) to activate or focus an element
16
+ */
17
+ accesskey?: string | null | undefined;
18
+ /**
19
+ * Indicates whether assistive technologies should present the entire region as a whole when changes occur.
20
+ */
21
+ 'aria-atomic'?: 'false' | 'true' | boolean | null | undefined;
22
+ /**
23
+ * The aria-busy attribute is used to indicate whether an element is currently busy or not.
24
+ */
25
+ 'aria-busy'?: 'true' | 'false' | boolean | null | undefined;
26
+ /**
27
+ * Identifies the element(s) whose contents or presence are controlled by this element. Value is a list of IDs separated by a space
28
+ */
29
+ 'aria-controls'?: string | null | undefined;
30
+ /**
31
+ * Identifies the element(s) that describes the object. Value is a list of IDs separated by a space
32
+ */
33
+ 'aria-describedby'?: string | null | undefined;
34
+ /**
35
+ * References an element that provides additional details about the current element.
36
+ */
37
+ 'aria-details'?: string | null | undefined;
38
+ /**
39
+ * Defines keyboard shortcuts available for the element.
40
+ */
41
+ 'aria-keyshortcuts'?: string | null | undefined;
42
+ /**
43
+ * Identifies the element(s) that labels the current element. Value is a list of IDs separated by a space
44
+ */
45
+ 'aria-labelledby'?: string | null | undefined;
46
+ /**
47
+ * Defines how updates to the element should be announced to screen readers.
48
+ */
49
+ 'aria-live'?: 'off' | 'polite' | 'assertive' | null | undefined;
50
+ /**
51
+ * Indicates what content changes should be announced in a live region.
52
+ */
53
+ 'aria-relevant'?: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined;
54
+ /**
55
+ * Provides a human-readable custom role description for assistive technologies.
56
+ */
57
+ 'aria-roledescription'?: string | null | undefined;
58
+ /**
59
+ * Represents the autocapitalize behavior of the element
60
+ */
61
+ autocapitalize?: 'none' | 'sentences' | 'words' | 'characters' | null | undefined;
62
+ /**
63
+ * Indicates whether the element is hidden
64
+ */
65
+ autofocus?: boolean | null | undefined;
66
+ /**
67
+ * Indicates whether the element can be edited in place
68
+ */
69
+ contenteditable?: 'true' | 'false' | 'inherit' | boolean | null | undefined;
70
+ /**
71
+ * Represents the text direction of the element
72
+ */
73
+ dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;
74
+ /**
75
+ * Indicates whether the element is draggable
76
+ */
77
+ draggable?: boolean | null | undefined;
78
+ /**
79
+ * Indicates whether the element is hidden
80
+ */
81
+ hidden?: boolean | null | undefined;
82
+ /**
83
+ * used to specify the data entry mode for an input. It helps guide on-screen keyboards (especially on mobile devices) to show the appropriate layout for the expected input type
84
+ */
85
+ inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined;
86
+ /**
87
+ * Specifies the primary language for the element's content
88
+ */
89
+ lang?: string | null | undefined;
90
+ /**
91
+ *
92
+ */
93
+ popover?: 'auto' | 'hint' | 'manual' | null | undefined;
94
+ /**
95
+ * Defines the semantic purpose of an element for assistive technologies.
96
+ */
97
+ role?: 'alert' | 'application' | 'article' | 'banner' | 'button' | 'checkbox' | 'complementary' | 'contentinfo' | 'dialog' | 'form' | 'grid' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'main' | 'menu' | 'menubar' | 'menuitem' | 'navigation' | 'none' | 'presentation' | 'radio' | 'region' | 'search' | 'status' | 'tab' | 'tablist' | 'tabpanel' | 'textbox' | 'toolbar' | 'tooltip' | null | undefined;
98
+ /**
99
+ * Represents a slot in a shadow DOM
100
+ */
101
+ slot?: string | null | undefined;
102
+ /**
103
+ * Represents the spellchecking behavior of the element
104
+ */
105
+ spellcheck?: 'true' | 'false' | boolean | null | undefined;
106
+ /**
107
+ * Represents the CSS inline style of the element
108
+ */
109
+ style?: string | null | undefined;
110
+ /**
111
+ * Represents a tab order of the element
112
+ */
113
+ tabindex?: number | null | undefined;
114
+ /**
115
+ * used to tell user agents whether the content should be translated.
116
+ */
117
+ translate?: 'yes' | 'no' | null | undefined;
118
+ }
119
+
120
+ /**
121
+ * Address -
122
+ */
123
+ export class Address {
124
+ private element: HTMLElement;
125
+
126
+ constructor(props: AddressProps = {}) {
127
+ this.element = document.createElement('address');
128
+ this.applyProps(props);
129
+ }
130
+
131
+ private applyProps(props: AddressProps): void {
132
+ if (props.children !== undefined) {
133
+ this.setChildren(props.children);
134
+ }
135
+ if (props.accesskey !== undefined) {
136
+ this.element.setAttribute('accesskey', String(props.accesskey));
137
+ }
138
+ if (props['aria-atomic'] !== undefined) {
139
+ this.setAriaAtomic(props['aria-atomic']);
140
+ }
141
+ if (props['aria-busy'] !== undefined) {
142
+ this.setAriaBusy(props['aria-busy']);
143
+ }
144
+ if (props['aria-controls'] !== undefined) {
145
+ this.element.setAttribute('aria-controls', String(props['aria-controls']));
146
+ }
147
+ if (props['aria-describedby'] !== undefined) {
148
+ this.element.setAttribute('aria-describedby', String(props['aria-describedby']));
149
+ }
150
+ if (props['aria-details'] !== undefined) {
151
+ this.element.setAttribute('aria-details', String(props['aria-details']));
152
+ }
153
+ if (props['aria-keyshortcuts'] !== undefined) {
154
+ this.element.setAttribute('aria-keyshortcuts', String(props['aria-keyshortcuts']));
155
+ }
156
+ if (props['aria-labelledby'] !== undefined) {
157
+ this.element.setAttribute('aria-labelledby', String(props['aria-labelledby']));
158
+ }
159
+ if (props['aria-live'] !== undefined) {
160
+ this.setAriaLive(props['aria-live']);
161
+ }
162
+ if (props['aria-relevant'] !== undefined) {
163
+ this.setAriaRelevant(props['aria-relevant']);
164
+ }
165
+ if (props['aria-roledescription'] !== undefined) {
166
+ this.element.setAttribute('aria-roledescription', String(props['aria-roledescription']));
167
+ }
168
+ if (props.autocapitalize !== undefined) {
169
+ this.setAutocapitalize(props.autocapitalize);
170
+ }
171
+ if (props.autofocus !== undefined) {
172
+ this.element.setAttribute('autofocus', String(props.autofocus));
173
+ }
174
+ if (props.contenteditable !== undefined) {
175
+ this.setContenteditable(props.contenteditable);
176
+ }
177
+ if (props.dir !== undefined) {
178
+ this.setDir(props.dir);
179
+ }
180
+ if (props.draggable !== undefined) {
181
+ this.element.setAttribute('draggable', String(props.draggable));
182
+ }
183
+ if (props.hidden !== undefined) {
184
+ this.element.setAttribute('hidden', String(props.hidden));
185
+ }
186
+ if (props.inputmode !== undefined) {
187
+ this.setInputmode(props.inputmode);
188
+ }
189
+ if (props.lang !== undefined) {
190
+ this.element.setAttribute('lang', String(props.lang));
191
+ }
192
+ if (props.popover !== undefined) {
193
+ this.setPopover(props.popover);
194
+ }
195
+ if (props.role !== undefined) {
196
+ this.setRole(props.role);
197
+ }
198
+ if (props.slot !== undefined) {
199
+ this.element.setAttribute('slot', String(props.slot));
200
+ }
201
+ if (props.spellcheck !== undefined) {
202
+ this.setSpellcheck(props.spellcheck);
203
+ }
204
+ if (props.style !== undefined) {
205
+ this.element.setAttribute('style', String(props.style));
206
+ }
207
+ if (props.tabindex !== undefined) {
208
+ this.element.setAttribute('tabindex', String(props.tabindex));
209
+ }
210
+ if (props.translate !== undefined) {
211
+ this.setTranslate(props.translate);
212
+ }
213
+ }
214
+
215
+ setAccesskey(value: string | null | undefined): this {
216
+ if (value === null || value === undefined) {
217
+ this.element.removeAttribute('accesskey');
218
+ } else {
219
+ this.element.setAttribute('accesskey', String(value));
220
+ }
221
+ return this;
222
+ }
223
+
224
+ setAriaAtomic(value: 'false' | 'true' | boolean | null | undefined): this {
225
+ if (value === null || value === undefined) {
226
+ this.element.removeAttribute('aria-atomic');
227
+ } else {
228
+ this.element.setAttribute('aria-atomic', String(value));
229
+ }
230
+ return this;
231
+ }
232
+
233
+ setAriaBusy(value: 'true' | 'false' | boolean | null | undefined): this {
234
+ if (value === null || value === undefined) {
235
+ this.element.removeAttribute('aria-busy');
236
+ } else {
237
+ this.element.setAttribute('aria-busy', String(value));
238
+ }
239
+ return this;
240
+ }
241
+
242
+ setAriaControls(value: string | null | undefined): this {
243
+ if (value === null || value === undefined) {
244
+ this.element.removeAttribute('aria-controls');
245
+ } else {
246
+ this.element.setAttribute('aria-controls', String(value));
247
+ }
248
+ return this;
249
+ }
250
+
251
+ setAriaDescribedby(value: string | null | undefined): this {
252
+ if (value === null || value === undefined) {
253
+ this.element.removeAttribute('aria-describedby');
254
+ } else {
255
+ this.element.setAttribute('aria-describedby', String(value));
256
+ }
257
+ return this;
258
+ }
259
+
260
+ setAriaDetails(value: string | null | undefined): this {
261
+ if (value === null || value === undefined) {
262
+ this.element.removeAttribute('aria-details');
263
+ } else {
264
+ this.element.setAttribute('aria-details', String(value));
265
+ }
266
+ return this;
267
+ }
268
+
269
+ setAriaKeyshortcuts(value: string | null | undefined): this {
270
+ if (value === null || value === undefined) {
271
+ this.element.removeAttribute('aria-keyshortcuts');
272
+ } else {
273
+ this.element.setAttribute('aria-keyshortcuts', String(value));
274
+ }
275
+ return this;
276
+ }
277
+
278
+ setAriaLabelledby(value: string | null | undefined): this {
279
+ if (value === null || value === undefined) {
280
+ this.element.removeAttribute('aria-labelledby');
281
+ } else {
282
+ this.element.setAttribute('aria-labelledby', String(value));
283
+ }
284
+ return this;
285
+ }
286
+
287
+ setAriaLive(value: 'off' | 'polite' | 'assertive' | null | undefined): this {
288
+ if (value === null || value === undefined) {
289
+ this.element.removeAttribute('aria-live');
290
+ } else {
291
+ this.element.setAttribute('aria-live', String(value));
292
+ }
293
+ return this;
294
+ }
295
+
296
+ setAriaRelevant(value: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined): this {
297
+ if (value === null || value === undefined) {
298
+ this.element.removeAttribute('aria-relevant');
299
+ } else {
300
+ this.element.setAttribute('aria-relevant', String(value));
301
+ }
302
+ return this;
303
+ }
304
+
305
+ setAriaRoledescription(value: string | null | undefined): this {
306
+ if (value === null || value === undefined) {
307
+ this.element.removeAttribute('aria-roledescription');
308
+ } else {
309
+ this.element.setAttribute('aria-roledescription', String(value));
310
+ }
311
+ return this;
312
+ }
313
+
314
+ setAutocapitalize(value: 'none' | 'sentences' | 'words' | 'characters' | null | undefined): this {
315
+ if (value === null || value === undefined) {
316
+ this.element.removeAttribute('autocapitalize');
317
+ } else {
318
+ this.element.setAttribute('autocapitalize', String(value));
319
+ }
320
+ return this;
321
+ }
322
+
323
+ setAutofocus(value: boolean | null | undefined): this {
324
+ if (value === true) {
325
+ this.element.setAttribute('autofocus', '');
326
+ } else {
327
+ this.element.removeAttribute('autofocus');
328
+ }
329
+ return this;
330
+ }
331
+
332
+ setContenteditable(value: 'true' | 'false' | 'inherit' | boolean | null | undefined): this {
333
+ if (value === null || value === undefined) {
334
+ this.element.removeAttribute('contenteditable');
335
+ } else {
336
+ this.element.setAttribute('contenteditable', String(value));
337
+ }
338
+ return this;
339
+ }
340
+
341
+ setDir(value: 'ltr' | 'rtl' | 'auto' | null | undefined): this {
342
+ if (value === null || value === undefined) {
343
+ this.element.removeAttribute('dir');
344
+ } else {
345
+ this.element.setAttribute('dir', String(value));
346
+ }
347
+ return this;
348
+ }
349
+
350
+ setDraggable(value: boolean | null | undefined): this {
351
+ if (value === true) {
352
+ this.element.setAttribute('draggable', '');
353
+ } else {
354
+ this.element.removeAttribute('draggable');
355
+ }
356
+ return this;
357
+ }
358
+
359
+ setHidden(value: boolean | null | undefined): this {
360
+ if (value === true) {
361
+ this.element.setAttribute('hidden', '');
362
+ } else {
363
+ this.element.removeAttribute('hidden');
364
+ }
365
+ return this;
366
+ }
367
+
368
+ setInputmode(value: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined): this {
369
+ if (value === null || value === undefined) {
370
+ this.element.removeAttribute('inputmode');
371
+ } else {
372
+ this.element.setAttribute('inputmode', String(value));
373
+ }
374
+ return this;
375
+ }
376
+
377
+ setLang(value: string | null | undefined): this {
378
+ if (value === null || value === undefined) {
379
+ this.element.removeAttribute('lang');
380
+ } else {
381
+ this.element.setAttribute('lang', String(value));
382
+ }
383
+ return this;
384
+ }
385
+
386
+ setPopover(value: 'auto' | 'hint' | 'manual' | null | undefined): this {
387
+ if (value === null || value === undefined) {
388
+ this.element.removeAttribute('popover');
389
+ } else {
390
+ this.element.setAttribute('popover', String(value));
391
+ }
392
+ return this;
393
+ }
394
+
395
+ setRole(value: 'alert' | 'application' | 'article' | 'banner' | 'button' | 'checkbox' | 'complementary' | 'contentinfo' | 'dialog' | 'form' | 'grid' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'main' | 'menu' | 'menubar' | 'menuitem' | 'navigation' | 'none' | 'presentation' | 'radio' | 'region' | 'search' | 'status' | 'tab' | 'tablist' | 'tabpanel' | 'textbox' | 'toolbar' | 'tooltip' | null | undefined): this {
396
+ if (value === null || value === undefined) {
397
+ this.element.removeAttribute('role');
398
+ } else {
399
+ this.element.setAttribute('role', String(value));
400
+ }
401
+ return this;
402
+ }
403
+
404
+ setSlot(value: string | null | undefined): this {
405
+ if (value === null || value === undefined) {
406
+ this.element.removeAttribute('slot');
407
+ } else {
408
+ this.element.setAttribute('slot', String(value));
409
+ }
410
+ return this;
411
+ }
412
+
413
+ setSpellcheck(value: 'true' | 'false' | boolean | null | undefined): this {
414
+ if (value === null || value === undefined) {
415
+ this.element.removeAttribute('spellcheck');
416
+ } else {
417
+ this.element.setAttribute('spellcheck', String(value));
418
+ }
419
+ return this;
420
+ }
421
+
422
+ setStyle(value: string | null | undefined): this {
423
+ if (value === null || value === undefined) {
424
+ this.element.removeAttribute('style');
425
+ } else {
426
+ this.element.setAttribute('style', String(value));
427
+ }
428
+ return this;
429
+ }
430
+
431
+ setTabindex(value: number | null | undefined): this {
432
+ if (value === null || value === undefined) {
433
+ this.element.removeAttribute('tabindex');
434
+ } else {
435
+ this.element.setAttribute('tabindex', String(value));
436
+ }
437
+ return this;
438
+ }
439
+
440
+ setTranslate(value: 'yes' | 'no' | null | undefined): this {
441
+ if (value === null || value === undefined) {
442
+ this.element.removeAttribute('translate');
443
+ } else {
444
+ this.element.setAttribute('translate', String(value));
445
+ }
446
+ return this;
447
+ }
448
+
449
+ setChildren(children: string | HTMLElement | (string | HTMLElement)[]): this {
450
+ // Clear existing children
451
+ while (this.element.firstChild) {
452
+ this.element.removeChild(this.element.firstChild);
453
+ }
454
+
455
+ if (typeof children === 'string') {
456
+ this.element.textContent = children;
457
+ } else if (Array.isArray(children)) {
458
+ children.forEach(child => {
459
+ if (typeof child === 'string') {
460
+ this.element.appendChild(document.createTextNode(child));
461
+ } else {
462
+ this.element.appendChild(child);
463
+ }
464
+ });
465
+ } else {
466
+ this.element.appendChild(children);
467
+ }
468
+ return this;
469
+ }
470
+
471
+ getElement(): HTMLElement {
472
+ return this.element;
473
+ }
474
+ }