@ktjs/core 0.23.0 → 0.24.1
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 +221 -298
- package/dist/index.iife.js +271 -147
- package/dist/index.legacy.js +267 -145
- package/dist/index.mjs +266 -147
- package/dist/jsx/index.d.ts +174 -322
- package/dist/jsx/index.mjs +121 -147
- package/dist/jsx/jsx-runtime.d.ts +14 -8
- package/dist/jsx/jsx-runtime.mjs +120 -100
- package/package.json +2 -2
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
|
-
|
|
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:
|
|
18
|
-
|
|
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:
|
|
29
|
-
removeOnChange(callback:
|
|
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
|
|
40
|
-
|
|
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
|
|
206
|
+
type KTPrefixedEventAttribute = {
|
|
158
207
|
[EventName in keyof HTMLElementEventMap as `on:${EventName}`]?: (ev: HTMLElementEventMap[EventName]) => void;
|
|
159
208
|
};
|
|
160
209
|
|
|
161
|
-
type KTAttribute = KTBaseAttribute &
|
|
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.
|
|
230
|
+
* @version 0.24.1 (Last Update: 2026.02.05 12:51:38.436)
|
|
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
|
-
|
|
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
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
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
|
-
|
|
492
|
-
|
|
493
|
-
};
|
|
403
|
+
details: BaseAttr & {
|
|
404
|
+
open?: boolean;
|
|
405
|
+
};
|
|
494
406
|
|
|
495
407
|
// Dialog element
|
|
496
|
-
dialog: BaseAttr &
|
|
497
|
-
|
|
498
|
-
|
|
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
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
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
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
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
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
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
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
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
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
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
|
-
|
|
828
|
-
|
|
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
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
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
|
-
|
|
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,
|
|
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 };
|