@praxisjs/jsx 0.1.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/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-runtime.d.ts +215 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +24 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/package.json +31 -0
- package/src/index.ts +1 -0
- package/src/jsx-runtime.ts +293 -0
- package/tsconfig.json +8 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present Mateus Martins
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { type Children, type ChildrenInternal, type ComponentConstructor, type FunctionComponent, type VNode } from "@praxisjs/shared";
|
|
2
|
+
type PropsOf<T> = T extends string ? JSX.IntrinsicElements[T] : T extends ComponentConstructor<infer P> ? P : T extends FunctionComponent<infer P> ? P : Record<string, unknown>;
|
|
3
|
+
type Reactive<T> = T | (() => T);
|
|
4
|
+
export declare function jsx<T extends VNode["type"]>(type: T, props: PropsOf<T> & {
|
|
5
|
+
children?: ChildrenInternal | ChildrenInternal[];
|
|
6
|
+
}, key?: string | number): VNode;
|
|
7
|
+
export declare const jsxs: typeof jsx;
|
|
8
|
+
export declare const jsxDEV: typeof jsx;
|
|
9
|
+
export declare const Fragment: unique symbol;
|
|
10
|
+
export declare namespace JSX {
|
|
11
|
+
export type Element = VNode;
|
|
12
|
+
interface GlobalAttributes {
|
|
13
|
+
key?: string | number | symbol;
|
|
14
|
+
}
|
|
15
|
+
type InstancePropsOf<C> = C extends {
|
|
16
|
+
prototype: infer I;
|
|
17
|
+
} ? {
|
|
18
|
+
[K in keyof I as K extends "defaults" | "onMount" | "onUnmount" | "onUpdate" ? never : I[K] extends (...args: unknown[]) => unknown ? never : K]?: I[K];
|
|
19
|
+
} : never;
|
|
20
|
+
export type LibraryManagedAttributes<C, P> = P & (C extends string ? Record<never, never> : InstancePropsOf<C> extends never ? Record<never, never> : InstancePropsOf<C>) & GlobalAttributes;
|
|
21
|
+
export interface IntrinsicElements {
|
|
22
|
+
div: HTMLAttributes;
|
|
23
|
+
span: HTMLAttributes;
|
|
24
|
+
p: HTMLAttributes;
|
|
25
|
+
h1: HTMLAttributes;
|
|
26
|
+
h2: HTMLAttributes;
|
|
27
|
+
h3: HTMLAttributes;
|
|
28
|
+
h4: HTMLAttributes;
|
|
29
|
+
h5: HTMLAttributes;
|
|
30
|
+
h6: HTMLAttributes;
|
|
31
|
+
button: ButtonAttributes;
|
|
32
|
+
input: InputAttributes;
|
|
33
|
+
form: FormAttributes;
|
|
34
|
+
ul: HTMLAttributes;
|
|
35
|
+
ol: HTMLAttributes;
|
|
36
|
+
li: HTMLAttributes;
|
|
37
|
+
a: AnchorAttributes;
|
|
38
|
+
img: ImgAttributes;
|
|
39
|
+
section: HTMLAttributes;
|
|
40
|
+
header: HTMLAttributes;
|
|
41
|
+
main: HTMLAttributes;
|
|
42
|
+
footer: HTMLAttributes;
|
|
43
|
+
nav: HTMLAttributes;
|
|
44
|
+
article: HTMLAttributes;
|
|
45
|
+
aside: HTMLAttributes;
|
|
46
|
+
label: LabelAttributes;
|
|
47
|
+
select: SelectAttributes;
|
|
48
|
+
option: OptionAttributes;
|
|
49
|
+
textarea: TextareaAttributes;
|
|
50
|
+
table: HTMLAttributes;
|
|
51
|
+
thead: HTMLAttributes;
|
|
52
|
+
tbody: HTMLAttributes;
|
|
53
|
+
tfoot: HTMLAttributes;
|
|
54
|
+
tr: HTMLAttributes;
|
|
55
|
+
th: ThAttributes;
|
|
56
|
+
td: TdAttributes;
|
|
57
|
+
pre: HTMLAttributes;
|
|
58
|
+
code: HTMLAttributes;
|
|
59
|
+
strong: HTMLAttributes;
|
|
60
|
+
em: HTMLAttributes;
|
|
61
|
+
small: HTMLAttributes;
|
|
62
|
+
hr: HTMLAttributes;
|
|
63
|
+
br: HTMLAttributes;
|
|
64
|
+
[key: string]: HTMLAttributes;
|
|
65
|
+
}
|
|
66
|
+
interface HTMLAttributes {
|
|
67
|
+
id?: Reactive<string>;
|
|
68
|
+
class?: Reactive<string>;
|
|
69
|
+
className?: Reactive<string>;
|
|
70
|
+
style?: Reactive<string | Partial<CSSStyleDeclaration>>;
|
|
71
|
+
children?: Children;
|
|
72
|
+
key?: string | number;
|
|
73
|
+
ref?: (el: HTMLElement) => void;
|
|
74
|
+
tabIndex?: Reactive<number>;
|
|
75
|
+
title?: Reactive<string>;
|
|
76
|
+
hidden?: Reactive<boolean>;
|
|
77
|
+
draggable?: Reactive<boolean>;
|
|
78
|
+
role?: Reactive<string>;
|
|
79
|
+
"aria-label"?: Reactive<string>;
|
|
80
|
+
"aria-hidden"?: Reactive<boolean | "true" | "false">;
|
|
81
|
+
"aria-expanded"?: Reactive<boolean | "true" | "false">;
|
|
82
|
+
"aria-checked"?: Reactive<boolean | "true" | "false" | "mixed">;
|
|
83
|
+
"aria-disabled"?: Reactive<boolean | "true" | "false">;
|
|
84
|
+
"aria-selected"?: Reactive<boolean | "true" | "false">;
|
|
85
|
+
"aria-controls"?: Reactive<string>;
|
|
86
|
+
"aria-describedby"?: Reactive<string>;
|
|
87
|
+
"aria-labelledby"?: Reactive<string>;
|
|
88
|
+
onClick?: (e: MouseEvent) => void;
|
|
89
|
+
onDblClick?: (e: MouseEvent) => void;
|
|
90
|
+
onMouseDown?: (e: MouseEvent) => void;
|
|
91
|
+
onMouseUp?: (e: MouseEvent) => void;
|
|
92
|
+
onMouseEnter?: (e: MouseEvent) => void;
|
|
93
|
+
onMouseLeave?: (e: MouseEvent) => void;
|
|
94
|
+
onMouseMove?: (e: MouseEvent) => void;
|
|
95
|
+
onContextMenu?: (e: MouseEvent) => void;
|
|
96
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
97
|
+
onKeyUp?: (e: KeyboardEvent) => void;
|
|
98
|
+
onKeyPress?: (e: KeyboardEvent) => void;
|
|
99
|
+
onFocus?: (e: FocusEvent) => void;
|
|
100
|
+
onBlur?: (e: FocusEvent) => void;
|
|
101
|
+
onChange?: (e: Event) => void;
|
|
102
|
+
onInput?: (e: InputEvent) => void;
|
|
103
|
+
onSubmit?: (e: SubmitEvent) => void;
|
|
104
|
+
onReset?: (e: Event) => void;
|
|
105
|
+
onDragStart?: (e: DragEvent) => void;
|
|
106
|
+
onDragEnd?: (e: DragEvent) => void;
|
|
107
|
+
onDragOver?: (e: DragEvent) => void;
|
|
108
|
+
onDrop?: (e: DragEvent) => void;
|
|
109
|
+
onTouchStart?: (e: TouchEvent) => void;
|
|
110
|
+
onTouchEnd?: (e: TouchEvent) => void;
|
|
111
|
+
onTouchMove?: (e: TouchEvent) => void;
|
|
112
|
+
onScroll?: (e: Event) => void;
|
|
113
|
+
onWheel?: (e: WheelEvent) => void;
|
|
114
|
+
onAnimationEnd?: (e: AnimationEvent) => void;
|
|
115
|
+
onTransitionEnd?: (e: TransitionEvent) => void;
|
|
116
|
+
[key: string]: unknown;
|
|
117
|
+
}
|
|
118
|
+
interface ButtonAttributes extends HTMLAttributes {
|
|
119
|
+
type?: "button" | "submit" | "reset";
|
|
120
|
+
disabled?: Reactive<boolean>;
|
|
121
|
+
form?: string;
|
|
122
|
+
name?: string;
|
|
123
|
+
value?: Reactive<string>;
|
|
124
|
+
}
|
|
125
|
+
interface InputAttributes extends HTMLAttributes {
|
|
126
|
+
type?: string;
|
|
127
|
+
value?: Reactive<string | number>;
|
|
128
|
+
defaultValue?: string | number;
|
|
129
|
+
placeholder?: Reactive<string>;
|
|
130
|
+
disabled?: Reactive<boolean>;
|
|
131
|
+
checked?: Reactive<boolean>;
|
|
132
|
+
defaultChecked?: boolean;
|
|
133
|
+
name?: string;
|
|
134
|
+
min?: Reactive<string | number>;
|
|
135
|
+
max?: Reactive<string | number>;
|
|
136
|
+
step?: Reactive<string | number>;
|
|
137
|
+
minLength?: number;
|
|
138
|
+
maxLength?: number;
|
|
139
|
+
pattern?: string;
|
|
140
|
+
required?: Reactive<boolean>;
|
|
141
|
+
readOnly?: Reactive<boolean>;
|
|
142
|
+
multiple?: boolean;
|
|
143
|
+
accept?: string;
|
|
144
|
+
autoComplete?: string;
|
|
145
|
+
autoFocus?: boolean;
|
|
146
|
+
}
|
|
147
|
+
interface FormAttributes extends HTMLAttributes {
|
|
148
|
+
action?: string;
|
|
149
|
+
method?: "get" | "post";
|
|
150
|
+
encType?: string;
|
|
151
|
+
noValidate?: boolean;
|
|
152
|
+
target?: string;
|
|
153
|
+
name?: string;
|
|
154
|
+
}
|
|
155
|
+
interface AnchorAttributes extends HTMLAttributes {
|
|
156
|
+
href?: Reactive<string>;
|
|
157
|
+
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
158
|
+
rel?: string;
|
|
159
|
+
download?: string | boolean;
|
|
160
|
+
}
|
|
161
|
+
interface ImgAttributes extends HTMLAttributes {
|
|
162
|
+
src?: Reactive<string>;
|
|
163
|
+
alt?: string;
|
|
164
|
+
width?: Reactive<number | string>;
|
|
165
|
+
height?: Reactive<number | string>;
|
|
166
|
+
loading?: "lazy" | "eager";
|
|
167
|
+
decoding?: "async" | "sync" | "auto";
|
|
168
|
+
}
|
|
169
|
+
interface LabelAttributes extends HTMLAttributes {
|
|
170
|
+
for?: string;
|
|
171
|
+
htmlFor?: string;
|
|
172
|
+
form?: string;
|
|
173
|
+
}
|
|
174
|
+
interface SelectAttributes extends HTMLAttributes {
|
|
175
|
+
value?: Reactive<string>;
|
|
176
|
+
multiple?: boolean;
|
|
177
|
+
size?: number;
|
|
178
|
+
disabled?: Reactive<boolean>;
|
|
179
|
+
required?: Reactive<boolean>;
|
|
180
|
+
name?: string;
|
|
181
|
+
}
|
|
182
|
+
interface OptionAttributes extends HTMLAttributes {
|
|
183
|
+
value?: string;
|
|
184
|
+
selected?: Reactive<boolean>;
|
|
185
|
+
disabled?: Reactive<boolean>;
|
|
186
|
+
label?: string;
|
|
187
|
+
}
|
|
188
|
+
interface TextareaAttributes extends HTMLAttributes {
|
|
189
|
+
value?: Reactive<string>;
|
|
190
|
+
defaultValue?: string;
|
|
191
|
+
placeholder?: Reactive<string>;
|
|
192
|
+
rows?: number;
|
|
193
|
+
cols?: number;
|
|
194
|
+
disabled?: Reactive<boolean>;
|
|
195
|
+
required?: Reactive<boolean>;
|
|
196
|
+
readOnly?: Reactive<boolean>;
|
|
197
|
+
minLength?: number;
|
|
198
|
+
maxLength?: number;
|
|
199
|
+
name?: string;
|
|
200
|
+
autoFocus?: boolean;
|
|
201
|
+
resize?: "none" | "both" | "horizontal" | "vertical";
|
|
202
|
+
}
|
|
203
|
+
interface ThAttributes extends HTMLAttributes {
|
|
204
|
+
colSpan?: number;
|
|
205
|
+
rowSpan?: number;
|
|
206
|
+
scope?: "col" | "row" | "colgroup" | "rowgroup";
|
|
207
|
+
}
|
|
208
|
+
interface TdAttributes extends HTMLAttributes {
|
|
209
|
+
colSpan?: number;
|
|
210
|
+
rowSpan?: number;
|
|
211
|
+
}
|
|
212
|
+
export {};
|
|
213
|
+
}
|
|
214
|
+
export {};
|
|
215
|
+
//# sourceMappingURL=jsx-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EAEb,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACX,MAAM,kBAAkB,CAAC;AAE1B,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAC9B,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,GACxB,CAAC,SAAS,oBAAoB,CAAC,MAAM,CAAC,CAAC,GACrC,CAAC,GACD,CAAC,SAAS,iBAAiB,CAAC,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{
|
|
3
|
+
const { children: raw, ...rest } = props;
|
|
4
|
+
const children = [];
|
|
5
|
+
if (raw !== undefined) {
|
|
6
|
+
if (Array.isArray(raw)) {
|
|
7
|
+
const flatted = flattenChildren(raw);
|
|
8
|
+
children.push(...flatted);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
children.push(raw);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
type,
|
|
16
|
+
props: rest,
|
|
17
|
+
children,
|
|
18
|
+
key,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export const jsxs = jsx;
|
|
22
|
+
export const jsxDEV = jsx;
|
|
23
|
+
export const Fragment = Symbol("Fragment");
|
|
24
|
+
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,GAKhB,MAAM,kBAAkB,CAAC;AAY1B,MAAM,UAAU,GAAG,CACjB,IAAO,EACP,KAAwE,EACxE,GAAqB;IAErB,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACzC,MAAM,QAAQ,GAAuB,EAAE,CAAC;IAExC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;YACrC,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI;QACJ,KAAK,EAAE,IAAI;QACX,QAAQ;QACR,GAAG;KACJ,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;AAE1B,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@praxisjs/jsx",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./jsx-runtime": {
|
|
13
|
+
"import": "./dist/jsx-runtime.js",
|
|
14
|
+
"types": "./dist/jsx-runtime.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./jsx-dev-runtime": {
|
|
17
|
+
"import": "./dist/jsx-runtime.js",
|
|
18
|
+
"types": "./dist/jsx-runtime.d.ts"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"typescript": "^5.9.3"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@praxisjs/shared": "0.1.0"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc",
|
|
29
|
+
"dev": "tsc --watch"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Fragment, jsx, jsxs, jsxDEV } from "./jsx-runtime";
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Children,
|
|
3
|
+
flattenChildren,
|
|
4
|
+
type ChildrenInternal,
|
|
5
|
+
type ComponentConstructor,
|
|
6
|
+
type FunctionComponent,
|
|
7
|
+
type VNode,
|
|
8
|
+
} from "@praxisjs/shared";
|
|
9
|
+
|
|
10
|
+
type PropsOf<T> = T extends string
|
|
11
|
+
? JSX.IntrinsicElements[T]
|
|
12
|
+
: T extends ComponentConstructor<infer P>
|
|
13
|
+
? P
|
|
14
|
+
: T extends FunctionComponent<infer P>
|
|
15
|
+
? P
|
|
16
|
+
: Record<string, unknown>;
|
|
17
|
+
|
|
18
|
+
type Reactive<T> = T | (() => T);
|
|
19
|
+
|
|
20
|
+
export function jsx<T extends VNode["type"]>(
|
|
21
|
+
type: T,
|
|
22
|
+
props: PropsOf<T> & { children?: ChildrenInternal | ChildrenInternal[] },
|
|
23
|
+
key?: string | number,
|
|
24
|
+
): VNode {
|
|
25
|
+
const { children: raw, ...rest } = props;
|
|
26
|
+
const children: ChildrenInternal[] = [];
|
|
27
|
+
|
|
28
|
+
if (raw !== undefined) {
|
|
29
|
+
if (Array.isArray(raw)) {
|
|
30
|
+
const flatted = flattenChildren(raw);
|
|
31
|
+
children.push(...flatted);
|
|
32
|
+
} else {
|
|
33
|
+
children.push(raw);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
type,
|
|
39
|
+
props: rest,
|
|
40
|
+
children,
|
|
41
|
+
key,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const jsxs = jsx;
|
|
46
|
+
export const jsxDEV = jsx;
|
|
47
|
+
|
|
48
|
+
export const Fragment = Symbol("Fragment");
|
|
49
|
+
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
51
|
+
export namespace JSX {
|
|
52
|
+
export type Element = VNode;
|
|
53
|
+
|
|
54
|
+
interface GlobalAttributes {
|
|
55
|
+
key?: string | number | symbol;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Infer props from the class instance properties
|
|
59
|
+
// (excludes lifecycle and methods)
|
|
60
|
+
type InstancePropsOf<C> = C extends { prototype: infer I }
|
|
61
|
+
? {
|
|
62
|
+
[K in keyof I as K extends
|
|
63
|
+
| "defaults"
|
|
64
|
+
| "onMount"
|
|
65
|
+
| "onUnmount"
|
|
66
|
+
| "onUpdate"
|
|
67
|
+
? never
|
|
68
|
+
: I[K] extends (...args: unknown[]) => unknown
|
|
69
|
+
? never
|
|
70
|
+
: K]?: I[K];
|
|
71
|
+
}
|
|
72
|
+
: never;
|
|
73
|
+
|
|
74
|
+
export type LibraryManagedAttributes<C, P> = P &
|
|
75
|
+
(C extends string
|
|
76
|
+
? Record<never, never>
|
|
77
|
+
: InstancePropsOf<C> extends never
|
|
78
|
+
? Record<never, never>
|
|
79
|
+
: InstancePropsOf<C>) &
|
|
80
|
+
GlobalAttributes;
|
|
81
|
+
|
|
82
|
+
export interface IntrinsicElements {
|
|
83
|
+
div: HTMLAttributes;
|
|
84
|
+
span: HTMLAttributes;
|
|
85
|
+
p: HTMLAttributes;
|
|
86
|
+
h1: HTMLAttributes;
|
|
87
|
+
h2: HTMLAttributes;
|
|
88
|
+
h3: HTMLAttributes;
|
|
89
|
+
h4: HTMLAttributes;
|
|
90
|
+
h5: HTMLAttributes;
|
|
91
|
+
h6: HTMLAttributes;
|
|
92
|
+
button: ButtonAttributes;
|
|
93
|
+
input: InputAttributes;
|
|
94
|
+
form: FormAttributes;
|
|
95
|
+
ul: HTMLAttributes;
|
|
96
|
+
ol: HTMLAttributes;
|
|
97
|
+
li: HTMLAttributes;
|
|
98
|
+
a: AnchorAttributes;
|
|
99
|
+
img: ImgAttributes;
|
|
100
|
+
section: HTMLAttributes;
|
|
101
|
+
header: HTMLAttributes;
|
|
102
|
+
main: HTMLAttributes;
|
|
103
|
+
footer: HTMLAttributes;
|
|
104
|
+
nav: HTMLAttributes;
|
|
105
|
+
article: HTMLAttributes;
|
|
106
|
+
aside: HTMLAttributes;
|
|
107
|
+
label: LabelAttributes;
|
|
108
|
+
select: SelectAttributes;
|
|
109
|
+
option: OptionAttributes;
|
|
110
|
+
textarea: TextareaAttributes;
|
|
111
|
+
table: HTMLAttributes;
|
|
112
|
+
thead: HTMLAttributes;
|
|
113
|
+
tbody: HTMLAttributes;
|
|
114
|
+
tfoot: HTMLAttributes;
|
|
115
|
+
tr: HTMLAttributes;
|
|
116
|
+
th: ThAttributes;
|
|
117
|
+
td: TdAttributes;
|
|
118
|
+
pre: HTMLAttributes;
|
|
119
|
+
code: HTMLAttributes;
|
|
120
|
+
strong: HTMLAttributes;
|
|
121
|
+
em: HTMLAttributes;
|
|
122
|
+
small: HTMLAttributes;
|
|
123
|
+
hr: HTMLAttributes;
|
|
124
|
+
br: HTMLAttributes;
|
|
125
|
+
[key: string]: HTMLAttributes;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface HTMLAttributes {
|
|
129
|
+
id?: Reactive<string>;
|
|
130
|
+
class?: Reactive<string>;
|
|
131
|
+
className?: Reactive<string>;
|
|
132
|
+
style?: Reactive<string | Partial<CSSStyleDeclaration>>;
|
|
133
|
+
children?: Children;
|
|
134
|
+
key?: string | number;
|
|
135
|
+
ref?: (el: HTMLElement) => void;
|
|
136
|
+
tabIndex?: Reactive<number>;
|
|
137
|
+
title?: Reactive<string>;
|
|
138
|
+
hidden?: Reactive<boolean>;
|
|
139
|
+
draggable?: Reactive<boolean>;
|
|
140
|
+
role?: Reactive<string>;
|
|
141
|
+
// Aria
|
|
142
|
+
"aria-label"?: Reactive<string>;
|
|
143
|
+
"aria-hidden"?: Reactive<boolean | "true" | "false">;
|
|
144
|
+
"aria-expanded"?: Reactive<boolean | "true" | "false">;
|
|
145
|
+
"aria-checked"?: Reactive<boolean | "true" | "false" | "mixed">;
|
|
146
|
+
"aria-disabled"?: Reactive<boolean | "true" | "false">;
|
|
147
|
+
"aria-selected"?: Reactive<boolean | "true" | "false">;
|
|
148
|
+
"aria-controls"?: Reactive<string>;
|
|
149
|
+
"aria-describedby"?: Reactive<string>;
|
|
150
|
+
"aria-labelledby"?: Reactive<string>;
|
|
151
|
+
// Mouse Events
|
|
152
|
+
onClick?: (e: MouseEvent) => void;
|
|
153
|
+
onDblClick?: (e: MouseEvent) => void;
|
|
154
|
+
onMouseDown?: (e: MouseEvent) => void;
|
|
155
|
+
onMouseUp?: (e: MouseEvent) => void;
|
|
156
|
+
onMouseEnter?: (e: MouseEvent) => void;
|
|
157
|
+
onMouseLeave?: (e: MouseEvent) => void;
|
|
158
|
+
onMouseMove?: (e: MouseEvent) => void;
|
|
159
|
+
onContextMenu?: (e: MouseEvent) => void;
|
|
160
|
+
// Keyboard Events
|
|
161
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
162
|
+
onKeyUp?: (e: KeyboardEvent) => void;
|
|
163
|
+
onKeyPress?: (e: KeyboardEvent) => void;
|
|
164
|
+
// Focus Events
|
|
165
|
+
onFocus?: (e: FocusEvent) => void;
|
|
166
|
+
onBlur?: (e: FocusEvent) => void;
|
|
167
|
+
// Form Events
|
|
168
|
+
onChange?: (e: Event) => void;
|
|
169
|
+
onInput?: (e: InputEvent) => void;
|
|
170
|
+
onSubmit?: (e: SubmitEvent) => void;
|
|
171
|
+
onReset?: (e: Event) => void;
|
|
172
|
+
// Drag Events
|
|
173
|
+
onDragStart?: (e: DragEvent) => void;
|
|
174
|
+
onDragEnd?: (e: DragEvent) => void;
|
|
175
|
+
onDragOver?: (e: DragEvent) => void;
|
|
176
|
+
onDrop?: (e: DragEvent) => void;
|
|
177
|
+
// Touch Events
|
|
178
|
+
onTouchStart?: (e: TouchEvent) => void;
|
|
179
|
+
onTouchEnd?: (e: TouchEvent) => void;
|
|
180
|
+
onTouchMove?: (e: TouchEvent) => void;
|
|
181
|
+
// Other Events
|
|
182
|
+
onScroll?: (e: Event) => void;
|
|
183
|
+
onWheel?: (e: WheelEvent) => void;
|
|
184
|
+
onAnimationEnd?: (e: AnimationEvent) => void;
|
|
185
|
+
onTransitionEnd?: (e: TransitionEvent) => void;
|
|
186
|
+
[key: string]: unknown;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
interface ButtonAttributes extends HTMLAttributes {
|
|
190
|
+
type?: "button" | "submit" | "reset";
|
|
191
|
+
disabled?: Reactive<boolean>;
|
|
192
|
+
form?: string;
|
|
193
|
+
name?: string;
|
|
194
|
+
value?: Reactive<string>;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
interface InputAttributes extends HTMLAttributes {
|
|
198
|
+
type?: string;
|
|
199
|
+
value?: Reactive<string | number>;
|
|
200
|
+
defaultValue?: string | number;
|
|
201
|
+
placeholder?: Reactive<string>;
|
|
202
|
+
disabled?: Reactive<boolean>;
|
|
203
|
+
checked?: Reactive<boolean>;
|
|
204
|
+
defaultChecked?: boolean;
|
|
205
|
+
name?: string;
|
|
206
|
+
min?: Reactive<string | number>;
|
|
207
|
+
max?: Reactive<string | number>;
|
|
208
|
+
step?: Reactive<string | number>;
|
|
209
|
+
minLength?: number;
|
|
210
|
+
maxLength?: number;
|
|
211
|
+
pattern?: string;
|
|
212
|
+
required?: Reactive<boolean>;
|
|
213
|
+
readOnly?: Reactive<boolean>;
|
|
214
|
+
multiple?: boolean;
|
|
215
|
+
accept?: string;
|
|
216
|
+
autoComplete?: string;
|
|
217
|
+
autoFocus?: boolean;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
interface FormAttributes extends HTMLAttributes {
|
|
221
|
+
action?: string;
|
|
222
|
+
method?: "get" | "post";
|
|
223
|
+
encType?: string;
|
|
224
|
+
noValidate?: boolean;
|
|
225
|
+
target?: string;
|
|
226
|
+
name?: string;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
interface AnchorAttributes extends HTMLAttributes {
|
|
230
|
+
href?: Reactive<string>;
|
|
231
|
+
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
232
|
+
rel?: string;
|
|
233
|
+
download?: string | boolean;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
interface ImgAttributes extends HTMLAttributes {
|
|
237
|
+
src?: Reactive<string>;
|
|
238
|
+
alt?: string;
|
|
239
|
+
width?: Reactive<number | string>;
|
|
240
|
+
height?: Reactive<number | string>;
|
|
241
|
+
loading?: "lazy" | "eager";
|
|
242
|
+
decoding?: "async" | "sync" | "auto";
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
interface LabelAttributes extends HTMLAttributes {
|
|
246
|
+
for?: string;
|
|
247
|
+
htmlFor?: string;
|
|
248
|
+
form?: string;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
interface SelectAttributes extends HTMLAttributes {
|
|
252
|
+
value?: Reactive<string>;
|
|
253
|
+
multiple?: boolean;
|
|
254
|
+
size?: number;
|
|
255
|
+
disabled?: Reactive<boolean>;
|
|
256
|
+
required?: Reactive<boolean>;
|
|
257
|
+
name?: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
interface OptionAttributes extends HTMLAttributes {
|
|
261
|
+
value?: string;
|
|
262
|
+
selected?: Reactive<boolean>;
|
|
263
|
+
disabled?: Reactive<boolean>;
|
|
264
|
+
label?: string;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
interface TextareaAttributes extends HTMLAttributes {
|
|
268
|
+
value?: Reactive<string>;
|
|
269
|
+
defaultValue?: string;
|
|
270
|
+
placeholder?: Reactive<string>;
|
|
271
|
+
rows?: number;
|
|
272
|
+
cols?: number;
|
|
273
|
+
disabled?: Reactive<boolean>;
|
|
274
|
+
required?: Reactive<boolean>;
|
|
275
|
+
readOnly?: Reactive<boolean>;
|
|
276
|
+
minLength?: number;
|
|
277
|
+
maxLength?: number;
|
|
278
|
+
name?: string;
|
|
279
|
+
autoFocus?: boolean;
|
|
280
|
+
resize?: "none" | "both" | "horizontal" | "vertical";
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
interface ThAttributes extends HTMLAttributes {
|
|
284
|
+
colSpan?: number;
|
|
285
|
+
rowSpan?: number;
|
|
286
|
+
scope?: "col" | "row" | "colgroup" | "rowgroup";
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
interface TdAttributes extends HTMLAttributes {
|
|
290
|
+
colSpan?: number;
|
|
291
|
+
rowSpan?: number;
|
|
292
|
+
}
|
|
293
|
+
}
|