@fictjs/runtime 0.0.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.
Files changed (51) hide show
  1. package/README.md +17 -0
  2. package/dist/index.cjs +4224 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +1572 -0
  5. package/dist/index.d.ts +1572 -0
  6. package/dist/index.dev.js +4240 -0
  7. package/dist/index.dev.js.map +1 -0
  8. package/dist/index.js +4133 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/jsx-dev-runtime.cjs +44 -0
  11. package/dist/jsx-dev-runtime.cjs.map +1 -0
  12. package/dist/jsx-dev-runtime.js +14 -0
  13. package/dist/jsx-dev-runtime.js.map +1 -0
  14. package/dist/jsx-runtime.cjs +44 -0
  15. package/dist/jsx-runtime.cjs.map +1 -0
  16. package/dist/jsx-runtime.js +14 -0
  17. package/dist/jsx-runtime.js.map +1 -0
  18. package/dist/slim.cjs +3384 -0
  19. package/dist/slim.cjs.map +1 -0
  20. package/dist/slim.d.cts +475 -0
  21. package/dist/slim.d.ts +475 -0
  22. package/dist/slim.js +3335 -0
  23. package/dist/slim.js.map +1 -0
  24. package/package.json +68 -0
  25. package/src/binding.ts +2127 -0
  26. package/src/constants.ts +456 -0
  27. package/src/cycle-guard.ts +134 -0
  28. package/src/devtools.ts +17 -0
  29. package/src/dom.ts +683 -0
  30. package/src/effect.ts +83 -0
  31. package/src/error-boundary.ts +118 -0
  32. package/src/hooks.ts +72 -0
  33. package/src/index.ts +184 -0
  34. package/src/jsx-dev-runtime.ts +2 -0
  35. package/src/jsx-runtime.ts +2 -0
  36. package/src/jsx.ts +786 -0
  37. package/src/lifecycle.ts +273 -0
  38. package/src/list-helpers.ts +619 -0
  39. package/src/memo.ts +14 -0
  40. package/src/node-ops.ts +185 -0
  41. package/src/props.ts +212 -0
  42. package/src/reconcile.ts +151 -0
  43. package/src/ref.ts +25 -0
  44. package/src/scheduler.ts +12 -0
  45. package/src/signal.ts +1278 -0
  46. package/src/slim.ts +68 -0
  47. package/src/store.ts +210 -0
  48. package/src/suspense.ts +187 -0
  49. package/src/transition.ts +128 -0
  50. package/src/types.ts +172 -0
  51. package/src/versioned-signal.ts +58 -0
