boxwood 1.1.1 → 2.1.0
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/.claude/settings.local.json +11 -0
- package/README.md +209 -98
- package/adapters/express/index.js +49 -0
- package/examples/typescript-example.ts +49 -0
- package/index.d.ts +545 -0
- package/index.js +168 -64
- package/package.json +6 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
// TypeScript definitions for boxwood
|
|
2
|
+
declare module 'boxwood' {
|
|
3
|
+
// Core types
|
|
4
|
+
type Child = string | number | Node | Node[] | null | undefined;
|
|
5
|
+
type Children = Child | Child[];
|
|
6
|
+
|
|
7
|
+
interface Node {
|
|
8
|
+
name: string;
|
|
9
|
+
attributes?: Record<string, any>;
|
|
10
|
+
children?: Children;
|
|
11
|
+
ignore?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ComponentProps {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface TranslateFunction {
|
|
19
|
+
(key: string): string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface ComponentWithI18n<T = ComponentProps> {
|
|
23
|
+
(props: T & { translate: TranslateFunction }, children?: Children): Node | Node[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface Component<T = ComponentProps> {
|
|
27
|
+
(props?: T, children?: Children): Node | Node[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// HTML Attributes
|
|
31
|
+
interface GlobalAttributes {
|
|
32
|
+
accesskey?: string;
|
|
33
|
+
autocapitalize?: string;
|
|
34
|
+
class?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
contenteditable?: boolean | 'true' | 'false';
|
|
37
|
+
contextmenu?: string;
|
|
38
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
39
|
+
draggable?: boolean | 'true' | 'false';
|
|
40
|
+
hidden?: boolean;
|
|
41
|
+
id?: string;
|
|
42
|
+
lang?: string;
|
|
43
|
+
slot?: string;
|
|
44
|
+
spellcheck?: boolean | 'true' | 'false';
|
|
45
|
+
style?: string | Record<string, string | number>;
|
|
46
|
+
tabindex?: number | string;
|
|
47
|
+
title?: string;
|
|
48
|
+
translate?: 'yes' | 'no';
|
|
49
|
+
role?: string;
|
|
50
|
+
// Data attributes
|
|
51
|
+
[key: `data-${string}`]: any;
|
|
52
|
+
// 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;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Element-specific attributes
|
|
78
|
+
interface AnchorAttributes extends GlobalAttributes {
|
|
79
|
+
href?: string;
|
|
80
|
+
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
81
|
+
rel?: string;
|
|
82
|
+
download?: string | boolean;
|
|
83
|
+
hreflang?: string;
|
|
84
|
+
ping?: string;
|
|
85
|
+
referrerpolicy?: string;
|
|
86
|
+
type?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface ImageAttributes extends GlobalAttributes {
|
|
90
|
+
src?: string;
|
|
91
|
+
alt?: string;
|
|
92
|
+
width?: number | string;
|
|
93
|
+
height?: number | string;
|
|
94
|
+
loading?: 'lazy' | 'eager';
|
|
95
|
+
decoding?: 'sync' | 'async' | 'auto';
|
|
96
|
+
srcset?: string;
|
|
97
|
+
sizes?: string;
|
|
98
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
99
|
+
referrerpolicy?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface InputAttributes extends GlobalAttributes {
|
|
103
|
+
type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' |
|
|
104
|
+
'date' | 'time' | 'datetime-local' | 'month' | 'week' | 'color' |
|
|
105
|
+
'checkbox' | 'radio' | 'file' | 'submit' | 'reset' | 'button' |
|
|
106
|
+
'hidden' | 'image' | 'range';
|
|
107
|
+
name?: string;
|
|
108
|
+
value?: string | number;
|
|
109
|
+
placeholder?: string;
|
|
110
|
+
required?: boolean;
|
|
111
|
+
disabled?: boolean;
|
|
112
|
+
readonly?: boolean;
|
|
113
|
+
checked?: boolean;
|
|
114
|
+
min?: number | string;
|
|
115
|
+
max?: number | string;
|
|
116
|
+
step?: number | string;
|
|
117
|
+
pattern?: string;
|
|
118
|
+
multiple?: boolean;
|
|
119
|
+
accept?: string;
|
|
120
|
+
autocomplete?: string;
|
|
121
|
+
autofocus?: boolean;
|
|
122
|
+
form?: string;
|
|
123
|
+
list?: string;
|
|
124
|
+
maxlength?: number;
|
|
125
|
+
minlength?: number;
|
|
126
|
+
size?: number;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
interface FormAttributes extends GlobalAttributes {
|
|
130
|
+
action?: string;
|
|
131
|
+
method?: 'get' | 'post' | 'dialog';
|
|
132
|
+
enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
|
|
133
|
+
name?: string;
|
|
134
|
+
target?: string;
|
|
135
|
+
novalidate?: boolean;
|
|
136
|
+
autocomplete?: 'on' | 'off';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface ButtonAttributes extends GlobalAttributes {
|
|
140
|
+
type?: 'submit' | 'reset' | 'button';
|
|
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;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
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?: 'hard' | 'soft';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
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;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
interface OptionAttributes extends GlobalAttributes {
|
|
179
|
+
value?: string;
|
|
180
|
+
label?: string;
|
|
181
|
+
selected?: boolean;
|
|
182
|
+
disabled?: boolean;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
interface LabelAttributes extends GlobalAttributes {
|
|
186
|
+
for?: string;
|
|
187
|
+
htmlFor?: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface ScriptAttributes extends GlobalAttributes {
|
|
191
|
+
src?: string;
|
|
192
|
+
type?: string;
|
|
193
|
+
async?: boolean;
|
|
194
|
+
defer?: boolean;
|
|
195
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
196
|
+
integrity?: string;
|
|
197
|
+
nomodule?: boolean;
|
|
198
|
+
referrerpolicy?: string;
|
|
199
|
+
target?: 'head' | 'body';
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
interface LinkAttributes extends GlobalAttributes {
|
|
203
|
+
href?: string;
|
|
204
|
+
rel?: string;
|
|
205
|
+
type?: string;
|
|
206
|
+
media?: string;
|
|
207
|
+
as?: string;
|
|
208
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
209
|
+
integrity?: string;
|
|
210
|
+
referrerpolicy?: string;
|
|
211
|
+
sizes?: string;
|
|
212
|
+
imagesrcset?: string;
|
|
213
|
+
imagesizes?: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
interface MetaAttributes extends GlobalAttributes {
|
|
217
|
+
charset?: string;
|
|
218
|
+
content?: string;
|
|
219
|
+
httpEquiv?: string;
|
|
220
|
+
name?: string;
|
|
221
|
+
property?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface MediaAttributes extends GlobalAttributes {
|
|
225
|
+
src?: string;
|
|
226
|
+
controls?: boolean;
|
|
227
|
+
autoplay?: boolean;
|
|
228
|
+
loop?: boolean;
|
|
229
|
+
muted?: boolean;
|
|
230
|
+
preload?: 'none' | 'metadata' | 'auto';
|
|
231
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
interface VideoAttributes extends MediaAttributes {
|
|
235
|
+
width?: number | string;
|
|
236
|
+
height?: number | string;
|
|
237
|
+
poster?: string;
|
|
238
|
+
playsinline?: boolean;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
interface AudioAttributes extends MediaAttributes {}
|
|
242
|
+
|
|
243
|
+
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?: 'lazy' | 'eager';
|
|
253
|
+
referrerpolicy?: string;
|
|
254
|
+
sandbox?: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
interface TableCellAttributes extends GlobalAttributes {
|
|
258
|
+
colspan?: number;
|
|
259
|
+
rowspan?: number;
|
|
260
|
+
headers?: string;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// SVG Attributes
|
|
264
|
+
interface SVGAttributes extends GlobalAttributes {
|
|
265
|
+
// 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;
|
|
276
|
+
// Presentation attributes
|
|
277
|
+
fill?: string;
|
|
278
|
+
fillOpacity?: number | string;
|
|
279
|
+
fillRule?: 'nonzero' | 'evenodd';
|
|
280
|
+
stroke?: string;
|
|
281
|
+
strokeWidth?: number | string;
|
|
282
|
+
strokeOpacity?: number | string;
|
|
283
|
+
strokeLinecap?: 'butt' | 'round' | 'square';
|
|
284
|
+
strokeLinejoin?: 'miter' | 'round' | 'bevel';
|
|
285
|
+
strokeDasharray?: string;
|
|
286
|
+
strokeDashoffset?: number | string;
|
|
287
|
+
opacity?: number | string;
|
|
288
|
+
transform?: string;
|
|
289
|
+
vectorEffect?: string;
|
|
290
|
+
shapeRendering?: string;
|
|
291
|
+
pathLength?: number;
|
|
292
|
+
// 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;
|
|
313
|
+
// Animation attributes
|
|
314
|
+
attributeName?: string;
|
|
315
|
+
from?: string | number;
|
|
316
|
+
to?: string | number;
|
|
317
|
+
dur?: string;
|
|
318
|
+
repeatCount?: number | 'indefinite';
|
|
319
|
+
// Gradient attributes
|
|
320
|
+
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
321
|
+
gradientTransform?: string;
|
|
322
|
+
fx?: number | string;
|
|
323
|
+
fy?: number | string;
|
|
324
|
+
offset?: string;
|
|
325
|
+
stopColor?: string;
|
|
326
|
+
stopOpacity?: number | string;
|
|
327
|
+
// Text attributes
|
|
328
|
+
textAnchor?: 'start' | 'middle' | 'end';
|
|
329
|
+
dominantBaseline?: string;
|
|
330
|
+
fontSize?: number | string;
|
|
331
|
+
fontFamily?: string;
|
|
332
|
+
fontWeight?: number | string;
|
|
333
|
+
letterSpacing?: number | string;
|
|
334
|
+
textDecoration?: string;
|
|
335
|
+
// Pattern attributes
|
|
336
|
+
patternUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
337
|
+
patternTransform?: string;
|
|
338
|
+
patternContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Element type functions
|
|
342
|
+
type ElementFunction<T = GlobalAttributes> = (attributes?: T, children?: Children) => Node;
|
|
343
|
+
|
|
344
|
+
// 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<GlobalAttributes & { alt?: string; coords?: string; shape?: string; href?: string; target?: string; rel?: string; }>;
|
|
349
|
+
export const Article: ElementFunction<GlobalAttributes>;
|
|
350
|
+
export const Aside: ElementFunction<GlobalAttributes>;
|
|
351
|
+
export const Audio: ElementFunction<AudioAttributes>;
|
|
352
|
+
export const B: ElementFunction<GlobalAttributes>;
|
|
353
|
+
export const Base: ElementFunction<GlobalAttributes & { href?: string; target?: string; }>;
|
|
354
|
+
export const Bdi: ElementFunction<GlobalAttributes>;
|
|
355
|
+
export const Bdo: ElementFunction<GlobalAttributes>;
|
|
356
|
+
export const Blockquote: ElementFunction<GlobalAttributes & { cite?: string; }>;
|
|
357
|
+
export const Body: ElementFunction<GlobalAttributes>;
|
|
358
|
+
export const Br: ElementFunction<GlobalAttributes>;
|
|
359
|
+
export const Button: ElementFunction<ButtonAttributes>;
|
|
360
|
+
export const Canvas: ElementFunction<GlobalAttributes & { width?: number | string; height?: number | string; }>;
|
|
361
|
+
export const Caption: ElementFunction<GlobalAttributes>;
|
|
362
|
+
export const Cite: ElementFunction<GlobalAttributes>;
|
|
363
|
+
export const Code: ElementFunction<GlobalAttributes>;
|
|
364
|
+
export const Col: ElementFunction<GlobalAttributes & { span?: number; }>;
|
|
365
|
+
export const Colgroup: ElementFunction<GlobalAttributes & { span?: number; }>;
|
|
366
|
+
export const Data: ElementFunction<GlobalAttributes & { value?: string; }>;
|
|
367
|
+
export const Datalist: ElementFunction<GlobalAttributes>;
|
|
368
|
+
export const Dd: ElementFunction<GlobalAttributes>;
|
|
369
|
+
export const Del: ElementFunction<GlobalAttributes & { cite?: string; datetime?: string; }>;
|
|
370
|
+
export const Details: ElementFunction<GlobalAttributes & { open?: boolean; }>;
|
|
371
|
+
export const Dfn: ElementFunction<GlobalAttributes>;
|
|
372
|
+
export const Dialog: ElementFunction<GlobalAttributes & { open?: boolean; }>;
|
|
373
|
+
export const Div: ElementFunction<GlobalAttributes>;
|
|
374
|
+
export const Dl: ElementFunction<GlobalAttributes>;
|
|
375
|
+
export const Dt: ElementFunction<GlobalAttributes>;
|
|
376
|
+
export const Em: ElementFunction<GlobalAttributes>;
|
|
377
|
+
export const Embed: ElementFunction<GlobalAttributes & { src?: string; type?: string; width?: number | string; height?: number | string; }>;
|
|
378
|
+
export const Fieldset: ElementFunction<GlobalAttributes & { disabled?: boolean; form?: string; name?: string; }>;
|
|
379
|
+
export const Figcaption: ElementFunction<GlobalAttributes>;
|
|
380
|
+
export const Figure: ElementFunction<GlobalAttributes>;
|
|
381
|
+
export const Footer: ElementFunction<GlobalAttributes>;
|
|
382
|
+
export const Form: ElementFunction<FormAttributes>;
|
|
383
|
+
export const H1: ElementFunction<GlobalAttributes>;
|
|
384
|
+
export const H2: ElementFunction<GlobalAttributes>;
|
|
385
|
+
export const H3: ElementFunction<GlobalAttributes>;
|
|
386
|
+
export const H4: ElementFunction<GlobalAttributes>;
|
|
387
|
+
export const H5: ElementFunction<GlobalAttributes>;
|
|
388
|
+
export const H6: ElementFunction<GlobalAttributes>;
|
|
389
|
+
export const Head: ElementFunction<GlobalAttributes>;
|
|
390
|
+
export const Header: ElementFunction<GlobalAttributes>;
|
|
391
|
+
export const Hgroup: ElementFunction<GlobalAttributes>;
|
|
392
|
+
export const Hr: ElementFunction<GlobalAttributes>;
|
|
393
|
+
export const Html: ElementFunction<GlobalAttributes & { lang?: string; }>;
|
|
394
|
+
export const I: ElementFunction<GlobalAttributes>;
|
|
395
|
+
export const Iframe: ElementFunction<IframeAttributes>;
|
|
396
|
+
export const Img: ElementFunction<ImageAttributes>;
|
|
397
|
+
export const Input: ElementFunction<InputAttributes>;
|
|
398
|
+
export const Ins: ElementFunction<GlobalAttributes & { cite?: string; datetime?: string; }>;
|
|
399
|
+
export const Kbd: ElementFunction<GlobalAttributes>;
|
|
400
|
+
export const Label: ElementFunction<LabelAttributes>;
|
|
401
|
+
export const Legend: ElementFunction<GlobalAttributes>;
|
|
402
|
+
export const Li: ElementFunction<GlobalAttributes & { value?: number; }>;
|
|
403
|
+
export const Link: ElementFunction<LinkAttributes>;
|
|
404
|
+
export const Main: ElementFunction<GlobalAttributes>;
|
|
405
|
+
export const Map: ElementFunction<GlobalAttributes & { name?: string; }>;
|
|
406
|
+
export const Mark: ElementFunction<GlobalAttributes>;
|
|
407
|
+
export const Menu: ElementFunction<GlobalAttributes>;
|
|
408
|
+
export const Meta: ElementFunction<MetaAttributes>;
|
|
409
|
+
export const Meter: ElementFunction<GlobalAttributes & { value?: number; min?: number; max?: number; low?: number; high?: number; optimum?: number; }>;
|
|
410
|
+
export const Nav: ElementFunction<GlobalAttributes>;
|
|
411
|
+
export const Noscript: ElementFunction<GlobalAttributes>;
|
|
412
|
+
export const Object: ElementFunction<GlobalAttributes & { data?: string; type?: string; name?: string; form?: string; width?: number | string; height?: number | string; }>;
|
|
413
|
+
export const Ol: ElementFunction<GlobalAttributes & { reversed?: boolean; start?: number; type?: '1' | 'a' | 'A' | 'i' | 'I'; }>;
|
|
414
|
+
export const Optgroup: ElementFunction<GlobalAttributes & { disabled?: boolean; label?: string; }>;
|
|
415
|
+
export const Option: ElementFunction<OptionAttributes>;
|
|
416
|
+
export const Output: ElementFunction<GlobalAttributes & { for?: string; form?: string; name?: string; }>;
|
|
417
|
+
export const P: ElementFunction<GlobalAttributes>;
|
|
418
|
+
export const Param: ElementFunction<GlobalAttributes & { name?: string; value?: string; }>;
|
|
419
|
+
export const Picture: ElementFunction<GlobalAttributes>;
|
|
420
|
+
export const Pre: ElementFunction<GlobalAttributes>;
|
|
421
|
+
export const Progress: ElementFunction<GlobalAttributes & { value?: number; max?: number; }>;
|
|
422
|
+
export const Q: ElementFunction<GlobalAttributes & { cite?: string; }>;
|
|
423
|
+
export const Rp: ElementFunction<GlobalAttributes>;
|
|
424
|
+
export const Rt: ElementFunction<GlobalAttributes>;
|
|
425
|
+
export const Ruby: ElementFunction<GlobalAttributes>;
|
|
426
|
+
export const S: ElementFunction<GlobalAttributes>;
|
|
427
|
+
export const Samp: ElementFunction<GlobalAttributes>;
|
|
428
|
+
export const Script: ElementFunction<ScriptAttributes>;
|
|
429
|
+
export const Section: ElementFunction<GlobalAttributes>;
|
|
430
|
+
export const Select: ElementFunction<SelectAttributes>;
|
|
431
|
+
export const Slot: ElementFunction<GlobalAttributes & { name?: string; }>;
|
|
432
|
+
export const Small: ElementFunction<GlobalAttributes>;
|
|
433
|
+
export const Source: ElementFunction<GlobalAttributes & { src?: string; type?: string; srcset?: string; sizes?: string; media?: string; }>;
|
|
434
|
+
export const Span: ElementFunction<GlobalAttributes>;
|
|
435
|
+
export const Strong: ElementFunction<GlobalAttributes>;
|
|
436
|
+
export const Style: ElementFunction<GlobalAttributes & { type?: string; media?: string; nonce?: string; }>;
|
|
437
|
+
export const Sub: ElementFunction<GlobalAttributes>;
|
|
438
|
+
export const Summary: ElementFunction<GlobalAttributes>;
|
|
439
|
+
export const Sup: ElementFunction<GlobalAttributes>;
|
|
440
|
+
export const Table: ElementFunction<GlobalAttributes>;
|
|
441
|
+
export const Tbody: ElementFunction<GlobalAttributes>;
|
|
442
|
+
export const Td: ElementFunction<TableCellAttributes>;
|
|
443
|
+
export const Template: ElementFunction<GlobalAttributes>;
|
|
444
|
+
export const Textarea: ElementFunction<TextAreaAttributes>;
|
|
445
|
+
export const Tfoot: ElementFunction<GlobalAttributes>;
|
|
446
|
+
export const Th: ElementFunction<TableCellAttributes & { scope?: 'row' | 'col' | 'rowgroup' | 'colgroup'; abbr?: string; }>;
|
|
447
|
+
export const Thead: ElementFunction<GlobalAttributes>;
|
|
448
|
+
export const Time: ElementFunction<GlobalAttributes & { datetime?: string; }>;
|
|
449
|
+
export const Title: ElementFunction<GlobalAttributes>;
|
|
450
|
+
export const Tr: ElementFunction<GlobalAttributes>;
|
|
451
|
+
export const Track: ElementFunction<GlobalAttributes & { kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'; src?: string; srclang?: string; label?: string; default?: boolean; }>;
|
|
452
|
+
export const U: ElementFunction<GlobalAttributes>;
|
|
453
|
+
export const Ul: ElementFunction<GlobalAttributes>;
|
|
454
|
+
export const Var: ElementFunction<GlobalAttributes>;
|
|
455
|
+
export const Video: ElementFunction<VideoAttributes>;
|
|
456
|
+
export const Wbr: ElementFunction<GlobalAttributes>;
|
|
457
|
+
|
|
458
|
+
// 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<SVGAttributes & { type?: string; }>;
|
|
463
|
+
export const Circle: ElementFunction<SVGAttributes>;
|
|
464
|
+
export const ClipPath: ElementFunction<SVGAttributes>;
|
|
465
|
+
export const Defs: ElementFunction<SVGAttributes>;
|
|
466
|
+
export const Desc: ElementFunction<SVGAttributes>;
|
|
467
|
+
export const Ellipse: ElementFunction<SVGAttributes>;
|
|
468
|
+
export const Filter: ElementFunction<SVGAttributes>;
|
|
469
|
+
export const ForeignObject: ElementFunction<SVGAttributes>;
|
|
470
|
+
export const G: ElementFunction<SVGAttributes>;
|
|
471
|
+
export const Image: ElementFunction<SVGAttributes>;
|
|
472
|
+
export const Line: ElementFunction<SVGAttributes>;
|
|
473
|
+
export const LinearGradient: ElementFunction<SVGAttributes>;
|
|
474
|
+
export const Marker: ElementFunction<SVGAttributes & { markerWidth?: number | string; markerHeight?: number | string; refX?: number | string; refY?: number | string; orient?: string | number; }>;
|
|
475
|
+
export const Mask: ElementFunction<SVGAttributes>;
|
|
476
|
+
export const Metadata: ElementFunction<SVGAttributes>;
|
|
477
|
+
export const Path: ElementFunction<SVGAttributes>;
|
|
478
|
+
export const Pattern: ElementFunction<SVGAttributes>;
|
|
479
|
+
export const Polygon: ElementFunction<SVGAttributes>;
|
|
480
|
+
export const Polyline: ElementFunction<SVGAttributes>;
|
|
481
|
+
export const RadialGradient: ElementFunction<SVGAttributes>;
|
|
482
|
+
export const Rect: ElementFunction<SVGAttributes>;
|
|
483
|
+
export const Set: ElementFunction<SVGAttributes>;
|
|
484
|
+
export const Stop: ElementFunction<SVGAttributes>;
|
|
485
|
+
export const Switch: ElementFunction<SVGAttributes>;
|
|
486
|
+
export const Symbol: ElementFunction<SVGAttributes>;
|
|
487
|
+
export const Text: ElementFunction<SVGAttributes>;
|
|
488
|
+
export const TextPath: ElementFunction<SVGAttributes>;
|
|
489
|
+
export const Tspan: ElementFunction<SVGAttributes>;
|
|
490
|
+
export const Use: ElementFunction<SVGAttributes>;
|
|
491
|
+
export const View: ElementFunction<SVGAttributes>;
|
|
492
|
+
|
|
493
|
+
// Special elements
|
|
494
|
+
export function Doctype(attributes?: { html?: boolean }): Node;
|
|
495
|
+
|
|
496
|
+
// Utility functions
|
|
497
|
+
export function escape(text: string): string;
|
|
498
|
+
export function raw(html: string): { html: string };
|
|
499
|
+
export function tag(name: string, attributes?: Record<string, any>, children?: Children): Node;
|
|
500
|
+
|
|
501
|
+
// 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;
|
|
505
|
+
|
|
506
|
+
// Component system
|
|
507
|
+
interface ComponentOptions {
|
|
508
|
+
styles?: string | string[] | { css: Node } | { css: Node }[];
|
|
509
|
+
scripts?: string | string[] | { js: Node } | { js: Node }[];
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export function component<T = ComponentProps>(
|
|
513
|
+
fn: Component<T> | ComponentWithI18n<T>,
|
|
514
|
+
options?: ComponentOptions
|
|
515
|
+
): Component<T>;
|
|
516
|
+
|
|
517
|
+
// CSS utilities
|
|
518
|
+
export function classes(...args: Array<string | Record<string, boolean> | undefined | null | false>): string;
|
|
519
|
+
|
|
520
|
+
// Internationalization
|
|
521
|
+
export function i18n<T = ComponentProps>(
|
|
522
|
+
fn: ComponentWithI18n<T>,
|
|
523
|
+
translations: Record<string, Record<string, string>>
|
|
524
|
+
): Component<T>;
|
|
525
|
+
|
|
526
|
+
// Compile function
|
|
527
|
+
interface CompileResult {
|
|
528
|
+
template(...args: any[]): string;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export function compile(path: string): CompileResult;
|
|
532
|
+
|
|
533
|
+
// Error types
|
|
534
|
+
export class CompileError extends Error {
|
|
535
|
+
constructor(message: string);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export class SecurityError extends Error {
|
|
539
|
+
constructor(message: string);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
export class TranslationError extends Error {
|
|
543
|
+
constructor(message: string);
|
|
544
|
+
}
|
|
545
|
+
}
|