@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.
- package/README.md +166 -0
- package/block/article/article.ts +506 -0
- package/block/aside/aside.ts +522 -0
- package/block/audio/audio.ts +506 -0
- package/block/blockquote/blockquote.ts +522 -0
- package/block/body/body.ts +458 -0
- package/block/canvas/canvas.ts +538 -0
- package/block/caption/caption.ts +506 -0
- package/block/colgroup/colgroup.ts +154 -0
- package/block/datalist/datalist.ts +506 -0
- package/block/dd/dd.ts +506 -0
- package/block/del/del.ts +538 -0
- package/block/details/details.ts +586 -0
- package/block/dialog/dialog.ts +586 -0
- package/block/div/div.ts +586 -0
- package/block/dl/dl.ts +506 -0
- package/block/dt/dt.ts +506 -0
- package/block/embed/embed.ts +317 -0
- package/block/fieldset/fieldset.ts +570 -0
- package/block/figcaption/figcaption.ts +506 -0
- package/block/figure/figure.ts +506 -0
- package/block/footer/footer.ts +522 -0
- package/block/form/form.ts +490 -0
- package/block/h1/h1.ts +490 -0
- package/block/h2/h2.ts +490 -0
- package/block/h3/h3.ts +490 -0
- package/block/h4/h4.ts +490 -0
- package/block/h5/h5.ts +490 -0
- package/block/h6/h6.ts +490 -0
- package/block/header/header.ts +298 -0
- package/block/hgroup/hgroup.ts +506 -0
- package/block/hr/hr.ts +189 -0
- package/block/html/html.ts +106 -0
- package/block/iframe/iframe.ts +538 -0
- package/block/ins/ins.ts +538 -0
- package/block/legend/legend.ts +506 -0
- package/block/li/li.ts +602 -0
- package/block/main/main.ts +538 -0
- package/block/map/map.ts +522 -0
- package/block/menu/menu.ts +554 -0
- package/block/nav/nav.ts +554 -0
- package/block/noscript/noscript.ts +282 -0
- package/block/object/object.ts +618 -0
- package/block/ol/ol.ts +618 -0
- package/block/optgroup/optgroup.ts +522 -0
- package/block/option/option.ts +618 -0
- package/block/p/p.ts +506 -0
- package/block/picture/picture.ts +506 -0
- package/block/pre/pre.ts +506 -0
- package/block/section/section.ts +538 -0
- package/block/summary/summary.ts +570 -0
- package/block/table/table.ts +570 -0
- package/block/tbody/tbody.ts +506 -0
- package/block/td/td.ts +666 -0
- package/block/template/template.ts +506 -0
- package/block/tfoot/tfoot.ts +506 -0
- package/block/th/th.ts +682 -0
- package/block/thead/thead.ts +506 -0
- package/block/tr/tr.ts +682 -0
- package/block/ul/ul.ts +570 -0
- package/block/video/video.ts +666 -0
- package/index.ts +126 -0
- package/inline/a/a.ts +682 -0
- package/inline/abbr/abbr.ts +490 -0
- package/inline/address/address.ts +474 -0
- package/inline/b/b.ts +506 -0
- package/inline/bdi/bdi.ts +490 -0
- package/inline/bdo/bdo.ts +506 -0
- package/inline/button/button.ts +826 -0
- package/inline/cite/cite.ts +506 -0
- package/inline/code/code.ts +506 -0
- package/inline/data/data.ts +522 -0
- package/inline/dfn/dfn.ts +506 -0
- package/inline/em/em.ts +506 -0
- package/inline/i/i.ts +506 -0
- package/inline/img/img.ts +445 -0
- package/inline/input/input.ts +1197 -0
- package/inline/kbd/kbd.ts +506 -0
- package/inline/label/label.ts +538 -0
- package/inline/mark/mark.ts +506 -0
- package/inline/meter/meter.ts +554 -0
- package/inline/output/output.ts +426 -0
- package/inline/progress/progress.ts +490 -0
- package/inline/q/q.ts +522 -0
- package/inline/rp/rp.ts +506 -0
- package/inline/rt/rt.ts +506 -0
- package/inline/ruby/ruby.ts +506 -0
- package/inline/s/s.ts +506 -0
- package/inline/samp/samp.ts +506 -0
- package/inline/select/select.ts +810 -0
- package/inline/slot/slot.ts +522 -0
- package/inline/small/small.ts +506 -0
- package/inline/span/span.ts +506 -0
- package/inline/strong/strong.ts +506 -0
- package/inline/sub/sub.ts +506 -0
- package/inline/sup/sup.ts +506 -0
- package/inline/svg/svg.ts +618 -0
- package/inline/textarea/textarea.ts +874 -0
- package/inline/time/time.ts +522 -0
- package/inline/u/u.ts +506 -0
- package/inline/var/var.ts +506 -0
- package/package.json +32 -0
- package/tsconfig.json +26 -0
- package/void/area/area.ts +397 -0
- package/void/base/base.ts +61 -0
- package/void/br/br.ts +77 -0
- package/void/col/col.ts +77 -0
- package/void/head/head.ts +58 -0
- package/void/link/link.ts +253 -0
- package/void/meta/meta.ts +157 -0
- package/void/param/param.ts +93 -0
- package/void/script/script.ts +250 -0
- package/void/source/source.ts +125 -0
- package/void/style/style.ts +154 -0
- package/void/title/title.ts +58 -0
- package/void/track/track.ts +157 -0
- package/void/wbr/wbr.ts +61 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE IS AUTOGENERATED. DO NOT EDIT IT.
|
|
3
|
+
*
|
|
4
|
+
* @generated December 28, 2025 12:26:31
|
|
5
|
+
* @component Noscript
|
|
6
|
+
* @description
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface NoscriptProps {
|
|
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
|
+
* Represents the autocapitalize behavior of the element
|
|
20
|
+
*/
|
|
21
|
+
autocapitalize?: 'none' | 'sentences' | 'words' | 'characters' | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Indicates whether the element is hidden
|
|
24
|
+
*/
|
|
25
|
+
autofocus?: boolean | null | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Indicates whether the element can be edited in place
|
|
28
|
+
*/
|
|
29
|
+
contenteditable?: 'true' | 'false' | 'inherit' | boolean | null | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Represents the text direction of the element
|
|
32
|
+
*/
|
|
33
|
+
dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Indicates whether the element is draggable
|
|
36
|
+
*/
|
|
37
|
+
draggable?: boolean | null | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Indicates whether the element is hidden
|
|
40
|
+
*/
|
|
41
|
+
hidden?: boolean | null | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* 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
|
|
44
|
+
*/
|
|
45
|
+
inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Specifies the primary language for the element's content
|
|
48
|
+
*/
|
|
49
|
+
lang?: string | null | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Represents the spellchecking behavior of the element
|
|
52
|
+
*/
|
|
53
|
+
spellcheck?: 'true' | 'false' | boolean | null | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Represents the CSS inline style of the element
|
|
56
|
+
*/
|
|
57
|
+
style?: string | null | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Represents a tab order of the element
|
|
60
|
+
*/
|
|
61
|
+
tabindex?: number | null | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Represents a title or tooltip for the element
|
|
64
|
+
*/
|
|
65
|
+
title?: string | null | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* used to tell user agents whether the content should be translated.
|
|
68
|
+
*/
|
|
69
|
+
translate?: 'yes' | 'no' | null | undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Noscript -
|
|
74
|
+
*/
|
|
75
|
+
export class Noscript {
|
|
76
|
+
private element: HTMLElement;
|
|
77
|
+
|
|
78
|
+
constructor(props: NoscriptProps = {}) {
|
|
79
|
+
this.element = document.createElement('noscript');
|
|
80
|
+
this.applyProps(props);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private applyProps(props: NoscriptProps): void {
|
|
84
|
+
if (props.children !== undefined) {
|
|
85
|
+
this.setChildren(props.children);
|
|
86
|
+
}
|
|
87
|
+
if (props.accesskey !== undefined) {
|
|
88
|
+
this.element.setAttribute('accesskey', String(props.accesskey));
|
|
89
|
+
}
|
|
90
|
+
if (props.autocapitalize !== undefined) {
|
|
91
|
+
this.setAutocapitalize(props.autocapitalize);
|
|
92
|
+
}
|
|
93
|
+
if (props.autofocus !== undefined) {
|
|
94
|
+
this.element.setAttribute('autofocus', String(props.autofocus));
|
|
95
|
+
}
|
|
96
|
+
if (props.contenteditable !== undefined) {
|
|
97
|
+
this.setContenteditable(props.contenteditable);
|
|
98
|
+
}
|
|
99
|
+
if (props.dir !== undefined) {
|
|
100
|
+
this.setDir(props.dir);
|
|
101
|
+
}
|
|
102
|
+
if (props.draggable !== undefined) {
|
|
103
|
+
this.element.setAttribute('draggable', String(props.draggable));
|
|
104
|
+
}
|
|
105
|
+
if (props.hidden !== undefined) {
|
|
106
|
+
this.element.setAttribute('hidden', String(props.hidden));
|
|
107
|
+
}
|
|
108
|
+
if (props.inputmode !== undefined) {
|
|
109
|
+
this.setInputmode(props.inputmode);
|
|
110
|
+
}
|
|
111
|
+
if (props.lang !== undefined) {
|
|
112
|
+
this.element.setAttribute('lang', String(props.lang));
|
|
113
|
+
}
|
|
114
|
+
if (props.spellcheck !== undefined) {
|
|
115
|
+
this.setSpellcheck(props.spellcheck);
|
|
116
|
+
}
|
|
117
|
+
if (props.style !== undefined) {
|
|
118
|
+
this.element.setAttribute('style', String(props.style));
|
|
119
|
+
}
|
|
120
|
+
if (props.tabindex !== undefined) {
|
|
121
|
+
this.element.setAttribute('tabindex', String(props.tabindex));
|
|
122
|
+
}
|
|
123
|
+
if (props.title !== undefined) {
|
|
124
|
+
this.element.setAttribute('title', String(props.title));
|
|
125
|
+
}
|
|
126
|
+
if (props.translate !== undefined) {
|
|
127
|
+
this.setTranslate(props.translate);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
setAccesskey(value: string | null | undefined): this {
|
|
132
|
+
if (value === null || value === undefined) {
|
|
133
|
+
this.element.removeAttribute('accesskey');
|
|
134
|
+
} else {
|
|
135
|
+
this.element.setAttribute('accesskey', String(value));
|
|
136
|
+
}
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
setAutocapitalize(value: 'none' | 'sentences' | 'words' | 'characters' | null | undefined): this {
|
|
141
|
+
if (value === null || value === undefined) {
|
|
142
|
+
this.element.removeAttribute('autocapitalize');
|
|
143
|
+
} else {
|
|
144
|
+
this.element.setAttribute('autocapitalize', String(value));
|
|
145
|
+
}
|
|
146
|
+
return this;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
setAutofocus(value: boolean | null | undefined): this {
|
|
150
|
+
if (value === true) {
|
|
151
|
+
this.element.setAttribute('autofocus', '');
|
|
152
|
+
} else {
|
|
153
|
+
this.element.removeAttribute('autofocus');
|
|
154
|
+
}
|
|
155
|
+
return this;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
setContenteditable(value: 'true' | 'false' | 'inherit' | boolean | null | undefined): this {
|
|
159
|
+
if (value === null || value === undefined) {
|
|
160
|
+
this.element.removeAttribute('contenteditable');
|
|
161
|
+
} else {
|
|
162
|
+
this.element.setAttribute('contenteditable', String(value));
|
|
163
|
+
}
|
|
164
|
+
return this;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
setDir(value: 'ltr' | 'rtl' | 'auto' | null | undefined): this {
|
|
168
|
+
if (value === null || value === undefined) {
|
|
169
|
+
this.element.removeAttribute('dir');
|
|
170
|
+
} else {
|
|
171
|
+
this.element.setAttribute('dir', String(value));
|
|
172
|
+
}
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
setDraggable(value: boolean | null | undefined): this {
|
|
177
|
+
if (value === true) {
|
|
178
|
+
this.element.setAttribute('draggable', '');
|
|
179
|
+
} else {
|
|
180
|
+
this.element.removeAttribute('draggable');
|
|
181
|
+
}
|
|
182
|
+
return this;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
setHidden(value: boolean | null | undefined): this {
|
|
186
|
+
if (value === true) {
|
|
187
|
+
this.element.setAttribute('hidden', '');
|
|
188
|
+
} else {
|
|
189
|
+
this.element.removeAttribute('hidden');
|
|
190
|
+
}
|
|
191
|
+
return this;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
setInputmode(value: 'none' | 'text' | 'decimal' | 'numeric' | 'email' | 'tel' | 'url' | 'search' | null | undefined): this {
|
|
195
|
+
if (value === null || value === undefined) {
|
|
196
|
+
this.element.removeAttribute('inputmode');
|
|
197
|
+
} else {
|
|
198
|
+
this.element.setAttribute('inputmode', String(value));
|
|
199
|
+
}
|
|
200
|
+
return this;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
setLang(value: string | null | undefined): this {
|
|
204
|
+
if (value === null || value === undefined) {
|
|
205
|
+
this.element.removeAttribute('lang');
|
|
206
|
+
} else {
|
|
207
|
+
this.element.setAttribute('lang', String(value));
|
|
208
|
+
}
|
|
209
|
+
return this;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
setSpellcheck(value: 'true' | 'false' | boolean | null | undefined): this {
|
|
213
|
+
if (value === null || value === undefined) {
|
|
214
|
+
this.element.removeAttribute('spellcheck');
|
|
215
|
+
} else {
|
|
216
|
+
this.element.setAttribute('spellcheck', String(value));
|
|
217
|
+
}
|
|
218
|
+
return this;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
setStyle(value: string | null | undefined): this {
|
|
222
|
+
if (value === null || value === undefined) {
|
|
223
|
+
this.element.removeAttribute('style');
|
|
224
|
+
} else {
|
|
225
|
+
this.element.setAttribute('style', String(value));
|
|
226
|
+
}
|
|
227
|
+
return this;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
setTabindex(value: number | null | undefined): this {
|
|
231
|
+
if (value === null || value === undefined) {
|
|
232
|
+
this.element.removeAttribute('tabindex');
|
|
233
|
+
} else {
|
|
234
|
+
this.element.setAttribute('tabindex', String(value));
|
|
235
|
+
}
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
setTitle(value: string | null | undefined): this {
|
|
240
|
+
if (value === null || value === undefined) {
|
|
241
|
+
this.element.removeAttribute('title');
|
|
242
|
+
} else {
|
|
243
|
+
this.element.setAttribute('title', String(value));
|
|
244
|
+
}
|
|
245
|
+
return this;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
setTranslate(value: 'yes' | 'no' | null | undefined): this {
|
|
249
|
+
if (value === null || value === undefined) {
|
|
250
|
+
this.element.removeAttribute('translate');
|
|
251
|
+
} else {
|
|
252
|
+
this.element.setAttribute('translate', String(value));
|
|
253
|
+
}
|
|
254
|
+
return this;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
setChildren(children: string | HTMLElement | (string | HTMLElement)[]): this {
|
|
258
|
+
// Clear existing children
|
|
259
|
+
while (this.element.firstChild) {
|
|
260
|
+
this.element.removeChild(this.element.firstChild);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (typeof children === 'string') {
|
|
264
|
+
this.element.textContent = children;
|
|
265
|
+
} else if (Array.isArray(children)) {
|
|
266
|
+
children.forEach(child => {
|
|
267
|
+
if (typeof child === 'string') {
|
|
268
|
+
this.element.appendChild(document.createTextNode(child));
|
|
269
|
+
} else {
|
|
270
|
+
this.element.appendChild(child);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
} else {
|
|
274
|
+
this.element.appendChild(children);
|
|
275
|
+
}
|
|
276
|
+
return this;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
getElement(): HTMLElement {
|
|
280
|
+
return this.element;
|
|
281
|
+
}
|
|
282
|
+
}
|