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