@ktjs/core 0.18.2 → 0.18.4

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/dist/index.d.ts CHANGED
@@ -21,7 +21,776 @@ interface KTRef<T> {
21
21
  * - can alse be used to store normal values, but it is not reactive.
22
22
  * @param value mostly an HTMLElement
23
23
  */
24
- declare function ref<T = HTMLElement>(value?: T): KTRef<T>;
24
+ declare function ref<T = HTMLElement>(value?: T, onChange?: ChangeHandler<T>): KTRef<T>;
25
+
26
+ // Base events available to all HTML elements
27
+ type BaseAttr = {
28
+ [k: string]: any;
29
+
30
+ // # base attributes
31
+ class?: string;
32
+ className?: string;
33
+ style?: string;
34
+
35
+ // # Events
36
+ // Mouse events
37
+ 'on:click'?: (ev: MouseEvent) => void;
38
+ 'on:dblclick'?: (ev: MouseEvent) => void;
39
+ 'on:mousedown'?: (ev: MouseEvent) => void;
40
+ 'on:mouseup'?: (ev: MouseEvent) => void;
41
+ 'on:mousemove'?: (ev: MouseEvent) => void;
42
+ 'on:mouseenter'?: (ev: MouseEvent) => void;
43
+ 'on:mouseleave'?: (ev: MouseEvent) => void;
44
+ 'on:mouseover'?: (ev: MouseEvent) => void;
45
+ 'on:mouseout'?: (ev: MouseEvent) => void;
46
+ 'on:contextmenu'?: (ev: MouseEvent) => void;
47
+
48
+ // Keyboard events
49
+ 'on:keydown'?: (ev: KeyboardEvent) => void;
50
+ 'on:keyup'?: (ev: KeyboardEvent) => void;
51
+ 'on:keypress'?: (ev: KeyboardEvent) => void;
52
+
53
+ // Focus events
54
+ 'on:focus'?: (ev: FocusEvent) => void;
55
+ 'on:blur'?: (ev: FocusEvent) => void;
56
+ 'on:focusin'?: (ev: FocusEvent) => void;
57
+ 'on:focusout'?: (ev: FocusEvent) => void;
58
+
59
+ // Input events
60
+ 'on:input'?: (ev: Event) => void;
61
+ 'on:change'?: (ev: Event) => void;
62
+ 'on:beforeinput'?: (ev: InputEvent) => void;
63
+
64
+ // Drag events
65
+ 'on:drag'?: (ev: DragEvent) => void;
66
+ 'on:dragstart'?: (ev: DragEvent) => void;
67
+ 'on:dragend'?: (ev: DragEvent) => void;
68
+ 'on:dragenter'?: (ev: DragEvent) => void;
69
+ 'on:dragleave'?: (ev: DragEvent) => void;
70
+ 'on:dragover'?: (ev: DragEvent) => void;
71
+ 'on:drop'?: (ev: DragEvent) => void;
72
+
73
+ // Clipboard events
74
+ 'on:copy'?: (ev: ClipboardEvent) => void;
75
+ 'on:cut'?: (ev: ClipboardEvent) => void;
76
+ 'on:paste'?: (ev: ClipboardEvent) => void;
77
+
78
+ // Touch events
79
+ 'on:touchstart'?: (ev: TouchEvent) => void;
80
+ 'on:touchmove'?: (ev: TouchEvent) => void;
81
+ 'on:touchend'?: (ev: TouchEvent) => void;
82
+ 'on:touchcancel'?: (ev: TouchEvent) => void;
83
+
84
+ // Wheel event
85
+ 'on:wheel'?: (ev: WheelEvent) => void;
86
+
87
+ // Animation events
88
+ 'on:animationstart'?: (ev: AnimationEvent) => void;
89
+ 'on:animationend'?: (ev: AnimationEvent) => void;
90
+ 'on:animationiteration'?: (ev: AnimationEvent) => void;
91
+
92
+ // Transition events
93
+ 'on:transitionstart'?: (ev: TransitionEvent) => void;
94
+ 'on:transitionend'?: (ev: TransitionEvent) => void;
95
+ 'on:transitionrun'?: (ev: TransitionEvent) => void;
96
+ 'on:transitioncancel'?: (ev: TransitionEvent) => void;
97
+
98
+ // Pointer events
99
+ 'on:pointerdown'?: (ev: PointerEvent) => void;
100
+ 'on:pointerup'?: (ev: PointerEvent) => void;
101
+ 'on:pointermove'?: (ev: PointerEvent) => void;
102
+ 'on:pointerenter'?: (ev: PointerEvent) => void;
103
+ 'on:pointerleave'?: (ev: PointerEvent) => void;
104
+ 'on:pointerover'?: (ev: PointerEvent) => void;
105
+ 'on:pointerout'?: (ev: PointerEvent) => void;
106
+ 'on:pointercancel'?: (ev: PointerEvent) => void;
107
+ 'on:gotpointercapture'?: (ev: PointerEvent) => void;
108
+ 'on:lostpointercapture'?: (ev: PointerEvent) => void;
109
+
110
+ // Selection events
111
+ 'on:select'?: (ev: Event) => void;
112
+ 'on:selectstart'?: (ev: Event) => void;
113
+
114
+ // Scroll event
115
+ 'on:scroll'?: (ev: Event) => void;
116
+
117
+ // Resize event
118
+ 'on:resize'?: (ev: UIEvent) => void;
119
+ };
120
+
121
+ // Form-specific events
122
+ interface FormElementEvents {
123
+ 'on:submit'?: (ev: SubmitEvent) => void;
124
+ 'on:reset'?: (ev: Event) => void;
125
+ 'on:invalid'?: (ev: Event) => void;
126
+ }
127
+
128
+ // Media-specific events
129
+ interface MediaElementEvents {
130
+ 'on:play'?: (ev: Event) => void;
131
+ 'on:pause'?: (ev: Event) => void;
132
+ 'on:playing'?: (ev: Event) => void;
133
+ 'on:ended'?: (ev: Event) => void;
134
+ 'on:canplay'?: (ev: Event) => void;
135
+ 'on:canplaythrough'?: (ev: Event) => void;
136
+ 'on:durationchange'?: (ev: Event) => void;
137
+ 'on:emptied'?: (ev: Event) => void;
138
+ 'on:loadeddata'?: (ev: Event) => void;
139
+ 'on:loadedmetadata'?: (ev: Event) => void;
140
+ 'on:loadstart'?: (ev: Event) => void;
141
+ 'on:progress'?: (ev: ProgressEvent) => void;
142
+ 'on:ratechange'?: (ev: Event) => void;
143
+ 'on:seeked'?: (ev: Event) => void;
144
+ 'on:seeking'?: (ev: Event) => void;
145
+ 'on:stalled'?: (ev: Event) => void;
146
+ 'on:suspend'?: (ev: Event) => void;
147
+ 'on:timeupdate'?: (ev: Event) => void;
148
+ 'on:volumechange'?: (ev: Event) => void;
149
+ 'on:waiting'?: (ev: Event) => void;
150
+ 'on:abort'?: (ev: UIEvent) => void;
151
+ 'on:error'?: (ev: ErrorEvent) => void;
152
+ }
153
+
154
+ // Details-specific events
155
+ interface DetailsElementEvents {
156
+ 'on:toggle'?: (ev: Event) => void;
157
+ }
158
+
159
+ // Dialog-specific events
160
+ interface DialogElementEvents {
161
+ 'on:cancel'?: (ev: Event) => void;
162
+ 'on:close'?: (ev: Event) => void;
163
+ }
164
+
165
+ // Image-specific events
166
+ interface ImageElementEvents {
167
+ 'on:load'?: (ev: Event) => void;
168
+ 'on:error'?: (ev: ErrorEvent) => void;
169
+ }
170
+
171
+ interface AttributesMap {
172
+ // Anchor element
173
+ a: BaseAttr & {
174
+ download?: string;
175
+ href?: string;
176
+ hreflang?: string;
177
+ ping?: string;
178
+ referrerpolicy?:
179
+ | 'no-referrer'
180
+ | 'no-referrer-when-downgrade'
181
+ | 'origin'
182
+ | 'origin-when-cross-origin'
183
+ | 'same-origin'
184
+ | 'strict-origin'
185
+ | 'strict-origin-when-cross-origin'
186
+ | 'unsafe-url';
187
+ rel?: string;
188
+ target?: '_self' | '_blank' | '_parent' | '_top' | string;
189
+ type?: string;
190
+ };
191
+
192
+ // Area element
193
+ area: BaseAttr & {
194
+ alt?: string;
195
+ coords?: string;
196
+ download?: string;
197
+ href?: string;
198
+ ping?: string;
199
+ referrerpolicy?:
200
+ | 'no-referrer'
201
+ | 'no-referrer-when-downgrade'
202
+ | 'origin'
203
+ | 'origin-when-cross-origin'
204
+ | 'same-origin'
205
+ | 'strict-origin'
206
+ | 'strict-origin-when-cross-origin'
207
+ | 'unsafe-url';
208
+ rel?: string;
209
+ shape?: 'rect' | 'circle' | 'poly' | 'default';
210
+ target?: '_self' | '_blank' | '_parent' | '_top' | string;
211
+ };
212
+
213
+ // Audio element
214
+ audio: BaseAttr &
215
+ MediaElementEvents & {
216
+ autoplay?: boolean;
217
+ controls?: boolean;
218
+ crossorigin?: 'anonymous' | 'use-credentials' | '';
219
+ loop?: boolean;
220
+ muted?: boolean;
221
+ preload?: 'none' | 'metadata' | 'auto' | '';
222
+ src?: string;
223
+ };
224
+
225
+ // Base element
226
+ base: BaseAttr & {
227
+ href?: string;
228
+ target?: '_self' | '_blank' | '_parent' | '_top' | string;
229
+ };
230
+
231
+ // Body element
232
+ body: BaseAttr & {};
233
+
234
+ // BR element
235
+ br: BaseAttr & {};
236
+
237
+ // Button element
238
+ button: BaseAttr & {
239
+ disabled?: boolean;
240
+ form?: string;
241
+ formaction?: string;
242
+ formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
243
+ formmethod?: 'get' | 'post' | 'dialog';
244
+ formnovalidate?: boolean;
245
+ formtarget?: '_self' | '_blank' | '_parent' | '_top' | string;
246
+ name?: string;
247
+ type?: 'submit' | 'reset' | 'button';
248
+ value?: string;
249
+ };
250
+
251
+ // Canvas element
252
+ canvas: BaseAttr & {
253
+ height?: number | string;
254
+ width?: number | string;
255
+ };
256
+
257
+ // Table caption element
258
+ caption: BaseAttr & {};
259
+
260
+ // Col element
261
+ col: BaseAttr & {
262
+ span?: number | string;
263
+ };
264
+
265
+ // Colgroup element
266
+ colgroup: BaseAttr & {
267
+ span?: number | string;
268
+ };
269
+
270
+ // Data element
271
+ data: BaseAttr & {
272
+ value?: string;
273
+ };
274
+
275
+ // Datalist element
276
+ datalist: BaseAttr & {};
277
+
278
+ // Del element
279
+ del: BaseAttr & {
280
+ cite?: string;
281
+ datetime?: string;
282
+ };
283
+
284
+ // Details element
285
+ details: BaseAttr &
286
+ DetailsElementEvents & {
287
+ open?: boolean;
288
+ };
289
+
290
+ // Dialog element
291
+ dialog: BaseAttr &
292
+ DialogElementEvents & {
293
+ open?: boolean;
294
+ };
295
+
296
+ // Embed element
297
+ embed: BaseAttr & {
298
+ height?: number | string;
299
+ src?: string;
300
+ type?: string;
301
+ width?: number | string;
302
+ };
303
+
304
+ // Fieldset element
305
+ fieldset: BaseAttr & {
306
+ disabled?: boolean;
307
+ form?: string;
308
+ name?: string;
309
+ };
310
+
311
+ // Form element
312
+ form: BaseAttr &
313
+ FormElementEvents & {
314
+ 'accept-charset'?: string;
315
+ action?: string;
316
+ autocomplete?: 'on' | 'off';
317
+ enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
318
+ method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring;
319
+
320
+ name?: string;
321
+ novalidate?: boolean;
322
+ target?: '_self' | '_blank' | '_parent' | '_top' | string;
323
+ };
324
+
325
+ // Head element
326
+ head: BaseAttr & {};
327
+
328
+ // HR element
329
+ hr: BaseAttr & {};
330
+
331
+ // HTML element
332
+ html: BaseAttr & {};
333
+
334
+ // IFrame element
335
+ iframe: BaseAttr &
336
+ ImageElementEvents & {
337
+ allow?: string;
338
+ allowfullscreen?: boolean;
339
+ allowpaymentrequest?: boolean;
340
+ height?: number | string;
341
+ loading?: 'eager' | 'lazy';
342
+ name?: string;
343
+ referrerpolicy?:
344
+ | 'no-referrer'
345
+ | 'no-referrer-when-downgrade'
346
+ | 'origin'
347
+ | 'origin-when-cross-origin'
348
+ | 'same-origin'
349
+ | 'strict-origin'
350
+ | 'strict-origin-when-cross-origin'
351
+ | 'unsafe-url';
352
+ sandbox?: string;
353
+ src?: string;
354
+ srcdoc?: string;
355
+ width?: number | string;
356
+ };
357
+
358
+ // Image element
359
+ img: BaseAttr &
360
+ ImageElementEvents & {
361
+ alt?: string;
362
+ crossorigin?: 'anonymous' | 'use-credentials' | '';
363
+ decoding?: 'sync' | 'async' | 'auto';
364
+ height?: number | string;
365
+ ismap?: boolean;
366
+ loading?: 'eager' | 'lazy';
367
+ referrerpolicy?:
368
+ | 'no-referrer'
369
+ | 'no-referrer-when-downgrade'
370
+ | 'origin'
371
+ | 'origin-when-cross-origin'
372
+ | 'same-origin'
373
+ | 'strict-origin'
374
+ | 'strict-origin-when-cross-origin'
375
+ | 'unsafe-url';
376
+ sizes?: string;
377
+ src?: string;
378
+ srcset?: string;
379
+ usemap?: string;
380
+ width?: number | string;
381
+ };
382
+
383
+ // Input element
384
+ input: BaseAttr & {
385
+ accept?: string;
386
+ alt?: string;
387
+ autocomplete?: string;
388
+ checked?: boolean;
389
+ dirname?: string;
390
+ disabled?: boolean;
391
+ form?: string;
392
+ formaction?: string;
393
+ formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
394
+ formmethod?: 'get' | 'post';
395
+ formnovalidate?: boolean;
396
+ formtarget?: '_self' | '_blank' | '_parent' | '_top' | string;
397
+ height?: number | string;
398
+ list?: string;
399
+ max?: number | string;
400
+ maxlength?: number | string;
401
+ min?: number | string;
402
+ minlength?: number | string;
403
+ multiple?: boolean;
404
+ name?: string;
405
+ pattern?: string;
406
+ placeholder?: string;
407
+ readonly?: boolean;
408
+ required?: boolean;
409
+ size?: number | string;
410
+ src?: string;
411
+ step?: number | string;
412
+ type?:
413
+ | 'button'
414
+ | 'checkbox'
415
+ | 'color'
416
+ | 'date'
417
+ | 'datetime-local'
418
+ | 'email'
419
+ | 'file'
420
+ | 'hidden'
421
+ | 'image'
422
+ | 'month'
423
+ | 'number'
424
+ | 'password'
425
+ | 'radio'
426
+ | 'range'
427
+ | 'reset'
428
+ | 'search'
429
+ | 'submit'
430
+ | 'tel'
431
+ | 'text'
432
+ | 'time'
433
+ | 'url'
434
+ | 'week';
435
+ value?: string;
436
+ width?: number | string;
437
+ };
438
+
439
+ // Ins element
440
+ ins: BaseAttr & {
441
+ cite?: string;
442
+ datetime?: string;
443
+ };
444
+
445
+ // Label element
446
+ label: BaseAttr & {
447
+ for?: string;
448
+ };
449
+
450
+ // Legend element
451
+ legend: BaseAttr & {};
452
+
453
+ // LI element
454
+ li: BaseAttr & {
455
+ value?: number | string;
456
+ };
457
+
458
+ // Link element
459
+ link: BaseAttr &
460
+ ImageElementEvents & {
461
+ as?: string;
462
+ crossorigin?: 'anonymous' | 'use-credentials' | '';
463
+ disabled?: boolean;
464
+ href?: string;
465
+ hreflang?: string;
466
+ imagesizes?: string;
467
+ imagesrcset?: string;
468
+ integrity?: string;
469
+ media?: string;
470
+ referrerpolicy?:
471
+ | 'no-referrer'
472
+ | 'no-referrer-when-downgrade'
473
+ | 'origin'
474
+ | 'origin-when-cross-origin'
475
+ | 'same-origin'
476
+ | 'strict-origin'
477
+ | 'strict-origin-when-cross-origin'
478
+ | 'unsafe-url';
479
+ rel?: string;
480
+ sizes?: string;
481
+ type?: string;
482
+ };
483
+
484
+ // Map element
485
+ map: BaseAttr & {
486
+ name?: string;
487
+ };
488
+
489
+ // Menu element
490
+ menu: BaseAttr & {};
491
+
492
+ // Meta element
493
+ meta: BaseAttr & {
494
+ charset?: string;
495
+ content?: string;
496
+ 'http-equiv'?: 'content-security-policy' | 'content-type' | 'default-style' | 'refresh' | string;
497
+ name?: string;
498
+ };
499
+
500
+ // Meter element
501
+ meter: BaseAttr & {
502
+ form?: string;
503
+ high?: number | string;
504
+ low?: number | string;
505
+ max?: number | string;
506
+ min?: number | string;
507
+ optimum?: number | string;
508
+ value?: number | string;
509
+ };
510
+
511
+ // Object element
512
+ object: BaseAttr &
513
+ ImageElementEvents & {
514
+ data?: string;
515
+ form?: string;
516
+ height?: number | string;
517
+ name?: string;
518
+ type?: string;
519
+ usemap?: string;
520
+ width?: number | string;
521
+ };
522
+
523
+ // OL element
524
+ ol: BaseAttr & {
525
+ reversed?: boolean;
526
+ start?: number | string;
527
+ type?: '1' | 'a' | 'A' | 'i' | 'I';
528
+ };
529
+
530
+ // Optgroup element
531
+ optgroup: BaseAttr & {
532
+ disabled?: boolean;
533
+ label?: string;
534
+ };
535
+
536
+ // Option element
537
+ option: BaseAttr & {
538
+ disabled?: boolean;
539
+ label?: string;
540
+ selected?: boolean;
541
+ value?: string;
542
+ };
543
+
544
+ // Output element
545
+ output: BaseAttr & {
546
+ for?: string;
547
+ form?: string;
548
+ name?: string;
549
+ };
550
+
551
+ // Picture element
552
+ picture: BaseAttr & {};
553
+
554
+ // Pre element
555
+ pre: BaseAttr & {};
556
+
557
+ // Progress element
558
+ progress: BaseAttr & {
559
+ max?: number | string;
560
+ value?: number | string;
561
+ };
562
+
563
+ // Quote element (q and blockquote)
564
+ q: BaseAttr & {
565
+ cite?: string;
566
+ };
567
+
568
+ blockquote: BaseAttr & {
569
+ cite?: string;
570
+ };
571
+
572
+ // Script element
573
+ script: BaseAttr &
574
+ ImageElementEvents & {
575
+ async?: boolean;
576
+ crossorigin?: 'anonymous' | 'use-credentials' | '';
577
+ defer?: boolean;
578
+ integrity?: string;
579
+ nomodule?: boolean;
580
+ referrerpolicy?:
581
+ | 'no-referrer'
582
+ | 'no-referrer-when-downgrade'
583
+ | 'origin'
584
+ | 'origin-when-cross-origin'
585
+ | 'same-origin'
586
+ | 'strict-origin'
587
+ | 'strict-origin-when-cross-origin'
588
+ | 'unsafe-url';
589
+ src?: string;
590
+ type?: string;
591
+ };
592
+
593
+ // Select element
594
+ select: BaseAttr & {
595
+ autocomplete?: string;
596
+ disabled?: boolean;
597
+ form?: string;
598
+ multiple?: boolean;
599
+ name?: string;
600
+ required?: boolean;
601
+ size?: number | string;
602
+ };
603
+
604
+ // Slot element
605
+ slot: BaseAttr & {
606
+ name?: string;
607
+ };
608
+
609
+ // Source element
610
+ source: BaseAttr & {
611
+ height?: number | string;
612
+ media?: string;
613
+ sizes?: string;
614
+ src?: string;
615
+ srcset?: string;
616
+ type?: string;
617
+ width?: number | string;
618
+ };
619
+
620
+ // Style element
621
+ style: BaseAttr &
622
+ ImageElementEvents & {
623
+ media?: string;
624
+ };
625
+
626
+ // Table element
627
+ table: BaseAttr & {};
628
+
629
+ // Table body/footer/header elements
630
+ tbody: BaseAttr & {};
631
+
632
+ tfoot: BaseAttr & {};
633
+
634
+ thead: BaseAttr & {};
635
+
636
+ // Table cell elements
637
+ td: BaseAttr & {
638
+ colspan?: number | string;
639
+ headers?: string;
640
+ rowspan?: number | string;
641
+ };
642
+
643
+ th: BaseAttr & {
644
+ abbr?: string;
645
+ colspan?: number | string;
646
+ headers?: string;
647
+ rowspan?: number | string;
648
+ scope?: 'row' | 'col' | 'rowgroup' | 'colgroup';
649
+ };
650
+
651
+ // Template element
652
+ template: BaseAttr & {};
653
+
654
+ // Textarea element
655
+ textarea: BaseAttr & {
656
+ autocomplete?: string;
657
+ cols?: number | string;
658
+ dirname?: string;
659
+ disabled?: boolean;
660
+ form?: string;
661
+ maxlength?: number | string;
662
+ minlength?: number | string;
663
+ name?: string;
664
+ placeholder?: string;
665
+ readonly?: boolean;
666
+ required?: boolean;
667
+ rows?: number | string;
668
+ wrap?: 'hard' | 'soft' | 'off';
669
+ };
670
+
671
+ // Time element
672
+ time: BaseAttr & {
673
+ datetime?: string;
674
+ };
675
+
676
+ // Title element
677
+ title: BaseAttr & {};
678
+
679
+ // TR element
680
+ tr: BaseAttr & {};
681
+
682
+ // Track element
683
+ track: BaseAttr & {
684
+ default?: boolean;
685
+ kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
686
+ label?: string;
687
+ src?: string;
688
+ srclang?: string;
689
+ };
690
+
691
+ // UL element
692
+ ul: BaseAttr & {};
693
+
694
+ // Video element
695
+ video: BaseAttr &
696
+ MediaElementEvents & {
697
+ autoplay?: boolean;
698
+ controls?: boolean;
699
+ crossorigin?: 'anonymous' | 'use-credentials' | '';
700
+ height?: number | string;
701
+ loop?: boolean;
702
+ muted?: boolean;
703
+ playsinline?: boolean;
704
+ poster?: string;
705
+ preload?: 'none' | 'metadata' | 'auto' | '';
706
+ src?: string;
707
+ width?: number | string;
708
+ };
709
+
710
+ // Generic HTMLElement (no specific attributes beyond BaseEvent)
711
+ abbr: BaseAttr & {};
712
+ address: BaseAttr & {};
713
+ article: BaseAttr & {};
714
+ aside: BaseAttr & {};
715
+ b: BaseAttr & {};
716
+ bdi: BaseAttr & {};
717
+ bdo: BaseAttr & {};
718
+ cite: BaseAttr & {};
719
+ code: BaseAttr & {};
720
+ dd: BaseAttr & {};
721
+ dfn: BaseAttr & {};
722
+ div: BaseAttr & {};
723
+ dl: BaseAttr & {};
724
+ dt: BaseAttr & {};
725
+ em: BaseAttr & {};
726
+ figcaption: BaseAttr & {};
727
+ figure: BaseAttr & {};
728
+ footer: BaseAttr & {};
729
+ h1: BaseAttr & {};
730
+ h2: BaseAttr & {};
731
+ h3: BaseAttr & {};
732
+ h4: BaseAttr & {};
733
+ h5: BaseAttr & {};
734
+ h6: BaseAttr & {};
735
+ header: BaseAttr & {};
736
+ hgroup: BaseAttr & {};
737
+ i: BaseAttr & {};
738
+ kbd: BaseAttr & {};
739
+ main: BaseAttr & {};
740
+ mark: BaseAttr & {};
741
+ nav: BaseAttr & {};
742
+ noscript: BaseAttr & {};
743
+ p: BaseAttr & {};
744
+ rp: BaseAttr & {};
745
+ rt: BaseAttr & {};
746
+ ruby: BaseAttr & {};
747
+ s: BaseAttr & {};
748
+ samp: BaseAttr & {};
749
+ search: BaseAttr & {};
750
+ section: BaseAttr & {};
751
+ small: BaseAttr & {};
752
+ span: BaseAttr & {};
753
+ strong: BaseAttr & {};
754
+ sub: BaseAttr & {};
755
+ summary: BaseAttr & {};
756
+ sup: BaseAttr & {};
757
+ u: BaseAttr & {};
758
+ var: BaseAttr & {};
759
+ wbr: BaseAttr & {};
760
+
761
+ svg: BaseAttr & {
762
+ class?: string;
763
+ style?: string;
764
+ width?: number | string;
765
+ height?: number | string;
766
+ viewBox?: string;
767
+ xmlns?: string;
768
+ fill?: string;
769
+ stroke?: string;
770
+ strokeWidth?: number | string;
771
+ strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';
772
+ strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit';
773
+ strokeDasharray?: string;
774
+ strokeDashoffset?: number | string;
775
+ opacity?: number | string;
776
+ preserveAspectRatio?: string;
777
+ transform?: string;
778
+ x?: number | string;
779
+ y?: number | string;
780
+ rx?: number | string;
781
+ ry?: number | string;
782
+ r?: number | string;
783
+ cx?: number | string;
784
+ cy?: number | string;
785
+ d?: string;
786
+ points?: string;
787
+ pathLength?: number | string;
788
+ viewbox?: string;
789
+ role?: string;
790
+ focusable?: boolean | 'true' | 'false';
791
+ xlinkHref?: string; // legacy xlink:href
792
+ };
793
+ }
25
794
 
26
795
  type Redraw = (props?: KTAttribute, ...args: any[]) => KTHTMLElement;
27
796
  type KTHTMLElement<El extends HTMLElement = HTMLElement, R extends Function = Redraw> = El & {
@@ -37,13 +806,56 @@ declare global {
37
806
  type Element = KTHTMLElement;
38
807
 
39
808
  interface IntrinsicElements {
40
- [tag: string]: KTAttribute & { children?: KTRawContent };
809
+ div: AttributesMap['div'];
810
+ span: AttributesMap['span'];
811
+ input: AttributesMap['input'];
812
+ button: AttributesMap['button'];
813
+ ul: AttributesMap['ul'];
814
+ li: AttributesMap['li'];
815
+ p: AttributesMap['p'];
816
+ a: AttributesMap['a'];
817
+ img: AttributesMap['img'];
818
+ form: AttributesMap['form'];
819
+ h1: AttributesMap['h1'];
820
+ h2: AttributesMap['h2'];
821
+ h3: AttributesMap['h3'];
822
+ h4: AttributesMap['h4'];
823
+ h5: AttributesMap['h5'];
824
+ h6: AttributesMap['h6'];
825
+ table: AttributesMap['table'];
826
+ thead: AttributesMap['thead'];
827
+ tbody: AttributesMap['tbody'];
828
+ tr: AttributesMap['tr'];
829
+ th: AttributesMap['th'];
830
+ td: AttributesMap['td'];
831
+ label: AttributesMap['label'];
832
+ select: AttributesMap['select'];
833
+ option: AttributesMap['option'];
834
+ textarea: AttributesMap['textarea'];
835
+ section: AttributesMap['section'];
836
+ header: AttributesMap['header'];
837
+ footer: AttributesMap['footer'];
838
+ nav: AttributesMap['nav'];
839
+ article: AttributesMap['article'];
840
+ aside: AttributesMap['aside'];
841
+ main: AttributesMap['main'];
842
+ figure: AttributesMap['figure'];
843
+ figcaption: AttributesMap['figcaption'];
844
+ video: AttributesMap['video'];
845
+ audio: AttributesMap['audio'];
846
+ canvas: AttributesMap['canvas'];
847
+ svg: AttributesMap['svg'];
848
+ code: AttributesMap['code'];
849
+ strong: AttributesMap['strong'];
850
+ small: AttributesMap['small'];
851
+ pre: AttributesMap['pre'];
41
852
  }
42
853
 
43
- // interface IntrinsicAttributes {
44
- // key?: string | number;
45
- // }
46
- type IntrinsicAttributes = KTAttribute;
854
+ interface IntrinsicAttributes {
855
+ ref?: KTRef<HTMLElement>;
856
+ 'k-if'?: any;
857
+ children?: KTRawContent;
858
+ }
47
859
 
48
860
  interface ElementChildrenAttribute {
49
861
  children: {};
@@ -129,35 +941,7 @@ type KTPrefixedEventHandlers = {
129
941
  [EventName in keyof HTMLElementEventMap as `on:${EventName}`]?: (ev: HTMLElementEventMap[EventName]) => void;
130
942
  };
131
943
 
132
- type KTSpecialEventHandlers = {
133
- /**
134
- * Directly extract `value` from the input element
135
- */
136
- 'on:ktchange'?: (value: string) => void;
137
- /**
138
- * Directly extract `value` and trim it
139
- */
140
- 'ontrim:ktchange'?: (value: string) => void;
141
- /**
142
- * Directly extract `value` and parse it to number
143
- */
144
- 'on:ktchangenumber'?: (value: number) => void;
145
-
146
- /**
147
- * Directly extract `value` from the input element
148
- */
149
- 'on:ktinput'?: (value: string) => void;
150
- /**
151
- * Directly extract `value` and trim it
152
- */
153
- 'ontrim:ktinput'?: (value: string) => void;
154
- /**
155
- * Directly extract `value` and parse it to number
156
- */
157
- 'on:ktinputnumber'?: (value: number) => void;
158
- };
159
-
160
- type KTAttribute = KTBaseAttribute & KTPrefixedEventHandlers & KTSpecialEventHandlers;
944
+ type KTAttribute = KTBaseAttribute & KTPrefixedEventHandlers;
161
945
 
162
946
  type KTComponent = (
163
947
  props: {
@@ -178,7 +962,7 @@ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGEl
178
962
  * ## About
179
963
  * @package @ktjs/core
180
964
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
181
- * @version 0.18.2 (Last Update: 2026.01.30 22:52:42.408)
965
+ * @version 0.18.4 (Last Update: 2026.01.31 01:05:10.539)
182
966
  * @license MIT
183
967
  * @link https://github.com/baendlorel/kt.js
184
968
  * @link https://baendlorel.github.io/ Welcome to my site!