@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,570 @@
1
+ /**
2
+ * THIS FILE IS AUTOGENERATED. DO NOT EDIT IT.
3
+ *
4
+ * @generated December 28, 2025 12:26:31
5
+ * @component Table
6
+ * @description
7
+ */
8
+
9
+ export interface TableProps {
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
+ * Defines the total number of columns in a table or grid.
28
+ */
29
+ 'aria-colcount'?: number | null | undefined;
30
+ /**
31
+ * Identifies the element(s) whose contents or presence are controlled by this element. Value is a list of IDs separated by a space
32
+ */
33
+ 'aria-controls'?: string | null | undefined;
34
+ /**
35
+ * Identifies the element(s) that describes the object. Value is a list of IDs separated by a space
36
+ */
37
+ 'aria-describedby'?: string | null | undefined;
38
+ /**
39
+ * References an element that provides additional details about the current element.
40
+ */
41
+ 'aria-details'?: string | null | undefined;
42
+ /**
43
+ * Indicates whether the element is exposed to an accessibility API. Use with caution on interactive elements. Set to true only on decorative elements such as icons, or when nav isnt visible
44
+ */
45
+ 'aria-hidden'?: 'false' | 'true' | boolean | null | undefined;
46
+ /**
47
+ * Defines keyboard shortcuts available for the element.
48
+ */
49
+ 'aria-keyshortcuts'?: string | null | undefined;
50
+ /**
51
+ * Identifies the element(s) that labels the current element. Value is a list of IDs separated by a space
52
+ */
53
+ 'aria-labelledby'?: string | null | undefined;
54
+ /**
55
+ * Defines how updates to the element should be announced to screen readers.
56
+ */
57
+ 'aria-live'?: 'off' | 'polite' | 'assertive' | null | undefined;
58
+ /**
59
+ * Establishes ownership relationships between elements. Value is a space-separated list of IDs.
60
+ */
61
+ 'aria-owns'?: string | null | undefined;
62
+ /**
63
+ * Indicates what content changes should be announced in a live region.
64
+ */
65
+ 'aria-relevant'?: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined;
66
+ /**
67
+ * Provides a human-readable custom role description for assistive technologies.
68
+ */
69
+ 'aria-roledescription'?: string | null | undefined;
70
+ /**
71
+ * Defines the total number of rows in a table or grid.
72
+ */
73
+ 'aria-rowcount'?: number | null | undefined;
74
+ /**
75
+ * Defines the sorting order of a column.
76
+ */
77
+ 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other' | null | undefined;
78
+ /**
79
+ * Represents the autocapitalize behavior of the element
80
+ */
81
+ autocapitalize?: 'none' | 'sentences' | 'words' | 'characters' | null | undefined;
82
+ /**
83
+ * Indicates whether the element is hidden
84
+ */
85
+ autofocus?: boolean | null | undefined;
86
+ /**
87
+ * Indicates whether the element can be edited in place
88
+ */
89
+ contenteditable?: 'true' | 'false' | 'inherit' | boolean | null | undefined;
90
+ /**
91
+ * Represents the text direction of the element
92
+ */
93
+ dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;
94
+ /**
95
+ * Indicates whether the element is draggable
96
+ */
97
+ draggable?: boolean | null | undefined;
98
+ /**
99
+ * Indicates whether the element is hidden
100
+ */
101
+ hidden?: boolean | null | undefined;
102
+ /**
103
+ * 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
104
+ */
105
+ inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined;
106
+ /**
107
+ * Specifies the primary language for the element's content
108
+ */
109
+ lang?: string | null | undefined;
110
+ /**
111
+ *
112
+ */
113
+ popover?: 'auto' | 'hint' | 'manual' | null | undefined;
114
+ /**
115
+ * Defines the semantic purpose of an element for assistive technologies.
116
+ */
117
+ 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;
118
+ /**
119
+ * Represents a slot in a shadow DOM
120
+ */
121
+ slot?: string | null | undefined;
122
+ /**
123
+ * Represents the spellchecking behavior of the element
124
+ */
125
+ spellcheck?: 'true' | 'false' | boolean | null | undefined;
126
+ /**
127
+ * Represents the CSS inline style of the element
128
+ */
129
+ style?: string | null | undefined;
130
+ /**
131
+ * Represents a tab order of the element
132
+ */
133
+ tabindex?: number | null | undefined;
134
+ /**
135
+ * Represents a title or tooltip for the element
136
+ */
137
+ title?: string | null | undefined;
138
+ /**
139
+ * used to tell user agents whether the content should be translated.
140
+ */
141
+ translate?: 'yes' | 'no' | null | undefined;
142
+ }
143
+
144
+ /**
145
+ * Table -
146
+ */
147
+ export class Table {
148
+ private element: HTMLElement;
149
+
150
+ constructor(props: TableProps = {}) {
151
+ this.element = document.createElement('table');
152
+ this.applyProps(props);
153
+ }
154
+
155
+ private applyProps(props: TableProps): void {
156
+ if (props.children !== undefined) {
157
+ this.setChildren(props.children);
158
+ }
159
+ if (props.accesskey !== undefined) {
160
+ this.element.setAttribute('accesskey', String(props.accesskey));
161
+ }
162
+ if (props['aria-atomic'] !== undefined) {
163
+ this.setAriaAtomic(props['aria-atomic']);
164
+ }
165
+ if (props['aria-busy'] !== undefined) {
166
+ this.setAriaBusy(props['aria-busy']);
167
+ }
168
+ if (props['aria-colcount'] !== undefined) {
169
+ this.element.setAttribute('aria-colcount', String(props['aria-colcount']));
170
+ }
171
+ if (props['aria-controls'] !== undefined) {
172
+ this.element.setAttribute('aria-controls', String(props['aria-controls']));
173
+ }
174
+ if (props['aria-describedby'] !== undefined) {
175
+ this.element.setAttribute('aria-describedby', String(props['aria-describedby']));
176
+ }
177
+ if (props['aria-details'] !== undefined) {
178
+ this.element.setAttribute('aria-details', String(props['aria-details']));
179
+ }
180
+ if (props['aria-hidden'] !== undefined) {
181
+ this.setAriaHidden(props['aria-hidden']);
182
+ }
183
+ if (props['aria-keyshortcuts'] !== undefined) {
184
+ this.element.setAttribute('aria-keyshortcuts', String(props['aria-keyshortcuts']));
185
+ }
186
+ if (props['aria-labelledby'] !== undefined) {
187
+ this.element.setAttribute('aria-labelledby', String(props['aria-labelledby']));
188
+ }
189
+ if (props['aria-live'] !== undefined) {
190
+ this.setAriaLive(props['aria-live']);
191
+ }
192
+ if (props['aria-owns'] !== undefined) {
193
+ this.element.setAttribute('aria-owns', String(props['aria-owns']));
194
+ }
195
+ if (props['aria-relevant'] !== undefined) {
196
+ this.setAriaRelevant(props['aria-relevant']);
197
+ }
198
+ if (props['aria-roledescription'] !== undefined) {
199
+ this.element.setAttribute('aria-roledescription', String(props['aria-roledescription']));
200
+ }
201
+ if (props['aria-rowcount'] !== undefined) {
202
+ this.element.setAttribute('aria-rowcount', String(props['aria-rowcount']));
203
+ }
204
+ if (props['aria-sort'] !== undefined) {
205
+ this.setAriaSort(props['aria-sort']);
206
+ }
207
+ if (props.autocapitalize !== undefined) {
208
+ this.setAutocapitalize(props.autocapitalize);
209
+ }
210
+ if (props.autofocus !== undefined) {
211
+ this.element.setAttribute('autofocus', String(props.autofocus));
212
+ }
213
+ if (props.contenteditable !== undefined) {
214
+ this.setContenteditable(props.contenteditable);
215
+ }
216
+ if (props.dir !== undefined) {
217
+ this.setDir(props.dir);
218
+ }
219
+ if (props.draggable !== undefined) {
220
+ this.element.setAttribute('draggable', String(props.draggable));
221
+ }
222
+ if (props.hidden !== undefined) {
223
+ this.element.setAttribute('hidden', String(props.hidden));
224
+ }
225
+ if (props.inputmode !== undefined) {
226
+ this.setInputmode(props.inputmode);
227
+ }
228
+ if (props.lang !== undefined) {
229
+ this.element.setAttribute('lang', String(props.lang));
230
+ }
231
+ if (props.popover !== undefined) {
232
+ this.setPopover(props.popover);
233
+ }
234
+ if (props.role !== undefined) {
235
+ this.setRole(props.role);
236
+ }
237
+ if (props.slot !== undefined) {
238
+ this.element.setAttribute('slot', String(props.slot));
239
+ }
240
+ if (props.spellcheck !== undefined) {
241
+ this.setSpellcheck(props.spellcheck);
242
+ }
243
+ if (props.style !== undefined) {
244
+ this.element.setAttribute('style', String(props.style));
245
+ }
246
+ if (props.tabindex !== undefined) {
247
+ this.element.setAttribute('tabindex', String(props.tabindex));
248
+ }
249
+ if (props.title !== undefined) {
250
+ this.element.setAttribute('title', String(props.title));
251
+ }
252
+ if (props.translate !== undefined) {
253
+ this.setTranslate(props.translate);
254
+ }
255
+ }
256
+
257
+ setAccesskey(value: string | null | undefined): this {
258
+ if (value === null || value === undefined) {
259
+ this.element.removeAttribute('accesskey');
260
+ } else {
261
+ this.element.setAttribute('accesskey', String(value));
262
+ }
263
+ return this;
264
+ }
265
+
266
+ setAriaAtomic(value: 'false' | 'true' | boolean | null | undefined): this {
267
+ if (value === null || value === undefined) {
268
+ this.element.removeAttribute('aria-atomic');
269
+ } else {
270
+ this.element.setAttribute('aria-atomic', String(value));
271
+ }
272
+ return this;
273
+ }
274
+
275
+ setAriaBusy(value: 'true' | 'false' | boolean | null | undefined): this {
276
+ if (value === null || value === undefined) {
277
+ this.element.removeAttribute('aria-busy');
278
+ } else {
279
+ this.element.setAttribute('aria-busy', String(value));
280
+ }
281
+ return this;
282
+ }
283
+
284
+ setAriaColcount(value: number | null | undefined): this {
285
+ if (value === null || value === undefined) {
286
+ this.element.removeAttribute('aria-colcount');
287
+ } else {
288
+ this.element.setAttribute('aria-colcount', String(value));
289
+ }
290
+ return this;
291
+ }
292
+
293
+ setAriaControls(value: string | null | undefined): this {
294
+ if (value === null || value === undefined) {
295
+ this.element.removeAttribute('aria-controls');
296
+ } else {
297
+ this.element.setAttribute('aria-controls', String(value));
298
+ }
299
+ return this;
300
+ }
301
+
302
+ setAriaDescribedby(value: string | null | undefined): this {
303
+ if (value === null || value === undefined) {
304
+ this.element.removeAttribute('aria-describedby');
305
+ } else {
306
+ this.element.setAttribute('aria-describedby', String(value));
307
+ }
308
+ return this;
309
+ }
310
+
311
+ setAriaDetails(value: string | null | undefined): this {
312
+ if (value === null || value === undefined) {
313
+ this.element.removeAttribute('aria-details');
314
+ } else {
315
+ this.element.setAttribute('aria-details', String(value));
316
+ }
317
+ return this;
318
+ }
319
+
320
+ setAriaHidden(value: 'false' | 'true' | boolean | null | undefined): this {
321
+ if (value === null || value === undefined) {
322
+ this.element.removeAttribute('aria-hidden');
323
+ } else {
324
+ this.element.setAttribute('aria-hidden', String(value));
325
+ }
326
+ return this;
327
+ }
328
+
329
+ setAriaKeyshortcuts(value: string | null | undefined): this {
330
+ if (value === null || value === undefined) {
331
+ this.element.removeAttribute('aria-keyshortcuts');
332
+ } else {
333
+ this.element.setAttribute('aria-keyshortcuts', String(value));
334
+ }
335
+ return this;
336
+ }
337
+
338
+ setAriaLabelledby(value: string | null | undefined): this {
339
+ if (value === null || value === undefined) {
340
+ this.element.removeAttribute('aria-labelledby');
341
+ } else {
342
+ this.element.setAttribute('aria-labelledby', String(value));
343
+ }
344
+ return this;
345
+ }
346
+
347
+ setAriaLive(value: 'off' | 'polite' | 'assertive' | null | undefined): this {
348
+ if (value === null || value === undefined) {
349
+ this.element.removeAttribute('aria-live');
350
+ } else {
351
+ this.element.setAttribute('aria-live', String(value));
352
+ }
353
+ return this;
354
+ }
355
+
356
+ setAriaOwns(value: string | null | undefined): this {
357
+ if (value === null || value === undefined) {
358
+ this.element.removeAttribute('aria-owns');
359
+ } else {
360
+ this.element.setAttribute('aria-owns', String(value));
361
+ }
362
+ return this;
363
+ }
364
+
365
+ setAriaRelevant(value: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined): this {
366
+ if (value === null || value === undefined) {
367
+ this.element.removeAttribute('aria-relevant');
368
+ } else {
369
+ this.element.setAttribute('aria-relevant', String(value));
370
+ }
371
+ return this;
372
+ }
373
+
374
+ setAriaRoledescription(value: string | null | undefined): this {
375
+ if (value === null || value === undefined) {
376
+ this.element.removeAttribute('aria-roledescription');
377
+ } else {
378
+ this.element.setAttribute('aria-roledescription', String(value));
379
+ }
380
+ return this;
381
+ }
382
+
383
+ setAriaRowcount(value: number | null | undefined): this {
384
+ if (value === null || value === undefined) {
385
+ this.element.removeAttribute('aria-rowcount');
386
+ } else {
387
+ this.element.setAttribute('aria-rowcount', String(value));
388
+ }
389
+ return this;
390
+ }
391
+
392
+ setAriaSort(value: 'none' | 'ascending' | 'descending' | 'other' | null | undefined): this {
393
+ if (value === null || value === undefined) {
394
+ this.element.removeAttribute('aria-sort');
395
+ } else {
396
+ this.element.setAttribute('aria-sort', String(value));
397
+ }
398
+ return this;
399
+ }
400
+
401
+ setAutocapitalize(value: 'none' | 'sentences' | 'words' | 'characters' | null | undefined): this {
402
+ if (value === null || value === undefined) {
403
+ this.element.removeAttribute('autocapitalize');
404
+ } else {
405
+ this.element.setAttribute('autocapitalize', String(value));
406
+ }
407
+ return this;
408
+ }
409
+
410
+ setAutofocus(value: boolean | null | undefined): this {
411
+ if (value === true) {
412
+ this.element.setAttribute('autofocus', '');
413
+ } else {
414
+ this.element.removeAttribute('autofocus');
415
+ }
416
+ return this;
417
+ }
418
+
419
+ setContenteditable(value: 'true' | 'false' | 'inherit' | boolean | null | undefined): this {
420
+ if (value === null || value === undefined) {
421
+ this.element.removeAttribute('contenteditable');
422
+ } else {
423
+ this.element.setAttribute('contenteditable', String(value));
424
+ }
425
+ return this;
426
+ }
427
+
428
+ setDir(value: 'ltr' | 'rtl' | 'auto' | null | undefined): this {
429
+ if (value === null || value === undefined) {
430
+ this.element.removeAttribute('dir');
431
+ } else {
432
+ this.element.setAttribute('dir', String(value));
433
+ }
434
+ return this;
435
+ }
436
+
437
+ setDraggable(value: boolean | null | undefined): this {
438
+ if (value === true) {
439
+ this.element.setAttribute('draggable', '');
440
+ } else {
441
+ this.element.removeAttribute('draggable');
442
+ }
443
+ return this;
444
+ }
445
+
446
+ setHidden(value: boolean | null | undefined): this {
447
+ if (value === true) {
448
+ this.element.setAttribute('hidden', '');
449
+ } else {
450
+ this.element.removeAttribute('hidden');
451
+ }
452
+ return this;
453
+ }
454
+
455
+ setInputmode(value: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined): this {
456
+ if (value === null || value === undefined) {
457
+ this.element.removeAttribute('inputmode');
458
+ } else {
459
+ this.element.setAttribute('inputmode', String(value));
460
+ }
461
+ return this;
462
+ }
463
+
464
+ setLang(value: string | null | undefined): this {
465
+ if (value === null || value === undefined) {
466
+ this.element.removeAttribute('lang');
467
+ } else {
468
+ this.element.setAttribute('lang', String(value));
469
+ }
470
+ return this;
471
+ }
472
+
473
+ setPopover(value: 'auto' | 'hint' | 'manual' | null | undefined): this {
474
+ if (value === null || value === undefined) {
475
+ this.element.removeAttribute('popover');
476
+ } else {
477
+ this.element.setAttribute('popover', String(value));
478
+ }
479
+ return this;
480
+ }
481
+
482
+ 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 {
483
+ if (value === null || value === undefined) {
484
+ this.element.removeAttribute('role');
485
+ } else {
486
+ this.element.setAttribute('role', String(value));
487
+ }
488
+ return this;
489
+ }
490
+
491
+ setSlot(value: string | null | undefined): this {
492
+ if (value === null || value === undefined) {
493
+ this.element.removeAttribute('slot');
494
+ } else {
495
+ this.element.setAttribute('slot', String(value));
496
+ }
497
+ return this;
498
+ }
499
+
500
+ setSpellcheck(value: 'true' | 'false' | boolean | null | undefined): this {
501
+ if (value === null || value === undefined) {
502
+ this.element.removeAttribute('spellcheck');
503
+ } else {
504
+ this.element.setAttribute('spellcheck', String(value));
505
+ }
506
+ return this;
507
+ }
508
+
509
+ setStyle(value: string | null | undefined): this {
510
+ if (value === null || value === undefined) {
511
+ this.element.removeAttribute('style');
512
+ } else {
513
+ this.element.setAttribute('style', String(value));
514
+ }
515
+ return this;
516
+ }
517
+
518
+ setTabindex(value: number | null | undefined): this {
519
+ if (value === null || value === undefined) {
520
+ this.element.removeAttribute('tabindex');
521
+ } else {
522
+ this.element.setAttribute('tabindex', String(value));
523
+ }
524
+ return this;
525
+ }
526
+
527
+ setTitle(value: string | null | undefined): this {
528
+ if (value === null || value === undefined) {
529
+ this.element.removeAttribute('title');
530
+ } else {
531
+ this.element.setAttribute('title', String(value));
532
+ }
533
+ return this;
534
+ }
535
+
536
+ setTranslate(value: 'yes' | 'no' | null | undefined): this {
537
+ if (value === null || value === undefined) {
538
+ this.element.removeAttribute('translate');
539
+ } else {
540
+ this.element.setAttribute('translate', String(value));
541
+ }
542
+ return this;
543
+ }
544
+
545
+ setChildren(children: string | HTMLElement | (string | HTMLElement)[]): this {
546
+ // Clear existing children
547
+ while (this.element.firstChild) {
548
+ this.element.removeChild(this.element.firstChild);
549
+ }
550
+
551
+ if (typeof children === 'string') {
552
+ this.element.textContent = children;
553
+ } else if (Array.isArray(children)) {
554
+ children.forEach(child => {
555
+ if (typeof child === 'string') {
556
+ this.element.appendChild(document.createTextNode(child));
557
+ } else {
558
+ this.element.appendChild(child);
559
+ }
560
+ });
561
+ } else {
562
+ this.element.appendChild(children);
563
+ }
564
+ return this;
565
+ }
566
+
567
+ getElement(): HTMLElement {
568
+ return this.element;
569
+ }
570
+ }