@ktjs/core 0.22.5 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -9,13 +9,55 @@ type MathMLTag = keyof MathMLElementTagNameMap;
9
9
 
10
10
  type InputElementTag = 'input' | 'select' | 'textarea';
11
11
 
12
- type RefChangeHandler<T> = (newValue: T, oldValue: T) => void;
12
+ declare class KTComputed<T> {
13
+ /**
14
+ * Indicates that this is a KTRef instance
15
+ */
16
+ isKT: true;
17
+ ktType: KTReactiveType;
18
+ private _subscribe;
19
+ constructor(_calculator: () => T, reactives: Array<KTReactive<unknown>>);
20
+ /**
21
+ * If new value and old value are both nodes, the old one will be replaced in the DOM
22
+ */
23
+ get value(): T;
24
+ set value(_newValue: T);
25
+ /**
26
+ * Register a callback when the value changes
27
+ * @param callback (newValue, oldValue) => xxx
28
+ */
29
+ addOnChange(callback: ReactiveChangeHandler<T>): void;
30
+ /**
31
+ * Unregister a callback
32
+ * @param callback (newValue, oldValue) => xxx
33
+ */
34
+ removeOnChange(callback: ReactiveChangeHandler<T>): boolean;
35
+ }
36
+ /**
37
+ * Create a reactive computed value
38
+ * @param computeFn
39
+ * @param reactives refs and computeds that this computed depends on
40
+ */
41
+ declare function computed<T = JSX.Element>(computeFn: () => T, reactives: Array<KTReactive<unknown>>): KTComputed<T>;
42
+
43
+ type KTReactive<T> = KTRef<T> | KTComputed<T>;
44
+
45
+ declare const enum KTReactiveType {
46
+ REF = 1,
47
+ COMPUTED = 2
48
+ }
49
+ declare const isKT: <T = any>(obj: any) => obj is KTReactive<T>;
50
+ declare const isRef: <T = any>(obj: any) => obj is KTRef<T>;
51
+ declare const isComputed: <T = any>(obj: any) => obj is KTComputed<T>;
52
+ type ReactiveChangeHandler<T> = (newValue: T, oldValue: T) => void;
53
+
13
54
  declare class KTRef<T> {
14
55
  /**
15
56
  * Indicates that this is a KTRef instance
16
57
  */
17
- isKT: boolean;
18
- constructor(_value: T, _onChanges: Array<RefChangeHandler<T>>);
58
+ isKT: true;
59
+ ktType: KTReactiveType;
60
+ constructor(_value: T, _onChanges: Array<ReactiveChangeHandler<T>>);
19
61
  /**
20
62
  * If new value and old value are both nodes, the old one will be replaced in the DOM
21
63
  */
@@ -25,10 +67,9 @@ declare class KTRef<T> {
25
67
  * Register a callback when the value changes
26
68
  * @param callback (newValue, oldValue) => xxx
27
69
  */
28
- addOnChange(callback: RefChangeHandler<T>): void;
29
- removeOnChange(callback: RefChangeHandler<T>): boolean;
70
+ addOnChange(callback: ReactiveChangeHandler<T>): void;
71
+ removeOnChange(callback: ReactiveChangeHandler<T>): boolean;
30
72
  }
31
- declare const isKTRef: <T = any>(obj: any) => obj is KTRef<T>;
32
73
  /**
33
74
  * Reference to the created HTML element.
34
75
  * - **Only** respond to `ref.value` changes, not reactive to internal changes of the element.
@@ -36,8 +77,16 @@ declare const isKTRef: <T = any>(obj: any) => obj is KTRef<T>;
36
77
  * - if the value is already a `KTRef`, it will be returned **directly**.
37
78
  * @param value mostly an HTMLElement
38
79
  */
39
- declare function ref<T = JSX.Element>(value?: T | KTRef<T>, onChange?: RefChangeHandler<T>): KTRef<T>;
40
- declare function deref<T = JSX.Element>(value: T | KTRef<T>): T;
80
+ declare function ref<T = JSX.Element>(value?: T, onChange?: ReactiveChangeHandler<T>): KTRef<T>;
81
+ /**
82
+ * Convert a value to `KTRef`.
83
+ * - Returns the original value if it is already a `KTRef`.
84
+ * - Throws error if the value is a `KTComputed`.
85
+ * - Otherwise wraps the value with `ref()`.
86
+ * @param o value to convert
87
+ */
88
+ declare const toRef: <T = any>(o: any) => KTRef<T>;
89
+ declare function deref<T = JSX.Element>(value: T | KTReactive<T>): T;
41
90
  type KTSurfaceRef<T extends Object> = {
42
91
  [K in keyof T]: KTRef<T[K]>;
43
92
  } & {
@@ -95,6 +144,12 @@ interface KTBaseAttribute {
95
144
  */
96
145
  'k-model'?: KTRef<any>;
97
146
 
147
+ /**
148
+ * Directly apply html string to `innerHTML`.
149
+ * - Would be reactive if `KTRef` instance is provided
150
+ */
151
+ 'k-html'?: any;
152
+
98
153
  // # normal HTML attributes
99
154
  id?: string;
100
155
  class?: string;
@@ -148,11 +203,11 @@ interface KTBaseAttribute {
148
203
  method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring;
149
204
  }
150
205
 
151
- type KTPrefixedEventHandlers = {
206
+ type KTPrefixedEventAttribute = {
152
207
  [EventName in keyof HTMLElementEventMap as `on:${EventName}`]?: (ev: HTMLElementEventMap[EventName]) => void;
153
208
  };
154
209
 
155
- type KTAttribute = KTBaseAttribute & KTPrefixedEventHandlers;
210
+ type KTAttribute = KTBaseAttribute & KTPrefixedEventAttribute;
156
211
 
157
212
  type KTComponent = (
158
213
  props: {
@@ -172,7 +227,7 @@ type KTComponent = (
172
227
  * ## About
173
228
  * @package @ktjs/core
174
229
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
175
- * @version 0.22.5 (Last Update: 2026.02.03 09:07:21.411)
230
+ * @version 0.24.0 (Last Update: 2026.02.05 12:08:54.164)
176
231
  * @license MIT
177
232
  * @link https://github.com/baendlorel/kt.js
178
233
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -223,149 +278,14 @@ declare function createRedrawable<T>(creator: () => T): KTRef<T> & {
223
278
  };
224
279
 
225
280
  // Base events available to all HTML elements
226
- interface BaseAttr {
281
+ type BaseAttr = KTPrefixedEventAttribute & {
227
282
  [k: string]: any;
228
283
 
229
284
  // # base attributes
230
285
  class?: string;
231
286
  className?: string;
232
287
  style?: string | Partial<CSSStyleDeclaration>;
233
-
234
- // # Events
235
- // Mouse events
236
- 'on:click'?: (ev: PointerEvent) => void;
237
- 'on:dblclick'?: (ev: PointerEvent) => void;
238
- 'on:mousedown'?: (ev: PointerEvent) => void;
239
- 'on:mouseup'?: (ev: MouseEvent) => void;
240
- 'on:mousemove'?: (ev: MouseEvent) => void;
241
- 'on:mouseenter'?: (ev: MouseEvent) => void;
242
- 'on:mouseleave'?: (ev: MouseEvent) => void;
243
- 'on:mouseover'?: (ev: MouseEvent) => void;
244
- 'on:mouseout'?: (ev: MouseEvent) => void;
245
- 'on:contextmenu'?: (ev: PointerEvent) => void;
246
-
247
- // Keyboard events
248
- 'on:keydown'?: (ev: KeyboardEvent) => void;
249
- 'on:keyup'?: (ev: KeyboardEvent) => void;
250
- 'on:keypress'?: (ev: KeyboardEvent) => void;
251
-
252
- // Focus events
253
- 'on:focus'?: (ev: FocusEvent) => void;
254
- 'on:blur'?: (ev: FocusEvent) => void;
255
- 'on:focusin'?: (ev: FocusEvent) => void;
256
- 'on:focusout'?: (ev: FocusEvent) => void;
257
-
258
- // Input events
259
- 'on:input'?: (ev: Event) => void;
260
- 'on:change'?: (ev: Event) => void;
261
- 'on:beforeinput'?: (ev: InputEvent) => void;
262
-
263
- // Drag events
264
- 'on:drag'?: (ev: DragEvent) => void;
265
- 'on:dragstart'?: (ev: DragEvent) => void;
266
- 'on:dragend'?: (ev: DragEvent) => void;
267
- 'on:dragenter'?: (ev: DragEvent) => void;
268
- 'on:dragleave'?: (ev: DragEvent) => void;
269
- 'on:dragover'?: (ev: DragEvent) => void;
270
- 'on:drop'?: (ev: DragEvent) => void;
271
-
272
- // Clipboard events
273
- 'on:copy'?: (ev: ClipboardEvent) => void;
274
- 'on:cut'?: (ev: ClipboardEvent) => void;
275
- 'on:paste'?: (ev: ClipboardEvent) => void;
276
-
277
- // Touch events
278
- 'on:touchstart'?: (ev: TouchEvent) => void;
279
- 'on:touchmove'?: (ev: TouchEvent) => void;
280
- 'on:touchend'?: (ev: TouchEvent) => void;
281
- 'on:touchcancel'?: (ev: TouchEvent) => void;
282
-
283
- // Wheel event
284
- 'on:wheel'?: (ev: WheelEvent) => void;
285
-
286
- // Animation events
287
- 'on:animationstart'?: (ev: AnimationEvent) => void;
288
- 'on:animationend'?: (ev: AnimationEvent) => void;
289
- 'on:animationiteration'?: (ev: AnimationEvent) => void;
290
-
291
- // Transition events
292
- 'on:transitionstart'?: (ev: TransitionEvent) => void;
293
- 'on:transitionend'?: (ev: TransitionEvent) => void;
294
- 'on:transitionrun'?: (ev: TransitionEvent) => void;
295
- 'on:transitioncancel'?: (ev: TransitionEvent) => void;
296
-
297
- // Pointer events
298
- 'on:pointerdown'?: (ev: PointerEvent) => void;
299
- 'on:pointerup'?: (ev: PointerEvent) => void;
300
- 'on:pointermove'?: (ev: PointerEvent) => void;
301
- 'on:pointerenter'?: (ev: PointerEvent) => void;
302
- 'on:pointerleave'?: (ev: PointerEvent) => void;
303
- 'on:pointerover'?: (ev: PointerEvent) => void;
304
- 'on:pointerout'?: (ev: PointerEvent) => void;
305
- 'on:pointercancel'?: (ev: PointerEvent) => void;
306
- 'on:gotpointercapture'?: (ev: PointerEvent) => void;
307
- 'on:lostpointercapture'?: (ev: PointerEvent) => void;
308
-
309
- // Selection events
310
- 'on:select'?: (ev: Event) => void;
311
- 'on:selectstart'?: (ev: Event) => void;
312
-
313
- // Scroll event
314
- 'on:scroll'?: (ev: Event) => void;
315
-
316
- // Resize event
317
- 'on:resize'?: (ev: UIEvent) => void;
318
- }
319
-
320
- // Form-specific events
321
- interface FormElementEvents {
322
- 'on:submit'?: (ev: SubmitEvent) => void;
323
- 'on:reset'?: (ev: Event) => void;
324
- 'on:invalid'?: (ev: Event) => void;
325
- }
326
-
327
- // Media-specific events
328
- interface MediaElementEvents {
329
- 'on:play'?: (ev: Event) => void;
330
- 'on:pause'?: (ev: Event) => void;
331
- 'on:playing'?: (ev: Event) => void;
332
- 'on:ended'?: (ev: Event) => void;
333
- 'on:canplay'?: (ev: Event) => void;
334
- 'on:canplaythrough'?: (ev: Event) => void;
335
- 'on:durationchange'?: (ev: Event) => void;
336
- 'on:emptied'?: (ev: Event) => void;
337
- 'on:loadeddata'?: (ev: Event) => void;
338
- 'on:loadedmetadata'?: (ev: Event) => void;
339
- 'on:loadstart'?: (ev: Event) => void;
340
- 'on:progress'?: (ev: ProgressEvent) => void;
341
- 'on:ratechange'?: (ev: Event) => void;
342
- 'on:seeked'?: (ev: Event) => void;
343
- 'on:seeking'?: (ev: Event) => void;
344
- 'on:stalled'?: (ev: Event) => void;
345
- 'on:suspend'?: (ev: Event) => void;
346
- 'on:timeupdate'?: (ev: Event) => void;
347
- 'on:volumechange'?: (ev: Event) => void;
348
- 'on:waiting'?: (ev: Event) => void;
349
- 'on:abort'?: (ev: UIEvent) => void;
350
- 'on:error'?: (ev: ErrorEvent) => void;
351
- }
352
-
353
- // Details-specific events
354
- interface DetailsElementEvents {
355
- 'on:toggle'?: (ev: Event) => void;
356
- }
357
-
358
- // Dialog-specific events
359
- interface DialogElementEvents {
360
- 'on:cancel'?: (ev: Event) => void;
361
- 'on:close'?: (ev: Event) => void;
362
- }
363
-
364
- // Image-specific events
365
- interface ImageElementEvents {
366
- 'on:load'?: (ev: Event) => void;
367
- 'on:error'?: (ev: ErrorEvent) => void;
368
- }
288
+ };
369
289
 
370
290
  interface AttributesMap {
371
291
  // Anchor element
@@ -410,16 +330,15 @@ interface AttributesMap {
410
330
  };
411
331
 
412
332
  // Audio element
413
- audio: BaseAttr &
414
- MediaElementEvents & {
415
- autoplay?: boolean;
416
- controls?: boolean;
417
- crossorigin?: 'anonymous' | 'use-credentials' | '';
418
- loop?: boolean;
419
- muted?: boolean;
420
- preload?: 'none' | 'metadata' | 'auto' | '';
421
- src?: string;
422
- };
333
+ audio: BaseAttr & {
334
+ autoplay?: boolean;
335
+ controls?: boolean;
336
+ crossorigin?: 'anonymous' | 'use-credentials' | '';
337
+ loop?: boolean;
338
+ muted?: boolean;
339
+ preload?: 'none' | 'metadata' | 'auto' | '';
340
+ src?: string;
341
+ };
423
342
 
424
343
  // Base element
425
344
  base: BaseAttr & {
@@ -481,16 +400,14 @@ interface AttributesMap {
481
400
  };
482
401
 
483
402
  // Details element
484
- details: BaseAttr &
485
- DetailsElementEvents & {
486
- open?: boolean;
487
- };
403
+ details: BaseAttr & {
404
+ open?: boolean;
405
+ };
488
406
 
489
407
  // Dialog element
490
- dialog: BaseAttr &
491
- DialogElementEvents & {
492
- open?: boolean;
493
- };
408
+ dialog: BaseAttr & {
409
+ open?: boolean;
410
+ };
494
411
 
495
412
  // Embed element
496
413
  embed: BaseAttr & {
@@ -508,18 +425,17 @@ interface AttributesMap {
508
425
  };
509
426
 
510
427
  // Form element
511
- form: BaseAttr &
512
- FormElementEvents & {
513
- 'accept-charset'?: string;
514
- action?: string;
515
- autocomplete?: 'on' | 'off';
516
- enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
517
- method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring;
518
-
519
- name?: string;
520
- novalidate?: boolean;
521
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
522
- };
428
+ form: BaseAttr & {
429
+ 'accept-charset'?: string;
430
+ action?: string;
431
+ autocomplete?: 'on' | 'off';
432
+ enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
433
+ method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring;
434
+
435
+ name?: string;
436
+ novalidate?: boolean;
437
+ target?: '_self' | '_blank' | '_parent' | '_top' | string;
438
+ };
523
439
 
524
440
  // Head element
525
441
  head: BaseAttr & {};
@@ -531,53 +447,51 @@ interface AttributesMap {
531
447
  html: BaseAttr & {};
532
448
 
533
449
  // IFrame element
534
- iframe: BaseAttr &
535
- ImageElementEvents & {
536
- allow?: string;
537
- allowfullscreen?: boolean;
538
- allowpaymentrequest?: boolean;
539
- height?: number | string;
540
- loading?: 'eager' | 'lazy';
541
- name?: string;
542
- referrerpolicy?:
543
- | 'no-referrer'
544
- | 'no-referrer-when-downgrade'
545
- | 'origin'
546
- | 'origin-when-cross-origin'
547
- | 'same-origin'
548
- | 'strict-origin'
549
- | 'strict-origin-when-cross-origin'
550
- | 'unsafe-url';
551
- sandbox?: string;
552
- src?: string;
553
- srcdoc?: string;
554
- width?: number | string;
555
- };
450
+ iframe: BaseAttr & {
451
+ allow?: string;
452
+ allowfullscreen?: boolean;
453
+ allowpaymentrequest?: boolean;
454
+ height?: number | string;
455
+ loading?: 'eager' | 'lazy';
456
+ name?: string;
457
+ referrerpolicy?:
458
+ | 'no-referrer'
459
+ | 'no-referrer-when-downgrade'
460
+ | 'origin'
461
+ | 'origin-when-cross-origin'
462
+ | 'same-origin'
463
+ | 'strict-origin'
464
+ | 'strict-origin-when-cross-origin'
465
+ | 'unsafe-url';
466
+ sandbox?: string;
467
+ src?: string;
468
+ srcdoc?: string;
469
+ width?: number | string;
470
+ };
556
471
 
557
472
  // Image element
558
- img: BaseAttr &
559
- ImageElementEvents & {
560
- alt?: string;
561
- crossorigin?: 'anonymous' | 'use-credentials' | '';
562
- decoding?: 'sync' | 'async' | 'auto';
563
- height?: number | string;
564
- ismap?: boolean;
565
- loading?: 'eager' | 'lazy';
566
- referrerpolicy?:
567
- | 'no-referrer'
568
- | 'no-referrer-when-downgrade'
569
- | 'origin'
570
- | 'origin-when-cross-origin'
571
- | 'same-origin'
572
- | 'strict-origin'
573
- | 'strict-origin-when-cross-origin'
574
- | 'unsafe-url';
575
- sizes?: string;
576
- src?: string;
577
- srcset?: string;
578
- usemap?: string;
579
- width?: number | string;
580
- };
473
+ img: BaseAttr & {
474
+ alt?: string;
475
+ crossorigin?: 'anonymous' | 'use-credentials' | '';
476
+ decoding?: 'sync' | 'async' | 'auto';
477
+ height?: number | string;
478
+ ismap?: boolean;
479
+ loading?: 'eager' | 'lazy';
480
+ referrerpolicy?:
481
+ | 'no-referrer'
482
+ | 'no-referrer-when-downgrade'
483
+ | 'origin'
484
+ | 'origin-when-cross-origin'
485
+ | 'same-origin'
486
+ | 'strict-origin'
487
+ | 'strict-origin-when-cross-origin'
488
+ | 'unsafe-url';
489
+ sizes?: string;
490
+ src?: string;
491
+ srcset?: string;
492
+ usemap?: string;
493
+ width?: number | string;
494
+ };
581
495
 
582
496
  // Input element
583
497
  input: BaseAttr & {
@@ -655,30 +569,29 @@ interface AttributesMap {
655
569
  };
656
570
 
657
571
  // Link element
658
- link: BaseAttr &
659
- ImageElementEvents & {
660
- as?: string;
661
- crossorigin?: 'anonymous' | 'use-credentials' | '';
662
- disabled?: boolean;
663
- href?: string;
664
- hreflang?: string;
665
- imagesizes?: string;
666
- imagesrcset?: string;
667
- integrity?: string;
668
- media?: string;
669
- referrerpolicy?:
670
- | 'no-referrer'
671
- | 'no-referrer-when-downgrade'
672
- | 'origin'
673
- | 'origin-when-cross-origin'
674
- | 'same-origin'
675
- | 'strict-origin'
676
- | 'strict-origin-when-cross-origin'
677
- | 'unsafe-url';
678
- rel?: string;
679
- sizes?: string;
680
- type?: string;
681
- };
572
+ link: BaseAttr & {
573
+ as?: string;
574
+ crossorigin?: 'anonymous' | 'use-credentials' | '';
575
+ disabled?: boolean;
576
+ href?: string;
577
+ hreflang?: string;
578
+ imagesizes?: string;
579
+ imagesrcset?: string;
580
+ integrity?: string;
581
+ media?: string;
582
+ referrerpolicy?:
583
+ | 'no-referrer'
584
+ | 'no-referrer-when-downgrade'
585
+ | 'origin'
586
+ | 'origin-when-cross-origin'
587
+ | 'same-origin'
588
+ | 'strict-origin'
589
+ | 'strict-origin-when-cross-origin'
590
+ | 'unsafe-url';
591
+ rel?: string;
592
+ sizes?: string;
593
+ type?: string;
594
+ };
682
595
 
683
596
  // Map element
684
597
  map: BaseAttr & {
@@ -708,16 +621,15 @@ interface AttributesMap {
708
621
  };
709
622
 
710
623
  // Object element
711
- object: BaseAttr &
712
- ImageElementEvents & {
713
- data?: string;
714
- form?: string;
715
- height?: number | string;
716
- name?: string;
717
- type?: string;
718
- usemap?: string;
719
- width?: number | string;
720
- };
624
+ object: BaseAttr & {
625
+ data?: string;
626
+ form?: string;
627
+ height?: number | string;
628
+ name?: string;
629
+ type?: string;
630
+ usemap?: string;
631
+ width?: number | string;
632
+ };
721
633
 
722
634
  // OL element
723
635
  ol: BaseAttr & {
@@ -769,25 +681,24 @@ interface AttributesMap {
769
681
  };
770
682
 
771
683
  // Script element
772
- script: BaseAttr &
773
- ImageElementEvents & {
774
- async?: boolean;
775
- crossorigin?: 'anonymous' | 'use-credentials' | '';
776
- defer?: boolean;
777
- integrity?: string;
778
- nomodule?: boolean;
779
- referrerpolicy?:
780
- | 'no-referrer'
781
- | 'no-referrer-when-downgrade'
782
- | 'origin'
783
- | 'origin-when-cross-origin'
784
- | 'same-origin'
785
- | 'strict-origin'
786
- | 'strict-origin-when-cross-origin'
787
- | 'unsafe-url';
788
- src?: string;
789
- type?: string;
790
- };
684
+ script: BaseAttr & {
685
+ async?: boolean;
686
+ crossorigin?: 'anonymous' | 'use-credentials' | '';
687
+ defer?: boolean;
688
+ integrity?: string;
689
+ nomodule?: boolean;
690
+ referrerpolicy?:
691
+ | 'no-referrer'
692
+ | 'no-referrer-when-downgrade'
693
+ | 'origin'
694
+ | 'origin-when-cross-origin'
695
+ | 'same-origin'
696
+ | 'strict-origin'
697
+ | 'strict-origin-when-cross-origin'
698
+ | 'unsafe-url';
699
+ src?: string;
700
+ type?: string;
701
+ };
791
702
 
792
703
  // Select element
793
704
  select: BaseAttr & {
@@ -817,10 +728,9 @@ interface AttributesMap {
817
728
  };
818
729
 
819
730
  // Style element
820
- style: BaseAttr &
821
- ImageElementEvents & {
822
- media?: string;
823
- };
731
+ style: BaseAttr & {
732
+ media?: string;
733
+ };
824
734
 
825
735
  // Table element
826
736
  table: BaseAttr & {};
@@ -891,20 +801,19 @@ interface AttributesMap {
891
801
  ul: BaseAttr & {};
892
802
 
893
803
  // Video element
894
- video: BaseAttr &
895
- MediaElementEvents & {
896
- autoplay?: boolean;
897
- controls?: boolean;
898
- crossorigin?: 'anonymous' | 'use-credentials' | '';
899
- height?: number | string;
900
- loop?: boolean;
901
- muted?: boolean;
902
- playsinline?: boolean;
903
- poster?: string;
904
- preload?: 'none' | 'metadata' | 'auto' | '';
905
- src?: string;
906
- width?: number | string;
907
- };
804
+ video: BaseAttr & {
805
+ autoplay?: boolean;
806
+ controls?: boolean;
807
+ crossorigin?: 'anonymous' | 'use-credentials' | '';
808
+ height?: number | string;
809
+ loop?: boolean;
810
+ muted?: boolean;
811
+ playsinline?: boolean;
812
+ poster?: string;
813
+ preload?: 'none' | 'metadata' | 'auto' | '';
814
+ src?: string;
815
+ width?: number | string;
816
+ };
908
817
 
909
818
  // Generic HTMLElement (no specific attributes beyond BaseEvent)
910
819
  abbr: BaseAttr & {};
@@ -1439,11 +1348,31 @@ declare global {
1439
1348
  // 'svg:view': SVGAttributesMap['view'];
1440
1349
  }
1441
1350
 
1442
- interface IntrinsicAttributes {
1351
+ type IntrinsicAttributes = KTPrefixedEventAttribute & {
1352
+ /**
1353
+ * Make a reference to the created element
1354
+ */
1443
1355
  ref?: KTRef<any>;
1356
+
1357
+ /**
1358
+ * Conditional rendering
1359
+ * - Provide a `KTRef` to make it reactive
1360
+ */
1444
1361
  'k-if'?: any;
1362
+
1363
+ /**
1364
+ * 2-way binding
1365
+ * - Provide a `KTRef` to make it reactive
1366
+ */
1367
+ 'k-model'?: KTRef<any>;
1368
+
1369
+ /**
1370
+ * Raw html binding
1371
+ * - Provide a `KTRef` to make it reactive
1372
+ */
1373
+ 'k-html'?: any;
1445
1374
  children?: KTRawContent;
1446
- }
1375
+ };
1447
1376
 
1448
1377
  interface ElementChildrenAttribute {
1449
1378
  children: {};
@@ -1477,5 +1406,5 @@ interface KTForProps<T> {
1477
1406
  */
1478
1407
  declare function KTFor<T>(props: KTForProps<T>): KTForElement;
1479
1408
 
1480
- export { $modelOrRef, Fragment, KTAsync, KTFor, KTRef, h as createElement, createRedrawable, deref, h, isKTRef, jsx, jsxDEV, jsxs, ref, surfaceRef };
1481
- export type { EventHandler, HTMLTag, InputElementTag, KTAttribute, KTForElement, KTForProps, KTRawAttr, KTRawContent, KTRawContents, KTSurfaceRef, MathMLTag, SVGTag };
1409
+ export { $modelOrRef, Fragment, KTAsync, KTComputed, KTFor, KTReactiveType, KTRef, computed, h as createElement, createRedrawable, deref, h, isComputed, isKT, isRef, jsx, jsxDEV, jsxs, ref, surfaceRef, toRef };
1410
+ export type { EventHandler, HTMLTag, InputElementTag, KTAttribute, KTForElement, KTForProps, KTPrefixedEventAttribute, KTRawAttr, KTRawContent, KTRawContents, KTReactive, KTSurfaceRef, MathMLTag, ReactiveChangeHandler, SVGTag };