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 CHANGED
@@ -1,545 +1,694 @@
1
1
  // TypeScript definitions for boxwood
2
- declare module 'boxwood' {
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
- (props: T & { translate: TranslateFunction }, children?: Children): Node | Node[];
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 | '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;
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?: '_blank' | '_self' | '_parent' | '_top';
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?: 'lazy' | 'eager';
95
- decoding?: 'sync' | 'async' | 'auto';
96
- srcset?: string;
97
- sizes?: string;
98
- crossorigin?: 'anonymous' | 'use-credentials';
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?: '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;
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?: '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';
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?: '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;
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?: 'hard' | 'soft';
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?: 'anonymous' | 'use-credentials';
196
- integrity?: string;
197
- nomodule?: boolean;
198
- referrerpolicy?: string;
199
- target?: 'head' | 'body';
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?: 'anonymous' | 'use-credentials';
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?: 'none' | 'metadata' | 'auto';
231
- crossorigin?: 'anonymous' | 'use-credentials';
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?: 'lazy' | 'eager';
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?: '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;
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 | 'indefinite';
339
+ attributeName?: string
340
+ from?: string | number
341
+ to?: string | number
342
+ dur?: string
343
+ repeatCount?: number | "indefinite"
319
344
  // 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;
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?: 'start' | 'middle' | 'end';
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?: 'userSpaceOnUse' | 'objectBoundingBox';
337
- patternTransform?: string;
338
- patternContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
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> = (attributes?: T, children?: Children) => Node;
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<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>;
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<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>;
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(name: string, attributes?: Record<string, any>, children?: Children): Node;
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(...args: Array<string | Record<string, boolean> | undefined | null | false>): string;
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
+ }