leaner 0.2.0 → 0.4.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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/core.js +23 -2
- package/dist/web.js +105 -6
- package/package.json +10 -4
- package/types/core.d.ts +4 -2
- package/types/jsx-runtime.d.ts +132 -0
- package/types/web.d.ts +640 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
package/dist/core.js
CHANGED
|
@@ -92,6 +92,9 @@ function withScope( scope, callback ) {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
function createWatcher( deps, callback, async ) {
|
|
95
|
+
if ( async )
|
|
96
|
+
callback = createSafeCallback( callback );
|
|
97
|
+
|
|
95
98
|
const watcher = {
|
|
96
99
|
deps,
|
|
97
100
|
callback,
|
|
@@ -99,7 +102,7 @@ function createWatcher( deps, callback, async ) {
|
|
|
99
102
|
};
|
|
100
103
|
|
|
101
104
|
if ( current != null )
|
|
102
|
-
current.push( watcher );
|
|
105
|
+
current.watchers.push( watcher );
|
|
103
106
|
|
|
104
107
|
if ( deps != null ) {
|
|
105
108
|
for ( const dep of deps ) {
|
|
@@ -110,6 +113,24 @@ function createWatcher( deps, callback, async ) {
|
|
|
110
113
|
return watcher;
|
|
111
114
|
}
|
|
112
115
|
|
|
116
|
+
function createSafeCallback( callback ) {
|
|
117
|
+
if ( current != null && current.errorHandler != null ) {
|
|
118
|
+
const handler = current.errorHandler;
|
|
119
|
+
|
|
120
|
+
return safeCallback;
|
|
121
|
+
|
|
122
|
+
function safeCallback() {
|
|
123
|
+
try {
|
|
124
|
+
callback();
|
|
125
|
+
} catch ( err ) {
|
|
126
|
+
handler( err );
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return callback;
|
|
132
|
+
}
|
|
133
|
+
|
|
113
134
|
function updateWatcher( watcher, deps ) {
|
|
114
135
|
for ( const dep of deps ) {
|
|
115
136
|
dep.add( watcher );
|
|
@@ -126,7 +147,7 @@ function updateWatcher( watcher, deps ) {
|
|
|
126
147
|
}
|
|
127
148
|
|
|
128
149
|
function destroyScope( scope ) {
|
|
129
|
-
for ( const watcher of scope ) {
|
|
150
|
+
for ( const watcher of scope.watchers ) {
|
|
130
151
|
watcher.callback = null;
|
|
131
152
|
|
|
132
153
|
if ( watcher.deps != null ) {
|
package/dist/web.js
CHANGED
|
@@ -37,15 +37,21 @@ function createComponent( template ) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function createContext( parent ) {
|
|
40
|
-
|
|
40
|
+
const context = {
|
|
41
41
|
parent,
|
|
42
42
|
children: null,
|
|
43
|
-
scope:
|
|
43
|
+
scope: {
|
|
44
|
+
watchers: [],
|
|
45
|
+
errorHandler: err => handleError( context, err ),
|
|
46
|
+
},
|
|
44
47
|
mount: null,
|
|
45
48
|
destroy: null,
|
|
46
49
|
refs: null,
|
|
47
50
|
services: null,
|
|
51
|
+
errorHandler: null,
|
|
48
52
|
};
|
|
53
|
+
|
|
54
|
+
return context;
|
|
49
55
|
}
|
|
50
56
|
|
|
51
57
|
function createChildContext() {
|
|
@@ -141,9 +147,9 @@ function destroyContext( context ) {
|
|
|
141
147
|
|
|
142
148
|
context.mount = null;
|
|
143
149
|
|
|
144
|
-
if ( context.scope.length > 0 ) {
|
|
150
|
+
if ( context.scope.watchers.length > 0 ) {
|
|
145
151
|
destroyScope( context.scope );
|
|
146
|
-
context.scope = [];
|
|
152
|
+
context.scope.watchers = [];
|
|
147
153
|
}
|
|
148
154
|
|
|
149
155
|
if ( context.children != null ) {
|
|
@@ -155,6 +161,25 @@ function destroyContext( context ) {
|
|
|
155
161
|
context.services = null;
|
|
156
162
|
}
|
|
157
163
|
|
|
164
|
+
function cleanUpContext( context ) {
|
|
165
|
+
context.destroy = null;
|
|
166
|
+
context.refs = null;
|
|
167
|
+
context.mount = null;
|
|
168
|
+
|
|
169
|
+
if ( context.scope.watchers.length > 0 ) {
|
|
170
|
+
destroyScope( context.scope );
|
|
171
|
+
context.scope.watchers = [];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if ( context.children != null ) {
|
|
175
|
+
for ( const child of context.children )
|
|
176
|
+
cleanUpContext( child );
|
|
177
|
+
context.children = null;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
context.services = null;
|
|
181
|
+
}
|
|
182
|
+
|
|
158
183
|
function provide( key, value ) {
|
|
159
184
|
if ( current == null )
|
|
160
185
|
throw new Error( 'provide() cannot be called outside of a component' );
|
|
@@ -175,6 +200,35 @@ function inject( key ) {
|
|
|
175
200
|
}
|
|
176
201
|
}
|
|
177
202
|
|
|
203
|
+
function handleError( context, err ) {
|
|
204
|
+
while ( context != null) {
|
|
205
|
+
if ( context.errorHandler != null ) {
|
|
206
|
+
context.errorHandler( err );
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
context = context.parent;
|
|
210
|
+
}
|
|
211
|
+
throw err;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function createSafeHandler( callback ) {
|
|
215
|
+
if ( current != null ) {
|
|
216
|
+
const context = current;
|
|
217
|
+
|
|
218
|
+
return safeHandler;
|
|
219
|
+
|
|
220
|
+
function safeHandler( e ) {
|
|
221
|
+
try {
|
|
222
|
+
callback( e );
|
|
223
|
+
} catch ( err ) {
|
|
224
|
+
handleError( context, err );
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return callback;
|
|
230
|
+
}
|
|
231
|
+
|
|
178
232
|
function setClasses( element, classes ) {
|
|
179
233
|
if ( typeof classes == 'function' ) {
|
|
180
234
|
reactive( classes, value => {
|
|
@@ -643,7 +697,7 @@ function createForDirective( template ) {
|
|
|
643
697
|
|
|
644
698
|
if ( containsMatchedByValue && !watchingContent ) {
|
|
645
699
|
destroyScope( context.scope );
|
|
646
|
-
context.scope = [];
|
|
700
|
+
context.scope.watchers = [];
|
|
647
701
|
withScope( context.scope, () => {
|
|
648
702
|
// clone the array to watch all elements
|
|
649
703
|
reactive( () => [ ...itemsGetter() ], updateContent );
|
|
@@ -844,13 +898,58 @@ function createSwitchDirective( template ) {
|
|
|
844
898
|
}
|
|
845
899
|
}
|
|
846
900
|
|
|
901
|
+
function createTryDirective( template ) {
|
|
902
|
+
const catchTemplate = template[ template.length - 1 ];
|
|
903
|
+
|
|
904
|
+
if ( !Array.isArray( catchTemplate ) || catchTemplate.length != 2 || catchTemplate[ 0 ] != 'catch' || typeof catchTemplate[ 1 ] != 'function' )
|
|
905
|
+
throw new TypeError( 'Invalid try template' );
|
|
906
|
+
|
|
907
|
+
const result = new DynamicNode( null );
|
|
908
|
+
|
|
909
|
+
const context = createChildContext();
|
|
910
|
+
|
|
911
|
+
let childTemplate = null;
|
|
912
|
+
if ( template.length == 3 )
|
|
913
|
+
childTemplate = template[ 1 ];
|
|
914
|
+
else
|
|
915
|
+
childTemplate = [ template.slice( 1, template.length - 1 ) ];
|
|
916
|
+
|
|
917
|
+
try {
|
|
918
|
+
updateDynamicNode( result, context, childTemplate );
|
|
919
|
+
} catch ( err ) {
|
|
920
|
+
updateErrorState( err );
|
|
921
|
+
return result;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
context.errorHandler = asyncErrorHandler;
|
|
925
|
+
|
|
926
|
+
return result;
|
|
927
|
+
|
|
928
|
+
function asyncErrorHandler( err ) {
|
|
929
|
+
try {
|
|
930
|
+
updateErrorState( err );
|
|
931
|
+
} catch ( err ) {
|
|
932
|
+
handleError( context, err );
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
function updateErrorState( err ) {
|
|
937
|
+
context.errorHandler = null;
|
|
938
|
+
if ( result.content == null )
|
|
939
|
+
cleanUpContext( context );
|
|
940
|
+
updateDynamicNode( result, context, catchTemplate[ 1 ]( err ) );
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
847
944
|
const Directives = {
|
|
945
|
+
catch: unexpectedDirective,
|
|
848
946
|
dynamic: createDynamicDirective,
|
|
849
947
|
else: unexpectedDirective,
|
|
850
948
|
for: createForDirective,
|
|
851
949
|
if: createIfDirective,
|
|
852
950
|
repeat: createRepeatDirective,
|
|
853
951
|
switch: createSwitchDirective,
|
|
952
|
+
try: createTryDirective,
|
|
854
953
|
};
|
|
855
954
|
|
|
856
955
|
const Properties = new Set( [ 'value', 'checked', 'textContent', 'innerHTML' ] );
|
|
@@ -943,7 +1042,7 @@ function setElementProperties( element, properties ) {
|
|
|
943
1042
|
|
|
944
1043
|
function setElementProperty( element, key, value ) {
|
|
945
1044
|
if ( key.startsWith( 'on' ) ) {
|
|
946
|
-
element.addEventListener( key.substring( 2 ), value );
|
|
1045
|
+
element.addEventListener( key.substring( 2 ), createSafeHandler( value ) );
|
|
947
1046
|
} else if ( Properties.has( key ) ) {
|
|
948
1047
|
if ( typeof value == 'function' )
|
|
949
1048
|
reactive( value, value => element[ key ] = value != null ? value : '' );
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "leaner",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Thin, reactive wrapper for DOM",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"import": "./dist/core.js",
|
|
22
22
|
"types": "./types/core.d.ts"
|
|
23
23
|
},
|
|
24
|
+
"./jsx-runtime": {
|
|
25
|
+
"types": "./types/jsx-runtime.d.ts"
|
|
26
|
+
},
|
|
24
27
|
"./web": {
|
|
25
28
|
"import": "./dist/web.js",
|
|
26
29
|
"types": "./types/web.d.ts"
|
|
@@ -48,9 +51,12 @@
|
|
|
48
51
|
"url": "https://github.com/leaner-js/leaner/issues"
|
|
49
52
|
},
|
|
50
53
|
"homepage": "https://leanerjs.org/",
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"csstype": "^3.2.3"
|
|
56
|
+
},
|
|
51
57
|
"devDependencies": {
|
|
52
|
-
"jsdom": "^
|
|
53
|
-
"rollup": "^4.
|
|
54
|
-
"vitest": "^1.
|
|
58
|
+
"jsdom": "^29.1.1",
|
|
59
|
+
"rollup": "^4.63.0",
|
|
60
|
+
"vitest": "^4.1.11"
|
|
55
61
|
}
|
|
56
62
|
}
|
package/types/core.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
type
|
|
1
|
+
type BuiltInObject = Function | Date | Error | RegExp | Promise<any> | Map<any, any> | Set<any> | WeakMap<any, any> | WeakSet<any> | Node;
|
|
2
|
+
|
|
3
|
+
type DeepReadonly<T> = T extends BuiltInObject ? T : T extends object ? {
|
|
2
4
|
readonly [ K in keyof T ]: DeepReadonly<T[ K ]>;
|
|
3
5
|
} : T;
|
|
4
6
|
|
|
@@ -20,7 +22,7 @@ declare class Mutator<T> {
|
|
|
20
22
|
private callback: ( value: T ) => void;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
export type Getter<T> = ( () => DeepReadonly<T> ) & ( T extends Array<infer U> ? ArrayGetter<U> : T extends object ? ObjectGetter<T> : {} );
|
|
25
|
+
export type Getter<T> = ( () => DeepReadonly<T> ) & ( T extends BuiltInObject ? {} : T extends Array<infer U> ? ArrayGetter<U> : T extends object ? ObjectGetter<T> : {} );
|
|
24
26
|
|
|
25
27
|
export type Setter<T> = ( value: ( T extends Function ? never : T ) | ( ( value: DeepReadonly<T> ) => T ) | Mutator<T> ) => void;
|
|
26
28
|
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Component, Leaner, LeanerNode, LeanerElement } from './web';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
namespace JSX {
|
|
5
|
+
type ElementType = string | ( ( props: any, children: LeanerNode[] ) => LeanerNode );
|
|
6
|
+
|
|
7
|
+
type Element = LeanerElement;
|
|
8
|
+
|
|
9
|
+
interface IntrinsicElements {
|
|
10
|
+
a: Leaner.HTMLAnchorProps;
|
|
11
|
+
abbr: Leaner.HTMLProps;
|
|
12
|
+
address: Leaner.HTMLProps;
|
|
13
|
+
area: Leaner.HTMLAreaProps;
|
|
14
|
+
article: Leaner.HTMLProps;
|
|
15
|
+
aside: Leaner.HTMLProps;
|
|
16
|
+
audio: Leaner.HTMLAudioProps;
|
|
17
|
+
b: Leaner.HTMLProps;
|
|
18
|
+
base: Leaner.HTMLBaseProps;
|
|
19
|
+
bdi: Leaner.HTMLProps;
|
|
20
|
+
bdo: Leaner.HTMLProps;
|
|
21
|
+
blockquote: Leaner.HTMLQuoteProps;
|
|
22
|
+
body: Leaner.HTMLProps<HTMLBodyElement>;
|
|
23
|
+
br: Leaner.HTMLProps<HTMLBRElement>;
|
|
24
|
+
button: Leaner.HTMLButtonProps;
|
|
25
|
+
canvas: Leaner.HTMLCanvasProps;
|
|
26
|
+
caption: Leaner.HTMLProps<HTMLTableCaptionElement>;
|
|
27
|
+
cite: Leaner.HTMLProps;
|
|
28
|
+
code: Leaner.HTMLProps;
|
|
29
|
+
col: Leaner.HTMLTableColProps;
|
|
30
|
+
colgroup: Leaner.HTMLTableColProps;
|
|
31
|
+
data: Leaner.HTMLDataProps;
|
|
32
|
+
datalist: Leaner.HTMLProps<HTMLDataListElement>;
|
|
33
|
+
dd: Leaner.HTMLProps;
|
|
34
|
+
del: Leaner.HTMLModProps;
|
|
35
|
+
details: Leaner.HTMLDetailsProps;
|
|
36
|
+
dfn: Leaner.HTMLProps;
|
|
37
|
+
dialog: Leaner.HTMLDialogProps;
|
|
38
|
+
div: Leaner.HTMLProps<HTMLDivElement>;
|
|
39
|
+
dl: Leaner.HTMLProps<HTMLDListElement>;
|
|
40
|
+
dt: Leaner.HTMLProps;
|
|
41
|
+
em: Leaner.HTMLProps;
|
|
42
|
+
embed: Leaner.HTMLEmbedProps;
|
|
43
|
+
fieldset: Leaner.HTMLFieldSetProps;
|
|
44
|
+
figcaption: Leaner.HTMLProps;
|
|
45
|
+
figure: Leaner.HTMLProps;
|
|
46
|
+
footer: Leaner.HTMLProps;
|
|
47
|
+
form: Leaner.HTMLFormProps;
|
|
48
|
+
h1: Leaner.HTMLProps<HTMLHeadingElement>;
|
|
49
|
+
h2: Leaner.HTMLProps<HTMLHeadingElement>;
|
|
50
|
+
h3: Leaner.HTMLProps<HTMLHeadingElement>;
|
|
51
|
+
h4: Leaner.HTMLProps<HTMLHeadingElement>;
|
|
52
|
+
h5: Leaner.HTMLProps<HTMLHeadingElement>;
|
|
53
|
+
h6: Leaner.HTMLProps<HTMLHeadingElement>;
|
|
54
|
+
head: Leaner.HTMLProps<HTMLHeadElement>;
|
|
55
|
+
header: Leaner.HTMLProps;
|
|
56
|
+
hgroup: Leaner.HTMLProps;
|
|
57
|
+
hr: Leaner.HTMLProps<HTMLHRElement>;
|
|
58
|
+
html: Leaner.HTMLProps<HTMLHtmlElement>;
|
|
59
|
+
i: Leaner.HTMLProps;
|
|
60
|
+
iframe: Leaner.HTMLIFrameProps;
|
|
61
|
+
img: Leaner.HTMLImageProps;
|
|
62
|
+
input: Leaner.HTMLInputProps;
|
|
63
|
+
ins: Leaner.HTMLModProps;
|
|
64
|
+
kbd: Leaner.HTMLProps;
|
|
65
|
+
label: Leaner.HTMLLabelProps;
|
|
66
|
+
legend: Leaner.HTMLProps<HTMLLegendElement>;
|
|
67
|
+
li: Leaner.HTMLLIProps;
|
|
68
|
+
link: Leaner.HTMLLinkProps;
|
|
69
|
+
main: Leaner.HTMLProps;
|
|
70
|
+
map: Leaner.HTMLMapProps;
|
|
71
|
+
mark: Leaner.HTMLProps;
|
|
72
|
+
menu: Leaner.HTMLProps<HTMLMenuElement>;
|
|
73
|
+
meta: Leaner.HTMLMetaProps;
|
|
74
|
+
meter: Leaner.HTMLMeterProps;
|
|
75
|
+
nav: Leaner.HTMLProps;
|
|
76
|
+
noscript: Leaner.HTMLProps;
|
|
77
|
+
object: Leaner.HTMLObjectProps;
|
|
78
|
+
ol: Leaner.HTMLLOListProps;
|
|
79
|
+
optgroup: Leaner.HTMLOptGroupProps;
|
|
80
|
+
option: Leaner.HTMLOptionProps;
|
|
81
|
+
output: Leaner.HTMLOutputProps;
|
|
82
|
+
p: Leaner.HTMLProps<HTMLParagraphElement>;
|
|
83
|
+
picture: Leaner.HTMLProps<HTMLPictureElement>;
|
|
84
|
+
pre: Leaner.HTMLProps<HTMLPreElement>;
|
|
85
|
+
progress: Leaner.HTMLProgressProps;
|
|
86
|
+
q: Leaner.HTMLQuoteProps;
|
|
87
|
+
rp: Leaner.HTMLProps;
|
|
88
|
+
rt: Leaner.HTMLProps;
|
|
89
|
+
s: Leaner.HTMLProps;
|
|
90
|
+
samp: Leaner.HTMLProps;
|
|
91
|
+
script: Leaner.HTMLScriptProps;
|
|
92
|
+
search: Leaner.HTMLProps;
|
|
93
|
+
section: Leaner.HTMLProps;
|
|
94
|
+
select: Leaner.HTMLSelectProps;
|
|
95
|
+
slot: Leaner.HTMLSlotProps;
|
|
96
|
+
small: Leaner.HTMLProps;
|
|
97
|
+
source: Leaner.HTMLSourceProps;
|
|
98
|
+
span: Leaner.HTMLProps<HTMLSpanElement>;
|
|
99
|
+
strong: Leaner.HTMLProps;
|
|
100
|
+
style: Leaner.HTMLStyleProps;
|
|
101
|
+
sub: Leaner.HTMLProps;
|
|
102
|
+
summary: Leaner.HTMLProps;
|
|
103
|
+
sup: Leaner.HTMLProps;
|
|
104
|
+
table: Leaner.HTMLProps<HTMLTableElement>;
|
|
105
|
+
tbody: Leaner.HTMLProps<HTMLTableSectionElement>;
|
|
106
|
+
td: Leaner.HTMLTableCellProps;
|
|
107
|
+
template: Leaner.HTMLProps<HTMLTemplateElement>;
|
|
108
|
+
textarea: Leaner.HTMLTextAreaProps;
|
|
109
|
+
tfoot: Leaner.HTMLProps<HTMLTableSectionElement>;
|
|
110
|
+
th: Leaner.HTMLTableCellHeaderProps;
|
|
111
|
+
thead: Leaner.HTMLProps<HTMLTableSectionElement>;
|
|
112
|
+
time: Leaner.HTMLTimeProps;
|
|
113
|
+
title: Leaner.HTMLProps<HTMLTimeElement>;
|
|
114
|
+
tr: Leaner.HTMLProps<HTMLTableRowElement>;
|
|
115
|
+
track: Leaner.HTMLTrackProps;
|
|
116
|
+
u: Leaner.HTMLProps;
|
|
117
|
+
ul: Leaner.HTMLProps<HTMLUListElement>;
|
|
118
|
+
var: Leaner.HTMLProps;
|
|
119
|
+
video: Leaner.HTMLVideoProps;
|
|
120
|
+
wbr: Leaner.HTMLProps;
|
|
121
|
+
|
|
122
|
+
catch: {};
|
|
123
|
+
dynamic: { is: () => string | Component, [ K: string ]: any };
|
|
124
|
+
else: {};
|
|
125
|
+
for: { items: () => readonly any[] };
|
|
126
|
+
if: { match: () => boolean };
|
|
127
|
+
repeat: { count: number | ( () => number ) };
|
|
128
|
+
switch: {};
|
|
129
|
+
try: {};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
package/types/web.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import * as CSS from 'csstype';
|
|
2
|
+
|
|
3
|
+
export type LeanerElement = any[];
|
|
4
|
+
|
|
5
|
+
export type LeanerNode = LeanerElement | Node | null | string | number | ( () => null | string | number );
|
|
6
|
+
|
|
7
|
+
export type Component = ( props: any, children: any[] ) => LeanerNode;
|
|
8
|
+
|
|
1
9
|
export interface App {
|
|
2
10
|
mount( target: HTMLElement ): void;
|
|
3
11
|
destroy(): void;
|
|
@@ -5,12 +13,641 @@ export interface App {
|
|
|
5
13
|
use( callback: () => void ): void;
|
|
6
14
|
}
|
|
7
15
|
|
|
8
|
-
|
|
16
|
+
interface InjectionConstraint<T> {}
|
|
17
|
+
|
|
18
|
+
export type InjectionKey<T> = symbol & InjectionConstraint<T>;
|
|
9
19
|
|
|
10
|
-
export declare function
|
|
20
|
+
export declare function createApp( component: Component ): App;
|
|
11
21
|
|
|
12
|
-
export declare function
|
|
22
|
+
export declare function inject<T>( key: string | InjectionKey<T> ): T | undefined;
|
|
23
|
+
|
|
24
|
+
export declare function provide<T, K = string | InjectionKey<T>>( key: K, value: K extends InjectionKey<infer V> ? V : T ): void;
|
|
13
25
|
|
|
14
26
|
export declare function onMount( callback: () => void ): void;
|
|
15
27
|
|
|
16
28
|
export declare function onDestroy( callback: () => void ): void;
|
|
29
|
+
|
|
30
|
+
type Prop<T> = T | null | ( () => T | null );
|
|
31
|
+
|
|
32
|
+
type BooleanProp = Prop<boolean | ''>;
|
|
33
|
+
|
|
34
|
+
type ReferrerPolicyProp = Prop<'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin'
|
|
35
|
+
| 'strict-origin-when-cross-origin' | 'unsafe-url'>;
|
|
36
|
+
|
|
37
|
+
type ClassObject = { [ K: string ]: boolean | null | ( () => boolean | null ) };
|
|
38
|
+
|
|
39
|
+
type ClassProp = string | null | ( () => string | string[] | null ) | Array<string | null | ( () => string | null ) | ClassObject> | ClassObject;
|
|
40
|
+
|
|
41
|
+
type StyleObject = {
|
|
42
|
+
[ K in keyof CSS.Properties ]: CSS.Properties[ K ] | null | ( () => CSS.Properties[ K ] | null );
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type StyleProp = string | null | ( () => string | null | CSS.Properties ) | StyleObject;
|
|
46
|
+
|
|
47
|
+
type GlobalEvent = Event;
|
|
48
|
+
type GlobalAnimationEvent = AnimationEvent;
|
|
49
|
+
type GlobalClipboardEvent = ClipboardEvent;
|
|
50
|
+
type GlobalCompositionEvent = CompositionEvent;
|
|
51
|
+
type GlobalDragEvent = DragEvent;
|
|
52
|
+
type GlobalFocusEvent = FocusEvent;
|
|
53
|
+
type GlobalFormDataEvent = FormDataEvent;
|
|
54
|
+
type GlobalInputEvent = InputEvent;
|
|
55
|
+
type GlobalKeyboardEvent = KeyboardEvent;
|
|
56
|
+
type GlobalMouseEvent = MouseEvent;
|
|
57
|
+
type GlobalPointerEvent = PointerEvent;
|
|
58
|
+
type GlobalSubmitEvent = SubmitEvent;
|
|
59
|
+
type GlobalToggleEvent = ToggleEvent;
|
|
60
|
+
type GlobalTouchEvent = TouchEvent;
|
|
61
|
+
type GlobalTransitionEvent = TransitionEvent;
|
|
62
|
+
type GlobalUIEvent = UIEvent;
|
|
63
|
+
type GlobalWheelEvent = WheelEvent;
|
|
64
|
+
|
|
65
|
+
type BaseTypedEvent<E, C, T> = E & {
|
|
66
|
+
currentTarget: C;
|
|
67
|
+
target: T;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
type TypedEvent<E, T> = BaseTypedEvent<E, EventTarget & T, EventTarget>;
|
|
71
|
+
type TypedTargetEvent<E, T> = BaseTypedEvent<E, EventTarget & T, EventTarget & T>;
|
|
72
|
+
|
|
73
|
+
type EventHandler<E> = ( e: E ) => void;
|
|
74
|
+
|
|
75
|
+
export namespace Leaner {
|
|
76
|
+
type Event<T = Element> = TypedEvent<GlobalEvent, T>;
|
|
77
|
+
type AnimationEvent<T = Element> = TypedEvent<GlobalAnimationEvent, T>;
|
|
78
|
+
type ClipboardEvent<T = Element> = TypedEvent<GlobalClipboardEvent, T>;
|
|
79
|
+
type CompositionEvent<T = Element> = TypedEvent<GlobalCompositionEvent, T>;
|
|
80
|
+
type DragEvent<T = Element> = TypedEvent<GlobalDragEvent, T>;
|
|
81
|
+
type FocusEvent<T = Element> = TypedEvent<GlobalFocusEvent, T>;
|
|
82
|
+
type FormDataEvent<T = Element> = TypedEvent<GlobalFormDataEvent, T>;
|
|
83
|
+
type InputEvent<T = Element> = TypedEvent<GlobalInputEvent, T>;
|
|
84
|
+
type KeyboardEvent<T = Element> = TypedEvent<GlobalKeyboardEvent, T>;
|
|
85
|
+
type MouseEvent<T = Element> = TypedEvent<GlobalMouseEvent, T>;
|
|
86
|
+
type PointerEvent<T = Element> = TypedEvent<GlobalPointerEvent, T>;
|
|
87
|
+
type ToggleEvent<T = Element> = TypedEvent<GlobalToggleEvent, T>;
|
|
88
|
+
type TouchEvent<T = Element> = TypedEvent<GlobalTouchEvent, T>;
|
|
89
|
+
type TransitionEvent<T = Element> = TypedEvent<GlobalTransitionEvent, T>;
|
|
90
|
+
type UIEvent<T = Element> = TypedEvent<GlobalUIEvent, T>;
|
|
91
|
+
type WheelEvent<T = Element> = TypedEvent<GlobalWheelEvent, T>;
|
|
92
|
+
|
|
93
|
+
type TargetEvent<T = Element> = TypedTargetEvent<GlobalEvent, T>;
|
|
94
|
+
type FocusTargetEvent<T = Element> = TypedTargetEvent<GlobalFocusEvent, T>;
|
|
95
|
+
|
|
96
|
+
interface HTMLProps<T = HTMLElement> {
|
|
97
|
+
accesskey?: Prop<string>;
|
|
98
|
+
autocapitalize?: Prop<'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'>;
|
|
99
|
+
autofocus?: BooleanProp;
|
|
100
|
+
class?: ClassProp;
|
|
101
|
+
contenteditable?: Prop<'true' | 'false' | 'plaintext-only'>;
|
|
102
|
+
dir?: Prop<'ltr' | 'rtl' | 'auto'>;
|
|
103
|
+
draggable?: Prop<'true' | 'false'>;
|
|
104
|
+
enterkeyhint?: Prop<'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'>;
|
|
105
|
+
exportparts?: Prop<string>;
|
|
106
|
+
hidden?: BooleanProp;
|
|
107
|
+
id?: Prop<string>;
|
|
108
|
+
inert?: BooleanProp;
|
|
109
|
+
inputmode?: Prop<'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'>;
|
|
110
|
+
is?: Prop<string>;
|
|
111
|
+
itemid?: Prop<string>;
|
|
112
|
+
itemprop?: Prop<string>;
|
|
113
|
+
itemref?: Prop<string>;
|
|
114
|
+
itemscope?: BooleanProp;
|
|
115
|
+
itemtype?: Prop<string>;
|
|
116
|
+
lang?: Prop<string>;
|
|
117
|
+
nonce?: Prop<string>;
|
|
118
|
+
part?: Prop<string>;
|
|
119
|
+
role?: Prop<'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo'
|
|
120
|
+
| 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox'
|
|
121
|
+
| 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option'
|
|
122
|
+
| 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider'
|
|
123
|
+
| 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem'>;
|
|
124
|
+
slot?: Prop<string>;
|
|
125
|
+
spellcheck?: Prop<'true' | 'false'>;
|
|
126
|
+
style?: StyleProp;
|
|
127
|
+
tabindex?: Prop<number>;
|
|
128
|
+
title?: Prop<string>;
|
|
129
|
+
translate?: Prop<'yes' | 'no'>;
|
|
130
|
+
|
|
131
|
+
'aria-activedescendant'?: Prop<string>;
|
|
132
|
+
'aria-atomic'?: Prop<'true' | 'false'>;
|
|
133
|
+
'aria-autocomplete'?: Prop<'none' | 'inline' | 'list' | 'both'>;
|
|
134
|
+
'aria-braillelabel'?: Prop<string>;
|
|
135
|
+
'aria-brailleroledescription'?: Prop<string>;
|
|
136
|
+
'aria-busy'?: Prop<'true' | 'false'>;
|
|
137
|
+
'aria-checked'?: Prop<'true' | 'false' | 'mixed'>;
|
|
138
|
+
'aria-colcount'?: Prop<number>;
|
|
139
|
+
'aria-colindex'?: Prop<number>;
|
|
140
|
+
'aria-colindextext'?: Prop<string>;
|
|
141
|
+
'aria-colspan'?: Prop<number>;
|
|
142
|
+
'aria-controls'?: Prop<string>;
|
|
143
|
+
'aria-current'?: Prop<'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time'>;
|
|
144
|
+
'aria-describedby'?: Prop<string>;
|
|
145
|
+
'aria-description'?: Prop<string>;
|
|
146
|
+
'aria-details'?: Prop<string>;
|
|
147
|
+
'aria-disabled'?: Prop<'true' | 'false'>;
|
|
148
|
+
'aria-errormessage'?: Prop<string>;
|
|
149
|
+
'aria-expanded'?: Prop<'true' | 'false'>;
|
|
150
|
+
'aria-flowto'?: Prop<string>;
|
|
151
|
+
'aria-haspopup'?: Prop<'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'>;
|
|
152
|
+
'aria-hidden'?: Prop<'true' | 'false'>;
|
|
153
|
+
'aria-invalid'?: Prop<'true' | 'false' | 'grammar' | 'spelling'>;
|
|
154
|
+
'aria-keyshortcuts'?: Prop<string>;
|
|
155
|
+
'aria-label'?: Prop<string>;
|
|
156
|
+
'aria-labelledby'?: Prop<string>;
|
|
157
|
+
'aria-level'?: Prop<number>;
|
|
158
|
+
'aria-live'?: Prop<'off' | 'assertive' | 'polite'>;
|
|
159
|
+
'aria-modal'?: Prop<'true' | 'false'>;
|
|
160
|
+
'aria-multiline'?: Prop<'true' | 'false'>;
|
|
161
|
+
'aria-multiselectable'?: Prop<'true' | 'false'>;
|
|
162
|
+
'aria-orientation'?: Prop<'horizontal' | 'vertical'>;
|
|
163
|
+
'aria-owns'?: Prop<string>;
|
|
164
|
+
'aria-placeholder'?: Prop<string>;
|
|
165
|
+
'aria-posinset'?: Prop<number>;
|
|
166
|
+
'aria-pressed'?: Prop<'true' | 'false' | 'mixed'>;
|
|
167
|
+
'aria-readonly'?: Prop<'true' | 'false'>;
|
|
168
|
+
'aria-relevant'?: Prop<'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals'>;
|
|
169
|
+
'aria-required'?: Prop<'true' | 'false'>;
|
|
170
|
+
'aria-roledescription'?: Prop<string>;
|
|
171
|
+
'aria-rowcount'?: Prop<number>;
|
|
172
|
+
'aria-rowindex'?: Prop<number>;
|
|
173
|
+
'aria-rowindextext'?: Prop<string>;
|
|
174
|
+
'aria-rowspan'?: Prop<number>;
|
|
175
|
+
'aria-selected'?: Prop<'true' | 'false'>;
|
|
176
|
+
'aria-setsize'?: Prop<number>;
|
|
177
|
+
'aria-sort'?: Prop<'none' | 'ascending' | 'descending' | 'other'>;
|
|
178
|
+
'aria-valuemax'?: Prop<number>;
|
|
179
|
+
'aria-valuemin'?: Prop<number>;
|
|
180
|
+
'aria-valuenow'?: Prop<number>;
|
|
181
|
+
'aria-valuetext'?: Prop<string>;
|
|
182
|
+
|
|
183
|
+
textContent?: Prop<string>;
|
|
184
|
+
innerHTML?: Prop<string>;
|
|
185
|
+
|
|
186
|
+
ref?: ( value: T | null ) => void;
|
|
187
|
+
|
|
188
|
+
onabort?: EventHandler<Event<T>>;
|
|
189
|
+
onanimationend?: EventHandler<AnimationEvent<T>>;
|
|
190
|
+
onanimationiteration?: EventHandler<AnimationEvent<T>>;
|
|
191
|
+
onanimationstart?: EventHandler<AnimationEvent<T>>;
|
|
192
|
+
onauxclick?: EventHandler<MouseEvent<T>>;
|
|
193
|
+
onbeforeinput?: EventHandler<InputEvent<T>>;
|
|
194
|
+
onblur?: EventHandler<FocusTargetEvent<T>>;
|
|
195
|
+
oncancel?: EventHandler<Event<T>>;
|
|
196
|
+
oncanplay?: EventHandler<Event<T>>;
|
|
197
|
+
oncanplaythrough?: EventHandler<Event<T>>;
|
|
198
|
+
onchange?: EventHandler<Event<T>>;
|
|
199
|
+
onclick?: EventHandler<PointerEvent<T>>;
|
|
200
|
+
onclose?: EventHandler<Event<T>>;
|
|
201
|
+
oncompositionend?: EventHandler<CompositionEvent<T>>;
|
|
202
|
+
oncompositionstart?: EventHandler<CompositionEvent<T>>;
|
|
203
|
+
oncompositionupdate?: EventHandler<CompositionEvent<T>>;
|
|
204
|
+
oncontextmenu?: EventHandler<PointerEvent<T>>;
|
|
205
|
+
oncopy?: EventHandler<ClipboardEvent<T>>;
|
|
206
|
+
oncut?: EventHandler<ClipboardEvent<T>>;
|
|
207
|
+
ondblclick?: EventHandler<PointerEvent<T>>;
|
|
208
|
+
ondrag?: EventHandler<DragEvent<T>>;
|
|
209
|
+
ondragend?: EventHandler<DragEvent<T>>;
|
|
210
|
+
ondragenter?: EventHandler<DragEvent<T>>;
|
|
211
|
+
ondragleave?: EventHandler<DragEvent<T>>;
|
|
212
|
+
ondragover?: EventHandler<DragEvent<T>>;
|
|
213
|
+
ondragstart?: EventHandler<DragEvent<T>>;
|
|
214
|
+
ondrop?: EventHandler<DragEvent<T>>;
|
|
215
|
+
ondurationchange?: EventHandler<Event<T>>;
|
|
216
|
+
onemptied?: EventHandler<Event<T>>;
|
|
217
|
+
onencrypted?: EventHandler<Event<T>>;
|
|
218
|
+
onended?: EventHandler<Event<T>>;
|
|
219
|
+
onerror?: EventHandler<UIEvent<T>>;
|
|
220
|
+
onfocus?: EventHandler<FocusTargetEvent<T>>;
|
|
221
|
+
onfocusin?: EventHandler<FocusEvent<T>>;
|
|
222
|
+
onfocusout?: EventHandler<FocusEvent<T>>;
|
|
223
|
+
onformdata?: EventHandler<FormDataEvent<T>>;
|
|
224
|
+
ongotpointercapture?: EventHandler<PointerEvent<T>>;
|
|
225
|
+
oninput?: EventHandler<InputEvent<T>>;
|
|
226
|
+
oninvalid?: EventHandler<Event<T>>;
|
|
227
|
+
onkeydown?: EventHandler<KeyboardEvent<T>>;
|
|
228
|
+
onkeyup?: EventHandler<KeyboardEvent<T>>;
|
|
229
|
+
onload?: EventHandler<UIEvent<T>>;
|
|
230
|
+
onloadeddata?: EventHandler<UIEvent<T>>;
|
|
231
|
+
onloadedmetadata?: EventHandler<UIEvent<T>>;
|
|
232
|
+
onloadstart?: EventHandler<UIEvent<T>>;
|
|
233
|
+
onlostpointercapture?: EventHandler<PointerEvent<T>>;
|
|
234
|
+
onmousedown?: EventHandler<MouseEvent<T>>;
|
|
235
|
+
onmouseenter?: EventHandler<MouseEvent<T>>;
|
|
236
|
+
onmouseleave?: EventHandler<MouseEvent<T>>;
|
|
237
|
+
onmousemove?: EventHandler<MouseEvent<T>>;
|
|
238
|
+
onmouseout?: EventHandler<MouseEvent<T>>;
|
|
239
|
+
onmouseover?: EventHandler<MouseEvent<T>>;
|
|
240
|
+
onmouseup?: EventHandler<MouseEvent<T>>;
|
|
241
|
+
onpaste?: EventHandler<ClipboardEvent<T>>;
|
|
242
|
+
onpause?: EventHandler<Event<T>>;
|
|
243
|
+
onplay?: EventHandler<Event<T>>;
|
|
244
|
+
onplaying?: EventHandler<Event<T>>;
|
|
245
|
+
onpointercancel?: EventHandler<PointerEvent<T>>;
|
|
246
|
+
onpointerdown?: EventHandler<PointerEvent<T>>;
|
|
247
|
+
onpointerenter?: EventHandler<PointerEvent<T>>;
|
|
248
|
+
onpointerleave?: EventHandler<PointerEvent<T>>;
|
|
249
|
+
onpointermove?: EventHandler<PointerEvent<T>>;
|
|
250
|
+
onpointerout?: EventHandler<PointerEvent<T>>;
|
|
251
|
+
onpointerover?: EventHandler<PointerEvent<T>>;
|
|
252
|
+
onpointerup?: EventHandler<PointerEvent<T>>;
|
|
253
|
+
onprogress?: EventHandler<Event<T>>;
|
|
254
|
+
onratechange?: EventHandler<Event<T>>;
|
|
255
|
+
onreset?: EventHandler<Event<T>>;
|
|
256
|
+
onresize?: EventHandler<Event<T>>;
|
|
257
|
+
onseeked?: EventHandler<Event<T>>;
|
|
258
|
+
onseeking?: EventHandler<Event<T>>;
|
|
259
|
+
onscroll?: EventHandler<Event<T>>;
|
|
260
|
+
onscrollend?: EventHandler<Event<T>>;
|
|
261
|
+
onselect?: EventHandler<Event<T>>;
|
|
262
|
+
onselectionchange?: EventHandler<Event<T>>;
|
|
263
|
+
onstalled?: EventHandler<Event<T>>;
|
|
264
|
+
onsubmit?: EventHandler<SubmitEvent<T>>;
|
|
265
|
+
onsuspend?: EventHandler<Event<T>>;
|
|
266
|
+
ontimeupdate?: EventHandler<Event<T>>;
|
|
267
|
+
ontoggle?: EventHandler<ToggleEvent<T>>;
|
|
268
|
+
ontouchcancel?: EventHandler<TouchEvent<T>>;
|
|
269
|
+
ontouchend?: EventHandler<TouchEvent<T>>;
|
|
270
|
+
ontouchmove?: EventHandler<TouchEvent<T>>;
|
|
271
|
+
ontouchstart?: EventHandler<TouchEvent<T>>;
|
|
272
|
+
ontransitioncancel?: EventHandler<TransitionEvent<T>>;
|
|
273
|
+
ontransitionend?: EventHandler<TransitionEvent<T>>;
|
|
274
|
+
ontransitionrun?: EventHandler<TransitionEvent<T>>;
|
|
275
|
+
ontransitionstart?: EventHandler<TransitionEvent<T>>;
|
|
276
|
+
onvolumechange?: EventHandler<Event<T>>;
|
|
277
|
+
onwaiting?: EventHandler<Event<T>>;
|
|
278
|
+
onwaitingforkey?: EventHandler<Event<T>>;
|
|
279
|
+
onwheel?: EventHandler<WheelEvent<T>>;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
interface HTMLAnchorProps extends HTMLProps<HTMLAnchorElement> {
|
|
283
|
+
download?: Prop<string>;
|
|
284
|
+
href?: Prop<string>;
|
|
285
|
+
hreflang?: Prop<string>;
|
|
286
|
+
media?: Prop<string>;
|
|
287
|
+
ping?: Prop<string>;
|
|
288
|
+
referrerpolicy?: ReferrerPolicyProp;
|
|
289
|
+
rel?: Prop<string>;
|
|
290
|
+
target?: Prop<string>;
|
|
291
|
+
type?: Prop<string>;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
interface HTMLAreaProps extends HTMLProps<HTMLAreaElement> {
|
|
295
|
+
alt?: Prop<string>;
|
|
296
|
+
coords?: Prop<string>;
|
|
297
|
+
download?: Prop<string>;
|
|
298
|
+
href?: Prop<string>;
|
|
299
|
+
ping?: Prop<string>;
|
|
300
|
+
referrerpolicy?: ReferrerPolicyProp;
|
|
301
|
+
rel?: Prop<string>;
|
|
302
|
+
shape?: Prop<string>;
|
|
303
|
+
target?: Prop<string>;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
interface HTMLAudioProps extends HTMLProps<HTMLAudioElement> {
|
|
307
|
+
autoplay?: BooleanProp;
|
|
308
|
+
controls?: BooleanProp;
|
|
309
|
+
controlslist?: Prop<string>;
|
|
310
|
+
crossorigin?: Prop<'anonymous' | 'use-credentials'>;
|
|
311
|
+
loading?: Prop<'eager' | 'lazy'>;
|
|
312
|
+
loop?: BooleanProp;
|
|
313
|
+
muted?: BooleanProp;
|
|
314
|
+
preload?: Prop<'none' | 'metadata' | 'auto'>;
|
|
315
|
+
src?: Prop<string>;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
interface HTMLBaseProps extends HTMLProps<HTMLBaseElement> {
|
|
319
|
+
href?: Prop<string>;
|
|
320
|
+
target?: Prop<string>;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface HTMLButtonProps extends HTMLProps<HTMLButtonElement> {
|
|
324
|
+
autofocus?: BooleanProp;
|
|
325
|
+
disabled?: BooleanProp;
|
|
326
|
+
form?: Prop<string>;
|
|
327
|
+
formaction?: Prop<string>;
|
|
328
|
+
formenctype?: Prop<string>;
|
|
329
|
+
formmethod?: Prop<string>;
|
|
330
|
+
formnovalidate?: BooleanProp;
|
|
331
|
+
formtarget?: Prop<string>;
|
|
332
|
+
name?: Prop<string>;
|
|
333
|
+
type?: Prop<'submit' | 'reset' | 'button'>;
|
|
334
|
+
value?: Prop<string>;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
interface HTMLCanvasProps extends HTMLProps<HTMLCanvasElement> {
|
|
338
|
+
height?: Prop<number>;
|
|
339
|
+
width?: Prop<number>;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
interface HTMLDataProps extends HTMLProps<HTMLDataElement> {
|
|
343
|
+
value?: Prop<string>;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
interface HTMLDetailsProps extends HTMLProps<HTMLDetailsElement> {
|
|
347
|
+
name?: Prop<string>;
|
|
348
|
+
open?: BooleanProp;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
interface HTMLDialogProps extends HTMLProps<HTMLDialogElement> {
|
|
352
|
+
closedby?: Prop<'any' | 'closerequest' | 'none'>;
|
|
353
|
+
open?: BooleanProp;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
interface HTMLEmbedProps extends HTMLProps<HTMLEmbedElement> {
|
|
357
|
+
height?: Prop<number>;
|
|
358
|
+
src?: Prop<string>;
|
|
359
|
+
type?: Prop<string>;
|
|
360
|
+
width?: Prop<number>;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
interface HTMLFieldSetProps extends HTMLProps<HTMLFieldSetElement> {
|
|
364
|
+
disabled?: BooleanProp;
|
|
365
|
+
form?: Prop<string>;
|
|
366
|
+
name?: Prop<string>;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
interface HTMLFormProps extends HTMLProps<HTMLFormElement> {
|
|
370
|
+
'accept-charset'?: Prop<string>;
|
|
371
|
+
action?: Prop<string>;
|
|
372
|
+
autocomplete?: Prop<'on' | 'off'>;
|
|
373
|
+
enctype?: Prop<string>;
|
|
374
|
+
method?: Prop<string>;
|
|
375
|
+
name?: Prop<string>;
|
|
376
|
+
novalidate?: BooleanProp;
|
|
377
|
+
rel?: Prop<string>;
|
|
378
|
+
target?: Prop<string>;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
interface HTMLIFrameProps extends HTMLProps<HTMLIFrameElement> {
|
|
382
|
+
allow?: Prop<string>;
|
|
383
|
+
allowfullscreen?: BooleanProp;
|
|
384
|
+
height?: Prop<number>;
|
|
385
|
+
loading?: Prop<'eager' | 'lazy'>;
|
|
386
|
+
name?: Prop<string>;
|
|
387
|
+
referrerpolicy?: ReferrerPolicyProp;
|
|
388
|
+
sandbox?: Prop<string>;
|
|
389
|
+
src?: Prop<string>;
|
|
390
|
+
srcdoc?: Prop<string>;
|
|
391
|
+
width?: Prop<number>;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
interface HTMLImageProps extends HTMLProps<HTMLImageElement> {
|
|
395
|
+
alt?: Prop<string>;
|
|
396
|
+
crossorigin?: Prop<'anonymous' | 'use-credentials'>;
|
|
397
|
+
decoding?: Prop<'sync' | 'async' | 'auto'>;
|
|
398
|
+
fetchpriority?: Prop<'high' | 'low' | 'auto'>;
|
|
399
|
+
height?: Prop<number>;
|
|
400
|
+
ismap?: BooleanProp;
|
|
401
|
+
loading?: Prop<'eager' | 'lazy'>;
|
|
402
|
+
referrerpolicy?: ReferrerPolicyProp;
|
|
403
|
+
sizes?: Prop<string>;
|
|
404
|
+
src?: Prop<string>;
|
|
405
|
+
srcset?: Prop<string>;
|
|
406
|
+
usemap?: Prop<string>;
|
|
407
|
+
width?: Prop<number>;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
interface HTMLInputProps extends HTMLProps<HTMLInputElement> {
|
|
411
|
+
accept?: Prop<string>;
|
|
412
|
+
alt?: Prop<string>;
|
|
413
|
+
autocomplete?: Prop<'on' | 'off'>;
|
|
414
|
+
autofocus?: BooleanProp;
|
|
415
|
+
checked?: Prop<boolean>;
|
|
416
|
+
dirname?: Prop<string>;
|
|
417
|
+
disabled?: BooleanProp;
|
|
418
|
+
form?: Prop<string>;
|
|
419
|
+
formaction?: Prop<string>;
|
|
420
|
+
formenctype?: Prop<string>;
|
|
421
|
+
formmethod?: Prop<string>;
|
|
422
|
+
formnovalidate?: BooleanProp;
|
|
423
|
+
formtarget?: Prop<string>;
|
|
424
|
+
height?: Prop<number>;
|
|
425
|
+
inputmode?: Prop<'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'>;
|
|
426
|
+
list?: Prop<string>;
|
|
427
|
+
max?: Prop<number | string>;
|
|
428
|
+
maxlength?: Prop<number>;
|
|
429
|
+
min?: Prop<number | string>;
|
|
430
|
+
minlength?: Prop<number>;
|
|
431
|
+
multiple?: BooleanProp;
|
|
432
|
+
name?: Prop<string>;
|
|
433
|
+
pattern?: Prop<string>;
|
|
434
|
+
placeholder?: Prop<string>;
|
|
435
|
+
readonly?: BooleanProp;
|
|
436
|
+
required?: BooleanProp;
|
|
437
|
+
size?: Prop<number>;
|
|
438
|
+
src?: Prop<string>;
|
|
439
|
+
step?: Prop<number | 'any'>;
|
|
440
|
+
type?: Prop<'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range'
|
|
441
|
+
| 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week'>;
|
|
442
|
+
value?: Prop<string>;
|
|
443
|
+
width?: Prop<number>;
|
|
444
|
+
|
|
445
|
+
onchange?: EventHandler<TargetEvent<HTMLInputElement>>;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
interface HTMLLabelProps extends HTMLProps<HTMLLabelElement> {
|
|
449
|
+
for?: Prop<string>;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
interface HTMLLIProps extends HTMLProps<HTMLLIElement> {
|
|
453
|
+
value?: Prop<number>;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
interface HTMLLinkProps extends HTMLProps<HTMLLinkElement> {
|
|
457
|
+
as?: Prop<string>;
|
|
458
|
+
blocking?: Prop<'render'>;
|
|
459
|
+
crossorigin?: Prop<'anonymous' | 'use-credentials'>;
|
|
460
|
+
disabled?: BooleanProp;
|
|
461
|
+
fetchpriority?: Prop<'high' | 'low' | 'auto'>;
|
|
462
|
+
href?: Prop<string>;
|
|
463
|
+
hreflang?: Prop<string>;
|
|
464
|
+
imagesizes?: Prop<string>;
|
|
465
|
+
imagesrcset?: Prop<string>;
|
|
466
|
+
integrity?: Prop<string>;
|
|
467
|
+
media?: Prop<string>;
|
|
468
|
+
referrerpolicy?: ReferrerPolicyProp;
|
|
469
|
+
rel?: Prop<string>;
|
|
470
|
+
sizes?: Prop<string>;
|
|
471
|
+
type?: Prop<string>;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
interface HTMLMapProps extends HTMLProps<HTMLMapElement> {
|
|
475
|
+
name?: Prop<string>;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
interface HTMLMetaProps extends HTMLProps<HTMLMetaElement> {
|
|
479
|
+
charset?: Prop<string>;
|
|
480
|
+
content?: Prop<string>;
|
|
481
|
+
'http-equiv'?: Prop<string>;
|
|
482
|
+
media?: Prop<string>;
|
|
483
|
+
name?: Prop<string>;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
interface HTMLMeterProps extends HTMLProps<HTMLMeterElement> {
|
|
487
|
+
high?: Prop<number>;
|
|
488
|
+
low?: Prop<number>;
|
|
489
|
+
max?: Prop<number>;
|
|
490
|
+
min?: Prop<number>;
|
|
491
|
+
optimium?: Prop<number>;
|
|
492
|
+
value?: Prop<number>;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
interface HTMLModProps extends HTMLProps<HTMLModElement> {
|
|
496
|
+
cite?: Prop<string>;
|
|
497
|
+
datetime?: Prop<string>;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
interface HTMLObjectProps extends HTMLProps<HTMLObjectElement> {
|
|
501
|
+
data?: Prop<string>;
|
|
502
|
+
form?: Prop<string>;
|
|
503
|
+
height?: Prop<number>;
|
|
504
|
+
name?: Prop<string>;
|
|
505
|
+
type?: Prop<string>;
|
|
506
|
+
width?: Prop<number>;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
interface HTMLLOListProps extends HTMLProps<HTMLOListElement> {
|
|
510
|
+
reversed?: BooleanProp;
|
|
511
|
+
start?: Prop<number>;
|
|
512
|
+
type?: Prop<string>;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
interface HTMLOptGroupProps extends HTMLProps<HTMLOptGroupElement> {
|
|
516
|
+
disabled?: BooleanProp;
|
|
517
|
+
label?: Prop<string>;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
interface HTMLOptionProps extends HTMLProps<HTMLOptionElement> {
|
|
521
|
+
disabled?: BooleanProp;
|
|
522
|
+
label?: Prop<string>;
|
|
523
|
+
selected?: BooleanProp;
|
|
524
|
+
value?: Prop<string>;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
interface HTMLOutputProps extends HTMLProps<HTMLOutputElement> {
|
|
528
|
+
for?: Prop<string>;
|
|
529
|
+
form?: Prop<string>;
|
|
530
|
+
name?: Prop<string>;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
interface HTMLProgressProps extends HTMLProps<HTMLProgressElement> {
|
|
534
|
+
max?: Prop<number>;
|
|
535
|
+
value?: Prop<number>;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
interface HTMLQuoteProps extends HTMLProps<HTMLQuoteElement> {
|
|
539
|
+
cite?: Prop<string>;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
interface HTMLScriptProps extends HTMLProps<HTMLScriptElement> {
|
|
543
|
+
async?: BooleanProp;
|
|
544
|
+
blocking?: Prop<'render'>;
|
|
545
|
+
crossorigin?: Prop<'anonymous' | 'use-credentials'>;
|
|
546
|
+
defer?: BooleanProp;
|
|
547
|
+
fetchpriority?: Prop<'high' | 'low' | 'auto'>;
|
|
548
|
+
integrity?: Prop<string>;
|
|
549
|
+
nomodule?: BooleanProp;
|
|
550
|
+
referrerpolicy?: ReferrerPolicyProp;
|
|
551
|
+
src?: Prop<string>;
|
|
552
|
+
type?: Prop<string>;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
interface HTMLSelectProps extends HTMLProps<HTMLSelectElement> {
|
|
556
|
+
autocomplete?: Prop<'on' | 'off'>;
|
|
557
|
+
autofocus?: BooleanProp;
|
|
558
|
+
disabled?: BooleanProp;
|
|
559
|
+
form?: Prop<string>;
|
|
560
|
+
multiple?: BooleanProp;
|
|
561
|
+
name?: Prop<string>;
|
|
562
|
+
required?: BooleanProp;
|
|
563
|
+
size?: Prop<number>;
|
|
564
|
+
value?: Prop<string>;
|
|
565
|
+
|
|
566
|
+
onchange?: EventHandler<TargetEvent<HTMLSelectElement>>;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
interface HTMLSlotProps extends HTMLProps<HTMLSlotElement> {
|
|
570
|
+
name?: Prop<string>;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
interface HTMLSourceProps extends HTMLProps<HTMLSourceElement> {
|
|
574
|
+
height?: Prop<number>;
|
|
575
|
+
media?: Prop<string>;
|
|
576
|
+
sizes?: Prop<string>;
|
|
577
|
+
src?: Prop<string>;
|
|
578
|
+
srcset?: Prop<string>;
|
|
579
|
+
type?: Prop<string>;
|
|
580
|
+
width?: Prop<number>;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
interface HTMLStyleProps extends HTMLProps<HTMLStyleElement> {
|
|
584
|
+
blocking?: Prop<'render'>;
|
|
585
|
+
media?: Prop<string>;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
interface HTMLTableColProps extends HTMLProps<HTMLTableColElement> {
|
|
589
|
+
span?: Prop<number>;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
interface HTMLTableCellProps extends HTMLProps<HTMLTableCellElement> {
|
|
593
|
+
colspan?: Prop<number>;
|
|
594
|
+
headers?: Prop<string>;
|
|
595
|
+
rowspan?: Prop<number>;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
interface HTMLTableCellHeaderProps extends HTMLProps<HTMLTableCellElement> {
|
|
599
|
+
abbr?: Prop<string>;
|
|
600
|
+
colspan?: Prop<number>;
|
|
601
|
+
headers?: Prop<string>;
|
|
602
|
+
rowspan?: Prop<number>;
|
|
603
|
+
scope?: Prop<'row' | 'col' | 'rowgroup' | 'colgroup'>;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
interface HTMLTextAreaProps extends HTMLProps<HTMLTextAreaElement> {
|
|
607
|
+
autocomplete?: Prop<'on' | 'off'>;
|
|
608
|
+
autofocus?: BooleanProp;
|
|
609
|
+
cols?: Prop<number>;
|
|
610
|
+
dirname?: Prop<string>;
|
|
611
|
+
disabled?: BooleanProp;
|
|
612
|
+
form?: Prop<string>;
|
|
613
|
+
maxlength?: Prop<number>;
|
|
614
|
+
minlength?: Prop<number>;
|
|
615
|
+
name?: Prop<string>;
|
|
616
|
+
placeholder?: Prop<string>;
|
|
617
|
+
readonly?: BooleanProp;
|
|
618
|
+
required?: BooleanProp;
|
|
619
|
+
rows?: Prop<number>;
|
|
620
|
+
wrap?: Prop<'hard' | 'soft'>;
|
|
621
|
+
value?: Prop<string>;
|
|
622
|
+
|
|
623
|
+
onchange?: EventHandler<TargetEvent<HTMLTextAreaElement>>;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
interface HTMLTimeProps extends HTMLProps<HTMLTimeElement> {
|
|
627
|
+
datetime?: Prop<string>;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
interface HTMLTrackProps extends HTMLProps<HTMLTrackElement> {
|
|
631
|
+
default?: BooleanProp;
|
|
632
|
+
kind?: Prop<string>;
|
|
633
|
+
label?: Prop<string>;
|
|
634
|
+
src?: Prop<string>;
|
|
635
|
+
srclang?: Prop<string>;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
interface HTMLVideoProps extends HTMLProps<HTMLVideoElement> {
|
|
639
|
+
autoplay?: BooleanProp;
|
|
640
|
+
controls?: BooleanProp;
|
|
641
|
+
controlslist?: Prop<string>;
|
|
642
|
+
crossorigin?: Prop<'anonymous' | 'use-credentials'>;
|
|
643
|
+
height?: Prop<number>;
|
|
644
|
+
loading?: Prop<'eager' | 'lazy'>;
|
|
645
|
+
loop?: BooleanProp;
|
|
646
|
+
muted?: BooleanProp;
|
|
647
|
+
playsinline?: BooleanProp;
|
|
648
|
+
poster?: Prop<string>;
|
|
649
|
+
preload?: Prop<'none' | 'metadata' | 'auto'>;
|
|
650
|
+
src?: Prop<string>;
|
|
651
|
+
width?: Prop<number>;
|
|
652
|
+
}
|
|
653
|
+
}
|