package/src/jsx.ts ADDED
@@ -0,0 +1,786 @@
1
+ import type { FictNode } from './types'
2
+
3
+ export const Fragment = Symbol('Fragment')
4
+
5
+ export function jsx(
6
+ type: string | typeof Fragment | ((props: Record<string, unknown>) => FictNode),
7
+ props: Record<string, unknown>,
8
+ key?: string,
9
+ ): FictNode {
10
+ return { type, props, key }
11
+ }
12
+
13
+ export const jsxs = jsx
14
+ export const jsxDEV = jsx
15
+
16
+ // eslint-disable-next-line @typescript-eslint/no-namespace
17
+ export namespace JSX {
18
+ export type Element = FictNode
19
+
20
+ export interface IntrinsicElements {
21
+ // Document structure
22
+ html: HTMLAttributes<HTMLHtmlElement>
23
+ head: HTMLAttributes<HTMLHeadElement>
24
+ body: HTMLAttributes<HTMLBodyElement>
25
+ title: HTMLAttributes<HTMLTitleElement>
26
+ meta: MetaHTMLAttributes<HTMLMetaElement>
27
+ link: LinkHTMLAttributes<HTMLLinkElement>
28
+ style: StyleHTMLAttributes<HTMLStyleElement>
29
+ script: ScriptHTMLAttributes<HTMLScriptElement>
30
+ noscript: HTMLAttributes<HTMLElement>
31
+
32
+ // Layout & Semantic
33
+ div: HTMLAttributes<HTMLDivElement>
34
+ span: HTMLAttributes<HTMLSpanElement>
35
+ main: HTMLAttributes<HTMLElement>
36
+ header: HTMLAttributes<HTMLElement>
37
+ footer: HTMLAttributes<HTMLElement>
38
+ section: HTMLAttributes<HTMLElement>
39
+ article: HTMLAttributes<HTMLElement>
40
+ aside: HTMLAttributes<HTMLElement>
41
+ nav: HTMLAttributes<HTMLElement>
42
+ address: HTMLAttributes<HTMLElement>
43
+
44
+ // Headings
45
+ h1: HTMLAttributes<HTMLHeadingElement>
46
+ h2: HTMLAttributes<HTMLHeadingElement>
47
+ h3: HTMLAttributes<HTMLHeadingElement>
48
+ h4: HTMLAttributes<HTMLHeadingElement>
49
+ h5: HTMLAttributes<HTMLHeadingElement>
50
+ h6: HTMLAttributes<HTMLHeadingElement>
51
+ hgroup: HTMLAttributes<HTMLElement>
52
+
53
+ // Text content
54
+ p: HTMLAttributes<HTMLParagraphElement>
55
+ blockquote: BlockquoteHTMLAttributes<HTMLQuoteElement>
56
+ pre: HTMLAttributes<HTMLPreElement>
57
+ figure: HTMLAttributes<HTMLElement>
58
+ figcaption: HTMLAttributes<HTMLElement>
59
+ hr: HTMLAttributes<HTMLHRElement>
60
+ br: HTMLAttributes<HTMLBRElement>
61
+ wbr: HTMLAttributes<HTMLElement>
62
+
63
+ // Inline text semantics
64
+ a: AnchorHTMLAttributes<HTMLAnchorElement>
65
+ abbr: HTMLAttributes<HTMLElement>
66
+ b: HTMLAttributes<HTMLElement>
67
+ bdi: HTMLAttributes<HTMLElement>
68
+ bdo: HTMLAttributes<HTMLElement>
69
+ cite: HTMLAttributes<HTMLElement>
70
+ code: HTMLAttributes<HTMLElement>
71
+ data: DataHTMLAttributes<HTMLDataElement>
72
+ dfn: HTMLAttributes<HTMLElement>
73
+ em: HTMLAttributes<HTMLElement>
74
+ i: HTMLAttributes<HTMLElement>
75
+ kbd: HTMLAttributes<HTMLElement>
76
+ mark: HTMLAttributes<HTMLElement>
77
+ q: QuoteHTMLAttributes<HTMLQuoteElement>
78
+ rp: HTMLAttributes<HTMLElement>
79
+ rt: HTMLAttributes<HTMLElement>
80
+ ruby: HTMLAttributes<HTMLElement>
81
+ s: HTMLAttributes<HTMLElement>
82
+ samp: HTMLAttributes<HTMLElement>
83
+ small: HTMLAttributes<HTMLElement>
84
+ strong: HTMLAttributes<HTMLElement>
85
+ sub: HTMLAttributes<HTMLElement>
86
+ sup: HTMLAttributes<HTMLElement>
87
+ time: TimeHTMLAttributes<HTMLTimeElement>
88
+ u: HTMLAttributes<HTMLElement>
89
+ var: HTMLAttributes<HTMLElement>
90
+
91
+ // Lists
92
+ ul: HTMLAttributes<HTMLUListElement>
93
+ ol: OlHTMLAttributes<HTMLOListElement>
94
+ li: LiHTMLAttributes<HTMLLIElement>
95
+ dl: HTMLAttributes<HTMLDListElement>
96
+ dt: HTMLAttributes<HTMLElement>
97
+ dd: HTMLAttributes<HTMLElement>
98
+ menu: HTMLAttributes<HTMLMenuElement>
99
+
100
+ // Tables
101
+ table: TableHTMLAttributes<HTMLTableElement>
102
+ caption: HTMLAttributes<HTMLTableCaptionElement>
103
+ colgroup: ColgroupHTMLAttributes<HTMLTableColElement>
104
+ col: ColHTMLAttributes<HTMLTableColElement>
105
+ thead: HTMLAttributes<HTMLTableSectionElement>
106
+ tbody: HTMLAttributes<HTMLTableSectionElement>
107
+ tfoot: HTMLAttributes<HTMLTableSectionElement>
108
+ tr: HTMLAttributes<HTMLTableRowElement>
109
+ th: ThHTMLAttributes<HTMLTableCellElement>
110
+ td: TdHTMLAttributes<HTMLTableCellElement>
111
+
112
+ // Forms
113
+ form: FormHTMLAttributes<HTMLFormElement>
114
+ fieldset: FieldsetHTMLAttributes<HTMLFieldSetElement>
115
+ legend: HTMLAttributes<HTMLLegendElement>
116
+ label: LabelHTMLAttributes<HTMLLabelElement>
117
+ input: InputHTMLAttributes<HTMLInputElement>
118
+ button: ButtonHTMLAttributes<HTMLButtonElement>
119
+ select: SelectHTMLAttributes<HTMLSelectElement>
120
+ datalist: HTMLAttributes<HTMLDataListElement>
121
+ optgroup: OptgroupHTMLAttributes<HTMLOptGroupElement>
122
+ option: OptionHTMLAttributes<HTMLOptionElement>
123
+ textarea: TextareaHTMLAttributes<HTMLTextAreaElement>
124
+ output: OutputHTMLAttributes<HTMLOutputElement>
125
+ progress: ProgressHTMLAttributes<HTMLProgressElement>
126
+ meter: MeterHTMLAttributes<HTMLMeterElement>
127
+
128
+ // Interactive
129
+ details: DetailsHTMLAttributes<HTMLDetailsElement>
130
+ summary: HTMLAttributes<HTMLElement>
131
+ dialog: DialogHTMLAttributes<HTMLDialogElement>
132
+
133
+ // Media
134
+ img: ImgHTMLAttributes<HTMLImageElement>
135
+ picture: HTMLAttributes<HTMLPictureElement>
136
+ source: SourceHTMLAttributes<HTMLSourceElement>
137
+ audio: AudioVideoHTMLAttributes<HTMLAudioElement>
138
+ video: AudioVideoHTMLAttributes<HTMLVideoElement>
139
+ track: TrackHTMLAttributes<HTMLTrackElement>
140
+ map: MapHTMLAttributes<HTMLMapElement>
141
+ area: AreaHTMLAttributes<HTMLAreaElement>
142
+
143
+ // Embedded content
144
+ iframe: IframeHTMLAttributes<HTMLIFrameElement>
145
+ embed: EmbedHTMLAttributes<HTMLEmbedElement>
146
+ object: ObjectHTMLAttributes<HTMLObjectElement>
147
+ param: ParamHTMLAttributes<HTMLParamElement>
148
+ canvas: CanvasHTMLAttributes<HTMLCanvasElement>
149
+
150
+ // SVG (basic support)
151
+ svg: SVGAttributes<SVGSVGElement>
152
+ path: SVGAttributes<SVGPathElement>
153
+ circle: SVGAttributes<SVGCircleElement>
154
+ rect: SVGAttributes<SVGRectElement>
155
+ line: SVGAttributes<SVGLineElement>
156
+ polyline: SVGAttributes<SVGPolylineElement>
157
+ polygon: SVGAttributes<SVGPolygonElement>
158
+ ellipse: SVGAttributes<SVGEllipseElement>
159
+ g: SVGAttributes<SVGGElement>
160
+ defs: SVGAttributes<SVGDefsElement>
161
+ use: SVGAttributes<SVGUseElement>
162
+ text: SVGAttributes<SVGTextElement>
163
+ tspan: SVGAttributes<SVGTSpanElement>
164
+
165
+ // Web components / other
166
+ template: HTMLAttributes<HTMLTemplateElement>
167
+ slot: SlotHTMLAttributes<HTMLSlotElement>
168
+ portal: HTMLAttributes<HTMLElement>
169
+ }
170
+
171
+ export interface ElementChildrenAttribute {
172
+ children: unknown
173
+ }
174
+ }
175
+
176
+ // ============================================================================
177
+ // Base HTML Attributes
178
+ // ============================================================================
179
+
180
+ interface HTMLAttributes<T> {
181
+ // Children
182
+ children?: FictNode | FictNode[]
183
+
184
+ // JSX special attributes
185
+ key?: string | number
186
+
187
+ // Core attributes
188
+ id?: string
189
+ class?: string
190
+ style?: string | Record<string, string | number>
191
+ title?: string
192
+ lang?: string
193
+ dir?: 'ltr' | 'rtl' | 'auto'
194
+ hidden?: boolean | 'hidden' | 'until-found'
195
+ tabIndex?: number
196
+ draggable?: boolean | 'true' | 'false'
197
+ contentEditable?: boolean | 'true' | 'false' | 'inherit'
198
+ spellCheck?: boolean | 'true' | 'false'
199
+ translate?: 'yes' | 'no'
200
+ inert?: boolean
201
+ popover?: 'auto' | 'manual'
202
+
203
+ // Experimental / newer
204
+ autofocus?: boolean
205
+ slot?: string
206
+ accessKey?: string
207
+
208
+ // Event handlers
209
+ onClick?: (e: MouseEvent) => void
210
+ onDblClick?: (e: MouseEvent) => void
211
+ onMouseDown?: (e: MouseEvent) => void
212
+ onMouseUp?: (e: MouseEvent) => void
213
+ onMouseMove?: (e: MouseEvent) => void
214
+ onMouseEnter?: (e: MouseEvent) => void
215
+ onMouseLeave?: (e: MouseEvent) => void
216
+ onMouseOver?: (e: MouseEvent) => void
217
+ onMouseOut?: (e: MouseEvent) => void
218
+ onContextMenu?: (e: MouseEvent) => void
219
+ onInput?: (e: InputEvent) => void
220
+ onChange?: (e: Event) => void
221
+ onSubmit?: (e: SubmitEvent) => void
222
+ onReset?: (e: Event) => void
223
+ onKeyDown?: (e: KeyboardEvent) => void
224
+ onKeyUp?: (e: KeyboardEvent) => void
225
+ onKeyPress?: (e: KeyboardEvent) => void
226
+ onFocus?: (e: FocusEvent) => void
227
+ onBlur?: (e: FocusEvent) => void
228
+ onScroll?: (e: Event) => void
229
+ onWheel?: (e: WheelEvent) => void
230
+ onLoad?: (e: Event) => void
231
+ onError?: (e: Event) => void
232
+
233
+ // Drag events
234
+ onDrag?: (e: DragEvent) => void
235
+ onDragStart?: (e: DragEvent) => void
236
+ onDragEnd?: (e: DragEvent) => void
237
+ onDragEnter?: (e: DragEvent) => void
238
+ onDragLeave?: (e: DragEvent) => void
239
+ onDragOver?: (e: DragEvent) => void
240
+ onDrop?: (e: DragEvent) => void
241
+
242
+ // Touch events
243
+ onTouchStart?: (e: TouchEvent) => void
244
+ onTouchMove?: (e: TouchEvent) => void
245
+ onTouchEnd?: (e: TouchEvent) => void
246
+ onTouchCancel?: (e: TouchEvent) => void
247
+
248
+ // Animation events
249
+ onAnimationStart?: (e: AnimationEvent) => void
250
+ onAnimationEnd?: (e: AnimationEvent) => void
251
+ onAnimationIteration?: (e: AnimationEvent) => void
252
+ onTransitionEnd?: (e: TransitionEvent) => void
253
+
254
+ // Pointer events
255
+ onPointerDown?: (e: PointerEvent) => void
256
+ onPointerUp?: (e: PointerEvent) => void
257
+ onPointerMove?: (e: PointerEvent) => void
258
+ onPointerEnter?: (e: PointerEvent) => void
259
+ onPointerLeave?: (e: PointerEvent) => void
260
+ onPointerOver?: (e: PointerEvent) => void
261
+ onPointerOut?: (e: PointerEvent) => void
262
+ onPointerCancel?: (e: PointerEvent) => void
263
+
264
+ // Ref
265
+ ref?: ((el: T | null) => void) | { current: T | null }
266
+
267
+ // ARIA attributes (common ones)
268
+ role?: string
269
+ 'aria-hidden'?: boolean | 'true' | 'false'
270
+ 'aria-label'?: string
271
+ 'aria-labelledby'?: string
272
+ 'aria-describedby'?: string
273
+ 'aria-live'?: 'off' | 'polite' | 'assertive'
274
+ 'aria-atomic'?: boolean | 'true' | 'false'
275
+ 'aria-busy'?: boolean | 'true' | 'false'
276
+ 'aria-current'?: boolean | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time'
277
+ 'aria-disabled'?: boolean | 'true' | 'false'
278
+ 'aria-expanded'?: boolean | 'true' | 'false'
279
+ 'aria-haspopup'?: boolean | 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'
280
+ 'aria-pressed'?: boolean | 'true' | 'false' | 'mixed'
281
+ 'aria-selected'?: boolean | 'true' | 'false'
282
+ 'aria-checked'?: boolean | 'true' | 'false' | 'mixed'
283
+ 'aria-controls'?: string
284
+ 'aria-owns'?: string
285
+ 'aria-activedescendant'?: string
286
+ 'aria-valuemin'?: number
287
+ 'aria-valuemax'?: number
288
+ 'aria-valuenow'?: number
289
+ 'aria-valuetext'?: string
290
+ 'aria-orientation'?: 'horizontal' | 'vertical'
291
+ 'aria-readonly'?: boolean | 'true' | 'false'
292
+ 'aria-required'?: boolean | 'true' | 'false'
293
+ 'aria-invalid'?: boolean | 'true' | 'false' | 'grammar' | 'spelling'
294
+ 'aria-errormessage'?: string
295
+ 'aria-modal'?: boolean | 'true' | 'false'
296
+ 'aria-placeholder'?: string
297
+ 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other'
298
+ 'aria-colcount'?: number
299
+ 'aria-colindex'?: number
300
+ 'aria-colspan'?: number
301
+ 'aria-rowcount'?: number
302
+ 'aria-rowindex'?: number
303
+ 'aria-rowspan'?: number
304
+ 'aria-setsize'?: number
305
+ 'aria-posinset'?: number
306
+ 'aria-level'?: number
307
+ 'aria-multiselectable'?: boolean | 'true' | 'false'
308
+ 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both'
309
+ 'aria-details'?: string
310
+ 'aria-keyshortcuts'?: string
311
+ 'aria-roledescription'?: string
312
+
313
+ // Data attributes via index signature
314
+ [key: `data-${string}`]: string | number | boolean | undefined
315
+ }
316
+
317
+ // ============================================================================
318
+ // Specialized Attribute Interfaces
319
+ // ============================================================================
320
+
321
+ interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
322
+ href?: string
323
+ target?: '_self' | '_blank' | '_parent' | '_top' | string
324
+ rel?: string
325
+ download?: boolean | string
326
+ hreflang?: string
327
+ type?: string
328
+ referrerPolicy?: ReferrerPolicy
329
+ ping?: string
330
+ }
331
+
332
+ interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
333
+ type?: 'button' | 'submit' | 'reset'
334
+ disabled?: boolean
335
+ name?: string
336
+ value?: string
337
+ form?: string
338
+ formAction?: string
339
+ formEncType?: string
340
+ formMethod?: string
341
+ formNoValidate?: boolean
342
+ formTarget?: string
343
+ popovertarget?: string
344
+ popovertargetaction?: 'show' | 'hide' | 'toggle'
345
+ }
346
+
347
+ interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
348
+ type?: string
349
+ value?: string | number | readonly string[]
350
+ defaultValue?: string | number | readonly string[]
351
+ checked?: boolean
352
+ defaultChecked?: boolean
353
+ disabled?: boolean
354
+ placeholder?: string
355
+ name?: string
356
+ form?: string
357
+ required?: boolean
358
+ readonly?: boolean
359
+ multiple?: boolean
360
+ min?: number | string
361
+ max?: number | string
362
+ minLength?: number
363
+ maxLength?: number
364
+ step?: number | string
365
+ pattern?: string
366
+ size?: number
367
+ accept?: string
368
+ capture?: boolean | 'user' | 'environment'
369
+ list?: string
370
+ autoComplete?: string
371
+ autoCapitalize?: string
372
+ inputMode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'
373
+ enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'
374
+ height?: number | string
375
+ width?: number | string
376
+ alt?: string
377
+ src?: string
378
+ formAction?: string
379
+ formEncType?: string
380
+ formMethod?: string
381
+ formNoValidate?: boolean
382
+ formTarget?: string
383
+ }
384
+
385
+ interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
386
+ action?: string
387
+ method?: 'get' | 'post' | 'dialog'
388
+ encType?: string
389
+ target?: string
390
+ name?: string
391
+ noValidate?: boolean
392
+ autoComplete?: 'on' | 'off'
393
+ acceptCharset?: string
394
+ }
395
+
396
+ interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
397
+ src?: string
398
+ alt?: string
399
+ width?: number | string
400
+ height?: number | string
401
+ srcSet?: string
402
+ sizes?: string
403
+ loading?: 'eager' | 'lazy'
404
+ decoding?: 'async' | 'auto' | 'sync'
405
+ crossOrigin?: 'anonymous' | 'use-credentials'
406
+ referrerPolicy?: ReferrerPolicy
407
+ useMap?: string
408
+ isMap?: boolean
409
+ fetchPriority?: 'auto' | 'high' | 'low'
410
+ }
411
+
412
+ interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
413
+ value?: string | number
414
+ defaultValue?: string
415
+ disabled?: boolean
416
+ placeholder?: string
417
+ name?: string
418
+ form?: string
419
+ required?: boolean
420
+ readonly?: boolean
421
+ rows?: number
422
+ cols?: number
423
+ minLength?: number
424
+ maxLength?: number
425
+ wrap?: 'hard' | 'soft' | 'off'
426
+ autoComplete?: string
427
+ }
428
+
429
+ interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
430
+ value?: string | number | readonly string[]
431
+ defaultValue?: string | number | readonly string[]
432
+ disabled?: boolean
433
+ name?: string
434
+ form?: string
435
+ required?: boolean
436
+ multiple?: boolean
437
+ size?: number
438
+ autoComplete?: string
439
+ }
440
+
441
+ interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
442
+ value?: string | number
443
+ disabled?: boolean
444
+ selected?: boolean
445
+ label?: string
446
+ }
447
+
448
+ interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
449
+ disabled?: boolean
450
+ label?: string
451
+ }
452
+
453
+ interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
454
+ for?: string
455
+ htmlFor?: string
456
+ form?: string
457
+ }
458
+
459
+ interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
460
+ disabled?: boolean
461
+ name?: string
462
+ form?: string
463
+ }
464
+
465
+ interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
466
+ for?: string
467
+ htmlFor?: string
468
+ form?: string
469
+ name?: string
470
+ }
471
+
472
+ interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
473
+ value?: number | string
474
+ max?: number | string
475
+ }
476
+
477
+ interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
478
+ value?: number | string
479
+ min?: number | string
480
+ max?: number | string
481
+ low?: number | string
482
+ high?: number | string
483
+ optimum?: number | string
484
+ }
485
+
486
+ // Table elements
487
+ interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
488
+ cellPadding?: number | string
489
+ cellSpacing?: number | string
490
+ border?: number | string
491
+ }
492
+
493
+ interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
494
+ colSpan?: number
495
+ rowSpan?: number
496
+ scope?: 'row' | 'col' | 'rowgroup' | 'colgroup'
497
+ abbr?: string
498
+ headers?: string
499
+ }
500
+
501
+ interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
502
+ colSpan?: number
503
+ rowSpan?: number
504
+ headers?: string
505
+ }
506
+
507
+ interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
508
+ span?: number
509
+ }
510
+
511
+ interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
512
+ span?: number
513
+ }
514
+
515
+ // List elements
516
+ interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
517
+ start?: number
518
+ reversed?: boolean
519
+ type?: '1' | 'a' | 'A' | 'i' | 'I'
520
+ }
521
+
522
+ interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
523
+ value?: number
524
+ }
525
+
526
+ // Media elements
527
+ interface AudioVideoHTMLAttributes<T> extends HTMLAttributes<T> {
528
+ src?: string
529
+ controls?: boolean
530
+ autoPlay?: boolean
531
+ loop?: boolean
532
+ muted?: boolean
533
+ preload?: 'none' | 'metadata' | 'auto'
534
+ crossOrigin?: 'anonymous' | 'use-credentials'
535
+ poster?: string // video only
536
+ width?: number | string // video only
537
+ height?: number | string // video only
538
+ playsInline?: boolean
539
+ disableRemotePlayback?: boolean
540
+ onPlay?: (e: Event) => void
541
+ onPause?: (e: Event) => void
542
+ onEnded?: (e: Event) => void
543
+ onTimeUpdate?: (e: Event) => void
544
+ onVolumeChange?: (e: Event) => void
545
+ onSeeking?: (e: Event) => void
546
+ onSeeked?: (e: Event) => void
547
+ onLoadedData?: (e: Event) => void
548
+ onLoadedMetadata?: (e: Event) => void
549
+ onCanPlay?: (e: Event) => void
550
+ onCanPlayThrough?: (e: Event) => void
551
+ onWaiting?: (e: Event) => void
552
+ onPlaying?: (e: Event) => void
553
+ onProgress?: (e: Event) => void
554
+ onDurationChange?: (e: Event) => void
555
+ onRateChange?: (e: Event) => void
556
+ onStalled?: (e: Event) => void
557
+ onSuspend?: (e: Event) => void
558
+ onEmptied?: (e: Event) => void
559
+ }
560
+
561
+ interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
562
+ src?: string
563
+ srcSet?: string
564
+ sizes?: string
565
+ type?: string
566
+ media?: string
567
+ width?: number | string
568
+ height?: number | string
569
+ }
570
+
571
+ interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
572
+ src?: string
573
+ srcLang?: string
574
+ label?: string
575
+ kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'
576
+ default?: boolean
577
+ }
578
+
579
+ // Embedded content
580
+ interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
581
+ src?: string
582
+ srcDoc?: string
583
+ name?: string
584
+ width?: number | string
585
+ height?: number | string
586
+ allow?: string
587
+ allowFullScreen?: boolean
588
+ sandbox?: string
589
+ loading?: 'eager' | 'lazy'
590
+ referrerPolicy?: ReferrerPolicy
591
+ }
592
+
593
+ interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
594
+ src?: string
595
+ type?: string
596
+ width?: number | string
597
+ height?: number | string
598
+ }
599
+
600
+ interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
601
+ data?: string
602
+ type?: string
603
+ name?: string
604
+ width?: number | string
605
+ height?: number | string
606
+ form?: string
607
+ useMap?: string
608
+ }
609
+
610
+ interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
611
+ name?: string
612
+ value?: string
613
+ }
614
+
615
+ interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
616
+ width?: number | string
617
+ height?: number | string
618
+ }
619
+
620
+ interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
621
+ name?: string
622
+ }
623
+
624
+ interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
625
+ alt?: string
626
+ coords?: string
627
+ href?: string
628
+ hreflang?: string
629
+ download?: boolean | string
630
+ rel?: string
631
+ shape?: 'rect' | 'circle' | 'poly' | 'default'
632
+ target?: string
633
+ referrerPolicy?: ReferrerPolicy
634
+ ping?: string
635
+ }
636
+
637
+ // Interactive elements
638
+ interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
639
+ open?: boolean
640
+ onToggle?: (e: Event) => void
641
+ }
642
+
643
+ interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
644
+ open?: boolean
645
+ onClose?: (e: Event) => void
646
+ onCancel?: (e: Event) => void
647
+ }
648
+
649
+ // Other elements
650
+ interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
651
+ cite?: string
652
+ }
653
+
654
+ interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
655
+ cite?: string
656
+ }
657
+
658
+ interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
659
+ dateTime?: string
660
+ }
661
+
662
+ interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
663
+ value?: string
664
+ }
665
+
666
+ interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
667
+ name?: string
668
+ content?: string
669
+ httpEquiv?: string
670
+ charSet?: string
671
+ property?: string
672
+ }
673
+
674
+ interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
675
+ href?: string
676
+ rel?: string
677
+ type?: string
678
+ media?: string
679
+ as?: string
680
+ crossOrigin?: 'anonymous' | 'use-credentials'
681
+ referrerPolicy?: ReferrerPolicy
682
+ sizes?: string
683
+ hreflang?: string
684
+ integrity?: string
685
+ fetchPriority?: 'auto' | 'high' | 'low'
686
+ disabled?: boolean
687
+ }
688
+
689
+ interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
690
+ media?: string
691
+ nonce?: string
692
+ blocking?: string
693
+ }
694
+
695
+ interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
696
+ src?: string
697
+ type?: string
698
+ async?: boolean
699
+ defer?: boolean
700
+ crossOrigin?: 'anonymous' | 'use-credentials'
701
+ integrity?: string
702
+ noModule?: boolean
703
+ nonce?: string
704
+ referrerPolicy?: ReferrerPolicy
705
+ fetchPriority?: 'auto' | 'high' | 'low'
706
+ blocking?: string
707
+ }
708
+
709
+ interface SlotHTMLAttributes<T> extends HTMLAttributes<T> {
710
+ name?: string
711
+ onSlotchange?: (e: Event) => void
712
+ }
713
+
714
+ // SVG Attributes (basic support)
715
+ interface SVGAttributes<T> extends HTMLAttributes<T> {
716
+ // Core SVG attributes
717
+ viewBox?: string
718
+ xmlns?: string
719
+ xmlnsXlink?: string
720
+ fill?: string
721
+ stroke?: string
722
+ strokeWidth?: string | number
723
+ strokeLinecap?: 'butt' | 'round' | 'square'
724
+ strokeLinejoin?: 'miter' | 'round' | 'bevel'
725
+ strokeDasharray?: string
726
+ strokeDashoffset?: string | number
727
+ strokeOpacity?: string | number
728
+ fillOpacity?: string | number
729
+ opacity?: string | number
730
+ transform?: string
731
+ transformOrigin?: string
732
+ clipPath?: string
733
+ mask?: string
734
+ filter?: string
735
+
736
+ // Shape attributes
737
+ d?: string
738
+ cx?: string | number
739
+ cy?: string | number
740
+ r?: string | number
741
+ rx?: string | number
742
+ ry?: string | number
743
+ x?: string | number
744
+ y?: string | number
745
+ x1?: string | number
746
+ y1?: string | number
747
+ x2?: string | number
748
+ y2?: string | number
749
+ width?: string | number
750
+ height?: string | number
751
+ points?: string
752
+ pathLength?: string | number
753
+
754
+ // Text attributes
755
+ textAnchor?: 'start' | 'middle' | 'end'
756
+ dominantBaseline?: string
757
+ dx?: string | number
758
+ dy?: string | number
759
+ fontSize?: string | number
760
+ fontFamily?: string
761
+ fontWeight?: string | number
762
+
763
+ // Use element
764
+ href?: string
765
+ xlinkHref?: string
766
+
767
+ // Gradient/pattern
768
+ gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox'
769
+ gradientTransform?: string
770
+ spreadMethod?: 'pad' | 'reflect' | 'repeat'
771
+ offset?: string | number
772
+ stopColor?: string
773
+ stopOpacity?: string | number
774
+
775
+ // Clip/mask
776
+ clipPathUnits?: 'userSpaceOnUse' | 'objectBoundingBox'
777
+ maskUnits?: 'userSpaceOnUse' | 'objectBoundingBox'
778
+ maskContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox'
779
+
780
+ // Other
781
+ preserveAspectRatio?: string
782
+ markerStart?: string
783
+ markerMid?: string
784
+ markerEnd?: string
785
+ vectorEffect?: string
786
+ }