nesquick 0.0.25 → 0.0.26
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/NesquickFragment.js
CHANGED
|
@@ -4,7 +4,9 @@ exports.NesquickFragment = void 0;
|
|
|
4
4
|
const NesquickComponent_1 = require("./NesquickComponent");
|
|
5
5
|
class NesquickFragment extends NesquickComponent_1.NesquickComponent {
|
|
6
6
|
constructor(children) {
|
|
7
|
-
super("", {
|
|
7
|
+
super("", {
|
|
8
|
+
children: children != null ? Array.isArray(children) ? children : [children] : []
|
|
9
|
+
});
|
|
8
10
|
this._lastNode = null;
|
|
9
11
|
this._fragment = null;
|
|
10
12
|
}
|
|
@@ -7,7 +7,7 @@ const NesquickFragment_1 = require("../NesquickFragment");
|
|
|
7
7
|
exports.Fragment = Symbol();
|
|
8
8
|
function functionizeProps(props) {
|
|
9
9
|
for (const k in props) {
|
|
10
|
-
if (typeof props[k] !== "function") {
|
|
10
|
+
if (k !== "children" && typeof props[k] !== "function") {
|
|
11
11
|
const v = props[k];
|
|
12
12
|
props[k] = () => v;
|
|
13
13
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSX } from "./jsx-runtime";
|
|
2
|
-
import { NesquickComponent, NesquickParent, VeactDocument } from "./NesquickComponent";
|
|
2
|
+
import { Child, Children, NesquickComponent, NesquickParent, VeactDocument } from "./NesquickComponent";
|
|
3
3
|
export declare class NesquickFragment extends NesquickComponent<{
|
|
4
|
-
children:
|
|
4
|
+
children: Child[];
|
|
5
5
|
}> implements NesquickParent {
|
|
6
6
|
private _lastNode;
|
|
7
7
|
private _fragment;
|
|
8
|
-
constructor(children:
|
|
8
|
+
constructor(children: Children);
|
|
9
9
|
render(document: VeactDocument): Node;
|
|
10
10
|
getDocument(): Document | null;
|
|
11
11
|
getParent(): Node | null;
|
|
@@ -14,7 +14,7 @@ type WrappedFunction<T> = (() => T) & {
|
|
|
14
14
|
};
|
|
15
15
|
type UserProp<T> = T extends (...args: any[]) => any ? T : WrappedFunction<T>;
|
|
16
16
|
type UserProps<T> = {
|
|
17
|
-
readonly [K in keyof T]: HasUndefined<T, K> extends true ? UserProp<T[K] | undefined> : UserProp<Exclude<T[K], undefined>>;
|
|
17
|
+
readonly [K in keyof T]: K extends keyof JSX.ElementChildrenAttribute ? T[K] : HasUndefined<T, K> extends true ? UserProp<T[K] | undefined> : UserProp<Exclude<T[K], undefined>>;
|
|
18
18
|
};
|
|
19
19
|
type JSXProp<T> = T extends {
|
|
20
20
|
readonly [WrappedFunctionType]?: infer R;
|
|
@@ -14,7 +14,7 @@ type WrappedFunction<T> = (() => T) & {
|
|
|
14
14
|
};
|
|
15
15
|
type UserProp<T> = T extends (...args: infer A) => infer R ? (((...args: A) => R) | T) : WrappedFunction<T>;
|
|
16
16
|
type UserProps<T> = {
|
|
17
|
-
readonly [K in keyof T]: HasUndefined<T, K> extends true ? UserProp<T[K] | undefined> : UserProp<Exclude<T[K], undefined>>;
|
|
17
|
+
readonly [K in keyof T]: K extends keyof JSX.ElementChildrenAttribute ? T[K] : HasUndefined<T, K> extends true ? UserProp<T[K] | undefined> : UserProp<Exclude<T[K], undefined>>;
|
|
18
18
|
};
|
|
19
19
|
type JSXProp<T> = T extends {
|
|
20
20
|
readonly [WrappedFunctionType]?: infer R;
|