boxwood 2.6.0 → 2.8.2
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/index.d.ts +569 -420
- package/index.js +179 -59
- package/package.json +5 -5
- package/ui/markdown/index.js +174 -35
package/index.d.ts
CHANGED
|
@@ -1,545 +1,694 @@
|
|
|
1
1
|
// TypeScript definitions for boxwood
|
|
2
|
-
declare module
|
|
2
|
+
declare module "boxwood" {
|
|
3
3
|
// Core types
|
|
4
|
-
type Child = string | number | Node | Node[] | null | undefined
|
|
5
|
-
type Children = Child | Child[]
|
|
4
|
+
type Child = string | number | Node | Node[] | null | undefined
|
|
5
|
+
type Children = Child | Child[]
|
|
6
6
|
|
|
7
7
|
interface Node {
|
|
8
|
-
name: string
|
|
9
|
-
attributes?: Record<string, any
|
|
10
|
-
children?: Children
|
|
11
|
-
ignore?: boolean
|
|
8
|
+
name: string
|
|
9
|
+
attributes?: Record<string, any>
|
|
10
|
+
children?: Children
|
|
11
|
+
ignore?: boolean
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface ComponentProps {
|
|
15
|
-
[key: string]: any
|
|
15
|
+
[key: string]: any
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
interface TranslateFunction {
|
|
19
|
-
(key: string): string
|
|
19
|
+
(key: string): string
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
interface ComponentWithI18n<T = ComponentProps> {
|
|
23
|
-
(
|
|
23
|
+
(
|
|
24
|
+
props: T & { translate: TranslateFunction },
|
|
25
|
+
children?: Children,
|
|
26
|
+
): Node | Node[]
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
interface Component<T = ComponentProps> {
|
|
27
|
-
(props?: T, children?: Children): Node | Node[]
|
|
30
|
+
(props?: T, children?: Children): Node | Node[]
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
// HTML Attributes
|
|
31
34
|
interface GlobalAttributes {
|
|
32
|
-
accesskey?: string
|
|
33
|
-
autocapitalize?: string
|
|
34
|
-
class?: string
|
|
35
|
-
className?: string
|
|
36
|
-
contenteditable?: boolean |
|
|
37
|
-
contextmenu?: string
|
|
38
|
-
dir?:
|
|
39
|
-
draggable?: boolean |
|
|
40
|
-
hidden?: boolean
|
|
41
|
-
id?: string
|
|
42
|
-
lang?: string
|
|
43
|
-
slot?: string
|
|
44
|
-
spellcheck?: boolean |
|
|
45
|
-
style?: string | Record<string, string | number
|
|
46
|
-
tabindex?: number | string
|
|
47
|
-
title?: string
|
|
48
|
-
translate?:
|
|
49
|
-
role?: string
|
|
35
|
+
accesskey?: string
|
|
36
|
+
autocapitalize?: string
|
|
37
|
+
class?: string
|
|
38
|
+
className?: string
|
|
39
|
+
contenteditable?: boolean | "true" | "false"
|
|
40
|
+
contextmenu?: string
|
|
41
|
+
dir?: "ltr" | "rtl" | "auto"
|
|
42
|
+
draggable?: boolean | "true" | "false"
|
|
43
|
+
hidden?: boolean
|
|
44
|
+
id?: string
|
|
45
|
+
lang?: string
|
|
46
|
+
slot?: string
|
|
47
|
+
spellcheck?: boolean | "true" | "false"
|
|
48
|
+
style?: string | Record<string, string | number>
|
|
49
|
+
tabindex?: number | string
|
|
50
|
+
title?: string
|
|
51
|
+
translate?: "yes" | "no"
|
|
52
|
+
role?: string
|
|
50
53
|
// Data attributes
|
|
51
|
-
[key: `data-${string}`]: any
|
|
54
|
+
[key: `data-${string}`]: any
|
|
52
55
|
// Event handlers
|
|
53
|
-
onclick?: string | Function
|
|
54
|
-
ondblclick?: string | Function
|
|
55
|
-
onmousedown?: string | Function
|
|
56
|
-
onmouseup?: string | Function
|
|
57
|
-
onmouseover?: string | Function
|
|
58
|
-
onmousemove?: string | Function
|
|
59
|
-
onmouseout?: string | Function
|
|
60
|
-
onmouseenter?: string | Function
|
|
61
|
-
onmouseleave?: string | Function
|
|
62
|
-
onkeydown?: string | Function
|
|
63
|
-
onkeyup?: string | Function
|
|
64
|
-
onkeypress?: string | Function
|
|
65
|
-
onfocus?: string | Function
|
|
66
|
-
onblur?: string | Function
|
|
67
|
-
onchange?: string | Function
|
|
68
|
-
oninput?: string | Function
|
|
69
|
-
onsubmit?: string | Function
|
|
70
|
-
onreset?: string | Function
|
|
71
|
-
onload?: string | Function
|
|
72
|
-
onerror?: string | Function
|
|
73
|
-
onresize?: string | Function
|
|
74
|
-
onscroll?: string | Function
|
|
56
|
+
onclick?: string | Function
|
|
57
|
+
ondblclick?: string | Function
|
|
58
|
+
onmousedown?: string | Function
|
|
59
|
+
onmouseup?: string | Function
|
|
60
|
+
onmouseover?: string | Function
|
|
61
|
+
onmousemove?: string | Function
|
|
62
|
+
onmouseout?: string | Function
|
|
63
|
+
onmouseenter?: string | Function
|
|
64
|
+
onmouseleave?: string | Function
|
|
65
|
+
onkeydown?: string | Function
|
|
66
|
+
onkeyup?: string | Function
|
|
67
|
+
onkeypress?: string | Function
|
|
68
|
+
onfocus?: string | Function
|
|
69
|
+
onblur?: string | Function
|
|
70
|
+
onchange?: string | Function
|
|
71
|
+
oninput?: string | Function
|
|
72
|
+
onsubmit?: string | Function
|
|
73
|
+
onreset?: string | Function
|
|
74
|
+
onload?: string | Function
|
|
75
|
+
onerror?: string | Function
|
|
76
|
+
onresize?: string | Function
|
|
77
|
+
onscroll?: string | Function
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
// Element-specific attributes
|
|
78
81
|
interface AnchorAttributes extends GlobalAttributes {
|
|
79
|
-
href?: string
|
|
80
|
-
target?:
|
|
81
|
-
rel?: string
|
|
82
|
-
download?: string | boolean
|
|
83
|
-
hreflang?: string
|
|
84
|
-
ping?: string
|
|
85
|
-
referrerpolicy?: string
|
|
86
|
-
type?: string
|
|
82
|
+
href?: string
|
|
83
|
+
target?: "_blank" | "_self" | "_parent" | "_top"
|
|
84
|
+
rel?: string
|
|
85
|
+
download?: string | boolean
|
|
86
|
+
hreflang?: string
|
|
87
|
+
ping?: string
|
|
88
|
+
referrerpolicy?: string
|
|
89
|
+
type?: string
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
interface ImageAttributes extends GlobalAttributes {
|
|
90
|
-
src?: string
|
|
91
|
-
alt?: string
|
|
92
|
-
width?: number | string
|
|
93
|
-
height?: number | string
|
|
94
|
-
loading?:
|
|
95
|
-
decoding?:
|
|
96
|
-
srcset?: string
|
|
97
|
-
sizes?: string
|
|
98
|
-
crossorigin?:
|
|
99
|
-
referrerpolicy?: string
|
|
93
|
+
src?: string
|
|
94
|
+
alt?: string
|
|
95
|
+
width?: number | string
|
|
96
|
+
height?: number | string
|
|
97
|
+
loading?: "lazy" | "eager"
|
|
98
|
+
decoding?: "sync" | "async" | "auto"
|
|
99
|
+
srcset?: string
|
|
100
|
+
sizes?: string
|
|
101
|
+
crossorigin?: "anonymous" | "use-credentials"
|
|
102
|
+
referrerpolicy?: string
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
interface InputAttributes extends GlobalAttributes {
|
|
103
|
-
type?:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
106
|
+
type?:
|
|
107
|
+
| "text"
|
|
108
|
+
| "password"
|
|
109
|
+
| "email"
|
|
110
|
+
| "number"
|
|
111
|
+
| "tel"
|
|
112
|
+
| "url"
|
|
113
|
+
| "search"
|
|
114
|
+
| "date"
|
|
115
|
+
| "time"
|
|
116
|
+
| "datetime-local"
|
|
117
|
+
| "month"
|
|
118
|
+
| "week"
|
|
119
|
+
| "color"
|
|
120
|
+
| "checkbox"
|
|
121
|
+
| "radio"
|
|
122
|
+
| "file"
|
|
123
|
+
| "submit"
|
|
124
|
+
| "reset"
|
|
125
|
+
| "button"
|
|
126
|
+
| "hidden"
|
|
127
|
+
| "image"
|
|
128
|
+
| "range"
|
|
129
|
+
name?: string
|
|
130
|
+
value?: string | number
|
|
131
|
+
placeholder?: string
|
|
132
|
+
required?: boolean
|
|
133
|
+
disabled?: boolean
|
|
134
|
+
readonly?: boolean
|
|
135
|
+
checked?: boolean
|
|
136
|
+
min?: number | string
|
|
137
|
+
max?: number | string
|
|
138
|
+
step?: number | string
|
|
139
|
+
pattern?: string
|
|
140
|
+
multiple?: boolean
|
|
141
|
+
accept?: string
|
|
142
|
+
autocomplete?: string
|
|
143
|
+
autofocus?: boolean
|
|
144
|
+
form?: string
|
|
145
|
+
list?: string
|
|
146
|
+
maxlength?: number
|
|
147
|
+
minlength?: number
|
|
148
|
+
size?: number
|
|
127
149
|
}
|
|
128
150
|
|
|
129
151
|
interface FormAttributes extends GlobalAttributes {
|
|
130
|
-
action?: string
|
|
131
|
-
method?:
|
|
132
|
-
enctype?:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
152
|
+
action?: string
|
|
153
|
+
method?: "get" | "post" | "dialog"
|
|
154
|
+
enctype?:
|
|
155
|
+
| "application/x-www-form-urlencoded"
|
|
156
|
+
| "multipart/form-data"
|
|
157
|
+
| "text/plain"
|
|
158
|
+
name?: string
|
|
159
|
+
target?: string
|
|
160
|
+
novalidate?: boolean
|
|
161
|
+
autocomplete?: "on" | "off"
|
|
137
162
|
}
|
|
138
163
|
|
|
139
164
|
interface ButtonAttributes extends GlobalAttributes {
|
|
140
|
-
type?:
|
|
141
|
-
name?: string
|
|
142
|
-
value?: string
|
|
143
|
-
disabled?: boolean
|
|
144
|
-
form?: string
|
|
145
|
-
formaction?: string
|
|
146
|
-
formenctype?: string
|
|
147
|
-
formmethod?: string
|
|
148
|
-
formnovalidate?: boolean
|
|
149
|
-
formtarget?: string
|
|
150
|
-
autofocus?: boolean
|
|
165
|
+
type?: "submit" | "reset" | "button"
|
|
166
|
+
name?: string
|
|
167
|
+
value?: string
|
|
168
|
+
disabled?: boolean
|
|
169
|
+
form?: string
|
|
170
|
+
formaction?: string
|
|
171
|
+
formenctype?: string
|
|
172
|
+
formmethod?: string
|
|
173
|
+
formnovalidate?: boolean
|
|
174
|
+
formtarget?: string
|
|
175
|
+
autofocus?: boolean
|
|
151
176
|
}
|
|
152
177
|
|
|
153
178
|
interface TextAreaAttributes extends GlobalAttributes {
|
|
154
|
-
name?: string
|
|
155
|
-
rows?: number
|
|
156
|
-
cols?: number
|
|
157
|
-
disabled?: boolean
|
|
158
|
-
readonly?: boolean
|
|
159
|
-
required?: boolean
|
|
160
|
-
placeholder?: string
|
|
161
|
-
autofocus?: boolean
|
|
162
|
-
form?: string
|
|
163
|
-
maxlength?: number
|
|
164
|
-
minlength?: number
|
|
165
|
-
wrap?:
|
|
179
|
+
name?: string
|
|
180
|
+
rows?: number
|
|
181
|
+
cols?: number
|
|
182
|
+
disabled?: boolean
|
|
183
|
+
readonly?: boolean
|
|
184
|
+
required?: boolean
|
|
185
|
+
placeholder?: string
|
|
186
|
+
autofocus?: boolean
|
|
187
|
+
form?: string
|
|
188
|
+
maxlength?: number
|
|
189
|
+
minlength?: number
|
|
190
|
+
wrap?: "hard" | "soft"
|
|
166
191
|
}
|
|
167
192
|
|
|
168
193
|
interface SelectAttributes extends GlobalAttributes {
|
|
169
|
-
name?: string
|
|
170
|
-
disabled?: boolean
|
|
171
|
-
required?: boolean
|
|
172
|
-
multiple?: boolean
|
|
173
|
-
size?: number
|
|
174
|
-
form?: string
|
|
175
|
-
autofocus?: boolean
|
|
194
|
+
name?: string
|
|
195
|
+
disabled?: boolean
|
|
196
|
+
required?: boolean
|
|
197
|
+
multiple?: boolean
|
|
198
|
+
size?: number
|
|
199
|
+
form?: string
|
|
200
|
+
autofocus?: boolean
|
|
176
201
|
}
|
|
177
202
|
|
|
178
203
|
interface OptionAttributes extends GlobalAttributes {
|
|
179
|
-
value?: string
|
|
180
|
-
label?: string
|
|
181
|
-
selected?: boolean
|
|
182
|
-
disabled?: boolean
|
|
204
|
+
value?: string
|
|
205
|
+
label?: string
|
|
206
|
+
selected?: boolean
|
|
207
|
+
disabled?: boolean
|
|
183
208
|
}
|
|
184
209
|
|
|
185
210
|
interface LabelAttributes extends GlobalAttributes {
|
|
186
|
-
for?: string
|
|
187
|
-
htmlFor?: string
|
|
211
|
+
for?: string
|
|
212
|
+
htmlFor?: string
|
|
188
213
|
}
|
|
189
214
|
|
|
190
215
|
interface ScriptAttributes extends GlobalAttributes {
|
|
191
|
-
src?: string
|
|
192
|
-
type?: string
|
|
193
|
-
async?: boolean
|
|
194
|
-
defer?: boolean
|
|
195
|
-
crossorigin?:
|
|
196
|
-
integrity?: string
|
|
197
|
-
nomodule?: boolean
|
|
198
|
-
referrerpolicy?: string
|
|
199
|
-
target?:
|
|
216
|
+
src?: string
|
|
217
|
+
type?: string
|
|
218
|
+
async?: boolean
|
|
219
|
+
defer?: boolean
|
|
220
|
+
crossorigin?: "anonymous" | "use-credentials"
|
|
221
|
+
integrity?: string
|
|
222
|
+
nomodule?: boolean
|
|
223
|
+
referrerpolicy?: string
|
|
224
|
+
target?: "head" | "body"
|
|
200
225
|
}
|
|
201
226
|
|
|
202
227
|
interface LinkAttributes extends GlobalAttributes {
|
|
203
|
-
href?: string
|
|
204
|
-
rel?: string
|
|
205
|
-
type?: string
|
|
206
|
-
media?: string
|
|
207
|
-
as?: string
|
|
208
|
-
crossorigin?:
|
|
209
|
-
integrity?: string
|
|
210
|
-
referrerpolicy?: string
|
|
211
|
-
sizes?: string
|
|
212
|
-
imagesrcset?: string
|
|
213
|
-
imagesizes?: string
|
|
228
|
+
href?: string
|
|
229
|
+
rel?: string
|
|
230
|
+
type?: string
|
|
231
|
+
media?: string
|
|
232
|
+
as?: string
|
|
233
|
+
crossorigin?: "anonymous" | "use-credentials"
|
|
234
|
+
integrity?: string
|
|
235
|
+
referrerpolicy?: string
|
|
236
|
+
sizes?: string
|
|
237
|
+
imagesrcset?: string
|
|
238
|
+
imagesizes?: string
|
|
214
239
|
}
|
|
215
240
|
|
|
216
241
|
interface MetaAttributes extends GlobalAttributes {
|
|
217
|
-
charset?: string
|
|
218
|
-
content?: string
|
|
219
|
-
httpEquiv?: string
|
|
220
|
-
name?: string
|
|
221
|
-
property?: string
|
|
242
|
+
charset?: string
|
|
243
|
+
content?: string
|
|
244
|
+
httpEquiv?: string
|
|
245
|
+
name?: string
|
|
246
|
+
property?: string
|
|
222
247
|
}
|
|
223
248
|
|
|
224
249
|
interface MediaAttributes extends GlobalAttributes {
|
|
225
|
-
src?: string
|
|
226
|
-
controls?: boolean
|
|
227
|
-
autoplay?: boolean
|
|
228
|
-
loop?: boolean
|
|
229
|
-
muted?: boolean
|
|
230
|
-
preload?:
|
|
231
|
-
crossorigin?:
|
|
250
|
+
src?: string
|
|
251
|
+
controls?: boolean
|
|
252
|
+
autoplay?: boolean
|
|
253
|
+
loop?: boolean
|
|
254
|
+
muted?: boolean
|
|
255
|
+
preload?: "none" | "metadata" | "auto"
|
|
256
|
+
crossorigin?: "anonymous" | "use-credentials"
|
|
232
257
|
}
|
|
233
258
|
|
|
234
259
|
interface VideoAttributes extends MediaAttributes {
|
|
235
|
-
width?: number | string
|
|
236
|
-
height?: number | string
|
|
237
|
-
poster?: string
|
|
238
|
-
playsinline?: boolean
|
|
260
|
+
width?: number | string
|
|
261
|
+
height?: number | string
|
|
262
|
+
poster?: string
|
|
263
|
+
playsinline?: boolean
|
|
239
264
|
}
|
|
240
265
|
|
|
241
266
|
interface AudioAttributes extends MediaAttributes {}
|
|
242
267
|
|
|
243
268
|
interface IframeAttributes extends GlobalAttributes {
|
|
244
|
-
src?: string
|
|
245
|
-
srcdoc?: string
|
|
246
|
-
name?: string
|
|
247
|
-
width?: number | string
|
|
248
|
-
height?: number | string
|
|
249
|
-
allow?: string
|
|
250
|
-
allowfullscreen?: boolean
|
|
251
|
-
allowpaymentrequest?: boolean
|
|
252
|
-
loading?:
|
|
253
|
-
referrerpolicy?: string
|
|
254
|
-
sandbox?: string
|
|
269
|
+
src?: string
|
|
270
|
+
srcdoc?: string
|
|
271
|
+
name?: string
|
|
272
|
+
width?: number | string
|
|
273
|
+
height?: number | string
|
|
274
|
+
allow?: string
|
|
275
|
+
allowfullscreen?: boolean
|
|
276
|
+
allowpaymentrequest?: boolean
|
|
277
|
+
loading?: "lazy" | "eager"
|
|
278
|
+
referrerpolicy?: string
|
|
279
|
+
sandbox?: string
|
|
255
280
|
}
|
|
256
281
|
|
|
257
282
|
interface TableCellAttributes extends GlobalAttributes {
|
|
258
|
-
colspan?: number
|
|
259
|
-
rowspan?: number
|
|
260
|
-
headers?: string
|
|
283
|
+
colspan?: number
|
|
284
|
+
rowspan?: number
|
|
285
|
+
headers?: string
|
|
261
286
|
}
|
|
262
287
|
|
|
263
288
|
// SVG Attributes
|
|
264
289
|
interface SVGAttributes extends GlobalAttributes {
|
|
265
290
|
// Core SVG attributes
|
|
266
|
-
viewBox?: string
|
|
267
|
-
preserveAspectRatio?: string
|
|
268
|
-
xmlns?: string
|
|
269
|
-
xmlnsXlink?: string
|
|
270
|
-
version?: string
|
|
271
|
-
baseProfile?: string
|
|
272
|
-
x?: number | string
|
|
273
|
-
y?: number | string
|
|
274
|
-
width?: number | string
|
|
275
|
-
height?: number | string
|
|
291
|
+
viewBox?: string
|
|
292
|
+
preserveAspectRatio?: string
|
|
293
|
+
xmlns?: string
|
|
294
|
+
xmlnsXlink?: string
|
|
295
|
+
version?: string
|
|
296
|
+
baseProfile?: string
|
|
297
|
+
x?: number | string
|
|
298
|
+
y?: number | string
|
|
299
|
+
width?: number | string
|
|
300
|
+
height?: number | string
|
|
276
301
|
// Presentation attributes
|
|
277
|
-
fill?: string
|
|
278
|
-
fillOpacity?: number | string
|
|
279
|
-
fillRule?:
|
|
280
|
-
stroke?: string
|
|
281
|
-
strokeWidth?: number | string
|
|
282
|
-
strokeOpacity?: number | string
|
|
283
|
-
strokeLinecap?:
|
|
284
|
-
strokeLinejoin?:
|
|
285
|
-
strokeDasharray?: string
|
|
286
|
-
strokeDashoffset?: number | string
|
|
287
|
-
opacity?: number | string
|
|
288
|
-
transform?: string
|
|
289
|
-
vectorEffect?: string
|
|
290
|
-
shapeRendering?: string
|
|
291
|
-
pathLength?: number
|
|
302
|
+
fill?: string
|
|
303
|
+
fillOpacity?: number | string
|
|
304
|
+
fillRule?: "nonzero" | "evenodd"
|
|
305
|
+
stroke?: string
|
|
306
|
+
strokeWidth?: number | string
|
|
307
|
+
strokeOpacity?: number | string
|
|
308
|
+
strokeLinecap?: "butt" | "round" | "square"
|
|
309
|
+
strokeLinejoin?: "miter" | "round" | "bevel"
|
|
310
|
+
strokeDasharray?: string
|
|
311
|
+
strokeDashoffset?: number | string
|
|
312
|
+
opacity?: number | string
|
|
313
|
+
transform?: string
|
|
314
|
+
vectorEffect?: string
|
|
315
|
+
shapeRendering?: string
|
|
316
|
+
pathLength?: number
|
|
292
317
|
// Common SVG attributes
|
|
293
|
-
d?: string
|
|
294
|
-
points?: string
|
|
295
|
-
cx?: number | string
|
|
296
|
-
cy?: number | string
|
|
297
|
-
r?: number | string
|
|
298
|
-
rx?: number | string
|
|
299
|
-
ry?: number | string
|
|
300
|
-
x1?: number | string
|
|
301
|
-
y1?: number | string
|
|
302
|
-
x2?: number | string
|
|
303
|
-
y2?: number | string
|
|
304
|
-
href?: string
|
|
305
|
-
xlinkHref?: string
|
|
306
|
-
id?: string
|
|
307
|
-
clipPath?: string
|
|
308
|
-
mask?: string
|
|
309
|
-
filter?: string
|
|
310
|
-
markerStart?: string
|
|
311
|
-
markerMid?: string
|
|
312
|
-
markerEnd?: string
|
|
318
|
+
d?: string
|
|
319
|
+
points?: string
|
|
320
|
+
cx?: number | string
|
|
321
|
+
cy?: number | string
|
|
322
|
+
r?: number | string
|
|
323
|
+
rx?: number | string
|
|
324
|
+
ry?: number | string
|
|
325
|
+
x1?: number | string
|
|
326
|
+
y1?: number | string
|
|
327
|
+
x2?: number | string
|
|
328
|
+
y2?: number | string
|
|
329
|
+
href?: string
|
|
330
|
+
xlinkHref?: string
|
|
331
|
+
id?: string
|
|
332
|
+
clipPath?: string
|
|
333
|
+
mask?: string
|
|
334
|
+
filter?: string
|
|
335
|
+
markerStart?: string
|
|
336
|
+
markerMid?: string
|
|
337
|
+
markerEnd?: string
|
|
313
338
|
// Animation attributes
|
|
314
|
-
attributeName?: string
|
|
315
|
-
from?: string | number
|
|
316
|
-
to?: string | number
|
|
317
|
-
dur?: string
|
|
318
|
-
repeatCount?: number |
|
|
339
|
+
attributeName?: string
|
|
340
|
+
from?: string | number
|
|
341
|
+
to?: string | number
|
|
342
|
+
dur?: string
|
|
343
|
+
repeatCount?: number | "indefinite"
|
|
319
344
|
// Gradient attributes
|
|
320
|
-
gradientUnits?:
|
|
321
|
-
gradientTransform?: string
|
|
322
|
-
fx?: number | string
|
|
323
|
-
fy?: number | string
|
|
324
|
-
offset?: string
|
|
325
|
-
stopColor?: string
|
|
326
|
-
stopOpacity?: number | string
|
|
345
|
+
gradientUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
346
|
+
gradientTransform?: string
|
|
347
|
+
fx?: number | string
|
|
348
|
+
fy?: number | string
|
|
349
|
+
offset?: string
|
|
350
|
+
stopColor?: string
|
|
351
|
+
stopOpacity?: number | string
|
|
327
352
|
// Text attributes
|
|
328
|
-
textAnchor?:
|
|
329
|
-
dominantBaseline?: string
|
|
330
|
-
fontSize?: number | string
|
|
331
|
-
fontFamily?: string
|
|
332
|
-
fontWeight?: number | string
|
|
333
|
-
letterSpacing?: number | string
|
|
334
|
-
textDecoration?: string
|
|
353
|
+
textAnchor?: "start" | "middle" | "end"
|
|
354
|
+
dominantBaseline?: string
|
|
355
|
+
fontSize?: number | string
|
|
356
|
+
fontFamily?: string
|
|
357
|
+
fontWeight?: number | string
|
|
358
|
+
letterSpacing?: number | string
|
|
359
|
+
textDecoration?: string
|
|
335
360
|
// Pattern attributes
|
|
336
|
-
patternUnits?:
|
|
337
|
-
patternTransform?: string
|
|
338
|
-
patternContentUnits?:
|
|
361
|
+
patternUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
362
|
+
patternTransform?: string
|
|
363
|
+
patternContentUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
339
364
|
}
|
|
340
365
|
|
|
341
366
|
// Element type functions
|
|
342
|
-
type ElementFunction<T = GlobalAttributes> = (
|
|
367
|
+
type ElementFunction<T = GlobalAttributes> = (
|
|
368
|
+
attributes?: T,
|
|
369
|
+
children?: Children,
|
|
370
|
+
) => Node
|
|
343
371
|
|
|
344
372
|
// HTML Elements
|
|
345
|
-
export const A: ElementFunction<AnchorAttributes
|
|
346
|
-
export const Abbr: ElementFunction<GlobalAttributes
|
|
347
|
-
export const Address: ElementFunction<GlobalAttributes
|
|
348
|
-
export const Area: ElementFunction<
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
export const
|
|
359
|
-
export const
|
|
360
|
-
export const
|
|
361
|
-
export const
|
|
362
|
-
export const
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
export const
|
|
366
|
-
export const
|
|
367
|
-
export const
|
|
368
|
-
export const
|
|
369
|
-
export const
|
|
370
|
-
export const
|
|
371
|
-
export const
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
export const
|
|
375
|
-
export const
|
|
376
|
-
export const
|
|
377
|
-
export const
|
|
378
|
-
export const
|
|
379
|
-
export const
|
|
380
|
-
export const
|
|
381
|
-
export const
|
|
382
|
-
export const
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
export const
|
|
386
|
-
export const
|
|
387
|
-
export const
|
|
388
|
-
export const
|
|
389
|
-
export const
|
|
390
|
-
export const
|
|
391
|
-
export const
|
|
392
|
-
export const
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
export const
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
export const
|
|
404
|
-
export const
|
|
405
|
-
export const
|
|
406
|
-
export const
|
|
407
|
-
export const
|
|
408
|
-
export const
|
|
409
|
-
export const
|
|
410
|
-
export const
|
|
411
|
-
export const
|
|
412
|
-
export const
|
|
413
|
-
export const
|
|
414
|
-
export const
|
|
415
|
-
export const
|
|
416
|
-
export const
|
|
417
|
-
export const
|
|
418
|
-
export const
|
|
419
|
-
export const
|
|
420
|
-
export const
|
|
421
|
-
export const
|
|
422
|
-
export const
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
export const
|
|
426
|
-
export const
|
|
427
|
-
export const
|
|
428
|
-
export const
|
|
429
|
-
export const
|
|
430
|
-
export const
|
|
431
|
-
export const
|
|
432
|
-
export const
|
|
433
|
-
export const
|
|
434
|
-
export const
|
|
435
|
-
export const
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
export const
|
|
446
|
-
export const
|
|
447
|
-
export const
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
373
|
+
export const A: ElementFunction<AnchorAttributes>
|
|
374
|
+
export const Abbr: ElementFunction<GlobalAttributes>
|
|
375
|
+
export const Address: ElementFunction<GlobalAttributes>
|
|
376
|
+
export const Area: ElementFunction<
|
|
377
|
+
GlobalAttributes & {
|
|
378
|
+
alt?: string
|
|
379
|
+
coords?: string
|
|
380
|
+
shape?: string
|
|
381
|
+
href?: string
|
|
382
|
+
target?: string
|
|
383
|
+
rel?: string
|
|
384
|
+
}
|
|
385
|
+
>
|
|
386
|
+
export const Article: ElementFunction<GlobalAttributes>
|
|
387
|
+
export const Aside: ElementFunction<GlobalAttributes>
|
|
388
|
+
export const Audio: ElementFunction<AudioAttributes>
|
|
389
|
+
export const B: ElementFunction<GlobalAttributes>
|
|
390
|
+
export const Base: ElementFunction<
|
|
391
|
+
GlobalAttributes & { href?: string; target?: string }
|
|
392
|
+
>
|
|
393
|
+
export const Bdi: ElementFunction<GlobalAttributes>
|
|
394
|
+
export const Bdo: ElementFunction<GlobalAttributes>
|
|
395
|
+
export const Blockquote: ElementFunction<GlobalAttributes & { cite?: string }>
|
|
396
|
+
export const Body: ElementFunction<GlobalAttributes>
|
|
397
|
+
export const Br: ElementFunction<GlobalAttributes>
|
|
398
|
+
export const Button: ElementFunction<ButtonAttributes>
|
|
399
|
+
export const Canvas: ElementFunction<
|
|
400
|
+
GlobalAttributes & { width?: number | string; height?: number | string }
|
|
401
|
+
>
|
|
402
|
+
export const Caption: ElementFunction<GlobalAttributes>
|
|
403
|
+
export const Cite: ElementFunction<GlobalAttributes>
|
|
404
|
+
export const Code: ElementFunction<GlobalAttributes>
|
|
405
|
+
export const Col: ElementFunction<GlobalAttributes & { span?: number }>
|
|
406
|
+
export const Colgroup: ElementFunction<GlobalAttributes & { span?: number }>
|
|
407
|
+
export const Data: ElementFunction<GlobalAttributes & { value?: string }>
|
|
408
|
+
export const Datalist: ElementFunction<GlobalAttributes>
|
|
409
|
+
export const Dd: ElementFunction<GlobalAttributes>
|
|
410
|
+
export const Del: ElementFunction<
|
|
411
|
+
GlobalAttributes & { cite?: string; datetime?: string }
|
|
412
|
+
>
|
|
413
|
+
export const Details: ElementFunction<GlobalAttributes & { open?: boolean }>
|
|
414
|
+
export const Dfn: ElementFunction<GlobalAttributes>
|
|
415
|
+
export const Dialog: ElementFunction<GlobalAttributes & { open?: boolean }>
|
|
416
|
+
export const Div: ElementFunction<GlobalAttributes>
|
|
417
|
+
export const Dl: ElementFunction<GlobalAttributes>
|
|
418
|
+
export const Dt: ElementFunction<GlobalAttributes>
|
|
419
|
+
export const Em: ElementFunction<GlobalAttributes>
|
|
420
|
+
export const Embed: ElementFunction<
|
|
421
|
+
GlobalAttributes & {
|
|
422
|
+
src?: string
|
|
423
|
+
type?: string
|
|
424
|
+
width?: number | string
|
|
425
|
+
height?: number | string
|
|
426
|
+
}
|
|
427
|
+
>
|
|
428
|
+
export const Fieldset: ElementFunction<
|
|
429
|
+
GlobalAttributes & { disabled?: boolean; form?: string; name?: string }
|
|
430
|
+
>
|
|
431
|
+
export const Figcaption: ElementFunction<GlobalAttributes>
|
|
432
|
+
export const Figure: ElementFunction<GlobalAttributes>
|
|
433
|
+
export const Footer: ElementFunction<GlobalAttributes>
|
|
434
|
+
export const Form: ElementFunction<FormAttributes>
|
|
435
|
+
export const H1: ElementFunction<GlobalAttributes>
|
|
436
|
+
export const H2: ElementFunction<GlobalAttributes>
|
|
437
|
+
export const H3: ElementFunction<GlobalAttributes>
|
|
438
|
+
export const H4: ElementFunction<GlobalAttributes>
|
|
439
|
+
export const H5: ElementFunction<GlobalAttributes>
|
|
440
|
+
export const H6: ElementFunction<GlobalAttributes>
|
|
441
|
+
export const Head: ElementFunction<GlobalAttributes>
|
|
442
|
+
export const Header: ElementFunction<GlobalAttributes>
|
|
443
|
+
export const Hgroup: ElementFunction<GlobalAttributes>
|
|
444
|
+
export const Hr: ElementFunction<GlobalAttributes>
|
|
445
|
+
export const Html: ElementFunction<GlobalAttributes & { lang?: string }>
|
|
446
|
+
export const I: ElementFunction<GlobalAttributes>
|
|
447
|
+
export const Iframe: ElementFunction<IframeAttributes>
|
|
448
|
+
export const Img: ElementFunction<ImageAttributes>
|
|
449
|
+
export const Input: ElementFunction<InputAttributes>
|
|
450
|
+
export const Ins: ElementFunction<
|
|
451
|
+
GlobalAttributes & { cite?: string; datetime?: string }
|
|
452
|
+
>
|
|
453
|
+
export const Kbd: ElementFunction<GlobalAttributes>
|
|
454
|
+
export const Label: ElementFunction<LabelAttributes>
|
|
455
|
+
export const Legend: ElementFunction<GlobalAttributes>
|
|
456
|
+
export const Li: ElementFunction<GlobalAttributes & { value?: number }>
|
|
457
|
+
export const Link: ElementFunction<LinkAttributes>
|
|
458
|
+
export const Main: ElementFunction<GlobalAttributes>
|
|
459
|
+
export const Map: ElementFunction<GlobalAttributes & { name?: string }>
|
|
460
|
+
export const Mark: ElementFunction<GlobalAttributes>
|
|
461
|
+
export const Menu: ElementFunction<GlobalAttributes>
|
|
462
|
+
export const Meta: ElementFunction<MetaAttributes>
|
|
463
|
+
export const Meter: ElementFunction<
|
|
464
|
+
GlobalAttributes & {
|
|
465
|
+
value?: number
|
|
466
|
+
min?: number
|
|
467
|
+
max?: number
|
|
468
|
+
low?: number
|
|
469
|
+
high?: number
|
|
470
|
+
optimum?: number
|
|
471
|
+
}
|
|
472
|
+
>
|
|
473
|
+
export const Nav: ElementFunction<GlobalAttributes>
|
|
474
|
+
export const Noscript: ElementFunction<GlobalAttributes>
|
|
475
|
+
export const Object: ElementFunction<
|
|
476
|
+
GlobalAttributes & {
|
|
477
|
+
data?: string
|
|
478
|
+
type?: string
|
|
479
|
+
name?: string
|
|
480
|
+
form?: string
|
|
481
|
+
width?: number | string
|
|
482
|
+
height?: number | string
|
|
483
|
+
}
|
|
484
|
+
>
|
|
485
|
+
export const Ol: ElementFunction<
|
|
486
|
+
GlobalAttributes & {
|
|
487
|
+
reversed?: boolean
|
|
488
|
+
start?: number
|
|
489
|
+
type?: "1" | "a" | "A" | "i" | "I"
|
|
490
|
+
}
|
|
491
|
+
>
|
|
492
|
+
export const Optgroup: ElementFunction<
|
|
493
|
+
GlobalAttributes & { disabled?: boolean; label?: string }
|
|
494
|
+
>
|
|
495
|
+
export const Option: ElementFunction<OptionAttributes>
|
|
496
|
+
export const Output: ElementFunction<
|
|
497
|
+
GlobalAttributes & { for?: string; form?: string; name?: string }
|
|
498
|
+
>
|
|
499
|
+
export const P: ElementFunction<GlobalAttributes>
|
|
500
|
+
export const Param: ElementFunction<
|
|
501
|
+
GlobalAttributes & { name?: string; value?: string }
|
|
502
|
+
>
|
|
503
|
+
export const Picture: ElementFunction<GlobalAttributes>
|
|
504
|
+
export const Pre: ElementFunction<GlobalAttributes>
|
|
505
|
+
export const Progress: ElementFunction<
|
|
506
|
+
GlobalAttributes & { value?: number; max?: number }
|
|
507
|
+
>
|
|
508
|
+
export const Q: ElementFunction<GlobalAttributes & { cite?: string }>
|
|
509
|
+
export const Rp: ElementFunction<GlobalAttributes>
|
|
510
|
+
export const Rt: ElementFunction<GlobalAttributes>
|
|
511
|
+
export const Ruby: ElementFunction<GlobalAttributes>
|
|
512
|
+
export const S: ElementFunction<GlobalAttributes>
|
|
513
|
+
export const Samp: ElementFunction<GlobalAttributes>
|
|
514
|
+
export const Script: ElementFunction<ScriptAttributes>
|
|
515
|
+
export const Section: ElementFunction<GlobalAttributes>
|
|
516
|
+
export const Select: ElementFunction<SelectAttributes>
|
|
517
|
+
export const Slot: ElementFunction<GlobalAttributes & { name?: string }>
|
|
518
|
+
export const Small: ElementFunction<GlobalAttributes>
|
|
519
|
+
export const Source: ElementFunction<
|
|
520
|
+
GlobalAttributes & {
|
|
521
|
+
src?: string
|
|
522
|
+
type?: string
|
|
523
|
+
srcset?: string
|
|
524
|
+
sizes?: string
|
|
525
|
+
media?: string
|
|
526
|
+
}
|
|
527
|
+
>
|
|
528
|
+
export const Span: ElementFunction<GlobalAttributes>
|
|
529
|
+
export const Strong: ElementFunction<GlobalAttributes>
|
|
530
|
+
export const Style: ElementFunction<
|
|
531
|
+
GlobalAttributes & { type?: string; media?: string; nonce?: string }
|
|
532
|
+
>
|
|
533
|
+
export const Sub: ElementFunction<GlobalAttributes>
|
|
534
|
+
export const Summary: ElementFunction<GlobalAttributes>
|
|
535
|
+
export const Sup: ElementFunction<GlobalAttributes>
|
|
536
|
+
export const Table: ElementFunction<GlobalAttributes>
|
|
537
|
+
export const Tbody: ElementFunction<GlobalAttributes>
|
|
538
|
+
export const Td: ElementFunction<TableCellAttributes>
|
|
539
|
+
export const Template: ElementFunction<GlobalAttributes>
|
|
540
|
+
export const Textarea: ElementFunction<TextAreaAttributes>
|
|
541
|
+
export const Tfoot: ElementFunction<GlobalAttributes>
|
|
542
|
+
export const Th: ElementFunction<
|
|
543
|
+
TableCellAttributes & {
|
|
544
|
+
scope?: "row" | "col" | "rowgroup" | "colgroup"
|
|
545
|
+
abbr?: string
|
|
546
|
+
}
|
|
547
|
+
>
|
|
548
|
+
export const Thead: ElementFunction<GlobalAttributes>
|
|
549
|
+
export const Time: ElementFunction<GlobalAttributes & { datetime?: string }>
|
|
550
|
+
export const Title: ElementFunction<GlobalAttributes>
|
|
551
|
+
export const Tr: ElementFunction<GlobalAttributes>
|
|
552
|
+
export const Track: ElementFunction<
|
|
553
|
+
GlobalAttributes & {
|
|
554
|
+
kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata"
|
|
555
|
+
src?: string
|
|
556
|
+
srclang?: string
|
|
557
|
+
label?: string
|
|
558
|
+
default?: boolean
|
|
559
|
+
}
|
|
560
|
+
>
|
|
561
|
+
export const U: ElementFunction<GlobalAttributes>
|
|
562
|
+
export const Ul: ElementFunction<GlobalAttributes>
|
|
563
|
+
export const Var: ElementFunction<GlobalAttributes>
|
|
564
|
+
export const Video: ElementFunction<VideoAttributes>
|
|
565
|
+
export const Wbr: ElementFunction<GlobalAttributes>
|
|
457
566
|
|
|
458
567
|
// SVG Elements
|
|
459
|
-
export const Svg: ElementFunction<SVGAttributes
|
|
460
|
-
export const Animate: ElementFunction<SVGAttributes
|
|
461
|
-
export const AnimateMotion: ElementFunction<SVGAttributes & { path?: string
|
|
462
|
-
export const AnimateTransform: ElementFunction<
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
export const
|
|
466
|
-
export const
|
|
467
|
-
export const
|
|
468
|
-
export const
|
|
469
|
-
export const
|
|
470
|
-
export const
|
|
471
|
-
export const
|
|
472
|
-
export const
|
|
473
|
-
export const
|
|
474
|
-
export const
|
|
475
|
-
export const
|
|
476
|
-
export const
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
export const
|
|
486
|
-
export const
|
|
487
|
-
export const
|
|
488
|
-
export const
|
|
489
|
-
export const
|
|
490
|
-
export const
|
|
491
|
-
export const
|
|
568
|
+
export const Svg: ElementFunction<SVGAttributes>
|
|
569
|
+
export const Animate: ElementFunction<SVGAttributes>
|
|
570
|
+
export const AnimateMotion: ElementFunction<SVGAttributes & { path?: string }>
|
|
571
|
+
export const AnimateTransform: ElementFunction<
|
|
572
|
+
SVGAttributes & { type?: string }
|
|
573
|
+
>
|
|
574
|
+
export const Circle: ElementFunction<SVGAttributes>
|
|
575
|
+
export const ClipPath: ElementFunction<SVGAttributes>
|
|
576
|
+
export const Defs: ElementFunction<SVGAttributes>
|
|
577
|
+
export const Desc: ElementFunction<SVGAttributes>
|
|
578
|
+
export const Ellipse: ElementFunction<SVGAttributes>
|
|
579
|
+
export const Filter: ElementFunction<SVGAttributes>
|
|
580
|
+
export const ForeignObject: ElementFunction<SVGAttributes>
|
|
581
|
+
export const G: ElementFunction<SVGAttributes>
|
|
582
|
+
export const Image: ElementFunction<SVGAttributes>
|
|
583
|
+
export const Line: ElementFunction<SVGAttributes>
|
|
584
|
+
export const LinearGradient: ElementFunction<SVGAttributes>
|
|
585
|
+
export const Marker: ElementFunction<
|
|
586
|
+
SVGAttributes & {
|
|
587
|
+
markerWidth?: number | string
|
|
588
|
+
markerHeight?: number | string
|
|
589
|
+
refX?: number | string
|
|
590
|
+
refY?: number | string
|
|
591
|
+
orient?: string | number
|
|
592
|
+
}
|
|
593
|
+
>
|
|
594
|
+
export const Mask: ElementFunction<SVGAttributes>
|
|
595
|
+
export const Metadata: ElementFunction<SVGAttributes>
|
|
596
|
+
export const Path: ElementFunction<SVGAttributes>
|
|
597
|
+
export const Pattern: ElementFunction<SVGAttributes>
|
|
598
|
+
export const Polygon: ElementFunction<SVGAttributes>
|
|
599
|
+
export const Polyline: ElementFunction<SVGAttributes>
|
|
600
|
+
export const RadialGradient: ElementFunction<SVGAttributes>
|
|
601
|
+
export const Rect: ElementFunction<SVGAttributes>
|
|
602
|
+
export const Set: ElementFunction<SVGAttributes>
|
|
603
|
+
export const Stop: ElementFunction<SVGAttributes>
|
|
604
|
+
export const Switch: ElementFunction<SVGAttributes>
|
|
605
|
+
export const Symbol: ElementFunction<SVGAttributes>
|
|
606
|
+
export const Text: ElementFunction<SVGAttributes>
|
|
607
|
+
export const TextPath: ElementFunction<SVGAttributes>
|
|
608
|
+
export const Tspan: ElementFunction<SVGAttributes>
|
|
609
|
+
export const Use: ElementFunction<SVGAttributes>
|
|
610
|
+
export const View: ElementFunction<SVGAttributes>
|
|
492
611
|
|
|
493
612
|
// Special elements
|
|
494
|
-
export function Doctype(attributes?: { html?: boolean }): Node
|
|
613
|
+
export function Doctype(attributes?: { html?: boolean }): Node
|
|
495
614
|
|
|
496
615
|
// Utility functions
|
|
497
|
-
export function escape(text: string): string
|
|
498
|
-
export function raw(html: string): { html: string }
|
|
499
|
-
export function tag(
|
|
616
|
+
export function escape(text: string): string
|
|
617
|
+
export function raw(html: string): { html: string }
|
|
618
|
+
export function tag(
|
|
619
|
+
name: string,
|
|
620
|
+
attributes?: Record<string, any>,
|
|
621
|
+
children?: Children,
|
|
622
|
+
): Node
|
|
500
623
|
|
|
501
624
|
// Asset loaders
|
|
502
|
-
export function css(path: string): { css: Node }
|
|
503
|
-
export function js(path: string): { js: Node }
|
|
504
|
-
export function json(path: string): any
|
|
625
|
+
export function css(path: string): { css: Node }
|
|
626
|
+
export function js(path: string): { js: Node }
|
|
627
|
+
export function json(path: string): any
|
|
505
628
|
|
|
506
629
|
// Component system
|
|
507
630
|
interface ComponentOptions {
|
|
508
|
-
styles?: string | string[] | { css: Node } | { css: Node }[]
|
|
509
|
-
scripts?: string | string[] | { js: Node } | { js: Node }[]
|
|
631
|
+
styles?: string | string[] | { css: Node } | { css: Node }[]
|
|
632
|
+
scripts?: string | string[] | { js: Node } | { js: Node }[]
|
|
510
633
|
}
|
|
511
634
|
|
|
512
635
|
export function component<T = ComponentProps>(
|
|
513
636
|
fn: Component<T> | ComponentWithI18n<T>,
|
|
514
|
-
options?: ComponentOptions
|
|
515
|
-
): Component<T
|
|
637
|
+
options?: ComponentOptions,
|
|
638
|
+
): Component<T>
|
|
516
639
|
|
|
517
640
|
// CSS utilities
|
|
518
|
-
export function classes(
|
|
641
|
+
export function classes(
|
|
642
|
+
...args: Array<string | Record<string, boolean> | undefined | null | false>
|
|
643
|
+
): string
|
|
519
644
|
|
|
520
645
|
// Internationalization
|
|
521
646
|
export function i18n<T = ComponentProps>(
|
|
522
647
|
fn: ComponentWithI18n<T>,
|
|
523
|
-
translations: Record<string, Record<string, string
|
|
524
|
-
): Component<T
|
|
648
|
+
translations: Record<string, Record<string, string>>,
|
|
649
|
+
): Component<T>
|
|
525
650
|
|
|
526
651
|
// Compile function
|
|
527
652
|
interface CompileResult {
|
|
528
|
-
template(...args: any[]): string
|
|
653
|
+
template(...args: any[]): string
|
|
529
654
|
}
|
|
530
655
|
|
|
531
|
-
export function compile(path: string): CompileResult
|
|
656
|
+
export function compile(path: string): CompileResult
|
|
532
657
|
|
|
533
658
|
// Error types
|
|
534
659
|
export class CompileError extends Error {
|
|
535
|
-
constructor(message: string)
|
|
660
|
+
constructor(message: string)
|
|
536
661
|
}
|
|
537
662
|
|
|
538
663
|
export class SecurityError extends Error {
|
|
539
|
-
constructor(message: string)
|
|
664
|
+
constructor(message: string)
|
|
540
665
|
}
|
|
541
666
|
|
|
542
667
|
export class TranslationError extends Error {
|
|
543
|
-
constructor(message: string)
|
|
668
|
+
constructor(message: string)
|
|
544
669
|
}
|
|
545
|
-
|
|
670
|
+
|
|
671
|
+
export class FileError extends Error {
|
|
672
|
+
constructor(message: string)
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
export class RawError extends Error {
|
|
676
|
+
constructor(message: string)
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
export class CSSError extends Error {
|
|
680
|
+
constructor(message: string)
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
export class ImageError extends Error {
|
|
684
|
+
constructor(message: string)
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
export class SVGError extends Error {
|
|
688
|
+
constructor(message: string)
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
export class JSONError extends Error {
|
|
692
|
+
constructor(message: string)
|
|
693
|
+
}
|
|
694
|
+
}
|