stagnate 1.0.8 → 1.1.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/{lib/Component.d.ts → Component.d.ts} +9 -10
- package/{lib/Component.js → Component.js} +5 -5
- package/Component.js.map +1 -0
- package/README.md +1 -3
- package/{lib/Slot.d.ts → Slot.d.ts} +1 -1
- package/{lib/Slot.js → Slot.js} +1 -1
- package/Slot.js.map +1 -0
- package/{lib/index.d.ts → index.d.ts} +1 -2
- package/{lib/index.js → index.js} +0 -2
- package/index.js.map +1 -0
- package/{lib/jsx-runtime.d.ts → jsx-runtime.d.ts} +2 -2
- package/{lib/jsx-runtime.js → jsx-runtime.js} +38 -23
- package/jsx-runtime.js.map +1 -0
- package/package.json +7 -20
- package/types.d.ts +617 -0
- package/lib/Component.js.map +0 -1
- package/lib/Slot.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/jsx-runtime.js.map +0 -1
- package/lib/types.d.ts +0 -197
- /package/{lib/types.js → types.js} +0 -0
- /package/{lib/types.js.map → types.js.map} +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @typeParam PROPS - interface describing jsx props passed to this component
|
|
6
6
|
* @typeParam ROOT - type of the html root element
|
|
7
7
|
*/
|
|
8
|
-
export declare class Component<REFS = {}, PROPS = undefined, ROOT extends
|
|
8
|
+
export declare class Component<REFS = {}, PROPS = undefined, ROOT extends Element = SVGElement | HTMLElement> {
|
|
9
9
|
/** properties received from jsx (or set via constructor) */
|
|
10
10
|
readonly props: PROPS extends undefined ? {} : PROPS;
|
|
11
11
|
private _components;
|
|
@@ -16,7 +16,7 @@ export declare class Component<REFS = {}, PROPS = undefined, ROOT extends SVGEle
|
|
|
16
16
|
* parent component, only accessible after {@link bind} was called
|
|
17
17
|
* for self-bound components `this.parent = this`
|
|
18
18
|
*/
|
|
19
|
-
protected parent: Component<any, any>;
|
|
19
|
+
protected parent: Component<any, any, Element>;
|
|
20
20
|
/**
|
|
21
21
|
* jsx references stored on this component,
|
|
22
22
|
* the REFS type should be set to a interface describing what references the component will use
|
|
@@ -27,15 +27,14 @@ export declare class Component<REFS = {}, PROPS = undefined, ROOT extends SVGEle
|
|
|
27
27
|
* if component is to be used from jsx it has to have one constructor argument being the props,
|
|
28
28
|
* any other constructor signature will fail when used from jsx
|
|
29
29
|
*/
|
|
30
|
-
constructor(...props: PROPS extends undefined ? [] : [
|
|
31
|
-
constructor(props: PROPS);
|
|
30
|
+
constructor(...props: PROPS extends undefined ? [] : [props: PROPS]);
|
|
32
31
|
private attach;
|
|
33
32
|
private detach;
|
|
34
33
|
/**
|
|
35
34
|
* component render function, should return the component JSX
|
|
36
35
|
* if null is returned {@link build} call will fail with an exception
|
|
37
36
|
*/
|
|
38
|
-
protected render():
|
|
37
|
+
protected render(): Node | null;
|
|
39
38
|
/** called in {@link build} before render is called */
|
|
40
39
|
protected onBeforeRender(): void;
|
|
41
40
|
/** called in {@link build} after render is called and root is set */
|
|
@@ -75,7 +74,7 @@ export declare class Component<REFS = {}, PROPS = undefined, ROOT extends SVGEle
|
|
|
75
74
|
* calls {@link render} and sets {@link root}
|
|
76
75
|
* @returns the created DOM element ({@link root})
|
|
77
76
|
*/
|
|
78
|
-
build():
|
|
77
|
+
build(): Node;
|
|
79
78
|
/**
|
|
80
79
|
* add component to a parent component,
|
|
81
80
|
* attach component if parent component is attached
|
|
@@ -83,7 +82,7 @@ export declare class Component<REFS = {}, PROPS = undefined, ROOT extends SVGEle
|
|
|
83
82
|
* a component can be self-bound by passing itself as parent (`x.bind(x)`),
|
|
84
83
|
* self-bound components get automatically attached
|
|
85
84
|
*/
|
|
86
|
-
bind(parent: Component<any, any>): void;
|
|
85
|
+
bind(parent: Component<any, any, Element>): void;
|
|
87
86
|
/**
|
|
88
87
|
* render the component, add it as a child of {@link parent} and insert it into DOM
|
|
89
88
|
*
|
|
@@ -93,7 +92,7 @@ export declare class Component<REFS = {}, PROPS = undefined, ROOT extends SVGEle
|
|
|
93
92
|
* @param target - DOM element to add the component to, if unset or null `parent.root` is used, if a component is passed it's root will be used
|
|
94
93
|
* @param before - add the element before the given DOM child, a number can be used as a child index, if unset adds the element as the last child
|
|
95
94
|
*/
|
|
96
|
-
create(parent: Component<any, any>, target?:
|
|
95
|
+
create(parent: Component<any, any, Element>, target?: Node | Component<any, any, Element> | null, before?: Node | Component<any, any, Element> | number): void;
|
|
97
96
|
/**
|
|
98
97
|
* render the component, add it as a child of {@link parent} and add it to DOM by replacing a existing element or component
|
|
99
98
|
*
|
|
@@ -102,7 +101,7 @@ export declare class Component<REFS = {}, PROPS = undefined, ROOT extends SVGEle
|
|
|
102
101
|
* @param parent - parent component
|
|
103
102
|
* @param target - component or DOM element to replace, if component is passed {@link destroy} will be called on it
|
|
104
103
|
*/
|
|
105
|
-
replace(parent: Component<any, any>, target: Element | Component<any, any>): void;
|
|
104
|
+
replace(parent: Component<any, any, Element>, target: Element | Component<any, any, Element>): void;
|
|
106
105
|
/**
|
|
107
106
|
* render the component, add it to DOM and self-bound, meant to be used for creating the root component
|
|
108
107
|
*
|
|
@@ -118,5 +117,5 @@ export declare class Component<REFS = {}, PROPS = undefined, ROOT extends SVGEle
|
|
|
118
117
|
/** public accessor for {@link root} */
|
|
119
118
|
get htmlRoot(): ROOT;
|
|
120
119
|
/** child component list accessor */
|
|
121
|
-
get components(): Readonly<Component<any, any,
|
|
120
|
+
get components(): Readonly<Component<any, any, Element>[]>;
|
|
122
121
|
}
|
|
@@ -26,6 +26,9 @@ export class Component {
|
|
|
26
26
|
this._components.forEach(x => x.detach());
|
|
27
27
|
this._components = [];
|
|
28
28
|
this._attached = false;
|
|
29
|
+
this.refs = {};
|
|
30
|
+
this.parent = null;
|
|
31
|
+
this.root = null;
|
|
29
32
|
this.onDetach();
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
@@ -137,7 +140,7 @@ export class Component {
|
|
|
137
140
|
target = target.root;
|
|
138
141
|
}
|
|
139
142
|
if (typeof before === "number") {
|
|
140
|
-
before = target.
|
|
143
|
+
before = before < target.childNodes.length ? target.childNodes[Math.max(0, before)] : undefined;
|
|
141
144
|
}
|
|
142
145
|
else if (before instanceof Component) {
|
|
143
146
|
before = before.root;
|
|
@@ -176,8 +179,6 @@ export class Component {
|
|
|
176
179
|
}
|
|
177
180
|
/** remove this component from DOM and its parent component */
|
|
178
181
|
destroy() {
|
|
179
|
-
this.detach();
|
|
180
|
-
this.refs = {};
|
|
181
182
|
if (this.root) {
|
|
182
183
|
this.root.remove();
|
|
183
184
|
}
|
|
@@ -187,8 +188,7 @@ export class Component {
|
|
|
187
188
|
this.parent._components.splice(index, 1);
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
|
-
this.
|
|
191
|
-
this.root = null;
|
|
191
|
+
this.detach();
|
|
192
192
|
}
|
|
193
193
|
/** true if component is attached */
|
|
194
194
|
get attached() {
|
package/Component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.js","sourceRoot":"","sources":["../src/Component.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,OAAO,SAAS;IA4BrB,YAAmB,KAAW;QAC7B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAA;QACrB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;QACtB,IAAI,CAAC,IAAI,GAAG,EAAU,CAAA;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACnB,CAAC;IAEO,MAAM;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACrD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;YACrC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;gBAC1B,SAAS,CAAC,MAAM,EAAE,CAAA;YACnB,CAAC;QACF,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,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AW,QAAQ;QAClB,OAAO,IAAI,CAAC,IAAI,CAAA;IACjB,CAAC;IAED,oCAAoC;IACpC,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,WAAW,CAAA;IACxB,CAAC;CACD"}
|
package/README.md
CHANGED
|
@@ -99,13 +99,11 @@ Same as `create` but replaces `target` instead of being appended to it.
|
|
|
99
99
|
#### The `createOrphanized` member function
|
|
100
100
|
|
|
101
101
|
```typescript
|
|
102
|
-
createOrphanized(target?:
|
|
102
|
+
createOrphanized(target?: Node)
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
Same as `create` but intended to create the root component. The component is automatically set as attached after render.
|
|
106
106
|
|
|
107
|
-
If `target` is `null` then component is appended to `document.body`.
|
|
108
|
-
|
|
109
107
|
## JSX attribute handling
|
|
110
108
|
|
|
111
109
|
### `ref` attribute
|
package/{lib/Slot.js → Slot.js}
RENAMED
package/Slot.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slot.js","sourceRoot":"","sources":["../src/Slot.ts"],"names":[],"mappings":"AAEA,MAAM,SAAU,SAAQ,KAAmB;IAE1C,YAAa,IAAY,EAAE,QAAsB;QAChD,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACpB,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,IAAI,CAAC,KAA6C;IACjE,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAQ,CAAA;AACxD,CAAC;AAED,WAAiB,IAAI;IACpB;;;;;OAKG;IACH,SAAgB,OAAO,CAA0B,KAAmB,EAAE,QAA6B,EAAE;QACpG,IAAI,KAAK,YAAY,SAAS,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YAChD,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;YAC5B,KAAK,CAAC,GAAG,EAAE,CAAA;QACZ,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;gBACrB,IAAI,IAAI,YAAY,SAAS,EAAE,CAAC;oBAC/B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;wBACjB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;oBAC3B,CAAC;oBACD,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;gBAChB,CAAC;qBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;oBAChC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;gBACrB,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,KAAU,CAAA;IAClB,CAAC;IAlBe,YAAO,UAkBtB,CAAA;AACF,CAAC,EA1BgB,IAAI,KAAJ,IAAI,QA0BpB"}
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -4,6 +4,6 @@ export declare function createElement(type: any, props: any, ...children: any[])
|
|
|
4
4
|
/** JSX fragment component, <> can be used as an alias */
|
|
5
5
|
export declare function Fragment(props: {
|
|
6
6
|
children: StagnateNode;
|
|
7
|
-
}):
|
|
7
|
+
}): DocumentFragment;
|
|
8
8
|
export { jsx as jsxs };
|
|
9
|
-
export { JSX };
|
|
9
|
+
export type { JSX };
|
|
@@ -1,34 +1,48 @@
|
|
|
1
1
|
import { Component } from "./Component";
|
|
2
|
-
function
|
|
2
|
+
function collectArray(data, accumulator) {
|
|
3
3
|
for (let i = 0; i < data.length; i += 1) {
|
|
4
4
|
const value = data[i];
|
|
5
5
|
if (Array.isArray(value)) {
|
|
6
|
-
|
|
6
|
+
collectArray(value, accumulator);
|
|
7
7
|
}
|
|
8
8
|
else if (value) {
|
|
9
9
|
accumulator.push(value);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function collectString(data, delimiter) {
|
|
14
14
|
if (Array.isArray(data)) {
|
|
15
15
|
const accumulator = [];
|
|
16
|
-
|
|
17
|
-
return accumulator;
|
|
16
|
+
collectArray(data, accumulator);
|
|
17
|
+
return accumulator.join(delimiter);
|
|
18
|
+
}
|
|
19
|
+
return data || "";
|
|
20
|
+
}
|
|
21
|
+
function collectNodes(data, parent) {
|
|
22
|
+
if (Array.isArray(data)) {
|
|
23
|
+
for (let i = 0; i < data.length; i += 1) {
|
|
24
|
+
const value = data[i];
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
collectNodes(value, parent);
|
|
27
|
+
}
|
|
28
|
+
else if (value) {
|
|
29
|
+
parent.appendChild(value instanceof Node ? value : document.createTextNode(value));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (data) {
|
|
34
|
+
parent.appendChild(data instanceof Node ? data : document.createTextNode(data));
|
|
18
35
|
}
|
|
19
|
-
return data ? [data] : [];
|
|
20
36
|
}
|
|
21
37
|
export function jsx(type, props) {
|
|
22
38
|
if (type == "text") {
|
|
23
|
-
const
|
|
24
|
-
const element = document.createTextNode(children.length ? children.join() : (props.value || ""));
|
|
39
|
+
const element = document.createTextNode(collectString(props.children, ""));
|
|
25
40
|
if (props.ref) {
|
|
26
41
|
props.ref(element);
|
|
27
42
|
}
|
|
28
43
|
return element;
|
|
29
44
|
}
|
|
30
45
|
else if (typeof type == "string") {
|
|
31
|
-
const children = collect(props.children);
|
|
32
46
|
let element;
|
|
33
47
|
let isSvg = false;
|
|
34
48
|
if (type.startsWith("svg")) {
|
|
@@ -39,32 +53,32 @@ export function jsx(type, props) {
|
|
|
39
53
|
element = document.createElement(type);
|
|
40
54
|
}
|
|
41
55
|
for (const key in props) {
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
let value = props[key];
|
|
57
|
+
if (value === undefined) {
|
|
58
|
+
// no-op
|
|
59
|
+
}
|
|
60
|
+
else if (key == "children") {
|
|
61
|
+
collectNodes(value, element);
|
|
44
62
|
}
|
|
45
63
|
else if (key.startsWith("on")) {
|
|
46
|
-
element.addEventListener(key.slice(2).toLowerCase(),
|
|
64
|
+
element.addEventListener(key.slice(2).toLowerCase(), value);
|
|
47
65
|
}
|
|
48
66
|
else if (key == "innerHTML") {
|
|
49
|
-
element.innerHTML =
|
|
67
|
+
element.innerHTML = value;
|
|
50
68
|
}
|
|
51
69
|
else if (key == "ref") {
|
|
52
|
-
|
|
70
|
+
value(element);
|
|
53
71
|
}
|
|
54
72
|
else if (key == "class") {
|
|
55
|
-
|
|
56
|
-
if (Array.isArray(value)) {
|
|
57
|
-
value = collect(value).join(" ");
|
|
58
|
-
}
|
|
73
|
+
value = collectString(value, " ");
|
|
59
74
|
if (value) {
|
|
60
75
|
element.setAttribute("class", value);
|
|
61
76
|
}
|
|
62
77
|
}
|
|
63
78
|
else if (key == "style") {
|
|
64
|
-
Object.assign(element.style,
|
|
79
|
+
Object.assign(element.style, value);
|
|
65
80
|
}
|
|
66
81
|
else {
|
|
67
|
-
const value = props[key];
|
|
68
82
|
const attribute = isSvg ? key : key.toLowerCase();
|
|
69
83
|
if (value === true) {
|
|
70
84
|
element.setAttribute(attribute, "");
|
|
@@ -75,12 +89,11 @@ export function jsx(type, props) {
|
|
|
75
89
|
else if (typeof value == "string") {
|
|
76
90
|
element.setAttribute(attribute, value);
|
|
77
91
|
}
|
|
78
|
-
else
|
|
92
|
+
else {
|
|
79
93
|
element.setAttribute(attribute, value.toString());
|
|
80
94
|
}
|
|
81
95
|
}
|
|
82
96
|
}
|
|
83
|
-
children.forEach(x => element.appendChild(x instanceof Node ? x : document.createTextNode(x.toString())));
|
|
84
97
|
return element;
|
|
85
98
|
}
|
|
86
99
|
else if (type.prototype instanceof Component) {
|
|
@@ -105,7 +118,9 @@ export function createElement(type, props, ...children) {
|
|
|
105
118
|
}
|
|
106
119
|
/** JSX fragment component, <> can be used as an alias */
|
|
107
120
|
export function Fragment(props) {
|
|
108
|
-
|
|
121
|
+
const fragment = document.createDocumentFragment();
|
|
122
|
+
collectNodes(props.children, fragment);
|
|
123
|
+
return fragment;
|
|
109
124
|
}
|
|
110
125
|
export { jsx as jsxs };
|
|
111
126
|
//# 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,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,SAAS,YAAY,CAAI,IAAyB,EAAE,WAAgB;IACnE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;QACjC,CAAC;aAAM,IAAI,KAAK,EAAE,CAAC;YAClB,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACxB,CAAC;IACF,CAAC;AACF,CAAC;AAED,SAAS,aAAa,CAAC,IAAuC,EAAE,SAAiB;IAChF,IAAI,KAAK,CAAC,OAAO,CA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YACf,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QACrB,CAAC;QACD,OAAO,OAAO,CAAA;IACf,CAAC;SAAM,CAAC;QACP,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA;QAC3B,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;YACf,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACnB,CAAC;QACD,OAAO,OAAO,CAAA;IACf,CAAC;AACF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAS,EAAE,KAAU,EAAE,GAAG,QAAe;IACtE,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;IACzB,OAAO,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACxB,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,QAAQ,CAAC,KAA+B;IACvD,MAAM,QAAQ,GAAG,QAAQ,CAAC,sBAAsB,EAAE,CAAA;IAClD,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IACtC,OAAO,QAAQ,CAAA;AAChB,CAAC;AAED,OAAO,EAAE,GAAG,IAAI,IAAI,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stagnate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "non-reactive react",
|
|
5
|
-
"main": "
|
|
6
|
-
"files": [
|
|
7
|
-
"lib/*"
|
|
8
|
-
],
|
|
9
|
-
"directories": {
|
|
10
|
-
"lib": "lib"
|
|
11
|
-
},
|
|
12
|
-
"exports": {
|
|
13
|
-
".": "./lib/index.js",
|
|
14
|
-
"./jsx-runtime": "./lib/jsx-runtime.js"
|
|
15
|
-
},
|
|
16
|
-
"typesVersions": {
|
|
17
|
-
"*": {
|
|
18
|
-
"*": ["./lib/*", "./lib/index.d.js"]
|
|
19
|
-
}
|
|
20
|
-
},
|
|
5
|
+
"main": "index.js",
|
|
21
6
|
"repository": {
|
|
22
7
|
"type": "git",
|
|
23
8
|
"url": "git+https://github.com/md5crypt/stagnate.git"
|
|
24
9
|
},
|
|
25
10
|
"scripts": {
|
|
26
11
|
"build": "tsc",
|
|
27
|
-
"start": "tsc --watch"
|
|
12
|
+
"start": "tsc --watch",
|
|
13
|
+
"link": "node publish.js symlink",
|
|
14
|
+
"prepublishOnly": "node publish.js verify && tsc --outDir .",
|
|
15
|
+
"pub": "node publish.js pre-publish && cd dist-package && npm publish && cd .. && node publish.js post-publish"
|
|
28
16
|
},
|
|
29
17
|
"author": "Marek Korzeniowski",
|
|
30
18
|
"license": "MIT",
|
|
@@ -39,10 +27,9 @@
|
|
|
39
27
|
],
|
|
40
28
|
"sideEffects": false,
|
|
41
29
|
"devDependencies": {
|
|
42
|
-
"@types/node": "^18.7.15",
|
|
43
30
|
"@typescript-eslint/eslint-plugin": "^5.36.2",
|
|
44
31
|
"@typescript-eslint/parser": "^5.36.2",
|
|
45
32
|
"eslint": "^8.23.0",
|
|
46
|
-
"typescript": "^
|
|
33
|
+
"typescript": "^5.9.2"
|
|
47
34
|
}
|
|
48
35
|
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
export type CollectableArray<T> = (CollectableArray<T> | T | undefined | null | false)[];
|
|
2
|
+
export type CollectableValue<T> = CollectableArray<T> | T | undefined | null | false;
|
|
3
|
+
export type RefererPolicy = "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
|
|
4
|
+
export type LinkTarget = "_self" | "_blank" | "_parent" | "_top";
|
|
5
|
+
export interface EventHandlers {
|
|
6
|
+
onAnimationCancel?: (ev: AnimationEvent) => void;
|
|
7
|
+
onAnimationEnd?: (ev: AnimationEvent) => void;
|
|
8
|
+
onAnimationIteration?: (ev: AnimationEvent) => void;
|
|
9
|
+
onAnimationStart?: (ev: AnimationEvent) => void;
|
|
10
|
+
onTransitionCancel?: (ev: TransitionEvent) => void;
|
|
11
|
+
onTransitionEnd?: (ev: TransitionEvent) => void;
|
|
12
|
+
onTransitionRun?: (ev: TransitionEvent) => void;
|
|
13
|
+
onTransitionStart?: (ev: TransitionEvent) => void;
|
|
14
|
+
onCopy?: (ev: ClipboardEvent) => void;
|
|
15
|
+
onCut?: (ev: ClipboardEvent) => void;
|
|
16
|
+
onPaste?: (ev: ClipboardEvent) => void;
|
|
17
|
+
onCompositionStart?: (ev: CompositionEvent) => void;
|
|
18
|
+
onCompositionUpdate?: (ev: CompositionEvent) => void;
|
|
19
|
+
onCompositionEnd?: (ev: CompositionEvent) => void;
|
|
20
|
+
onFocus?: (ev: FocusEvent) => void;
|
|
21
|
+
onBlur?: (ev: FocusEvent) => void;
|
|
22
|
+
onFocusIn?: (ev: FocusEvent) => void;
|
|
23
|
+
onFocusOut?: (ev: FocusEvent) => void;
|
|
24
|
+
onBeforeInput?: (ev: InputEvent) => void;
|
|
25
|
+
onChange?: (ev: InputEvent) => void;
|
|
26
|
+
onInput?: (ev: InputEvent) => void;
|
|
27
|
+
onInvalid?: (ev: Event) => void;
|
|
28
|
+
onReset?: (ev: Event) => void;
|
|
29
|
+
onSubmit?: (ev: SubmitEvent) => void;
|
|
30
|
+
onKeyDown?: (ev: KeyboardEvent) => void;
|
|
31
|
+
onKeyUp?: (ev: KeyboardEvent) => void;
|
|
32
|
+
onAuxClick?: (ev: MouseEvent) => void;
|
|
33
|
+
onClick?: (ev: MouseEvent) => void;
|
|
34
|
+
onContextMenu?: (ev: MouseEvent) => void;
|
|
35
|
+
onDblClick?: (ev: MouseEvent) => void;
|
|
36
|
+
onMouseDown?: (ev: MouseEvent) => void;
|
|
37
|
+
onMouseEnter?: (ev: MouseEvent) => void;
|
|
38
|
+
onMouseLeave?: (ev: MouseEvent) => void;
|
|
39
|
+
onMouseMove?: (ev: MouseEvent) => void;
|
|
40
|
+
onMouseOut?: (ev: MouseEvent) => void;
|
|
41
|
+
onMouseOver?: (ev: MouseEvent) => void;
|
|
42
|
+
onMouseUp?: (ev: MouseEvent) => void;
|
|
43
|
+
onWheel?: (ev: WheelEvent) => void;
|
|
44
|
+
onPointerCancel?: (ev: PointerEvent) => void;
|
|
45
|
+
onPointerDown?: (ev: PointerEvent) => void;
|
|
46
|
+
onPointerEnter?: (ev: PointerEvent) => void;
|
|
47
|
+
onPointerLeave?: (ev: PointerEvent) => void;
|
|
48
|
+
onPointerMove?: (ev: PointerEvent) => void;
|
|
49
|
+
onPointerOut?: (ev: PointerEvent) => void;
|
|
50
|
+
onPointerOver?: (ev: PointerEvent) => void;
|
|
51
|
+
onPointerUp?: (ev: PointerEvent) => void;
|
|
52
|
+
onGotPointerCapture?: (ev: PointerEvent) => void;
|
|
53
|
+
onLostPointerCapture?: (ev: PointerEvent) => void;
|
|
54
|
+
onDrag?: (ev: DragEvent) => void;
|
|
55
|
+
onDragEnd?: (ev: DragEvent) => void;
|
|
56
|
+
onDragEnter?: (ev: DragEvent) => void;
|
|
57
|
+
onDragLeave?: (ev: DragEvent) => void;
|
|
58
|
+
onDragOver?: (ev: DragEvent) => void;
|
|
59
|
+
onDragStart?: (ev: DragEvent) => void;
|
|
60
|
+
onDrop?: (ev: DragEvent) => void;
|
|
61
|
+
onCanPlay?: (ev: Event) => void;
|
|
62
|
+
onCanPlayThrough?: (ev: Event) => void;
|
|
63
|
+
onDurationChange?: (ev: Event) => void;
|
|
64
|
+
onEmptied?: (ev: Event) => void;
|
|
65
|
+
onEnded?: (ev: Event) => void;
|
|
66
|
+
onLoadedData?: (ev: Event) => void;
|
|
67
|
+
onLoadedMetadata?: (ev: Event) => void;
|
|
68
|
+
onLoadStart?: (ev: Event) => void;
|
|
69
|
+
onPause?: (ev: Event) => void;
|
|
70
|
+
onPlay?: (ev: Event) => void;
|
|
71
|
+
onPlaying?: (ev: Event) => void;
|
|
72
|
+
onRateChange?: (ev: Event) => void;
|
|
73
|
+
onSeeked?: (ev: Event) => void;
|
|
74
|
+
onSeeking?: (ev: Event) => void;
|
|
75
|
+
onStalled?: (ev: Event) => void;
|
|
76
|
+
onSuspend?: (ev: Event) => void;
|
|
77
|
+
onTimeUpdate?: (ev: Event) => void;
|
|
78
|
+
onVolumeChange?: (ev: Event) => void;
|
|
79
|
+
onWaiting?: (ev: Event) => void;
|
|
80
|
+
onClose?: (ev: Event) => void;
|
|
81
|
+
onError?: (ev: Event) => void;
|
|
82
|
+
onLoad?: (ev: Event) => void;
|
|
83
|
+
onResize?: (ev: UIEvent) => void;
|
|
84
|
+
onScroll?: (ev: Event) => void;
|
|
85
|
+
onToggle?: (ev: Event) => void;
|
|
86
|
+
}
|
|
87
|
+
export interface GlobalAttributes<T> extends EventHandlers {
|
|
88
|
+
ref?: (value: T) => void;
|
|
89
|
+
id?: string;
|
|
90
|
+
class?: CollectableValue<string>;
|
|
91
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
92
|
+
title?: string;
|
|
93
|
+
tabIndex?: number;
|
|
94
|
+
innerHTML?: string;
|
|
95
|
+
accessKey?: string;
|
|
96
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters";
|
|
97
|
+
autoFocus?: boolean;
|
|
98
|
+
contentEditable?: "true" | "false" | "plaintext-only";
|
|
99
|
+
dir?: "ltr" | "rtl" | "auto";
|
|
100
|
+
draggable?: "true" | "false";
|
|
101
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send";
|
|
102
|
+
hidden?: boolean;
|
|
103
|
+
inert?: boolean;
|
|
104
|
+
inputMode?: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
|
|
105
|
+
lang?: string;
|
|
106
|
+
nonce?: string;
|
|
107
|
+
popover?: "auto" | "manual";
|
|
108
|
+
spellcheck?: "true" | "false";
|
|
109
|
+
translate?: "yes" | "no";
|
|
110
|
+
is?: string;
|
|
111
|
+
virtualKeyboardPolicy?: "auto" | "manual";
|
|
112
|
+
role?: string;
|
|
113
|
+
/** Web components / shadow DOM related */
|
|
114
|
+
slot?: string;
|
|
115
|
+
part?: string;
|
|
116
|
+
exportParts?: string;
|
|
117
|
+
/** Micro data */
|
|
118
|
+
itemId?: string;
|
|
119
|
+
itemProp?: string;
|
|
120
|
+
itemRef?: string;
|
|
121
|
+
itemScope?: boolean;
|
|
122
|
+
itemType?: string;
|
|
123
|
+
[key: `aria-${string}`]: string | number | undefined;
|
|
124
|
+
[key: `data-${string}`]: string | number | undefined;
|
|
125
|
+
}
|
|
126
|
+
export interface FormSubmitterAttributes {
|
|
127
|
+
form?: string;
|
|
128
|
+
formAction?: string;
|
|
129
|
+
formEncType?: "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
|
|
130
|
+
formMethod?: "get" | "post" | "dialog";
|
|
131
|
+
formNoValidate?: boolean;
|
|
132
|
+
formTarget?: LinkTarget;
|
|
133
|
+
}
|
|
134
|
+
export interface HTMLElementAttributes<T> extends GlobalAttributes<T> {
|
|
135
|
+
children?: CollectableValue<JSX.Element | string>;
|
|
136
|
+
}
|
|
137
|
+
export interface TextElementAttributes {
|
|
138
|
+
ref?: (value: Text) => void;
|
|
139
|
+
children?: CollectableValue<string>;
|
|
140
|
+
}
|
|
141
|
+
export interface ImageElementAttributes extends GlobalAttributes<HTMLImageElement> {
|
|
142
|
+
alt?: string;
|
|
143
|
+
src?: string;
|
|
144
|
+
srcSet?: string;
|
|
145
|
+
sizes?: string;
|
|
146
|
+
width?: number | string;
|
|
147
|
+
height?: number | string;
|
|
148
|
+
crossOrigin?: "anonymous" | "use-credentials";
|
|
149
|
+
decoding?: "sync" | "async" | "auto";
|
|
150
|
+
fetchPriority?: "high" | "low" | "auto";
|
|
151
|
+
isMap?: boolean;
|
|
152
|
+
useMap?: string;
|
|
153
|
+
loading?: "eager" | "lazy";
|
|
154
|
+
referrerPolicy?: RefererPolicy;
|
|
155
|
+
elementTiming?: string;
|
|
156
|
+
}
|
|
157
|
+
export interface AnchorElementAttributes extends HTMLElementAttributes<HTMLAnchorElement> {
|
|
158
|
+
href?: string;
|
|
159
|
+
target?: LinkTarget;
|
|
160
|
+
rel?: string;
|
|
161
|
+
hreflang?: string;
|
|
162
|
+
referrerPolicy?: RefererPolicy;
|
|
163
|
+
download?: boolean | string;
|
|
164
|
+
ping?: string;
|
|
165
|
+
type?: string;
|
|
166
|
+
}
|
|
167
|
+
export interface InputElementAttributes extends GlobalAttributes<HTMLInputElement>, FormSubmitterAttributes {
|
|
168
|
+
type?: ("button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week");
|
|
169
|
+
alt?: string;
|
|
170
|
+
checked?: boolean;
|
|
171
|
+
accept?: string;
|
|
172
|
+
capture?: boolean | "user" | "environment";
|
|
173
|
+
autocomplete?: string;
|
|
174
|
+
autoFocus?: boolean;
|
|
175
|
+
dirName?: string;
|
|
176
|
+
disabled?: boolean;
|
|
177
|
+
list?: string;
|
|
178
|
+
max?: number | string;
|
|
179
|
+
maxLength?: number;
|
|
180
|
+
min?: number | string;
|
|
181
|
+
minLength?: number;
|
|
182
|
+
multiple?: boolean;
|
|
183
|
+
name?: string;
|
|
184
|
+
pattern?: string;
|
|
185
|
+
placeholder?: string;
|
|
186
|
+
readonly?: boolean;
|
|
187
|
+
required?: boolean;
|
|
188
|
+
size?: number;
|
|
189
|
+
src?: string;
|
|
190
|
+
step?: number | "any";
|
|
191
|
+
width?: string | number;
|
|
192
|
+
height?: string | number;
|
|
193
|
+
value?: string | number;
|
|
194
|
+
inputMode?: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
|
|
195
|
+
popoverTarget?: string;
|
|
196
|
+
popoverTargetAction?: "toggle" | "show" | "hide";
|
|
197
|
+
}
|
|
198
|
+
export interface TextAreaElementAttributes extends GlobalAttributes<HTMLTextAreaElement> {
|
|
199
|
+
cols?: number;
|
|
200
|
+
rows?: number;
|
|
201
|
+
autoFocus?: boolean;
|
|
202
|
+
disabled?: boolean;
|
|
203
|
+
maxLength?: number;
|
|
204
|
+
minLength?: number;
|
|
205
|
+
name?: string;
|
|
206
|
+
placeholder?: string;
|
|
207
|
+
readonly?: boolean;
|
|
208
|
+
required?: boolean;
|
|
209
|
+
value?: string;
|
|
210
|
+
wrap?: "hard" | "soft" | "off";
|
|
211
|
+
dirName?: string;
|
|
212
|
+
form?: string;
|
|
213
|
+
children?: CollectableValue<string>;
|
|
214
|
+
}
|
|
215
|
+
export interface SelectElementAttributes extends GlobalAttributes<HTMLSelectElement> {
|
|
216
|
+
autoFocus?: boolean;
|
|
217
|
+
disabled?: boolean;
|
|
218
|
+
form?: string;
|
|
219
|
+
multiple?: boolean;
|
|
220
|
+
name?: string;
|
|
221
|
+
required?: boolean;
|
|
222
|
+
size?: number;
|
|
223
|
+
autocomplete?: string;
|
|
224
|
+
value?: string | number | string[];
|
|
225
|
+
children?: CollectableValue<JSX.Element>;
|
|
226
|
+
}
|
|
227
|
+
export interface OptionElementAttributes extends GlobalAttributes<HTMLOptionElement> {
|
|
228
|
+
disabled?: boolean;
|
|
229
|
+
label?: string;
|
|
230
|
+
selected?: boolean;
|
|
231
|
+
value?: string;
|
|
232
|
+
children?: CollectableValue<string>;
|
|
233
|
+
}
|
|
234
|
+
export interface OptGroupElementAttributes extends GlobalAttributes<HTMLOptGroupElement> {
|
|
235
|
+
disabled?: boolean;
|
|
236
|
+
label?: string;
|
|
237
|
+
children?: CollectableValue<JSX.Element>;
|
|
238
|
+
}
|
|
239
|
+
export interface LabelElementAttributes extends HTMLElementAttributes<HTMLLabelElement> {
|
|
240
|
+
for?: string;
|
|
241
|
+
form?: string;
|
|
242
|
+
}
|
|
243
|
+
export interface ButtonElementAttributes extends HTMLElementAttributes<HTMLButtonElement>, FormSubmitterAttributes {
|
|
244
|
+
autoFocus?: boolean;
|
|
245
|
+
disabled?: boolean;
|
|
246
|
+
name?: string;
|
|
247
|
+
type?: "button" | "submit" | "reset";
|
|
248
|
+
value?: string;
|
|
249
|
+
popoverTarget?: string;
|
|
250
|
+
popoverTargetAction?: "toggle" | "show" | "hide";
|
|
251
|
+
}
|
|
252
|
+
export interface FieldsetElementAttributes extends HTMLElementAttributes<HTMLFieldSetElement> {
|
|
253
|
+
disabled?: boolean;
|
|
254
|
+
form?: string;
|
|
255
|
+
name?: string;
|
|
256
|
+
}
|
|
257
|
+
export interface OutputElementAttributes extends HTMLElementAttributes<HTMLOutputElement> {
|
|
258
|
+
for?: string;
|
|
259
|
+
form?: string;
|
|
260
|
+
name?: string;
|
|
261
|
+
value?: string;
|
|
262
|
+
}
|
|
263
|
+
export interface ProgressElementAttributes extends HTMLElementAttributes<HTMLProgressElement> {
|
|
264
|
+
max?: number;
|
|
265
|
+
value?: number;
|
|
266
|
+
}
|
|
267
|
+
export interface MeterElementAttributes extends HTMLElementAttributes<HTMLMeterElement> {
|
|
268
|
+
value?: number;
|
|
269
|
+
min?: number;
|
|
270
|
+
max?: number;
|
|
271
|
+
low?: number;
|
|
272
|
+
high?: number;
|
|
273
|
+
optimum?: number;
|
|
274
|
+
form?: string;
|
|
275
|
+
}
|
|
276
|
+
export interface FormElementAttributes extends HTMLElementAttributes<HTMLFormElement> {
|
|
277
|
+
acceptCharset?: string;
|
|
278
|
+
action?: string;
|
|
279
|
+
autocomplete?: "on" | "off" | string;
|
|
280
|
+
encType?: "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
|
|
281
|
+
method?: "get" | "post" | "dialog";
|
|
282
|
+
name?: string;
|
|
283
|
+
noValidate?: boolean;
|
|
284
|
+
rel?: string;
|
|
285
|
+
target?: LinkTarget;
|
|
286
|
+
}
|
|
287
|
+
export interface IframeElementAttributes extends GlobalAttributes<HTMLIFrameElement> {
|
|
288
|
+
src?: string;
|
|
289
|
+
srcDoc?: string;
|
|
290
|
+
name?: string;
|
|
291
|
+
allow?: string;
|
|
292
|
+
allowFullScreen?: boolean;
|
|
293
|
+
referrerPolicy?: RefererPolicy;
|
|
294
|
+
sandbox?: string;
|
|
295
|
+
loading?: "eager" | "lazy";
|
|
296
|
+
width?: number | string;
|
|
297
|
+
height?: number | string;
|
|
298
|
+
children?: CollectableValue<string>;
|
|
299
|
+
}
|
|
300
|
+
export interface SvgElementAttributes extends HTMLElementAttributes<SVGElement> {
|
|
301
|
+
viewBox?: string;
|
|
302
|
+
fill?: string;
|
|
303
|
+
width?: number | string;
|
|
304
|
+
height?: number | string;
|
|
305
|
+
}
|
|
306
|
+
export interface AudioElementAttributes extends HTMLElementAttributes<HTMLAudioElement> {
|
|
307
|
+
src?: string;
|
|
308
|
+
autoPlay?: boolean;
|
|
309
|
+
controls?: boolean;
|
|
310
|
+
loop?: boolean;
|
|
311
|
+
muted?: boolean;
|
|
312
|
+
preload?: "none" | "metadata" | "auto" | true;
|
|
313
|
+
crossOrigin?: "anonymous" | "use-credentials";
|
|
314
|
+
controlsList?: string;
|
|
315
|
+
}
|
|
316
|
+
export interface VideoElementAttributes extends HTMLElementAttributes<HTMLVideoElement> {
|
|
317
|
+
src?: string;
|
|
318
|
+
autoPlay?: boolean;
|
|
319
|
+
controls?: boolean;
|
|
320
|
+
loop?: boolean;
|
|
321
|
+
muted?: boolean;
|
|
322
|
+
preload?: "none" | "metadata" | "auto" | true;
|
|
323
|
+
crossOrigin?: "anonymous" | "use-credentials";
|
|
324
|
+
controlsList?: string;
|
|
325
|
+
playsInline?: boolean;
|
|
326
|
+
width?: string | number;
|
|
327
|
+
height?: string | number;
|
|
328
|
+
poster?: string;
|
|
329
|
+
}
|
|
330
|
+
export interface SourceElementAttributes extends GlobalAttributes<HTMLSourceElement> {
|
|
331
|
+
src?: string;
|
|
332
|
+
type?: string;
|
|
333
|
+
media?: string;
|
|
334
|
+
srcSet?: string;
|
|
335
|
+
sizes?: string;
|
|
336
|
+
}
|
|
337
|
+
export interface TrackElementAttributes extends GlobalAttributes<HTMLTrackElement> {
|
|
338
|
+
default?: boolean;
|
|
339
|
+
kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata";
|
|
340
|
+
label?: string;
|
|
341
|
+
src?: string;
|
|
342
|
+
srcLang?: string;
|
|
343
|
+
}
|
|
344
|
+
export interface CanvasElementAttributes extends HTMLElementAttributes<HTMLCanvasElement> {
|
|
345
|
+
width?: string | number;
|
|
346
|
+
height?: string | number;
|
|
347
|
+
}
|
|
348
|
+
export interface MapElementAttributes extends HTMLElementAttributes<HTMLMapElement> {
|
|
349
|
+
name?: string;
|
|
350
|
+
}
|
|
351
|
+
export interface AreaElementAttributes extends GlobalAttributes<HTMLAreaElement> {
|
|
352
|
+
alt?: string;
|
|
353
|
+
coords?: string;
|
|
354
|
+
download?: boolean | string;
|
|
355
|
+
href?: string;
|
|
356
|
+
ping?: string;
|
|
357
|
+
referrerPolicy?: RefererPolicy;
|
|
358
|
+
rel?: string;
|
|
359
|
+
shape?: "rect" | "circle" | "poly" | "default";
|
|
360
|
+
target?: LinkTarget;
|
|
361
|
+
}
|
|
362
|
+
export interface ColGroupElementAttributes extends HTMLElementAttributes<HTMLTableColElement> {
|
|
363
|
+
span?: number;
|
|
364
|
+
}
|
|
365
|
+
export interface ColElementAttributes extends GlobalAttributes<HTMLTableColElement> {
|
|
366
|
+
span?: number;
|
|
367
|
+
}
|
|
368
|
+
export interface ThElementAttributes extends HTMLElementAttributes<HTMLTableCellElement> {
|
|
369
|
+
abbr?: string;
|
|
370
|
+
colSpan?: number;
|
|
371
|
+
rowSpan?: number;
|
|
372
|
+
headers?: string;
|
|
373
|
+
scope?: "row" | "col" | "rowgroup" | "colgroup" | "auto";
|
|
374
|
+
}
|
|
375
|
+
export interface TdElementAttributes extends HTMLElementAttributes<HTMLTableCellElement> {
|
|
376
|
+
colSpan?: number;
|
|
377
|
+
rowSpan?: number;
|
|
378
|
+
headers?: string;
|
|
379
|
+
}
|
|
380
|
+
export interface OlElementAttributes extends HTMLElementAttributes<HTMLOListElement> {
|
|
381
|
+
reversed?: boolean;
|
|
382
|
+
start?: number;
|
|
383
|
+
type?: "1" | "a" | "A" | "i" | "I";
|
|
384
|
+
}
|
|
385
|
+
export interface LiElementAttributes extends HTMLElementAttributes<HTMLLIElement> {
|
|
386
|
+
value?: number;
|
|
387
|
+
}
|
|
388
|
+
export interface BlockquoteElementAttributes extends HTMLElementAttributes<HTMLQuoteElement> {
|
|
389
|
+
cite?: string;
|
|
390
|
+
}
|
|
391
|
+
export interface QElementAttributes extends HTMLElementAttributes<HTMLQuoteElement> {
|
|
392
|
+
cite?: string;
|
|
393
|
+
}
|
|
394
|
+
export interface DataElementAttributes extends HTMLElementAttributes<HTMLDataElement> {
|
|
395
|
+
value?: string | number;
|
|
396
|
+
}
|
|
397
|
+
export interface TimeElementAttributes extends HTMLElementAttributes<HTMLTimeElement> {
|
|
398
|
+
dateTime?: string;
|
|
399
|
+
}
|
|
400
|
+
export interface DetailsElementAttributes extends HTMLElementAttributes<HTMLDetailsElement> {
|
|
401
|
+
open?: boolean;
|
|
402
|
+
}
|
|
403
|
+
export interface DialogElementAttributes extends HTMLElementAttributes<HTMLDialogElement> {
|
|
404
|
+
open?: boolean;
|
|
405
|
+
}
|
|
406
|
+
export interface LinkElementAttributes extends GlobalAttributes<HTMLLinkElement> {
|
|
407
|
+
as?: string;
|
|
408
|
+
crossOrigin?: "anonymous" | "use-credentials";
|
|
409
|
+
disabled?: boolean;
|
|
410
|
+
fetchPriority?: "high" | "low" | "auto";
|
|
411
|
+
href?: string;
|
|
412
|
+
imageSizes?: string;
|
|
413
|
+
imageSrcSet?: string;
|
|
414
|
+
integrity?: string;
|
|
415
|
+
media?: string;
|
|
416
|
+
referrerPolicy?: RefererPolicy;
|
|
417
|
+
rel?: string;
|
|
418
|
+
sizes?: string;
|
|
419
|
+
type?: string;
|
|
420
|
+
blocking?: "render";
|
|
421
|
+
}
|
|
422
|
+
export interface MetaElementAttributes extends GlobalAttributes<HTMLMetaElement> {
|
|
423
|
+
charset?: string;
|
|
424
|
+
content?: string;
|
|
425
|
+
httpEquiv?: string;
|
|
426
|
+
name?: string;
|
|
427
|
+
media?: string;
|
|
428
|
+
}
|
|
429
|
+
export interface BaseElementAttributes extends GlobalAttributes<HTMLBaseElement> {
|
|
430
|
+
href?: string;
|
|
431
|
+
target?: LinkTarget;
|
|
432
|
+
}
|
|
433
|
+
export interface ScriptElementAttributes extends GlobalAttributes<HTMLScriptElement> {
|
|
434
|
+
async?: boolean;
|
|
435
|
+
defer?: boolean;
|
|
436
|
+
crossOrigin?: "anonymous" | "use-credentials";
|
|
437
|
+
integrity?: string;
|
|
438
|
+
nonce?: string;
|
|
439
|
+
referrerPolicy?: RefererPolicy;
|
|
440
|
+
src?: string;
|
|
441
|
+
type?: string;
|
|
442
|
+
noModule?: boolean;
|
|
443
|
+
blocking?: "render";
|
|
444
|
+
children?: CollectableValue<string>;
|
|
445
|
+
}
|
|
446
|
+
export interface StyleElementAttributes extends GlobalAttributes<HTMLStyleElement> {
|
|
447
|
+
media?: string;
|
|
448
|
+
nonce?: string;
|
|
449
|
+
blocking?: "render";
|
|
450
|
+
children?: CollectableValue<string>;
|
|
451
|
+
}
|
|
452
|
+
export interface ObjectElementAttributes extends HTMLElementAttributes<HTMLObjectElement> {
|
|
453
|
+
data?: string;
|
|
454
|
+
type?: string;
|
|
455
|
+
name?: string;
|
|
456
|
+
width?: number | string;
|
|
457
|
+
height?: number | string;
|
|
458
|
+
useMap?: string;
|
|
459
|
+
form?: string;
|
|
460
|
+
typemustmatch?: boolean;
|
|
461
|
+
}
|
|
462
|
+
export interface EmbedElementAttributes extends GlobalAttributes<HTMLEmbedElement> {
|
|
463
|
+
src?: string;
|
|
464
|
+
type?: string;
|
|
465
|
+
width?: number | string;
|
|
466
|
+
height?: number | string;
|
|
467
|
+
}
|
|
468
|
+
export interface SlotElementAttributes extends HTMLElementAttributes<HTMLSlotElement> {
|
|
469
|
+
name?: string;
|
|
470
|
+
}
|
|
471
|
+
export interface TableElementAttributes extends HTMLElementAttributes<HTMLTableElement> {
|
|
472
|
+
sortable?: boolean;
|
|
473
|
+
}
|
|
474
|
+
export interface InsDelElementAttributes extends HTMLElementAttributes<HTMLModElement> {
|
|
475
|
+
cite?: string;
|
|
476
|
+
dateTime?: string;
|
|
477
|
+
}
|
|
478
|
+
export declare namespace JSX {
|
|
479
|
+
interface IntrinsicElements {
|
|
480
|
+
text: TextElementAttributes;
|
|
481
|
+
html: HTMLElementAttributes<HTMLHtmlElement>;
|
|
482
|
+
head: HTMLElementAttributes<HTMLHeadElement>;
|
|
483
|
+
base: BaseElementAttributes;
|
|
484
|
+
link: LinkElementAttributes;
|
|
485
|
+
meta: MetaElementAttributes;
|
|
486
|
+
style: StyleElementAttributes;
|
|
487
|
+
title: HTMLElementAttributes<HTMLTitleElement>;
|
|
488
|
+
body: HTMLElementAttributes<HTMLBodyElement>;
|
|
489
|
+
address: HTMLElementAttributes<HTMLElement>;
|
|
490
|
+
article: HTMLElementAttributes<HTMLElement>;
|
|
491
|
+
aside: HTMLElementAttributes<HTMLElement>;
|
|
492
|
+
footer: HTMLElementAttributes<HTMLElement>;
|
|
493
|
+
header: HTMLElementAttributes<HTMLElement>;
|
|
494
|
+
h1: HTMLElementAttributes<HTMLHeadingElement>;
|
|
495
|
+
h2: HTMLElementAttributes<HTMLHeadingElement>;
|
|
496
|
+
h3: HTMLElementAttributes<HTMLHeadingElement>;
|
|
497
|
+
h4: HTMLElementAttributes<HTMLHeadingElement>;
|
|
498
|
+
h5: HTMLElementAttributes<HTMLHeadingElement>;
|
|
499
|
+
h6: HTMLElementAttributes<HTMLHeadingElement>;
|
|
500
|
+
main: HTMLElementAttributes<HTMLElement>;
|
|
501
|
+
nav: HTMLElementAttributes<HTMLElement>;
|
|
502
|
+
section: HTMLElementAttributes<HTMLElement>;
|
|
503
|
+
blockquote: BlockquoteElementAttributes;
|
|
504
|
+
div: HTMLElementAttributes<HTMLDivElement>;
|
|
505
|
+
dl: HTMLElementAttributes<HTMLDListElement>;
|
|
506
|
+
dt: HTMLElementAttributes<HTMLElement>;
|
|
507
|
+
dd: HTMLElementAttributes<HTMLElement>;
|
|
508
|
+
figcaption: HTMLElementAttributes<HTMLElement>;
|
|
509
|
+
figure: HTMLElementAttributes<HTMLElement>;
|
|
510
|
+
hr: HTMLElementAttributes<HTMLHRElement>;
|
|
511
|
+
li: LiElementAttributes;
|
|
512
|
+
ol: OlElementAttributes;
|
|
513
|
+
p: HTMLElementAttributes<HTMLParagraphElement>;
|
|
514
|
+
pre: HTMLElementAttributes<HTMLPreElement>;
|
|
515
|
+
ul: HTMLElementAttributes<HTMLUListElement>;
|
|
516
|
+
a: AnchorElementAttributes;
|
|
517
|
+
abbr: HTMLElementAttributes<HTMLElement>;
|
|
518
|
+
b: HTMLElementAttributes<HTMLElement>;
|
|
519
|
+
bdi: HTMLElementAttributes<HTMLElement>;
|
|
520
|
+
bdo: HTMLElementAttributes<HTMLElement>;
|
|
521
|
+
br: HTMLElementAttributes<HTMLBRElement>;
|
|
522
|
+
cite: HTMLElementAttributes<HTMLElement>;
|
|
523
|
+
code: HTMLElementAttributes<HTMLElement>;
|
|
524
|
+
data: DataElementAttributes;
|
|
525
|
+
dfn: HTMLElementAttributes<HTMLElement>;
|
|
526
|
+
em: HTMLElementAttributes<HTMLElement>;
|
|
527
|
+
i: HTMLElementAttributes<HTMLElement>;
|
|
528
|
+
kbd: HTMLElementAttributes<HTMLElement>;
|
|
529
|
+
mark: HTMLElementAttributes<HTMLElement>;
|
|
530
|
+
q: QElementAttributes;
|
|
531
|
+
rp: HTMLElementAttributes<HTMLElement>;
|
|
532
|
+
rt: HTMLElementAttributes<HTMLElement>;
|
|
533
|
+
ruby: HTMLElementAttributes<HTMLElement>;
|
|
534
|
+
s: HTMLElementAttributes<HTMLElement>;
|
|
535
|
+
samp: HTMLElementAttributes<HTMLElement>;
|
|
536
|
+
small: HTMLElementAttributes<HTMLElement>;
|
|
537
|
+
span: HTMLElementAttributes<HTMLSpanElement>;
|
|
538
|
+
strong: HTMLElementAttributes<HTMLElement>;
|
|
539
|
+
sub: HTMLElementAttributes<HTMLElement>;
|
|
540
|
+
sup: HTMLElementAttributes<HTMLElement>;
|
|
541
|
+
time: TimeElementAttributes;
|
|
542
|
+
u: HTMLElementAttributes<HTMLElement>;
|
|
543
|
+
var: HTMLElementAttributes<HTMLElement>;
|
|
544
|
+
wbr: HTMLElementAttributes<HTMLBRElement>;
|
|
545
|
+
del: InsDelElementAttributes;
|
|
546
|
+
ins: InsDelElementAttributes;
|
|
547
|
+
img: ImageElementAttributes;
|
|
548
|
+
iframe: IframeElementAttributes;
|
|
549
|
+
embed: EmbedElementAttributes;
|
|
550
|
+
object: ObjectElementAttributes;
|
|
551
|
+
picture: GlobalAttributes<HTMLPictureElement>;
|
|
552
|
+
source: SourceElementAttributes;
|
|
553
|
+
track: TrackElementAttributes;
|
|
554
|
+
video: VideoElementAttributes;
|
|
555
|
+
audio: AudioElementAttributes;
|
|
556
|
+
map: MapElementAttributes;
|
|
557
|
+
area: AreaElementAttributes;
|
|
558
|
+
canvas: CanvasElementAttributes;
|
|
559
|
+
noscript: HTMLElementAttributes<HTMLElement>;
|
|
560
|
+
script: ScriptElementAttributes;
|
|
561
|
+
template: GlobalAttributes<HTMLTemplateElement>;
|
|
562
|
+
slot: SlotElementAttributes;
|
|
563
|
+
table: TableElementAttributes;
|
|
564
|
+
caption: HTMLElementAttributes<HTMLTableCaptionElement>;
|
|
565
|
+
colgroup: ColGroupElementAttributes;
|
|
566
|
+
col: ColElementAttributes;
|
|
567
|
+
tbody: HTMLElementAttributes<HTMLTableSectionElement>;
|
|
568
|
+
thead: HTMLElementAttributes<HTMLTableSectionElement>;
|
|
569
|
+
tfoot: HTMLElementAttributes<HTMLTableSectionElement>;
|
|
570
|
+
tr: HTMLElementAttributes<HTMLTableRowElement>;
|
|
571
|
+
th: ThElementAttributes;
|
|
572
|
+
td: TdElementAttributes;
|
|
573
|
+
form: FormElementAttributes;
|
|
574
|
+
label: LabelElementAttributes;
|
|
575
|
+
input: InputElementAttributes;
|
|
576
|
+
textarea: TextAreaElementAttributes;
|
|
577
|
+
select: SelectElementAttributes;
|
|
578
|
+
option: OptionElementAttributes;
|
|
579
|
+
optgroup: OptGroupElementAttributes;
|
|
580
|
+
button: ButtonElementAttributes;
|
|
581
|
+
fieldset: FieldsetElementAttributes;
|
|
582
|
+
legend: HTMLElementAttributes<HTMLLegendElement>;
|
|
583
|
+
output: OutputElementAttributes;
|
|
584
|
+
progress: ProgressElementAttributes;
|
|
585
|
+
meter: MeterElementAttributes;
|
|
586
|
+
datalist: HTMLElementAttributes<HTMLDataListElement>;
|
|
587
|
+
details: DetailsElementAttributes;
|
|
588
|
+
summary: HTMLElementAttributes<HTMLElement>;
|
|
589
|
+
dialog: DialogElementAttributes;
|
|
590
|
+
svg: SvgElementAttributes;
|
|
591
|
+
[key: `svg:${string}`]: GlobalAttributes<SVGElement> & Record<string, any>;
|
|
592
|
+
}
|
|
593
|
+
interface ElementChildrenAttribute {
|
|
594
|
+
children: {};
|
|
595
|
+
}
|
|
596
|
+
interface Element extends Node {
|
|
597
|
+
}
|
|
598
|
+
interface ElementClass {
|
|
599
|
+
htmlRoot: globalThis.Element | null;
|
|
600
|
+
}
|
|
601
|
+
interface IntrinsicClassAttributes<T> {
|
|
602
|
+
ref?: (value: T) => void;
|
|
603
|
+
}
|
|
604
|
+
interface ElementAttributesProperty {
|
|
605
|
+
props: {};
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
/** get props of an JSX element or component function / class */
|
|
609
|
+
export type ComponentProps<T extends keyof JSX.IntrinsicElements | {
|
|
610
|
+
props: any;
|
|
611
|
+
} | ((props: any) => any)> = T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : (T extends {
|
|
612
|
+
props: any;
|
|
613
|
+
} ? T["props"] : (T extends (props: any) => any ? Parameters<T>[0] : never));
|
|
614
|
+
/** any value that can be used in JSX */
|
|
615
|
+
export type StagnateNode = CollectableValue<JSX.Element | string>;
|
|
616
|
+
/** the JSX element css class attribute */
|
|
617
|
+
export type ClassAttribute = CollectableValue<string>;
|
package/lib/Component.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sourceRoot":"","sources":["../src/Component.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,OAAO,SAAS;IA6BrB,YAAmB,KAAW;QAC7B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAA;QACrB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;QACtB,IAAI,CAAC,IAAI,GAAG,EAAU,CAAA;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACnB,CAAC;IAEO,MAAM;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;YACpD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;YACrC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;gBACzB,SAAS,CAAC,MAAM,EAAE,CAAA;aAClB;SACD;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;QACrB,IAAI,CAAC,QAAQ,EAAE,CAAA;IAChB,CAAC;IAEO,MAAM;QACb,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAA;QACzC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAA;QACrB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;QACtB,IAAI,CAAC,QAAQ,EAAE,CAAA;IAChB,CAAC;IAED;;;OAGG;IACO,MAAM;QACf,OAAO,IAAI,CAAA;IACZ,CAAC;IAED,sDAAsD;IAC5C,cAAc;IACxB,CAAC;IAED,qEAAqE;IAC3D,QAAQ;IAClB,CAAC;IAED;;;;OAIG;IACO,QAAQ;IAClB,CAAC;IAED;;;;OAIG;IACO,QAAQ;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,EAAE;QACpG,IAAI,KAAK,YAAY,SAAS,IAAI,KAAK,CAAC,MAAM,EAAE;YAC/C,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;YAC5B,KAAK,CAAC,GAAG,EAAE,CAAA;SACX;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;gBACzC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;gBACrB,IAAI,IAAI,YAAY,SAAS,EAAE;oBAC9B,IAAI,KAAK,CAAC,MAAM,EAAE;wBACjB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;qBAC1B;oBACD,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;iBACf;qBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;oBAC/B,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;iBACpB;aACD;SACD;QACD,OAAO,KAAU,CAAA;IAClB,CAAC;IAlBe,YAAO,UAkBtB,CAAA;AACF,CAAC,EA1BgB,IAAI,KAAJ,IAAI,QA0BpB"}
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAEvD,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA"}
|
package/lib/jsx-runtime.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.js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,CAAA;QAC9C,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,EAAE,CAAA;QACjC,IAAI,KAAK,CAAC,GAAG,EAAE;YACd,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;SACpB;QACD,OAAO,OAAO,CAAA;KACd;SAAM;QACN,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA;QAC3B,IAAI,KAAK,CAAC,GAAG,EAAE;YACd,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;SAClB;QACD,OAAO,OAAO,CAAA;KACd;AACF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAS,EAAE,KAAU,EAAE,GAAG,QAAe;IACtE,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;IACzB,OAAO,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACxB,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,QAAQ,CAAC,KAA+B;IACvD,OAAO,KAAK,CAAC,QAAuB,CAAA;AACrC,CAAC;AAED,OAAO,EAAE,GAAG,IAAI,IAAI,EAAE,CAAA"}
|
package/lib/types.d.ts
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
export declare type CollectableArray<T> = (CollectableArray<T> | T | undefined | null | false)[];
|
|
2
|
-
export declare type CollectableValue<T> = CollectableArray<T> | T | undefined | null | false;
|
|
3
|
-
export declare type RefererPolicy = "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
|
|
4
|
-
export interface EvenHandlers {
|
|
5
|
-
onAnimationCancel: (ev: AnimationEvent) => void;
|
|
6
|
-
onAnimationEnd: (ev: AnimationEvent) => void;
|
|
7
|
-
onAnimationIteration: (ev: AnimationEvent) => void;
|
|
8
|
-
onAnimationStart: (ev: AnimationEvent) => void;
|
|
9
|
-
onBlur: (ev: FocusEvent) => void;
|
|
10
|
-
onChange: (ev: Event) => void;
|
|
11
|
-
onClick: (ev: MouseEvent) => void;
|
|
12
|
-
onClose: (ev: Event) => void;
|
|
13
|
-
onDrag: (ev: DragEvent) => void;
|
|
14
|
-
onDragEnd: (ev: DragEvent) => void;
|
|
15
|
-
onDragEnter: (ev: DragEvent) => void;
|
|
16
|
-
onDragLeave: (ev: DragEvent) => void;
|
|
17
|
-
onDragOver: (ev: DragEvent) => void;
|
|
18
|
-
onDragStart: (ev: DragEvent) => void;
|
|
19
|
-
onDrop: (ev: DragEvent) => void;
|
|
20
|
-
onContextMenu: (ev: MouseEvent) => void;
|
|
21
|
-
onDblClick: (ev: MouseEvent) => void;
|
|
22
|
-
onFocus: (ev: FocusEvent) => void;
|
|
23
|
-
onInput: (ev: Event) => void;
|
|
24
|
-
onKeyDown: (ev: KeyboardEvent) => void;
|
|
25
|
-
onKeyPress: (ev: KeyboardEvent) => void;
|
|
26
|
-
onKeyUp: (ev: KeyboardEvent) => void;
|
|
27
|
-
onLoad: (ev: Event) => void;
|
|
28
|
-
onMouseDown: (ev: MouseEvent) => void;
|
|
29
|
-
onMouseEnter: (ev: MouseEvent) => void;
|
|
30
|
-
onMouseLeave: (ev: MouseEvent) => void;
|
|
31
|
-
onMouseMove: (ev: MouseEvent) => void;
|
|
32
|
-
onMouseOut: (ev: MouseEvent) => void;
|
|
33
|
-
onMouseOver: (ev: MouseEvent) => void;
|
|
34
|
-
onMouseUp: (ev: MouseEvent) => void;
|
|
35
|
-
onPointerCancel: (ev: PointerEvent) => void;
|
|
36
|
-
onPointerDown: (ev: PointerEvent) => void;
|
|
37
|
-
onPointerEnter: (ev: PointerEvent) => void;
|
|
38
|
-
onPointerLeave: (ev: PointerEvent) => void;
|
|
39
|
-
onPointerMove: (ev: PointerEvent) => void;
|
|
40
|
-
onPointerOut: (ev: PointerEvent) => void;
|
|
41
|
-
onPointerOver: (ev: PointerEvent) => void;
|
|
42
|
-
onPointerUp: (ev: PointerEvent) => void;
|
|
43
|
-
onScroll: (ev: Event) => void;
|
|
44
|
-
onTouchCancel: (ev: TouchEvent) => void;
|
|
45
|
-
onTouchEnd: (ev: TouchEvent) => void;
|
|
46
|
-
onTouchMove: (ev: TouchEvent) => void;
|
|
47
|
-
onTouchStart: (ev: TouchEvent) => void;
|
|
48
|
-
onTransitionCancel: (ev: TransitionEvent) => void;
|
|
49
|
-
onTransitionEnd: (ev: TransitionEvent) => void;
|
|
50
|
-
onTransitionRun: (ev: TransitionEvent) => void;
|
|
51
|
-
onTransitionStart: (ev: TransitionEvent) => void;
|
|
52
|
-
}
|
|
53
|
-
export interface GlobalAttributes<T> extends Partial<EvenHandlers> {
|
|
54
|
-
ref?: (value: T) => void;
|
|
55
|
-
id?: string;
|
|
56
|
-
class?: CollectableValue<string>;
|
|
57
|
-
style?: Partial<CSSStyleDeclaration>;
|
|
58
|
-
title?: string;
|
|
59
|
-
tabIndex?: number;
|
|
60
|
-
innerHTML?: string;
|
|
61
|
-
accessKey?: "string";
|
|
62
|
-
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters";
|
|
63
|
-
autoFocus?: boolean;
|
|
64
|
-
contentEditable?: boolean;
|
|
65
|
-
dir?: "ltr" | "rtl" | "auto";
|
|
66
|
-
draggable?: boolean;
|
|
67
|
-
enterKeyHint?: boolean;
|
|
68
|
-
hidden?: boolean;
|
|
69
|
-
inert?: boolean;
|
|
70
|
-
inputMode?: "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
|
|
71
|
-
lang?: string;
|
|
72
|
-
role?: string;
|
|
73
|
-
spellcheck?: boolean | string;
|
|
74
|
-
translate?: "" | "yes" | "no";
|
|
75
|
-
virtualKeyboardPolicy?: "auto" | "manual";
|
|
76
|
-
}
|
|
77
|
-
export interface HTMLElementAttributes<T> extends GlobalAttributes<T> {
|
|
78
|
-
children?: CollectableValue<JSX.Element | string>;
|
|
79
|
-
}
|
|
80
|
-
export interface TextElementAttributes {
|
|
81
|
-
value?: string;
|
|
82
|
-
ref?: (value: Text) => void;
|
|
83
|
-
children?: CollectableValue<string>;
|
|
84
|
-
}
|
|
85
|
-
export interface ImageElementAttributes extends GlobalAttributes<HTMLImageElement> {
|
|
86
|
-
alt?: string;
|
|
87
|
-
src?: string;
|
|
88
|
-
crossOrigin?: "anonymous" | "use-credentials";
|
|
89
|
-
}
|
|
90
|
-
export interface AnchorElementAttributes extends GlobalAttributes<HTMLAnchorElement> {
|
|
91
|
-
href?: string;
|
|
92
|
-
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
93
|
-
rel?: string;
|
|
94
|
-
download?: string;
|
|
95
|
-
referrerPolicy?: RefererPolicy;
|
|
96
|
-
children?: CollectableValue<JSX.Element | string>;
|
|
97
|
-
}
|
|
98
|
-
export interface InputElementAttributes extends GlobalAttributes<HTMLInputElement> {
|
|
99
|
-
type?: "button" | "checkbox" | "checkbox" | "hidden" | "password" | "radio" | "text" | "file";
|
|
100
|
-
alt?: string;
|
|
101
|
-
checked?: boolean;
|
|
102
|
-
disabled?: boolean;
|
|
103
|
-
maxLength?: number;
|
|
104
|
-
minLength?: number;
|
|
105
|
-
name?: string;
|
|
106
|
-
placeholder?: string;
|
|
107
|
-
readonly?: boolean;
|
|
108
|
-
value?: string;
|
|
109
|
-
accept?: string;
|
|
110
|
-
multiple?: boolean;
|
|
111
|
-
}
|
|
112
|
-
export interface TextAreaElementAttributes extends GlobalAttributes<HTMLTextAreaElement> {
|
|
113
|
-
cols?: number;
|
|
114
|
-
rows?: number;
|
|
115
|
-
disabled?: boolean;
|
|
116
|
-
maxLength?: number;
|
|
117
|
-
minLength?: number;
|
|
118
|
-
name?: string;
|
|
119
|
-
placeholder?: string;
|
|
120
|
-
readonly?: boolean;
|
|
121
|
-
value?: string;
|
|
122
|
-
spellcheck?: boolean | "default";
|
|
123
|
-
wrap?: "hard" | "soft" | "off";
|
|
124
|
-
children?: CollectableValue<string>;
|
|
125
|
-
}
|
|
126
|
-
export interface SelectElementAttributes extends GlobalAttributes<HTMLSelectElement> {
|
|
127
|
-
disabled?: boolean;
|
|
128
|
-
name?: string;
|
|
129
|
-
children?: CollectableValue<JSX.Element | string>;
|
|
130
|
-
value?: string;
|
|
131
|
-
}
|
|
132
|
-
export interface OptionElementAttributes extends GlobalAttributes<HTMLOptionElement> {
|
|
133
|
-
disabled?: boolean;
|
|
134
|
-
label?: string;
|
|
135
|
-
selected?: string;
|
|
136
|
-
value?: string;
|
|
137
|
-
children?: CollectableValue<string>;
|
|
138
|
-
}
|
|
139
|
-
export interface IframeElementAttributes extends GlobalAttributes<HTMLIFrameElement> {
|
|
140
|
-
allow?: string;
|
|
141
|
-
allowFullScreen?: boolean;
|
|
142
|
-
referrerPolicy?: RefererPolicy;
|
|
143
|
-
sandbox?: string;
|
|
144
|
-
src?: string;
|
|
145
|
-
}
|
|
146
|
-
export interface IframeElementAttributes extends GlobalAttributes<HTMLIFrameElement> {
|
|
147
|
-
allow?: string;
|
|
148
|
-
allowFullScreen?: boolean;
|
|
149
|
-
referrerPolicy?: RefererPolicy;
|
|
150
|
-
sandbox?: string;
|
|
151
|
-
src?: string;
|
|
152
|
-
}
|
|
153
|
-
export interface SvgElementAttributes extends GlobalAttributes<SVGElement> {
|
|
154
|
-
viewBox?: string;
|
|
155
|
-
fill?: string;
|
|
156
|
-
children?: CollectableValue<JSX.Element | string>;
|
|
157
|
-
}
|
|
158
|
-
export declare namespace JSX {
|
|
159
|
-
interface IntrinsicElements {
|
|
160
|
-
text: TextElementAttributes;
|
|
161
|
-
div: HTMLElementAttributes<HTMLDivElement>;
|
|
162
|
-
span: HTMLElementAttributes<HTMLSpanElement>;
|
|
163
|
-
img: ImageElementAttributes;
|
|
164
|
-
a: AnchorElementAttributes;
|
|
165
|
-
input: InputElementAttributes;
|
|
166
|
-
textarea: TextAreaElementAttributes;
|
|
167
|
-
select: SelectElementAttributes;
|
|
168
|
-
option: OptionElementAttributes;
|
|
169
|
-
iframe: IframeElementAttributes;
|
|
170
|
-
svg: SvgElementAttributes;
|
|
171
|
-
[key: `svg:${string}`]: GlobalAttributes<SVGElement> & Record<string, any>;
|
|
172
|
-
}
|
|
173
|
-
interface ElementChildrenAttribute {
|
|
174
|
-
children: {};
|
|
175
|
-
}
|
|
176
|
-
interface Element extends globalThis.Element {
|
|
177
|
-
}
|
|
178
|
-
interface ElementClass {
|
|
179
|
-
htmlRoot: JSX.Element | null;
|
|
180
|
-
}
|
|
181
|
-
interface IntrinsicClassAttributes<T> {
|
|
182
|
-
ref?: (value: T) => void;
|
|
183
|
-
}
|
|
184
|
-
interface ElementAttributesProperty {
|
|
185
|
-
props: {};
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
/** get props of an JSX element or component function / class */
|
|
189
|
-
export declare type ComponentProps<T extends keyof JSX.IntrinsicElements | {
|
|
190
|
-
props: any;
|
|
191
|
-
} | ((props: any) => any)> = T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : (T extends {
|
|
192
|
-
props: any;
|
|
193
|
-
} ? T["props"] : (T extends (props: any) => any ? Parameters<T>[0] : never));
|
|
194
|
-
/** any value that can be used in JSX */
|
|
195
|
-
export declare type StagnateNode = CollectableValue<JSX.Element | string>;
|
|
196
|
-
/** the JSX element css class attribute */
|
|
197
|
-
export declare type ClassAttribute = CollectableValue<string>;
|
|
File without changes
|
|
File without changes
|