@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,874 @@
1
+ /**
2
+ * THIS FILE IS AUTOGENERATED. DO NOT EDIT IT.
3
+ *
4
+ * @generated December 28, 2025 12:26:31
5
+ * @component Textarea
6
+ * @description
7
+ */
8
+
9
+ export interface TextareaProps {
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
+ * Specifies autocomplete behavior for input fields.
24
+ */
25
+ 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both' | 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
+ * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
40
+ */
41
+ 'aria-disabled'?: 'false' | 'true' | boolean | null | undefined;
42
+ /**
43
+ * Indicates whether a collapsible UI element is expanded (true) or collapsed (false).
44
+ */
45
+ 'aria-expanded'?: 'false' | 'true' | 'undefined' | boolean | null | undefined;
46
+ /**
47
+ * Indicates that an element has an associated popup menu, listbox, tree, grid, or dialog.
48
+ */
49
+ 'aria-haspopup'?: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | boolean | null | undefined;
50
+ /**
51
+ * Indicates that the value entered does not conform to the expected format.
52
+ */
53
+ 'aria-invalid'?: 'false' | 'true' | 'grammar' | 'spelling' | boolean | null | undefined;
54
+ /**
55
+ * Defines keyboard shortcuts available for the element.
56
+ */
57
+ 'aria-keyshortcuts'?: string | null | undefined;
58
+ /**
59
+ * Defines a string value that labels the current element for assistive technologies.
60
+ */
61
+ 'aria-label'?: string | null | undefined;
62
+ /**
63
+ * Identifies the element(s) that labels the current element. Value is a list of IDs separated by a space
64
+ */
65
+ 'aria-labelledby'?: string | null | undefined;
66
+ /**
67
+ * Defines how updates to the element should be announced to screen readers.
68
+ */
69
+ 'aria-live'?: 'off' | 'polite' | 'assertive' | null | undefined;
70
+ /**
71
+ * Indicates whether the input allows multiple lines of text.
72
+ */
73
+ 'aria-multiline'?: 'false' | 'true' | boolean | null | undefined;
74
+ /**
75
+ * Provides a placeholder hint for an input field.
76
+ */
77
+ 'aria-placeholder'?: string | null | undefined;
78
+ /**
79
+ * Indicates whether a toggle button is pressed (true, false, or mixed).
80
+ */
81
+ 'aria-pressed'?: 'false' | 'true' | 'mixed' | 'undefined' | boolean | null | undefined;
82
+ /**
83
+ * Marks an input field as read-only but still selectable and focusable.
84
+ */
85
+ 'aria-readonly'?: 'false' | 'true' | boolean | null | undefined;
86
+ /**
87
+ * Indicates what content changes should be announced in a live region.
88
+ */
89
+ 'aria-relevant'?: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined;
90
+ /**
91
+ * Specifies that an input field is required before form submission.
92
+ */
93
+ 'aria-required'?: 'false' | 'true' | boolean | null | undefined;
94
+ /**
95
+ * Provides a human-readable custom role description for assistive technologies.
96
+ */
97
+ 'aria-roledescription'?: string | null | undefined;
98
+ /**
99
+ * Represents the autocapitalize behavior of the element
100
+ */
101
+ autocapitalize?: 'none' | 'sentences' | 'words' | 'characters' | null | undefined;
102
+ /**
103
+ *
104
+ */
105
+ autocomplete?: 'off' | 'on' | null | undefined;
106
+ /**
107
+ * Specifies controls whether autocorrection of editable text is enabled for spelling and/or punctuation errors. Default is on.
108
+ */
109
+ autocorrect?: 'off' | 'on' | null | undefined;
110
+ /**
111
+ * Indicates whether the element is hidden
112
+ */
113
+ autofocus?: boolean | null | undefined;
114
+ /**
115
+ * Specifies the visible width of a text area, in average character widths.
116
+ */
117
+ cols?: number | null | undefined;
118
+ /**
119
+ * Indicates whether the element can be edited in place
120
+ */
121
+ contenteditable?: 'true' | 'false' | 'inherit' | boolean | null | undefined;
122
+ /**
123
+ * Represents the text direction of the element
124
+ */
125
+ dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;
126
+ /**
127
+ * Specifies the name of the field that will contain the text direction (ltr or rtl) of the input or textarea when the form is submitted
128
+ */
129
+ dirname?: string | null | undefined;
130
+ /**
131
+ * When present, it specifies that an input element should be disabled.
132
+ */
133
+ disabled?: boolean | null | undefined;
134
+ /**
135
+ * Indicates whether the element is draggable
136
+ */
137
+ draggable?: boolean | null | undefined;
138
+ /**
139
+ * Associates the button with a form element by ID. Allows buttons to be associated with forms anywhere in the document, not just inside a form element. Can override ancestor form association. Element-specific to button, input, object, select, textarea, and fieldset.
140
+ */
141
+ form?: string | null | undefined;
142
+ /**
143
+ * Indicates whether the element is hidden
144
+ */
145
+ hidden?: boolean | null | undefined;
146
+ /**
147
+ * 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
148
+ */
149
+ inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined;
150
+ /**
151
+ * Specifies the primary language for the element's content
152
+ */
153
+ lang?: string | null | undefined;
154
+ /**
155
+ * Specifies the maximum number of characters allowed in an input field.
156
+ */
157
+ maxlength?: number | null | undefined;
158
+ /**
159
+ * Specifies the minimum number of characters required in an input field.
160
+ */
161
+ minlength?: number | null | undefined;
162
+ /**
163
+ * Specifies the name associated with the element. The meaning may vary depending on the context.
164
+ */
165
+ name?: string | null | undefined;
166
+ /**
167
+ * Specifies a short hint that describes the expected value of an input field.
168
+ */
169
+ placeholder?: string | null | undefined;
170
+ /**
171
+ *
172
+ */
173
+ popover?: 'auto' | 'hint' | 'manual' | null | undefined;
174
+ /**
175
+ * When present, it specifies that an input element is read-only.
176
+ */
177
+ readonly?: boolean | null | undefined;
178
+ /**
179
+ * When present, it specifies that an input field must be filled out before submitting the form.
180
+ */
181
+ required?: boolean | null | undefined;
182
+ /**
183
+ * Defines the semantic purpose of an element for assistive technologies.
184
+ */
185
+ 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;
186
+ /**
187
+ * Specifies the visible number of lines in a text area.
188
+ */
189
+ rows?: number | null | undefined;
190
+ /**
191
+ * Represents a slot in a shadow DOM
192
+ */
193
+ slot?: string | null | undefined;
194
+ /**
195
+ * Represents the spellchecking behavior of the element
196
+ */
197
+ spellcheck?: 'true' | 'false' | boolean | null | undefined;
198
+ /**
199
+ * Represents the CSS inline style of the element
200
+ */
201
+ style?: string | null | undefined;
202
+ /**
203
+ * Represents a tab order of the element
204
+ */
205
+ tabindex?: number | null | undefined;
206
+ /**
207
+ * Represents a title or tooltip for the element
208
+ */
209
+ title?: string | null | undefined;
210
+ /**
211
+ * used to tell user agents whether the content should be translated.
212
+ */
213
+ translate?: 'yes' | 'no' | null | undefined;
214
+ /**
215
+ *
216
+ */
217
+ wrap?: 'hard' | 'off' | 'soft' | null | undefined;
218
+ }
219
+
220
+ /**
221
+ * Textarea -
222
+ */
223
+ export class Textarea {
224
+ private element: HTMLElement;
225
+
226
+ constructor(props: TextareaProps = {}) {
227
+ this.element = document.createElement('textarea');
228
+ this.applyProps(props);
229
+ }
230
+
231
+ private applyProps(props: TextareaProps): void {
232
+ if (props.children !== undefined) {
233
+ this.setChildren(props.children);
234
+ }
235
+ if (props.accesskey !== undefined) {
236
+ this.element.setAttribute('accesskey', String(props.accesskey));
237
+ }
238
+ if (props['aria-atomic'] !== undefined) {
239
+ this.setAriaAtomic(props['aria-atomic']);
240
+ }
241
+ if (props['aria-autocomplete'] !== undefined) {
242
+ this.setAriaAutocomplete(props['aria-autocomplete']);
243
+ }
244
+ if (props['aria-controls'] !== undefined) {
245
+ this.element.setAttribute('aria-controls', String(props['aria-controls']));
246
+ }
247
+ if (props['aria-describedby'] !== undefined) {
248
+ this.element.setAttribute('aria-describedby', String(props['aria-describedby']));
249
+ }
250
+ if (props['aria-details'] !== undefined) {
251
+ this.element.setAttribute('aria-details', String(props['aria-details']));
252
+ }
253
+ if (props['aria-disabled'] !== undefined) {
254
+ this.setAriaDisabled(props['aria-disabled']);
255
+ }
256
+ if (props['aria-expanded'] !== undefined) {
257
+ this.setAriaExpanded(props['aria-expanded']);
258
+ }
259
+ if (props['aria-haspopup'] !== undefined) {
260
+ this.setAriaHaspopup(props['aria-haspopup']);
261
+ }
262
+ if (props['aria-invalid'] !== undefined) {
263
+ this.setAriaInvalid(props['aria-invalid']);
264
+ }
265
+ if (props['aria-keyshortcuts'] !== undefined) {
266
+ this.element.setAttribute('aria-keyshortcuts', String(props['aria-keyshortcuts']));
267
+ }
268
+ if (props['aria-label'] !== undefined) {
269
+ this.element.setAttribute('aria-label', String(props['aria-label']));
270
+ }
271
+ if (props['aria-labelledby'] !== undefined) {
272
+ this.element.setAttribute('aria-labelledby', String(props['aria-labelledby']));
273
+ }
274
+ if (props['aria-live'] !== undefined) {
275
+ this.setAriaLive(props['aria-live']);
276
+ }
277
+ if (props['aria-multiline'] !== undefined) {
278
+ this.setAriaMultiline(props['aria-multiline']);
279
+ }
280
+ if (props['aria-placeholder'] !== undefined) {
281
+ this.element.setAttribute('aria-placeholder', String(props['aria-placeholder']));
282
+ }
283
+ if (props['aria-pressed'] !== undefined) {
284
+ this.setAriaPressed(props['aria-pressed']);
285
+ }
286
+ if (props['aria-readonly'] !== undefined) {
287
+ this.setAriaReadonly(props['aria-readonly']);
288
+ }
289
+ if (props['aria-relevant'] !== undefined) {
290
+ this.setAriaRelevant(props['aria-relevant']);
291
+ }
292
+ if (props['aria-required'] !== undefined) {
293
+ this.setAriaRequired(props['aria-required']);
294
+ }
295
+ if (props['aria-roledescription'] !== undefined) {
296
+ this.element.setAttribute('aria-roledescription', String(props['aria-roledescription']));
297
+ }
298
+ if (props.autocapitalize !== undefined) {
299
+ this.setAutocapitalize(props.autocapitalize);
300
+ }
301
+ if (props.autocomplete !== undefined) {
302
+ this.setAutocomplete(props.autocomplete);
303
+ }
304
+ if (props.autocorrect !== undefined) {
305
+ this.setAutocorrect(props.autocorrect);
306
+ }
307
+ if (props.autofocus !== undefined) {
308
+ this.element.setAttribute('autofocus', String(props.autofocus));
309
+ }
310
+ if (props.cols !== undefined) {
311
+ this.element.setAttribute('cols', String(props.cols));
312
+ }
313
+ if (props.contenteditable !== undefined) {
314
+ this.setContenteditable(props.contenteditable);
315
+ }
316
+ if (props.dir !== undefined) {
317
+ this.setDir(props.dir);
318
+ }
319
+ if (props.dirname !== undefined) {
320
+ this.element.setAttribute('dirname', String(props.dirname));
321
+ }
322
+ if (props.disabled !== undefined) {
323
+ this.element.setAttribute('disabled', String(props.disabled));
324
+ }
325
+ if (props.draggable !== undefined) {
326
+ this.element.setAttribute('draggable', String(props.draggable));
327
+ }
328
+ if (props.form !== undefined) {
329
+ this.element.setAttribute('form', String(props.form));
330
+ }
331
+ if (props.hidden !== undefined) {
332
+ this.element.setAttribute('hidden', String(props.hidden));
333
+ }
334
+ if (props.inputmode !== undefined) {
335
+ this.setInputmode(props.inputmode);
336
+ }
337
+ if (props.lang !== undefined) {
338
+ this.element.setAttribute('lang', String(props.lang));
339
+ }
340
+ if (props.maxlength !== undefined) {
341
+ this.element.setAttribute('maxlength', String(props.maxlength));
342
+ }
343
+ if (props.minlength !== undefined) {
344
+ this.element.setAttribute('minlength', String(props.minlength));
345
+ }
346
+ if (props.name !== undefined) {
347
+ this.element.setAttribute('name', String(props.name));
348
+ }
349
+ if (props.placeholder !== undefined) {
350
+ this.element.setAttribute('placeholder', String(props.placeholder));
351
+ }
352
+ if (props.popover !== undefined) {
353
+ this.setPopover(props.popover);
354
+ }
355
+ if (props.readonly !== undefined) {
356
+ this.element.setAttribute('readonly', String(props.readonly));
357
+ }
358
+ if (props.required !== undefined) {
359
+ this.element.setAttribute('required', String(props.required));
360
+ }
361
+ if (props.role !== undefined) {
362
+ this.setRole(props.role);
363
+ }
364
+ if (props.rows !== undefined) {
365
+ this.element.setAttribute('rows', String(props.rows));
366
+ }
367
+ if (props.slot !== undefined) {
368
+ this.element.setAttribute('slot', String(props.slot));
369
+ }
370
+ if (props.spellcheck !== undefined) {
371
+ this.setSpellcheck(props.spellcheck);
372
+ }
373
+ if (props.style !== undefined) {
374
+ this.element.setAttribute('style', String(props.style));
375
+ }
376
+ if (props.tabindex !== undefined) {
377
+ this.element.setAttribute('tabindex', String(props.tabindex));
378
+ }
379
+ if (props.title !== undefined) {
380
+ this.element.setAttribute('title', String(props.title));
381
+ }
382
+ if (props.translate !== undefined) {
383
+ this.setTranslate(props.translate);
384
+ }
385
+ if (props.wrap !== undefined) {
386
+ this.setWrap(props.wrap);
387
+ }
388
+ }
389
+
390
+ setAccesskey(value: string | null | undefined): this {
391
+ if (value === null || value === undefined) {
392
+ this.element.removeAttribute('accesskey');
393
+ } else {
394
+ this.element.setAttribute('accesskey', String(value));
395
+ }
396
+ return this;
397
+ }
398
+
399
+ setAriaAtomic(value: 'false' | 'true' | boolean | null | undefined): this {
400
+ if (value === null || value === undefined) {
401
+ this.element.removeAttribute('aria-atomic');
402
+ } else {
403
+ this.element.setAttribute('aria-atomic', String(value));
404
+ }
405
+ return this;
406
+ }
407
+
408
+ setAriaAutocomplete(value: 'none' | 'inline' | 'list' | 'both' | null | undefined): this {
409
+ if (value === null || value === undefined) {
410
+ this.element.removeAttribute('aria-autocomplete');
411
+ } else {
412
+ this.element.setAttribute('aria-autocomplete', String(value));
413
+ }
414
+ return this;
415
+ }
416
+
417
+ setAriaControls(value: string | null | undefined): this {
418
+ if (value === null || value === undefined) {
419
+ this.element.removeAttribute('aria-controls');
420
+ } else {
421
+ this.element.setAttribute('aria-controls', String(value));
422
+ }
423
+ return this;
424
+ }
425
+
426
+ setAriaDescribedby(value: string | null | undefined): this {
427
+ if (value === null || value === undefined) {
428
+ this.element.removeAttribute('aria-describedby');
429
+ } else {
430
+ this.element.setAttribute('aria-describedby', String(value));
431
+ }
432
+ return this;
433
+ }
434
+
435
+ setAriaDetails(value: string | null | undefined): this {
436
+ if (value === null || value === undefined) {
437
+ this.element.removeAttribute('aria-details');
438
+ } else {
439
+ this.element.setAttribute('aria-details', String(value));
440
+ }
441
+ return this;
442
+ }
443
+
444
+ setAriaDisabled(value: 'false' | 'true' | boolean | null | undefined): this {
445
+ if (value === null || value === undefined) {
446
+ this.element.removeAttribute('aria-disabled');
447
+ } else {
448
+ this.element.setAttribute('aria-disabled', String(value));
449
+ }
450
+ return this;
451
+ }
452
+
453
+ setAriaExpanded(value: 'false' | 'true' | 'undefined' | boolean | null | undefined): this {
454
+ if (value === null || value === undefined) {
455
+ this.element.removeAttribute('aria-expanded');
456
+ } else {
457
+ this.element.setAttribute('aria-expanded', String(value));
458
+ }
459
+ return this;
460
+ }
461
+
462
+ setAriaHaspopup(value: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | boolean | null | undefined): this {
463
+ if (value === null || value === undefined) {
464
+ this.element.removeAttribute('aria-haspopup');
465
+ } else {
466
+ this.element.setAttribute('aria-haspopup', String(value));
467
+ }
468
+ return this;
469
+ }
470
+
471
+ setAriaInvalid(value: 'false' | 'true' | 'grammar' | 'spelling' | boolean | null | undefined): this {
472
+ if (value === null || value === undefined) {
473
+ this.element.removeAttribute('aria-invalid');
474
+ } else {
475
+ this.element.setAttribute('aria-invalid', String(value));
476
+ }
477
+ return this;
478
+ }
479
+
480
+ setAriaKeyshortcuts(value: string | null | undefined): this {
481
+ if (value === null || value === undefined) {
482
+ this.element.removeAttribute('aria-keyshortcuts');
483
+ } else {
484
+ this.element.setAttribute('aria-keyshortcuts', String(value));
485
+ }
486
+ return this;
487
+ }
488
+
489
+ setAriaLabel(value: string | null | undefined): this {
490
+ if (value === null || value === undefined) {
491
+ this.element.removeAttribute('aria-label');
492
+ } else {
493
+ this.element.setAttribute('aria-label', String(value));
494
+ }
495
+ return this;
496
+ }
497
+
498
+ setAriaLabelledby(value: string | null | undefined): this {
499
+ if (value === null || value === undefined) {
500
+ this.element.removeAttribute('aria-labelledby');
501
+ } else {
502
+ this.element.setAttribute('aria-labelledby', String(value));
503
+ }
504
+ return this;
505
+ }
506
+
507
+ setAriaLive(value: 'off' | 'polite' | 'assertive' | null | undefined): this {
508
+ if (value === null || value === undefined) {
509
+ this.element.removeAttribute('aria-live');
510
+ } else {
511
+ this.element.setAttribute('aria-live', String(value));
512
+ }
513
+ return this;
514
+ }
515
+
516
+ setAriaMultiline(value: 'false' | 'true' | boolean | null | undefined): this {
517
+ if (value === null || value === undefined) {
518
+ this.element.removeAttribute('aria-multiline');
519
+ } else {
520
+ this.element.setAttribute('aria-multiline', String(value));
521
+ }
522
+ return this;
523
+ }
524
+
525
+ setAriaPlaceholder(value: string | null | undefined): this {
526
+ if (value === null || value === undefined) {
527
+ this.element.removeAttribute('aria-placeholder');
528
+ } else {
529
+ this.element.setAttribute('aria-placeholder', String(value));
530
+ }
531
+ return this;
532
+ }
533
+
534
+ setAriaPressed(value: 'false' | 'true' | 'mixed' | 'undefined' | boolean | null | undefined): this {
535
+ if (value === null || value === undefined) {
536
+ this.element.removeAttribute('aria-pressed');
537
+ } else {
538
+ this.element.setAttribute('aria-pressed', String(value));
539
+ }
540
+ return this;
541
+ }
542
+
543
+ setAriaReadonly(value: 'false' | 'true' | boolean | null | undefined): this {
544
+ if (value === null || value === undefined) {
545
+ this.element.removeAttribute('aria-readonly');
546
+ } else {
547
+ this.element.setAttribute('aria-readonly', String(value));
548
+ }
549
+ return this;
550
+ }
551
+
552
+ setAriaRelevant(value: 'additions' | 'removals' | 'text' | 'all' | 'additions text' | null | undefined): this {
553
+ if (value === null || value === undefined) {
554
+ this.element.removeAttribute('aria-relevant');
555
+ } else {
556
+ this.element.setAttribute('aria-relevant', String(value));
557
+ }
558
+ return this;
559
+ }
560
+
561
+ setAriaRequired(value: 'false' | 'true' | boolean | null | undefined): this {
562
+ if (value === null || value === undefined) {
563
+ this.element.removeAttribute('aria-required');
564
+ } else {
565
+ this.element.setAttribute('aria-required', String(value));
566
+ }
567
+ return this;
568
+ }
569
+
570
+ setAriaRoledescription(value: string | null | undefined): this {
571
+ if (value === null || value === undefined) {
572
+ this.element.removeAttribute('aria-roledescription');
573
+ } else {
574
+ this.element.setAttribute('aria-roledescription', String(value));
575
+ }
576
+ return this;
577
+ }
578
+
579
+ setAutocapitalize(value: 'none' | 'sentences' | 'words' | 'characters' | null | undefined): this {
580
+ if (value === null || value === undefined) {
581
+ this.element.removeAttribute('autocapitalize');
582
+ } else {
583
+ this.element.setAttribute('autocapitalize', String(value));
584
+ }
585
+ return this;
586
+ }
587
+
588
+ setAutocomplete(value: 'off' | 'on' | null | undefined): this {
589
+ if (value === null || value === undefined) {
590
+ this.element.removeAttribute('autocomplete');
591
+ } else {
592
+ this.element.setAttribute('autocomplete', String(value));
593
+ }
594
+ return this;
595
+ }
596
+
597
+ setAutocorrect(value: 'off' | 'on' | null | undefined): this {
598
+ if (value === null || value === undefined) {
599
+ this.element.removeAttribute('autocorrect');
600
+ } else {
601
+ this.element.setAttribute('autocorrect', String(value));
602
+ }
603
+ return this;
604
+ }
605
+
606
+ setAutofocus(value: boolean | null | undefined): this {
607
+ if (value === true) {
608
+ this.element.setAttribute('autofocus', '');
609
+ } else {
610
+ this.element.removeAttribute('autofocus');
611
+ }
612
+ return this;
613
+ }
614
+
615
+ setCols(value: number | null | undefined): this {
616
+ if (value === null || value === undefined) {
617
+ this.element.removeAttribute('cols');
618
+ } else {
619
+ this.element.setAttribute('cols', String(value));
620
+ }
621
+ return this;
622
+ }
623
+
624
+ setContenteditable(value: 'true' | 'false' | 'inherit' | boolean | null | undefined): this {
625
+ if (value === null || value === undefined) {
626
+ this.element.removeAttribute('contenteditable');
627
+ } else {
628
+ this.element.setAttribute('contenteditable', String(value));
629
+ }
630
+ return this;
631
+ }
632
+
633
+ setDir(value: 'ltr' | 'rtl' | 'auto' | null | undefined): this {
634
+ if (value === null || value === undefined) {
635
+ this.element.removeAttribute('dir');
636
+ } else {
637
+ this.element.setAttribute('dir', String(value));
638
+ }
639
+ return this;
640
+ }
641
+
642
+ setDirname(value: string | null | undefined): this {
643
+ if (value === null || value === undefined) {
644
+ this.element.removeAttribute('dirname');
645
+ } else {
646
+ this.element.setAttribute('dirname', String(value));
647
+ }
648
+ return this;
649
+ }
650
+
651
+ setDisabled(value: boolean | null | undefined): this {
652
+ if (value === true) {
653
+ this.element.setAttribute('disabled', '');
654
+ } else {
655
+ this.element.removeAttribute('disabled');
656
+ }
657
+ return this;
658
+ }
659
+
660
+ setDraggable(value: boolean | null | undefined): this {
661
+ if (value === true) {
662
+ this.element.setAttribute('draggable', '');
663
+ } else {
664
+ this.element.removeAttribute('draggable');
665
+ }
666
+ return this;
667
+ }
668
+
669
+ setForm(value: string | null | undefined): this {
670
+ if (value === null || value === undefined) {
671
+ this.element.removeAttribute('form');
672
+ } else {
673
+ this.element.setAttribute('form', String(value));
674
+ }
675
+ return this;
676
+ }
677
+
678
+ setHidden(value: boolean | null | undefined): this {
679
+ if (value === true) {
680
+ this.element.setAttribute('hidden', '');
681
+ } else {
682
+ this.element.removeAttribute('hidden');
683
+ }
684
+ return this;
685
+ }
686
+
687
+ setInputmode(value: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined): this {
688
+ if (value === null || value === undefined) {
689
+ this.element.removeAttribute('inputmode');
690
+ } else {
691
+ this.element.setAttribute('inputmode', String(value));
692
+ }
693
+ return this;
694
+ }
695
+
696
+ setLang(value: string | null | undefined): this {
697
+ if (value === null || value === undefined) {
698
+ this.element.removeAttribute('lang');
699
+ } else {
700
+ this.element.setAttribute('lang', String(value));
701
+ }
702
+ return this;
703
+ }
704
+
705
+ setMaxlength(value: number | null | undefined): this {
706
+ if (value === null || value === undefined) {
707
+ this.element.removeAttribute('maxlength');
708
+ } else {
709
+ this.element.setAttribute('maxlength', String(value));
710
+ }
711
+ return this;
712
+ }
713
+
714
+ setMinlength(value: number | null | undefined): this {
715
+ if (value === null || value === undefined) {
716
+ this.element.removeAttribute('minlength');
717
+ } else {
718
+ this.element.setAttribute('minlength', String(value));
719
+ }
720
+ return this;
721
+ }
722
+
723
+ setName(value: string | null | undefined): this {
724
+ if (value === null || value === undefined) {
725
+ this.element.removeAttribute('name');
726
+ } else {
727
+ this.element.setAttribute('name', String(value));
728
+ }
729
+ return this;
730
+ }
731
+
732
+ setPlaceholder(value: string | null | undefined): this {
733
+ if (value === null || value === undefined) {
734
+ this.element.removeAttribute('placeholder');
735
+ } else {
736
+ this.element.setAttribute('placeholder', String(value));
737
+ }
738
+ return this;
739
+ }
740
+
741
+ setPopover(value: 'auto' | 'hint' | 'manual' | null | undefined): this {
742
+ if (value === null || value === undefined) {
743
+ this.element.removeAttribute('popover');
744
+ } else {
745
+ this.element.setAttribute('popover', String(value));
746
+ }
747
+ return this;
748
+ }
749
+
750
+ setReadonly(value: boolean | null | undefined): this {
751
+ if (value === true) {
752
+ this.element.setAttribute('readonly', '');
753
+ } else {
754
+ this.element.removeAttribute('readonly');
755
+ }
756
+ return this;
757
+ }
758
+
759
+ setRequired(value: boolean | null | undefined): this {
760
+ if (value === true) {
761
+ this.element.setAttribute('required', '');
762
+ } else {
763
+ this.element.removeAttribute('required');
764
+ }
765
+ return this;
766
+ }
767
+
768
+ 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 {
769
+ if (value === null || value === undefined) {
770
+ this.element.removeAttribute('role');
771
+ } else {
772
+ this.element.setAttribute('role', String(value));
773
+ }
774
+ return this;
775
+ }
776
+
777
+ setRows(value: number | null | undefined): this {
778
+ if (value === null || value === undefined) {
779
+ this.element.removeAttribute('rows');
780
+ } else {
781
+ this.element.setAttribute('rows', String(value));
782
+ }
783
+ return this;
784
+ }
785
+
786
+ setSlot(value: string | null | undefined): this {
787
+ if (value === null || value === undefined) {
788
+ this.element.removeAttribute('slot');
789
+ } else {
790
+ this.element.setAttribute('slot', String(value));
791
+ }
792
+ return this;
793
+ }
794
+
795
+ setSpellcheck(value: 'true' | 'false' | boolean | null | undefined): this {
796
+ if (value === null || value === undefined) {
797
+ this.element.removeAttribute('spellcheck');
798
+ } else {
799
+ this.element.setAttribute('spellcheck', String(value));
800
+ }
801
+ return this;
802
+ }
803
+
804
+ setStyle(value: string | null | undefined): this {
805
+ if (value === null || value === undefined) {
806
+ this.element.removeAttribute('style');
807
+ } else {
808
+ this.element.setAttribute('style', String(value));
809
+ }
810
+ return this;
811
+ }
812
+
813
+ setTabindex(value: number | null | undefined): this {
814
+ if (value === null || value === undefined) {
815
+ this.element.removeAttribute('tabindex');
816
+ } else {
817
+ this.element.setAttribute('tabindex', String(value));
818
+ }
819
+ return this;
820
+ }
821
+
822
+ setTitle(value: string | null | undefined): this {
823
+ if (value === null || value === undefined) {
824
+ this.element.removeAttribute('title');
825
+ } else {
826
+ this.element.setAttribute('title', String(value));
827
+ }
828
+ return this;
829
+ }
830
+
831
+ setTranslate(value: 'yes' | 'no' | null | undefined): this {
832
+ if (value === null || value === undefined) {
833
+ this.element.removeAttribute('translate');
834
+ } else {
835
+ this.element.setAttribute('translate', String(value));
836
+ }
837
+ return this;
838
+ }
839
+
840
+ setWrap(value: 'hard' | 'off' | 'soft' | null | undefined): this {
841
+ if (value === null || value === undefined) {
842
+ this.element.removeAttribute('wrap');
843
+ } else {
844
+ this.element.setAttribute('wrap', String(value));
845
+ }
846
+ return this;
847
+ }
848
+
849
+ setChildren(children: string | HTMLElement | (string | HTMLElement)[]): this {
850
+ // Clear existing children
851
+ while (this.element.firstChild) {
852
+ this.element.removeChild(this.element.firstChild);
853
+ }
854
+
855
+ if (typeof children === 'string') {
856
+ this.element.textContent = children;
857
+ } else if (Array.isArray(children)) {
858
+ children.forEach(child => {
859
+ if (typeof child === 'string') {
860
+ this.element.appendChild(document.createTextNode(child));
861
+ } else {
862
+ this.element.appendChild(child);
863
+ }
864
+ });
865
+ } else {
866
+ this.element.appendChild(children);
867
+ }
868
+ return this;
869
+ }
870
+
871
+ getElement(): HTMLElement {
872
+ return this.element;
873
+ }
874
+ }