@ktjs/core 0.28.2 → 0.29.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.
@@ -1,1331 +0,0 @@
1
- import { otherstring, HTMLTag, SVGTag, MathMLTag } from '@ktjs/shared';
2
-
3
- declare const enum KTReactiveType {
4
- REF = 1,
5
- COMPUTED = 2
6
- }
7
-
8
- type ReactiveChangeHandler<T> = (newValue: T, oldValue: T) => void;
9
-
10
- declare class KTReactive<T> {
11
- /**
12
- * Indicates that this is a KTRef instance
13
- */
14
- isKT: boolean;
15
-
16
- ktType: KTReactiveType;
17
-
18
- /**
19
- * If new value and old value are both nodes, the old one will be replaced in the DOM
20
- */
21
- get value();
22
- set value(newValue: T);
23
-
24
- /**
25
- * Force all listeners to run even when reference identity has not changed.
26
- * Useful for in-place array/object mutations.
27
- */
28
- notify(): void;
29
-
30
- /**
31
- * Mutate current value in-place and notify listeners once.
32
- *
33
- * @example
34
- * const items = ref<number[]>([1, 2]);
35
- * items.mutate((list) => list.push(3));
36
- */
37
- mutate<R = void>(mutator: (currentValue: T) => R): R;
38
- /**
39
- * Register a callback when the value changes
40
- * @param callback (newValue, oldValue) => xxx
41
- */
42
- addOnChange(callback: ReactiveChangeHandler<T>): void;
43
- removeOnChange(callback: ReactiveChangeHandler<T>): void;
44
- }
45
-
46
- // & Shockingly, If T is boolean, KTReactify<T> becomes KTReactive<true> | KTReactive<false>. It causes @ktjs/mui that disabledRefs not assignable.
47
- type KTReactify<T> = T extends boolean ? KTReactive<boolean> : T extends any ? KTReactive<T> : never;
48
-
49
- type KTReactifyProps<T extends object> = {
50
- [K in keyof T]: KTReactify<Exclude<T[K], undefined>> | T[K];
51
- };
52
-
53
- declare class KTRef<T> implements KTReactive<T> {
54
- /**
55
- * Indicates that this is a KTRef instance
56
- */
57
- isKT: true;
58
- ktType: KTReactiveType;
59
- constructor(_value: T, _onChanges: Array<ReactiveChangeHandler<T>>);
60
- /**
61
- * If new value and old value are both nodes, the old one will be replaced in the DOM
62
- */
63
- get value(): T;
64
- set value(newValue: T);
65
- /**
66
- * Force all listeners to run even when reference identity has not changed.
67
- * Useful for in-place array/object mutations.
68
- */
69
- notify(): void;
70
- /**
71
- * Mutate current value in-place and notify listeners once.
72
- *
73
- * @example
74
- * const items = ref<number[]>([1, 2]);
75
- * items.mutate((list) => list.push(3));
76
- */
77
- mutate<R = void>(mutator: (currentValue: T) => R): R;
78
- /**
79
- * Register a callback when the value changes
80
- * @param callback (newValue, oldValue) => xxx
81
- */
82
- addOnChange(callback: ReactiveChangeHandler<T>): void;
83
- removeOnChange(callback: ReactiveChangeHandler<T>): boolean;
84
- }
85
-
86
- type HTML<T extends (HTMLTag | SVGTag | MathMLTag) & otherstring> = T extends SVGTag
87
- ? SVGElementTagNameMap[T]
88
- : T extends HTMLTag
89
- ? HTMLElementTagNameMap[T]
90
- : T extends MathMLTag
91
- ? MathMLElementTagNameMap[T]
92
- : HTMLElement;
93
-
94
- type SingleContent = KTRef<any> | HTMLElement | Element | Node | string | number | boolean | null | undefined;
95
- type KTAvailableContent = SingleContent | KTAvailableContent[];
96
- type KTRawContent = KTAvailableContent | Promise<KTAvailableContent>;
97
- type KTRawAttr = KTAttribute | null | undefined | '' | false;
98
-
99
- /**
100
- * Used to create enhanced HTML elements
101
- */
102
- interface KTBaseAttribute {
103
- [k: string]: any;
104
-
105
- // # kt-specific attributes
106
- ref?: KTRef<JSX.Element>;
107
-
108
- /**
109
- * If a `KTRef` is bound, it will be reactive; otherwise, it will be static.
110
- */
111
- 'k-if'?: any;
112
-
113
- /**
114
- * Register two-way data binding between an input element and a KTRef.
115
- * - Default to regist `input` event and `value` property(`checked` for checkboxes and radios).
116
- */
117
- 'k-model'?: KTRef<any>;
118
-
119
- /**
120
- * Directly apply html string to `innerHTML`.
121
- * - Would be reactive if `KTRef` instance is provided
122
- */
123
- 'k-html'?: any;
124
-
125
- // # normal HTML attributes
126
- id?: string;
127
- class?: string;
128
- className?: string;
129
- style?: string | Partial<CSSStyleDeclaration>;
130
-
131
- type?:
132
- | 'text'
133
- | 'password'
134
- | 'email'
135
- | 'number'
136
- | 'tel'
137
- | 'url'
138
- | 'search'
139
- | 'date'
140
- | 'datetime-local'
141
- | 'time'
142
- | 'month'
143
- | 'week'
144
- | 'color'
145
- | 'range'
146
- | 'file'
147
- | 'checkbox'
148
- | 'radio'
149
- | 'hidden'
150
- | 'submit'
151
- | 'reset'
152
- | 'button'
153
- | 'image'
154
- | otherstring;
155
- for?: string;
156
-
157
- name?: string;
158
- title?: string;
159
- placeholder?: string;
160
- contenteditable?: boolean;
161
- value?: any;
162
- valueAsDate?: Date;
163
- valueAsNumber?: number;
164
- label?: string;
165
- disabled?: boolean;
166
-
167
- min?: string | number;
168
- max?: string | number;
169
- step?: string | number;
170
-
171
- selected?: boolean;
172
- checked?: boolean;
173
-
174
- action?: string;
175
- method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring;
176
- }
177
-
178
- type KTPrefixedEventAttribute = {
179
- [EventName in keyof HTMLElementEventMap as `on:${EventName}`]?: (ev: HTMLElementEventMap[EventName]) => void;
180
- };
181
-
182
- type KTAttribute = KTBaseAttribute & KTPrefixedEventAttribute;
183
-
184
- /**
185
- * Create an enhanced HTMLElement.
186
- * - Only supports HTMLElements, **NOT** SVGElements or other Elements.
187
- * @param tag tag of an `HTMLElement`
188
- * @param attr attribute object or className
189
- * @param content a string or an array of HTMLEnhancedElement as child nodes
190
- *
191
- * ## About
192
- * @package @ktjs/core
193
- * @author Kasukabe Tsumugi <futami16237@gmail.com>
194
- * @version 0.28.2 (Last Update: 2026.02.10 14:46:21.243)
195
- * @license MIT
196
- * @link https://github.com/baendlorel/kt.js
197
- * @link https://baendlorel.github.io/ Welcome to my site!
198
- * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
199
- * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
200
- */
201
- declare const h: <T extends HTMLTag | SVGTag | MathMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent) => HTML<T>;
202
-
203
- type JSXTag = HTMLTag | ((props?: any) => HTMLElement) | ((props?: any) => Promise<HTMLElement>);
204
- /**
205
- * @param tag html tag or function component
206
- * @param props properties/attributes
207
- */
208
- declare function jsx(tag: JSXTag, props: KTAttribute): JSX.Element;
209
- /**
210
- * Fragment support - returns an array of children
211
- * Enhanced Fragment component that manages arrays of elements
212
- */
213
- declare function Fragment(props: {
214
- children?: KTRawContent;
215
- }): JSX.Element;
216
- /**
217
- * JSX Development runtime - same as jsx but with additional dev checks
218
- */
219
- declare const jsxDEV: typeof jsx;
220
- /**
221
- * JSX runtime for React 17+ automatic runtime
222
- * This is called when using jsx: "react-jsx" or "react-jsxdev"
223
- */
224
- declare const jsxs: typeof jsx;
225
-
226
- /**
227
- * A helper to create redrawable elements
228
- * ```tsx
229
- * export function MyComponent() {
230
- * let aa = 10;
231
- * // ...
232
- * // aa might be changed
233
- * return createRedrawable(() => <div>{aa}</div>);
234
- * }
235
- * ```
236
- * Then the returned element has a `redraw` method to redraw itself with new values.
237
- * @param creator a simple creator function that returns an element
238
- * @returns created element's ref
239
- */
240
- declare function createRedrawable<T>(creator: () => T): KTRef<T> & {
241
- redraw: () => T;
242
- };
243
-
244
- // Base events available to all HTML elements
245
- type BaseAttr = KTPrefixedEventAttribute &
246
- KTReactifyProps<{
247
- [k: string]: any;
248
-
249
- // # base attributes
250
- class?: string;
251
- className?: string;
252
- style?: string | Partial<CSSStyleDeclaration>;
253
- }>;
254
-
255
- interface AttributesMap {
256
- // Anchor element
257
- a: BaseAttr &
258
- KTReactifyProps<{
259
- download?: string;
260
- href?: string;
261
- hreflang?: string;
262
- ping?: string;
263
- referrerpolicy?:
264
- | 'no-referrer'
265
- | 'no-referrer-when-downgrade'
266
- | 'origin'
267
- | 'origin-when-cross-origin'
268
- | 'same-origin'
269
- | 'strict-origin'
270
- | 'strict-origin-when-cross-origin'
271
- | 'unsafe-url';
272
- rel?: string;
273
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
274
- type?: string;
275
- }>;
276
-
277
- // Area element
278
- area: BaseAttr &
279
- KTReactifyProps<{
280
- alt?: string;
281
- coords?: string;
282
- download?: string;
283
- href?: string;
284
- ping?: string;
285
- referrerpolicy?:
286
- | 'no-referrer'
287
- | 'no-referrer-when-downgrade'
288
- | 'origin'
289
- | 'origin-when-cross-origin'
290
- | 'same-origin'
291
- | 'strict-origin'
292
- | 'strict-origin-when-cross-origin'
293
- | 'unsafe-url';
294
- rel?: string;
295
- shape?: 'rect' | 'circle' | 'poly' | 'default';
296
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
297
- }>;
298
-
299
- // Audio element
300
- audio: BaseAttr &
301
- KTReactifyProps<{
302
- autoplay?: boolean;
303
- controls?: boolean;
304
- crossorigin?: 'anonymous' | 'use-credentials' | '';
305
- loop?: boolean;
306
- muted?: boolean;
307
- preload?: 'none' | 'metadata' | 'auto' | '';
308
- src?: string;
309
- }>;
310
-
311
- // Base element
312
- base: BaseAttr &
313
- KTReactifyProps<{
314
- href?: string;
315
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
316
- }>;
317
-
318
- // Body element
319
- body: BaseAttr & KTReactifyProps<{}>;
320
-
321
- // BR element
322
- br: BaseAttr & KTReactifyProps<{}>;
323
-
324
- // Button element
325
- button: BaseAttr &
326
- KTReactifyProps<{
327
- disabled?: boolean;
328
- form?: string;
329
- formaction?: string;
330
- formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
331
- formmethod?: 'get' | 'post' | 'dialog';
332
- formnovalidate?: boolean;
333
- formtarget?: '_self' | '_blank' | '_parent' | '_top' | string;
334
- name?: string;
335
- type?: 'submit' | 'reset' | 'button';
336
- value?: string;
337
- }>;
338
-
339
- // Canvas element
340
- canvas: BaseAttr &
341
- KTReactifyProps<{
342
- height?: number | string;
343
- width?: number | string;
344
- }>;
345
-
346
- // Table caption element
347
- caption: BaseAttr & KTReactifyProps<{}>;
348
-
349
- // Col element
350
- col: BaseAttr &
351
- KTReactifyProps<{
352
- span?: number | string;
353
- }>;
354
-
355
- // Colgroup element
356
- colgroup: BaseAttr &
357
- KTReactifyProps<{
358
- span?: number | string;
359
- }>;
360
-
361
- // Data element
362
- data: BaseAttr &
363
- KTReactifyProps<{
364
- value?: string;
365
- }>;
366
-
367
- // Datalist element
368
- datalist: BaseAttr & KTReactifyProps<{}>;
369
-
370
- // Del element
371
- del: BaseAttr &
372
- KTReactifyProps<{
373
- cite?: string;
374
- datetime?: string;
375
- }>;
376
-
377
- // Details element
378
- details: BaseAttr &
379
- KTReactifyProps<{
380
- open?: boolean;
381
- }>;
382
-
383
- // Dialog element
384
- dialog: BaseAttr &
385
- KTReactifyProps<{
386
- open?: boolean;
387
- }>;
388
-
389
- // Embed element
390
- embed: BaseAttr &
391
- KTReactifyProps<{
392
- height?: number | string;
393
- src?: string;
394
- type?: string;
395
- width?: number | string;
396
- }>;
397
-
398
- // Fieldset element
399
- fieldset: BaseAttr &
400
- KTReactifyProps<{
401
- disabled?: boolean;
402
- form?: string;
403
- name?: string;
404
- }>;
405
-
406
- // Form element
407
- form: BaseAttr &
408
- KTReactifyProps<{
409
- 'accept-charset'?: string;
410
- action?: string;
411
- autocomplete?: 'on' | 'off';
412
- enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
413
- method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring;
414
-
415
- name?: string;
416
- novalidate?: boolean;
417
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
418
- }>;
419
-
420
- // Head element
421
- head: BaseAttr & KTReactifyProps<{}>;
422
-
423
- // HR element
424
- hr: BaseAttr & KTReactifyProps<{}>;
425
-
426
- // HTML element
427
- html: BaseAttr & KTReactifyProps<{}>;
428
-
429
- // IFrame element
430
- iframe: BaseAttr &
431
- KTReactifyProps<{
432
- allow?: string;
433
- allowfullscreen?: boolean;
434
- allowpaymentrequest?: boolean;
435
- height?: number | string;
436
- loading?: 'eager' | 'lazy';
437
- name?: string;
438
- referrerpolicy?:
439
- | 'no-referrer'
440
- | 'no-referrer-when-downgrade'
441
- | 'origin'
442
- | 'origin-when-cross-origin'
443
- | 'same-origin'
444
- | 'strict-origin'
445
- | 'strict-origin-when-cross-origin'
446
- | 'unsafe-url';
447
- sandbox?: string;
448
- src?: string;
449
- srcdoc?: string;
450
- width?: number | string;
451
- }>;
452
-
453
- // Image element
454
- img: BaseAttr &
455
- KTReactifyProps<{
456
- alt?: string;
457
- crossorigin?: 'anonymous' | 'use-credentials' | '';
458
- decoding?: 'sync' | 'async' | 'auto';
459
- height?: number | string;
460
- ismap?: boolean;
461
- loading?: 'eager' | 'lazy';
462
- referrerpolicy?:
463
- | 'no-referrer'
464
- | 'no-referrer-when-downgrade'
465
- | 'origin'
466
- | 'origin-when-cross-origin'
467
- | 'same-origin'
468
- | 'strict-origin'
469
- | 'strict-origin-when-cross-origin'
470
- | 'unsafe-url';
471
- sizes?: string;
472
- src?: string;
473
- srcset?: string;
474
- usemap?: string;
475
- width?: number | string;
476
- }>;
477
-
478
- // Input element
479
- input: BaseAttr &
480
- KTReactifyProps<{
481
- accept?: string;
482
- alt?: string;
483
- autocomplete?: string;
484
- checked?: boolean;
485
- dirname?: string;
486
- disabled?: boolean;
487
- form?: string;
488
- formaction?: string;
489
- formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
490
- formmethod?: 'get' | 'post';
491
- formnovalidate?: boolean;
492
- formtarget?: '_self' | '_blank' | '_parent' | '_top' | string;
493
- height?: number | string;
494
- list?: string;
495
- max?: number | string;
496
- maxlength?: number | string;
497
- min?: number | string;
498
- minlength?: number | string;
499
- multiple?: boolean;
500
- name?: string;
501
- pattern?: string;
502
- placeholder?: string;
503
- readonly?: boolean;
504
- required?: boolean;
505
- size?: number | string;
506
- src?: string;
507
- step?: number | string;
508
- type?:
509
- | 'button'
510
- | 'checkbox'
511
- | 'color'
512
- | 'date'
513
- | 'datetime-local'
514
- | 'email'
515
- | 'file'
516
- | 'hidden'
517
- | 'image'
518
- | 'month'
519
- | 'number'
520
- | 'password'
521
- | 'radio'
522
- | 'range'
523
- | 'reset'
524
- | 'search'
525
- | 'submit'
526
- | 'tel'
527
- | 'text'
528
- | 'time'
529
- | 'url'
530
- | 'week';
531
- value?: string;
532
- width?: number | string;
533
- }>;
534
-
535
- // Ins element
536
- ins: BaseAttr &
537
- KTReactifyProps<{
538
- cite?: string;
539
- datetime?: string;
540
- }>;
541
-
542
- // Label element
543
- label: BaseAttr &
544
- KTReactifyProps<{
545
- for?: string;
546
- }>;
547
-
548
- // Legend element
549
- legend: BaseAttr & KTReactifyProps<{}>;
550
-
551
- // LI element
552
- li: BaseAttr &
553
- KTReactifyProps<{
554
- value?: number | string;
555
- }>;
556
-
557
- // Link element
558
- link: BaseAttr &
559
- KTReactifyProps<{
560
- as?: string;
561
- crossorigin?: 'anonymous' | 'use-credentials' | '';
562
- disabled?: boolean;
563
- href?: string;
564
- hreflang?: string;
565
- imagesizes?: string;
566
- imagesrcset?: string;
567
- integrity?: string;
568
- media?: string;
569
- referrerpolicy?:
570
- | 'no-referrer'
571
- | 'no-referrer-when-downgrade'
572
- | 'origin'
573
- | 'origin-when-cross-origin'
574
- | 'same-origin'
575
- | 'strict-origin'
576
- | 'strict-origin-when-cross-origin'
577
- | 'unsafe-url';
578
- rel?: string;
579
- sizes?: string;
580
- type?: string;
581
- }>;
582
-
583
- // Map element
584
- map: BaseAttr &
585
- KTReactifyProps<{
586
- name?: string;
587
- }>;
588
-
589
- // Menu element
590
- menu: BaseAttr & KTReactifyProps<{}>;
591
-
592
- // Meta element
593
- meta: BaseAttr &
594
- KTReactifyProps<{
595
- charset?: string;
596
- content?: string;
597
- 'http-equiv'?: 'content-security-policy' | 'content-type' | 'default-style' | 'refresh' | string;
598
- name?: string;
599
- }>;
600
-
601
- // Meter element
602
- meter: BaseAttr &
603
- KTReactifyProps<{
604
- form?: string;
605
- high?: number | string;
606
- low?: number | string;
607
- max?: number | string;
608
- min?: number | string;
609
- optimum?: number | string;
610
- value?: number | string;
611
- }>;
612
-
613
- // Object element
614
- object: BaseAttr &
615
- KTReactifyProps<{
616
- data?: string;
617
- form?: string;
618
- height?: number | string;
619
- name?: string;
620
- type?: string;
621
- usemap?: string;
622
- width?: number | string;
623
- }>;
624
-
625
- // OL element
626
- ol: BaseAttr &
627
- KTReactifyProps<{
628
- reversed?: boolean;
629
- start?: number | string;
630
- type?: '1' | 'a' | 'A' | 'i' | 'I';
631
- }>;
632
-
633
- // Optgroup element
634
- optgroup: BaseAttr &
635
- KTReactifyProps<{
636
- disabled?: boolean;
637
- label?: string;
638
- }>;
639
-
640
- // Option element
641
- option: BaseAttr &
642
- KTReactifyProps<{
643
- disabled?: boolean;
644
- label?: string;
645
- selected?: boolean;
646
- value?: string;
647
- }>;
648
-
649
- // Output element
650
- output: BaseAttr &
651
- KTReactifyProps<{
652
- for?: string;
653
- form?: string;
654
- name?: string;
655
- }>;
656
-
657
- // Picture element
658
- picture: BaseAttr & KTReactifyProps<{}>;
659
-
660
- // Pre element
661
- pre: BaseAttr & KTReactifyProps<{}>;
662
-
663
- // Progress element
664
- progress: BaseAttr &
665
- KTReactifyProps<{
666
- max?: number | string;
667
- value?: number | string;
668
- }>;
669
-
670
- // Quote element (q and blockquote)
671
- q: BaseAttr &
672
- KTReactifyProps<{
673
- cite?: string;
674
- }>;
675
-
676
- blockquote: BaseAttr &
677
- KTReactifyProps<{
678
- cite?: string;
679
- }>;
680
-
681
- // Script element
682
- script: BaseAttr &
683
- KTReactifyProps<{
684
- async?: boolean;
685
- crossorigin?: 'anonymous' | 'use-credentials' | '';
686
- defer?: boolean;
687
- integrity?: string;
688
- nomodule?: boolean;
689
- referrerpolicy?:
690
- | 'no-referrer'
691
- | 'no-referrer-when-downgrade'
692
- | 'origin'
693
- | 'origin-when-cross-origin'
694
- | 'same-origin'
695
- | 'strict-origin'
696
- | 'strict-origin-when-cross-origin'
697
- | 'unsafe-url';
698
- src?: string;
699
- type?: string;
700
- }>;
701
-
702
- // Select element
703
- select: BaseAttr &
704
- KTReactifyProps<{
705
- autocomplete?: string;
706
- disabled?: boolean;
707
- form?: string;
708
- multiple?: boolean;
709
- name?: string;
710
- required?: boolean;
711
- size?: number | string;
712
- }>;
713
-
714
- // Slot element
715
- slot: BaseAttr &
716
- KTReactifyProps<{
717
- name?: string;
718
- }>;
719
-
720
- // Source element
721
- source: BaseAttr &
722
- KTReactifyProps<{
723
- height?: number | string;
724
- media?: string;
725
- sizes?: string;
726
- src?: string;
727
- srcset?: string;
728
- type?: string;
729
- width?: number | string;
730
- }>;
731
-
732
- // Style element
733
- style: BaseAttr &
734
- KTReactifyProps<{
735
- media?: string;
736
- }>;
737
-
738
- // Table element
739
- table: BaseAttr & KTReactifyProps<{}>;
740
-
741
- // Table body/footer/header elements
742
- tbody: BaseAttr & KTReactifyProps<{}>;
743
-
744
- tfoot: BaseAttr & KTReactifyProps<{}>;
745
-
746
- thead: BaseAttr & KTReactifyProps<{}>;
747
-
748
- // Table cell elements
749
- td: BaseAttr &
750
- KTReactifyProps<{
751
- colspan?: number | string;
752
- headers?: string;
753
- rowspan?: number | string;
754
- }>;
755
-
756
- th: BaseAttr &
757
- KTReactifyProps<{
758
- abbr?: string;
759
- colspan?: number | string;
760
- headers?: string;
761
- rowspan?: number | string;
762
- scope?: 'row' | 'col' | 'rowgroup' | 'colgroup';
763
- }>;
764
-
765
- // Template element
766
- template: BaseAttr & KTReactifyProps<{}>;
767
-
768
- // Textarea element
769
- textarea: BaseAttr &
770
- KTReactifyProps<{
771
- autocomplete?: string;
772
- cols?: number | string;
773
- dirname?: string;
774
- disabled?: boolean;
775
- form?: string;
776
- maxlength?: number | string;
777
- minlength?: number | string;
778
- name?: string;
779
- placeholder?: string;
780
- readonly?: boolean;
781
- required?: boolean;
782
- rows?: number | string;
783
- wrap?: 'hard' | 'soft' | 'off';
784
- }>;
785
-
786
- // Time element
787
- time: BaseAttr &
788
- KTReactifyProps<{
789
- datetime?: string;
790
- }>;
791
-
792
- // Title element
793
- title: BaseAttr & KTReactifyProps<{}>;
794
-
795
- // TR element
796
- tr: BaseAttr & KTReactifyProps<{}>;
797
-
798
- // Track element
799
- track: BaseAttr &
800
- KTReactifyProps<{
801
- default?: boolean;
802
- kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
803
- label?: string;
804
- src?: string;
805
- srclang?: string;
806
- }>;
807
-
808
- // UL element
809
- ul: BaseAttr & KTReactifyProps<{}>;
810
-
811
- // Video element
812
- video: BaseAttr &
813
- KTReactifyProps<{
814
- autoplay?: boolean;
815
- controls?: boolean;
816
- crossorigin?: 'anonymous' | 'use-credentials' | '';
817
- height?: number | string;
818
- loop?: boolean;
819
- muted?: boolean;
820
- playsinline?: boolean;
821
- poster?: string;
822
- preload?: 'none' | 'metadata' | 'auto' | '';
823
- src?: string;
824
- width?: number | string;
825
- }>;
826
-
827
- // Generic HTMLElement (no specific attributes beyond BaseEvent)
828
- abbr: BaseAttr & KTReactifyProps<{}>;
829
- address: BaseAttr & KTReactifyProps<{}>;
830
- article: BaseAttr & KTReactifyProps<{}>;
831
- aside: BaseAttr & KTReactifyProps<{}>;
832
- b: BaseAttr & KTReactifyProps<{}>;
833
- bdi: BaseAttr & KTReactifyProps<{}>;
834
- bdo: BaseAttr & KTReactifyProps<{}>;
835
- cite: BaseAttr & KTReactifyProps<{}>;
836
- code: BaseAttr & KTReactifyProps<{}>;
837
- dd: BaseAttr & KTReactifyProps<{}>;
838
- dfn: BaseAttr & KTReactifyProps<{}>;
839
- div: BaseAttr & KTReactifyProps<{}>;
840
- dl: BaseAttr & KTReactifyProps<{}>;
841
- dt: BaseAttr & KTReactifyProps<{}>;
842
- em: BaseAttr & KTReactifyProps<{}>;
843
- figcaption: BaseAttr & KTReactifyProps<{}>;
844
- figure: BaseAttr & KTReactifyProps<{}>;
845
- footer: BaseAttr & KTReactifyProps<{}>;
846
- h1: BaseAttr & KTReactifyProps<{}>;
847
- h2: BaseAttr & KTReactifyProps<{}>;
848
- h3: BaseAttr & KTReactifyProps<{}>;
849
- h4: BaseAttr & KTReactifyProps<{}>;
850
- h5: BaseAttr & KTReactifyProps<{}>;
851
- h6: BaseAttr & KTReactifyProps<{}>;
852
- header: BaseAttr & KTReactifyProps<{}>;
853
- hgroup: BaseAttr & KTReactifyProps<{}>;
854
- i: BaseAttr & KTReactifyProps<{}>;
855
- kbd: BaseAttr & KTReactifyProps<{}>;
856
- main: BaseAttr & KTReactifyProps<{}>;
857
- mark: BaseAttr & KTReactifyProps<{}>;
858
- nav: BaseAttr & KTReactifyProps<{}>;
859
- noscript: BaseAttr & KTReactifyProps<{}>;
860
- p: BaseAttr & KTReactifyProps<{}>;
861
- rp: BaseAttr & KTReactifyProps<{}>;
862
- rt: BaseAttr & KTReactifyProps<{}>;
863
- ruby: BaseAttr & KTReactifyProps<{}>;
864
- s: BaseAttr & KTReactifyProps<{}>;
865
- samp: BaseAttr & KTReactifyProps<{}>;
866
- search: BaseAttr & KTReactifyProps<{}>;
867
- section: BaseAttr & KTReactifyProps<{}>;
868
- small: BaseAttr & KTReactifyProps<{}>;
869
- span: BaseAttr & KTReactifyProps<{}>;
870
- strong: BaseAttr & KTReactifyProps<{}>;
871
- sub: BaseAttr & KTReactifyProps<{}>;
872
- summary: BaseAttr & KTReactifyProps<{}>;
873
- sup: BaseAttr & KTReactifyProps<{}>;
874
- u: BaseAttr & KTReactifyProps<{}>;
875
- var: BaseAttr & KTReactifyProps<{}>;
876
- wbr: BaseAttr & KTReactifyProps<{}>;
877
-
878
- svg: BaseAttr & {
879
- class?: string;
880
- style?: string | Partial<CSSStyleDeclaration>;
881
- width?: number | string;
882
- height?: number | string;
883
- viewBox?: string;
884
- xmlns?: string;
885
- fill?: string;
886
- stroke?: string;
887
- strokeWidth?: number | string;
888
- strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';
889
- strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit';
890
- strokeDasharray?: string;
891
- strokeDashoffset?: number | string;
892
- opacity?: number | string;
893
- preserveAspectRatio?: string;
894
- transform?: string;
895
- x?: number | string;
896
- y?: number | string;
897
- rx?: number | string;
898
- ry?: number | string;
899
- r?: number | string;
900
- cx?: number | string;
901
- cy?: number | string;
902
- d?: string;
903
- points?: string;
904
- pathLength?: number | string;
905
- viewbox?: string;
906
- role?: string;
907
- focusable?: boolean | 'true' | 'false';
908
- xlinkHref?: string; // legacy xlink:href
909
- };
910
- }
911
-
912
- interface SVGAttributesMap {
913
- a: AttributesMap['svg'] & { href?: string; x?: number | string; y?: number | string };
914
- animate: AttributesMap['svg'] & {
915
- attributeName?: string;
916
- from?: string | number;
917
- to?: string | number;
918
- dur?: string;
919
- repeatCount?: string | number;
920
- };
921
- animateMotion: AttributesMap['svg'] & { path?: string; dur?: string; rotate?: string };
922
- animateTransform: AttributesMap['svg'] & { type?: string; from?: string; to?: string; dur?: string };
923
- circle: AttributesMap['svg'] & { cx?: number | string; cy?: number | string; r?: number | string };
924
- clipPath: AttributesMap['svg'] & { clipPathUnits?: 'userSpaceOnUse' | 'objectBoundingBox' };
925
- defs: AttributesMap['svg'];
926
- desc: AttributesMap['svg'];
927
- ellipse: AttributesMap['svg'] & {
928
- cx?: number | string;
929
- cy?: number | string;
930
- rx?: number | string;
931
- ry?: number | string;
932
- };
933
-
934
- // Filter primitives (provide common props)
935
- feBlend: AttributesMap['svg'] & { in?: string; in2?: string; mode?: string };
936
- feColorMatrix: AttributesMap['svg'] & {
937
- type?: 'matrix' | 'saturate' | 'hueRotate' | 'luminanceToAlpha';
938
- values?: string;
939
- };
940
- feComponentTransfer: AttributesMap['svg'] & {};
941
- feComposite: AttributesMap['svg'] & {
942
- in?: string;
943
- in2?: string;
944
- operator?: string;
945
- k1?: number | string;
946
- k2?: number | string;
947
- k3?: number | string;
948
- k4?: number | string;
949
- };
950
- feConvolveMatrix: AttributesMap['svg'] & {
951
- order?: string | number;
952
- kernelMatrix?: string;
953
- divisor?: string | number;
954
- bias?: string | number;
955
- };
956
- feDiffuseLighting: AttributesMap['svg'] & {};
957
- feDisplacementMap: AttributesMap['svg'] & {
958
- in?: string;
959
- in2?: string;
960
- scale?: number | string;
961
- xChannelSelector?: string;
962
- yChannelSelector?: string;
963
- };
964
- feDistantLight: AttributesMap['svg'] & { azimuth?: number | string; elevation?: number | string };
965
- feDropShadow: AttributesMap['svg'] & {
966
- dx?: number | string;
967
- dy?: number | string;
968
- stdDeviation?: number | string;
969
- floodColor?: string;
970
- floodOpacity?: number | string;
971
- };
972
- feFlood: AttributesMap['svg'] & { floodColor?: string; floodOpacity?: number | string };
973
- feFuncA: AttributesMap['svg'] & {};
974
- feFuncB: AttributesMap['svg'] & {};
975
- feFuncG: AttributesMap['svg'] & {};
976
- feFuncR: AttributesMap['svg'] & {};
977
- feGaussianBlur: AttributesMap['svg'] & { stdDeviation?: number | string; edgeMode?: string };
978
- feImage: AttributesMap['svg'] & { href?: string };
979
- feMerge: AttributesMap['svg'] & {};
980
- feMergeNode: AttributesMap['svg'] & { in?: string };
981
- feMorphology: AttributesMap['svg'] & { operator?: 'erode' | 'dilate'; radius?: number | string };
982
- feOffset: AttributesMap['svg'] & { dx?: number | string; dy?: number | string };
983
- fePointLight: AttributesMap['svg'] & { x?: number | string; y?: number | string; z?: number | string };
984
- feSpecularLighting: AttributesMap['svg'] & {
985
- specularConstant?: number | string;
986
- specularExponent?: number | string;
987
- surfaceScale?: number | string;
988
- };
989
- feSpotLight: AttributesMap['svg'] & {
990
- x?: number | string;
991
- y?: number | string;
992
- z?: number | string;
993
- pointsAtX?: number | string;
994
- pointsAtY?: number | string;
995
- pointsAtZ?: number | string;
996
- specularExponent?: number | string;
997
- limitingConeAngle?: number | string;
998
- };
999
- feTile: AttributesMap['svg'] & {};
1000
- feTurbulence: AttributesMap['svg'] & {
1001
- baseFrequency?: number | string;
1002
- numOctaves?: number | string;
1003
- seed?: number | string;
1004
- stitchTiles?: string;
1005
- type?: 'fractalNoise' | 'turbulence';
1006
- };
1007
-
1008
- filter: AttributesMap['svg'] & {
1009
- x?: number | string;
1010
- y?: number | string;
1011
- width?: number | string;
1012
- height?: number | string;
1013
- filterUnits?: string;
1014
- primitiveUnits?: string;
1015
- };
1016
- foreignObject: AttributesMap['svg'] & {
1017
- x?: number | string;
1018
- y?: number | string;
1019
- width?: number | string;
1020
- height?: number | string;
1021
- };
1022
- g: AttributesMap['svg'];
1023
- image: AttributesMap['svg'] & {
1024
- href?: string;
1025
- x?: number | string;
1026
- y?: number | string;
1027
- width?: number | string;
1028
- height?: number | string;
1029
- };
1030
- line: AttributesMap['svg'] & {
1031
- x1?: number | string;
1032
- y1?: number | string;
1033
- x2?: number | string;
1034
- y2?: number | string;
1035
- };
1036
- linearGradient: AttributesMap['svg'] & {
1037
- x1?: number | string;
1038
- y1?: number | string;
1039
- x2?: number | string;
1040
- y2?: number | string;
1041
- gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
1042
- gradientTransform?: string;
1043
- };
1044
- marker: AttributesMap['svg'] & {
1045
- markerUnits?: string;
1046
- markerWidth?: number | string;
1047
- markerHeight?: number | string;
1048
- refX?: number | string;
1049
- refY?: number | string;
1050
- orient?: string;
1051
- };
1052
- mask: AttributesMap['svg'] & {
1053
- maskUnits?: string;
1054
- maskContentUnits?: string;
1055
- x?: number | string;
1056
- y?: number | string;
1057
- width?: number | string;
1058
- height?: number | string;
1059
- };
1060
- metadata: AttributesMap['svg'];
1061
- mpath: AttributesMap['svg'] & { href?: string };
1062
- path: AttributesMap['svg'] & { d?: string; pathLength?: number | string };
1063
- pattern: AttributesMap['svg'] & {
1064
- patternUnits?: string;
1065
- patternContentUnits?: string;
1066
- width?: number | string;
1067
- height?: number | string;
1068
- x?: number | string;
1069
- y?: number | string;
1070
- };
1071
- polygon: AttributesMap['svg'] & { points?: string };
1072
- polyline: AttributesMap['svg'] & { points?: string };
1073
- radialGradient: AttributesMap['svg'] & {
1074
- cx?: number | string;
1075
- cy?: number | string;
1076
- r?: number | string;
1077
- fx?: number | string;
1078
- fy?: number | string;
1079
- gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
1080
- gradientTransform?: string;
1081
- };
1082
- rect: AttributesMap['svg'] & {
1083
- x?: number | string;
1084
- y?: number | string;
1085
- width?: number | string;
1086
- height?: number | string;
1087
- rx?: number | string;
1088
- ry?: number | string;
1089
- };
1090
- script: AttributesMap['svg'] & { href?: string; type?: string };
1091
- set: AttributesMap['svg'] & { attributeName?: string; to?: string | number; begin?: string; dur?: string };
1092
- stop: AttributesMap['svg'] & { offset?: number | string; stopColor?: string; stopOpacity?: number | string };
1093
- style: AttributesMap['svg'] & { media?: string };
1094
- svg: AttributesMap['svg'];
1095
- switch: AttributesMap['svg'];
1096
- symbol: AttributesMap['svg'] & { viewBox?: string; preserveAspectRatio?: string };
1097
- text: AttributesMap['svg'] & {
1098
- x?: number | string;
1099
- y?: number | string;
1100
- dx?: number | string;
1101
- dy?: number | string;
1102
- textLength?: number | string;
1103
- };
1104
- textPath: AttributesMap['svg'] & { href?: string; startOffset?: number | string };
1105
- title: AttributesMap['svg'];
1106
- tspan: AttributesMap['svg'] & {
1107
- x?: number | string;
1108
- y?: number | string;
1109
- dx?: number | string;
1110
- dy?: number | string;
1111
- };
1112
- use: AttributesMap['svg'] & {
1113
- href?: string;
1114
- x?: number | string;
1115
- y?: number | string;
1116
- width?: number | string;
1117
- height?: number | string;
1118
- };
1119
- view: AttributesMap['svg'] & { viewBox?: string; preserveAspectRatio?: string };
1120
- }
1121
-
1122
- declare global {
1123
- namespace JSX {
1124
- type Element = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
1125
-
1126
- interface IntrinsicElements {
1127
- [k: string]: AttributesMap['div']; // Allow any element with div attributes as fallback
1128
-
1129
- // Document-level & metadata
1130
- html: AttributesMap['html'];
1131
- head: AttributesMap['head'];
1132
- title: AttributesMap['title'];
1133
- base: AttributesMap['base'];
1134
- link: AttributesMap['link'];
1135
- meta: AttributesMap['meta'];
1136
-
1137
- // Sectioning
1138
- body: AttributesMap['body'];
1139
- header: AttributesMap['header'];
1140
- footer: AttributesMap['footer'];
1141
- nav: AttributesMap['nav'];
1142
- main: AttributesMap['main'];
1143
- section: AttributesMap['section'];
1144
- article: AttributesMap['article'];
1145
- aside: AttributesMap['aside'];
1146
-
1147
- // Headings
1148
- h1: AttributesMap['h1'];
1149
- h2: AttributesMap['h2'];
1150
- h3: AttributesMap['h3'];
1151
- h4: AttributesMap['h4'];
1152
- h5: AttributesMap['h5'];
1153
- h6: AttributesMap['h6'];
1154
-
1155
- // Text content
1156
- p: AttributesMap['p'];
1157
- pre: AttributesMap['pre'];
1158
- code: AttributesMap['code'];
1159
- strong: AttributesMap['strong'];
1160
- small: AttributesMap['small'];
1161
- em: AttributesMap['em'];
1162
- br: AttributesMap['br'];
1163
- i: AttributesMap['i'];
1164
-
1165
- // Lists
1166
- ul: AttributesMap['ul'];
1167
- ol: AttributesMap['ol'];
1168
- li: AttributesMap['li'];
1169
-
1170
- // Tables
1171
- table: AttributesMap['table'];
1172
- thead: AttributesMap['thead'];
1173
- tbody: AttributesMap['tbody'];
1174
- tfoot: AttributesMap['tfoot'];
1175
- tr: AttributesMap['tr'];
1176
- th: AttributesMap['th'];
1177
- td: AttributesMap['td'];
1178
-
1179
- // Forms
1180
- form: AttributesMap['form'];
1181
- label: AttributesMap['label'];
1182
- input: AttributesMap['input'];
1183
- textarea: AttributesMap['textarea'];
1184
- select: AttributesMap['select'];
1185
- option: AttributesMap['option'];
1186
- optgroup: AttributesMap['optgroup'];
1187
- button: AttributesMap['button'];
1188
- fieldset: AttributesMap['fieldset'];
1189
- legend: AttributesMap['legend'];
1190
- datalist: AttributesMap['datalist'];
1191
- output: AttributesMap['output'];
1192
-
1193
- // Media & embedded
1194
- img: AttributesMap['img'];
1195
- picture: AttributesMap['picture'];
1196
- source: AttributesMap['source'];
1197
- audio: AttributesMap['audio'];
1198
- video: AttributesMap['video'];
1199
- track: AttributesMap['track'];
1200
- iframe: AttributesMap['iframe'];
1201
- embed: AttributesMap['embed'];
1202
- object: AttributesMap['object'];
1203
- canvas: AttributesMap['canvas'];
1204
-
1205
- // Interactive & misc
1206
- a: AttributesMap['a'] & SVGAttributesMap['a'];
1207
- area: AttributesMap['area'];
1208
- map: AttributesMap['map'];
1209
- details: AttributesMap['details'];
1210
- dialog: AttributesMap['dialog'];
1211
- summary: AttributesMap['summary'];
1212
- slot: AttributesMap['slot'];
1213
-
1214
- // Scripting & styles
1215
- script: AttributesMap['script'];
1216
- style: AttributesMap['style'];
1217
-
1218
- // Semantic & phrasing
1219
- figure: AttributesMap['figure'];
1220
- figcaption: AttributesMap['figcaption'];
1221
- blockquote: AttributesMap['blockquote'];
1222
- q: AttributesMap['q'];
1223
-
1224
- // Generic elements
1225
- div: AttributesMap['div'];
1226
- span: AttributesMap['span'];
1227
- address: AttributesMap['address'];
1228
- abbr: AttributesMap['abbr'];
1229
- b: AttributesMap['b'];
1230
- cite: AttributesMap['cite'];
1231
- dl: AttributesMap['dl'];
1232
- dt: AttributesMap['dt'];
1233
- dd: AttributesMap['dd'];
1234
- hr: AttributesMap['hr'];
1235
-
1236
- // SVG
1237
- svg: AttributesMap['svg'];
1238
- // a: SVGAttributesMap['a'];
1239
- animate: SVGAttributesMap['animate'];
1240
- animateMotion: SVGAttributesMap['animateMotion'];
1241
- animateTransform: SVGAttributesMap['animateTransform'];
1242
- circle: SVGAttributesMap['circle'];
1243
- clipPath: SVGAttributesMap['clipPath'];
1244
- defs: SVGAttributesMap['defs'];
1245
- desc: SVGAttributesMap['desc'];
1246
- ellipse: SVGAttributesMap['ellipse'];
1247
- feBlend: SVGAttributesMap['feBlend'];
1248
- feColorMatrix: SVGAttributesMap['feColorMatrix'];
1249
- feComponentTransfer: SVGAttributesMap['feComponentTransfer'];
1250
- feComposite: SVGAttributesMap['feComposite'];
1251
- feConvolveMatrix: SVGAttributesMap['feConvolveMatrix'];
1252
- feDiffuseLighting: SVGAttributesMap['feDiffuseLighting'];
1253
- feDisplacementMap: SVGAttributesMap['feDisplacementMap'];
1254
- feDistantLight: SVGAttributesMap['feDistantLight'];
1255
- feDropShadow: SVGAttributesMap['feDropShadow'];
1256
- feFlood: SVGAttributesMap['feFlood'];
1257
- feFuncA: SVGAttributesMap['feFuncA'];
1258
- feFuncB: SVGAttributesMap['feFuncB'];
1259
- feFuncG: SVGAttributesMap['feFuncG'];
1260
- feFuncR: SVGAttributesMap['feFuncR'];
1261
- feGaussianBlur: SVGAttributesMap['feGaussianBlur'];
1262
- feImage: SVGAttributesMap['feImage'];
1263
- feMerge: SVGAttributesMap['feMerge'];
1264
- feMergeNode: SVGAttributesMap['feMergeNode'];
1265
- feMorphology: SVGAttributesMap['feMorphology'];
1266
- feOffset: SVGAttributesMap['feOffset'];
1267
- fePointLight: SVGAttributesMap['fePointLight'];
1268
- feSpecularLighting: SVGAttributesMap['feSpecularLighting'];
1269
- feSpotLight: SVGAttributesMap['feSpotLight'];
1270
- feTile: SVGAttributesMap['feTile'];
1271
- feTurbulence: SVGAttributesMap['feTurbulence'];
1272
- filter: SVGAttributesMap['filter'];
1273
- foreignObject: SVGAttributesMap['foreignObject'];
1274
- g: SVGAttributesMap['g'];
1275
- image: SVGAttributesMap['image'];
1276
- line: SVGAttributesMap['line'];
1277
- linearGradient: SVGAttributesMap['linearGradient'];
1278
- marker: SVGAttributesMap['marker'];
1279
- mask: SVGAttributesMap['mask'];
1280
- metadata: SVGAttributesMap['metadata'];
1281
- mpath: SVGAttributesMap['mpath'];
1282
- path: SVGAttributesMap['path'];
1283
- pattern: SVGAttributesMap['pattern'];
1284
- polygon: SVGAttributesMap['polygon'];
1285
- polyline: SVGAttributesMap['polyline'];
1286
- radialGradient: SVGAttributesMap['radialGradient'];
1287
- rect: SVGAttributesMap['rect'];
1288
- set: SVGAttributesMap['set'];
1289
- stop: SVGAttributesMap['stop'];
1290
- switch: SVGAttributesMap['switch'];
1291
- symbol: SVGAttributesMap['symbol'];
1292
- text: SVGAttributesMap['text'];
1293
- textPath: SVGAttributesMap['textPath'];
1294
- tspan: SVGAttributesMap['tspan'];
1295
- use: SVGAttributesMap['use'];
1296
- view: SVGAttributesMap['view'];
1297
- }
1298
-
1299
- interface IntrinsicAttributes {
1300
- /**
1301
- * Make a reference to the created element
1302
- */
1303
- ref?: KTRef<any>;
1304
-
1305
- /**
1306
- * Conditional rendering
1307
- * - Provide a `KTRef` to make it reactive
1308
- */
1309
- 'k-if'?: any;
1310
-
1311
- /**
1312
- * 2-way binding
1313
- * - Provide a `KTRef` to make it reactive
1314
- */
1315
- 'k-model'?: KTRef<any>;
1316
-
1317
- /**
1318
- * Raw html binding
1319
- * - Provide a `KTRef` to make it reactive
1320
- */
1321
- 'k-html'?: any;
1322
- children?: KTRawContent;
1323
- }
1324
-
1325
- interface ElementChildrenAttribute {
1326
- children: {};
1327
- }
1328
- }
1329
- }
1330
-
1331
- export { Fragment, h as createElement, createRedrawable, jsx, jsxDEV, jsxs };