@ktjs/core 0.23.0 → 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
  } & {
@@ -154,11 +203,11 @@ interface KTBaseAttribute {
154
203
  method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring;
155
204
  }
156
205
 
157
- type KTPrefixedEventHandlers = {
206
+ type KTPrefixedEventAttribute = {
158
207
  [EventName in keyof HTMLElementEventMap as `on:${EventName}`]?: (ev: HTMLElementEventMap[EventName]) => void;
159
208
  };
160
209
 
161
- type KTAttribute = KTBaseAttribute & KTPrefixedEventHandlers;
210
+ type KTAttribute = KTBaseAttribute & KTPrefixedEventAttribute;
162
211
 
163
212
  type KTComponent = (
164
213
  props: {
@@ -178,7 +227,7 @@ type KTComponent = (
178
227
  * ## About
179
228
  * @package @ktjs/core
180
229
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
181
- * @version 0.23.0 (Last Update: 2026.02.03 17:15:01.812)
230
+ * @version 0.24.0 (Last Update: 2026.02.05 12:08:54.164)
182
231
  * @license MIT
183
232
  * @link https://github.com/baendlorel/kt.js
184
233
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -229,149 +278,14 @@ declare function createRedrawable<T>(creator: () => T): KTRef<T> & {
229
278
  };
230
279
 
231
280
  // Base events available to all HTML elements
232
- interface BaseAttr {
281
+ type BaseAttr = KTPrefixedEventAttribute & {
233
282
  [k: string]: any;
234
283
 
235
284
  // # base attributes
236
285
  class?: string;
237
286
  className?: string;
238
287
  style?: string | Partial<CSSStyleDeclaration>;
239
-
240
- // # Events
241
- // Mouse events
242
- 'on:click'?: (ev: PointerEvent) => void;
243
- 'on:dblclick'?: (ev: PointerEvent) => void;
244
- 'on:mousedown'?: (ev: PointerEvent) => void;
245
- 'on:mouseup'?: (ev: MouseEvent) => void;
246
- 'on:mousemove'?: (ev: MouseEvent) => void;
247
- 'on:mouseenter'?: (ev: MouseEvent) => void;
248
- 'on:mouseleave'?: (ev: MouseEvent) => void;
249
- 'on:mouseover'?: (ev: MouseEvent) => void;
250
- 'on:mouseout'?: (ev: MouseEvent) => void;
251
- 'on:contextmenu'?: (ev: PointerEvent) => void;
252
-
253
- // Keyboard events
254
- 'on:keydown'?: (ev: KeyboardEvent) => void;
255
- 'on:keyup'?: (ev: KeyboardEvent) => void;
256
- 'on:keypress'?: (ev: KeyboardEvent) => void;
257
-
258
- // Focus events
259
- 'on:focus'?: (ev: FocusEvent) => void;
260
- 'on:blur'?: (ev: FocusEvent) => void;
261
- 'on:focusin'?: (ev: FocusEvent) => void;
262
- 'on:focusout'?: (ev: FocusEvent) => void;
263
-
264
- // Input events
265
- 'on:input'?: (ev: Event) => void;
266
- 'on:change'?: (ev: Event) => void;
267
- 'on:beforeinput'?: (ev: InputEvent) => void;
268
-
269
- // Drag events
270
- 'on:drag'?: (ev: DragEvent) => void;
271
- 'on:dragstart'?: (ev: DragEvent) => void;
272
- 'on:dragend'?: (ev: DragEvent) => void;
273
- 'on:dragenter'?: (ev: DragEvent) => void;
274
- 'on:dragleave'?: (ev: DragEvent) => void;
275
- 'on:dragover'?: (ev: DragEvent) => void;
276
- 'on:drop'?: (ev: DragEvent) => void;
277
-
278
- // Clipboard events
279
- 'on:copy'?: (ev: ClipboardEvent) => void;
280
- 'on:cut'?: (ev: ClipboardEvent) => void;
281
- 'on:paste'?: (ev: ClipboardEvent) => void;
282
-
283
- // Touch events
284
- 'on:touchstart'?: (ev: TouchEvent) => void;
285
- 'on:touchmove'?: (ev: TouchEvent) => void;
286
- 'on:touchend'?: (ev: TouchEvent) => void;
287
- 'on:touchcancel'?: (ev: TouchEvent) => void;
288
-
289
- // Wheel event
290
- 'on:wheel'?: (ev: WheelEvent) => void;
291
-
292
- // Animation events
293
- 'on:animationstart'?: (ev: AnimationEvent) => void;
294
- 'on:animationend'?: (ev: AnimationEvent) => void;
295
- 'on:animationiteration'?: (ev: AnimationEvent) => void;
296
-
297
- // Transition events
298
- 'on:transitionstart'?: (ev: TransitionEvent) => void;
299
- 'on:transitionend'?: (ev: TransitionEvent) => void;
300
- 'on:transitionrun'?: (ev: TransitionEvent) => void;
301
- 'on:transitioncancel'?: (ev: TransitionEvent) => void;
302
-
303
- // Pointer events
304
- 'on:pointerdown'?: (ev: PointerEvent) => void;
305
- 'on:pointerup'?: (ev: PointerEvent) => void;
306
- 'on:pointermove'?: (ev: PointerEvent) => void;
307
- 'on:pointerenter'?: (ev: PointerEvent) => void;
308
- 'on:pointerleave'?: (ev: PointerEvent) => void;
309
- 'on:pointerover'?: (ev: PointerEvent) => void;
310
- 'on:pointerout'?: (ev: PointerEvent) => void;
311
- 'on:pointercancel'?: (ev: PointerEvent) => void;
312
- 'on:gotpointercapture'?: (ev: PointerEvent) => void;
313
- 'on:lostpointercapture'?: (ev: PointerEvent) => void;
314
-
315
- // Selection events
316
- 'on:select'?: (ev: Event) => void;
317
- 'on:selectstart'?: (ev: Event) => void;
318
-
319
- // Scroll event
320
- 'on:scroll'?: (ev: Event) => void;
321
-
322
- // Resize event
323
- 'on:resize'?: (ev: UIEvent) => void;
324
- }
325
-
326
- // Form-specific events
327
- interface FormElementEvents {
328
- 'on:submit'?: (ev: SubmitEvent) => void;
329
- 'on:reset'?: (ev: Event) => void;
330
- 'on:invalid'?: (ev: Event) => void;
331
- }
332
-
333
- // Media-specific events
334
- interface MediaElementEvents {
335
- 'on:play'?: (ev: Event) => void;
336
- 'on:pause'?: (ev: Event) => void;
337
- 'on:playing'?: (ev: Event) => void;
338
- 'on:ended'?: (ev: Event) => void;
339
- 'on:canplay'?: (ev: Event) => void;
340
- 'on:canplaythrough'?: (ev: Event) => void;
341
- 'on:durationchange'?: (ev: Event) => void;
342
- 'on:emptied'?: (ev: Event) => void;
343
- 'on:loadeddata'?: (ev: Event) => void;
344
- 'on:loadedmetadata'?: (ev: Event) => void;
345
- 'on:loadstart'?: (ev: Event) => void;
346
- 'on:progress'?: (ev: ProgressEvent) => void;
347
- 'on:ratechange'?: (ev: Event) => void;
348
- 'on:seeked'?: (ev: Event) => void;
349
- 'on:seeking'?: (ev: Event) => void;
350
- 'on:stalled'?: (ev: Event) => void;
351
- 'on:suspend'?: (ev: Event) => void;
352
- 'on:timeupdate'?: (ev: Event) => void;
353
- 'on:volumechange'?: (ev: Event) => void;
354
- 'on:waiting'?: (ev: Event) => void;
355
- 'on:abort'?: (ev: UIEvent) => void;
356
- 'on:error'?: (ev: ErrorEvent) => void;
357
- }
358
-
359
- // Details-specific events
360
- interface DetailsElementEvents {
361
- 'on:toggle'?: (ev: Event) => void;
362
- }
363
-
364
- // Dialog-specific events
365
- interface DialogElementEvents {
366
- 'on:cancel'?: (ev: Event) => void;
367
- 'on:close'?: (ev: Event) => void;
368
- }
369
-
370
- // Image-specific events
371
- interface ImageElementEvents {
372
- 'on:load'?: (ev: Event) => void;
373
- 'on:error'?: (ev: ErrorEvent) => void;
374
- }
288
+ };
375
289
 
376
290
  interface AttributesMap {
377
291
  // Anchor element
@@ -416,16 +330,15 @@ interface AttributesMap {
416
330
  };
417
331
 
418
332
  // Audio element
419
- audio: BaseAttr &
420
- MediaElementEvents & {
421
- autoplay?: boolean;
422
- controls?: boolean;
423
- crossorigin?: 'anonymous' | 'use-credentials' | '';
424
- loop?: boolean;
425
- muted?: boolean;
426
- preload?: 'none' | 'metadata' | 'auto' | '';
427
- src?: string;
428
- };
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
+ };
429
342
 
430
343
  // Base element
431
344
  base: BaseAttr & {
@@ -487,16 +400,14 @@ interface AttributesMap {
487
400
  };
488
401
 
489
402
  // Details element
490
- details: BaseAttr &
491
- DetailsElementEvents & {
492
- open?: boolean;
493
- };
403
+ details: BaseAttr & {
404
+ open?: boolean;
405
+ };
494
406
 
495
407
  // Dialog element
496
- dialog: BaseAttr &
497
- DialogElementEvents & {
498
- open?: boolean;
499
- };
408
+ dialog: BaseAttr & {
409
+ open?: boolean;
410
+ };
500
411
 
501
412
  // Embed element
502
413
  embed: BaseAttr & {
@@ -514,18 +425,17 @@ interface AttributesMap {
514
425
  };
515
426
 
516
427
  // Form element
517
- form: BaseAttr &
518
- FormElementEvents & {
519
- 'accept-charset'?: string;
520
- action?: string;
521
- autocomplete?: 'on' | 'off';
522
- enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
523
- method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring;
524
-
525
- name?: string;
526
- novalidate?: boolean;
527
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
528
- };
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
+ };
529
439
 
530
440
  // Head element
531
441
  head: BaseAttr & {};
@@ -537,53 +447,51 @@ interface AttributesMap {
537
447
  html: BaseAttr & {};
538
448
 
539
449
  // IFrame element
540
- iframe: BaseAttr &
541
- ImageElementEvents & {
542
- allow?: string;
543
- allowfullscreen?: boolean;
544
- allowpaymentrequest?: boolean;
545
- height?: number | string;
546
- loading?: 'eager' | 'lazy';
547
- name?: string;
548
- referrerpolicy?:
549
- | 'no-referrer'
550
- | 'no-referrer-when-downgrade'
551
- | 'origin'
552
- | 'origin-when-cross-origin'
553
- | 'same-origin'
554
- | 'strict-origin'
555
- | 'strict-origin-when-cross-origin'
556
- | 'unsafe-url';
557
- sandbox?: string;
558
- src?: string;
559
- srcdoc?: string;
560
- width?: number | string;
561
- };
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
+ };
562
471
 
563
472
  // Image element
564
- img: BaseAttr &
565
- ImageElementEvents & {
566
- alt?: string;
567
- crossorigin?: 'anonymous' | 'use-credentials' | '';
568
- decoding?: 'sync' | 'async' | 'auto';
569
- height?: number | string;
570
- ismap?: boolean;
571
- loading?: 'eager' | 'lazy';
572
- referrerpolicy?:
573
- | 'no-referrer'
574
- | 'no-referrer-when-downgrade'
575
- | 'origin'
576
- | 'origin-when-cross-origin'
577
- | 'same-origin'
578
- | 'strict-origin'
579
- | 'strict-origin-when-cross-origin'
580
- | 'unsafe-url';
581
- sizes?: string;
582
- src?: string;
583
- srcset?: string;
584
- usemap?: string;
585
- width?: number | string;
586
- };
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
+ };
587
495
 
588
496
  // Input element
589
497
  input: BaseAttr & {
@@ -661,30 +569,29 @@ interface AttributesMap {
661
569
  };
662
570
 
663
571
  // Link element
664
- link: BaseAttr &
665
- ImageElementEvents & {
666
- as?: string;
667
- crossorigin?: 'anonymous' | 'use-credentials' | '';
668
- disabled?: boolean;
669
- href?: string;
670
- hreflang?: string;
671
- imagesizes?: string;
672
- imagesrcset?: string;
673
- integrity?: string;
674
- media?: string;
675
- referrerpolicy?:
676
- | 'no-referrer'
677
- | 'no-referrer-when-downgrade'
678
- | 'origin'
679
- | 'origin-when-cross-origin'
680
- | 'same-origin'
681
- | 'strict-origin'
682
- | 'strict-origin-when-cross-origin'
683
- | 'unsafe-url';
684
- rel?: string;
685
- sizes?: string;
686
- type?: string;
687
- };
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
+ };
688
595
 
689
596
  // Map element
690
597
  map: BaseAttr & {
@@ -714,16 +621,15 @@ interface AttributesMap {
714
621
  };
715
622
 
716
623
  // Object element
717
- object: BaseAttr &
718
- ImageElementEvents & {
719
- data?: string;
720
- form?: string;
721
- height?: number | string;
722
- name?: string;
723
- type?: string;
724
- usemap?: string;
725
- width?: number | string;
726
- };
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
+ };
727
633
 
728
634
  // OL element
729
635
  ol: BaseAttr & {
@@ -775,25 +681,24 @@ interface AttributesMap {
775
681
  };
776
682
 
777
683
  // Script element
778
- script: BaseAttr &
779
- ImageElementEvents & {
780
- async?: boolean;
781
- crossorigin?: 'anonymous' | 'use-credentials' | '';
782
- defer?: boolean;
783
- integrity?: string;
784
- nomodule?: boolean;
785
- referrerpolicy?:
786
- | 'no-referrer'
787
- | 'no-referrer-when-downgrade'
788
- | 'origin'
789
- | 'origin-when-cross-origin'
790
- | 'same-origin'
791
- | 'strict-origin'
792
- | 'strict-origin-when-cross-origin'
793
- | 'unsafe-url';
794
- src?: string;
795
- type?: string;
796
- };
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
+ };
797
702
 
798
703
  // Select element
799
704
  select: BaseAttr & {
@@ -823,10 +728,9 @@ interface AttributesMap {
823
728
  };
824
729
 
825
730
  // Style element
826
- style: BaseAttr &
827
- ImageElementEvents & {
828
- media?: string;
829
- };
731
+ style: BaseAttr & {
732
+ media?: string;
733
+ };
830
734
 
831
735
  // Table element
832
736
  table: BaseAttr & {};
@@ -897,20 +801,19 @@ interface AttributesMap {
897
801
  ul: BaseAttr & {};
898
802
 
899
803
  // Video element
900
- video: BaseAttr &
901
- MediaElementEvents & {
902
- autoplay?: boolean;
903
- controls?: boolean;
904
- crossorigin?: 'anonymous' | 'use-credentials' | '';
905
- height?: number | string;
906
- loop?: boolean;
907
- muted?: boolean;
908
- playsinline?: boolean;
909
- poster?: string;
910
- preload?: 'none' | 'metadata' | 'auto' | '';
911
- src?: string;
912
- width?: number | string;
913
- };
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
+ };
914
817
 
915
818
  // Generic HTMLElement (no specific attributes beyond BaseEvent)
916
819
  abbr: BaseAttr & {};
@@ -1445,11 +1348,31 @@ declare global {
1445
1348
  // 'svg:view': SVGAttributesMap['view'];
1446
1349
  }
1447
1350
 
1448
- interface IntrinsicAttributes {
1351
+ type IntrinsicAttributes = KTPrefixedEventAttribute & {
1352
+ /**
1353
+ * Make a reference to the created element
1354
+ */
1449
1355
  ref?: KTRef<any>;
1356
+
1357
+ /**
1358
+ * Conditional rendering
1359
+ * - Provide a `KTRef` to make it reactive
1360
+ */
1450
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;
1451
1374
  children?: KTRawContent;
1452
- }
1375
+ };
1453
1376
 
1454
1377
  interface ElementChildrenAttribute {
1455
1378
  children: {};
@@ -1483,5 +1406,5 @@ interface KTForProps<T> {
1483
1406
  */
1484
1407
  declare function KTFor<T>(props: KTForProps<T>): KTForElement;
1485
1408
 
1486
- export { $modelOrRef, Fragment, KTAsync, KTFor, KTRef, h as createElement, createRedrawable, deref, h, isKTRef, jsx, jsxDEV, jsxs, ref, surfaceRef };
1487
- 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 };