diff --git a/client/VERSION b/client/VERSION
index 314c3d71..ab679818 100644
--- a/client/VERSION
+++ b/client/VERSION
@@ -1 +1 @@
-1.1.5
\ No newline at end of file
+1.1.6
\ No newline at end of file
diff --git a/client/config/test/jest.config.js b/client/config/test/jest.config.js
index 201cf3f3..1f1196b7 100644
--- a/client/config/test/jest.config.js
+++ b/client/config/test/jest.config.js
@@ -6,7 +6,9 @@ const globals = {};
buildVars.forEach(({ name, defaultValue }) => {
globals[name] = process.env[name] || defaultValue;
});
-const isEE = process.env.REACT_APP_EDITION === "enterprise";
+const edition = process.env.REACT_APP_EDITION;
+const isEEGlobal = edition === "enterprise-global";
+const isEE = edition === "enterprise" || isEEGlobal;
const dirname = currentDirName(import.meta.url);
export default {
diff --git a/client/package.json b/client/package.json
index f9ffb39b..36415a57 100644
--- a/client/package.json
+++ b/client/package.json
@@ -12,6 +12,7 @@
"scripts": {
"start": "yarn workspace openblocks start",
"start:ee": "REACT_APP_EDITION=enterprise yarn workspace openblocks start",
+ "start:ee-global": "REACT_APP_EDITION=enterprise-global yarn workspace openblocks start",
"build": "yarn node ./scripts/build.js",
"test": "jest",
"prepare": "yarn workspace openblocks prepare",
@@ -71,6 +72,7 @@
"react-virtualized@^9.22.3": "patch:react-virtualized@npm%3A9.22.3#./.yarn/patches/react-virtualized-npm-9.22.3-0fff3cbf64.patch"
},
"dependencies": {
+ "antd-mobile": "^5.28.0",
"chalk": "4",
"number-precision": "^1.6.0",
"react-player": "^2.11.0",
diff --git a/client/packages/openblocks-core/lib/index.cjs b/client/packages/openblocks-core/lib/index.cjs
index ec946769..a25796e5 100644
--- a/client/packages/openblocks-core/lib/index.cjs
+++ b/client/packages/openblocks-core/lib/index.cjs
@@ -106,49 +106,40 @@ function __spreadArray(to, from, pack) {
return to.concat(ar || Array.prototype.slice.call(from));
}
-function getCache(obj, fnName) {
+function isEqualArgs(args, cacheArgs, equals) {
+ if (!cacheArgs) {
+ return false;
+ }
+ if (args.length === 0 && cacheArgs.length === 0) {
+ return true;
+ }
+ return (args.length === cacheArgs.length &&
+ cacheArgs.every(function (arg, index) { var _a, _b; return (_b = (_a = equals === null || equals === void 0 ? void 0 : equals[index]) === null || _a === void 0 ? void 0 : _a.call(equals, arg, args[index])) !== null && _b !== void 0 ? _b : arg === args[index]; }));
+}
+function getCacheResult(thisObj, fnName, args, equals) {
var _a;
- return (_a = obj === null || obj === void 0 ? void 0 : obj.__cache) === null || _a === void 0 ? void 0 : _a[fnName];
+ var cache = (_a = thisObj === null || thisObj === void 0 ? void 0 : thisObj.__cache) === null || _a === void 0 ? void 0 : _a[fnName];
+ if (cache && isEqualArgs(args, cache.args, equals)) {
+ return cache.result;
+ }
}
-function createCache(obj, fnName, args) {
- if (!obj.__cache) {
- obj.__cache = {};
+function cache(fn, args, thisObj, fnName, equals) {
+ var result = getCacheResult(thisObj, fnName, args, equals);
+ if (result) {
+ return result.value;
}
- obj.__cache[fnName] = {
+ var cache = {
id: Symbol("id"),
args: args,
- isInProgress: true,
time: Date.now(),
};
- return getCache(obj, fnName);
-}
-function genCache(fn, args, thisObj, fnName) {
- var cache = createCache(thisObj, fnName, args);
- var value = fn.apply(thisObj, args);
- cache.isInProgress = false;
- cache.value = value;
-}
-function read(thisObj, fnName) {
- var cache = getCache(thisObj, fnName);
- return cache && cache.value;
-}
-function hitCache(args, thisObj, fnName, equals) {
- var cache = getCache(thisObj, fnName);
- if (!cache || !cache.args)
- return false;
- if (args.length === 0 && cache.args.length === 0)
- return true;
- return cache.args.every(function (arg, index) { var _a, _b; return (_b = (_a = equals === null || equals === void 0 ? void 0 : equals[index]) === null || _a === void 0 ? void 0 : _a.call(equals, arg, args[index])) !== null && _b !== void 0 ? _b : arg === args[index]; });
-}
-function isCyclic(thisObj, fnName) {
- var cache = getCache(thisObj, fnName);
- return cache && cache.isInProgress;
-}
-function cache(fn, args, thisObj, fnName, equals) {
- if (!hitCache(args, thisObj, fnName, equals) && !isCyclic(thisObj, fnName)) {
- genCache(fn, args, thisObj, fnName);
+ if (!thisObj.__cache) {
+ thisObj.__cache = {};
}
- return read(thisObj, fnName);
+ thisObj.__cache[fnName] = cache;
+ var value = fn.apply(thisObj, args);
+ cache.result = { value: value };
+ return value;
}
function memoized(equals) {
return function (target, fnName, descriptor) {
@@ -1049,23 +1040,24 @@ var loglevel = {exports: {}};
var log = loglevel.exports;
-// global variables black list, forbidden to use
-var blacklist = new Set([
+// global variables black list, forbidden to use in for jsQuery/jsAction
+var functionBlacklist = new Set([
"top",
"parent",
"document",
"location",
"chrome",
- "setTimeout",
"fetch",
- "setInterval",
- "clearInterval",
- "setImmediate",
"XMLHttpRequest",
"importScripts",
"Navigator",
"MutationObserver",
]);
+var expressionBlacklist = new Set(__spreadArray(__spreadArray([], Array.from(functionBlacklist.values()), true), [
+ "setTimeout",
+ "setInterval",
+ "setImmediate",
+], false));
var globalVarNames = new Set(["window", "globalThis", "self", "global"]);
function createBlackHole() {
return new Proxy(function () {
@@ -1087,12 +1079,14 @@ function createBlackHole() {
},
});
}
-function createMockWindow() {
- var win = new Proxy({}, {
+function createMockWindow(base, blacklist) {
+ if (blacklist === void 0) { blacklist = expressionBlacklist; }
+ var win = new Proxy(Object.assign({}, base), {
has: function () {
return true;
},
set: function (target, p, newValue) {
+ console.info("set:", p, newValue);
return Reflect.set(target, p, newValue);
},
get: function (target, p) {
@@ -1102,19 +1096,11 @@ function createMockWindow() {
if (globalVarNames.has(p)) {
return win;
}
- if (typeof p === "string" && blacklist.has(p)) {
+ if (typeof p === "string" && (blacklist === null || blacklist === void 0 ? void 0 : blacklist.has(p))) {
log.log("[Sandbox] access ".concat(String(p), " on mock window, return mock object"));
return createBlackHole();
}
- var ret = Reflect.get(window, p);
- if (typeof ret === "function" && !ret.prototype) {
- return ret.bind(window);
- }
- // get DOM element by id, serializing may cause error
- if (isDomElement(ret)) {
- return undefined;
- }
- return ret;
+ return getPropertyFromNativeWindow(p);
},
});
return win;
@@ -1126,12 +1112,26 @@ function clearMockWindow() {
function isDomElement(obj) {
return obj instanceof Element || obj instanceof HTMLCollection;
}
+function getPropertyFromNativeWindow(prop) {
+ var ret = Reflect.get(window, prop);
+ if (typeof ret === "function" && !ret.prototype) {
+ return ret.bind(window);
+ }
+ // get DOM element by id, serializing may cause error
+ if (isDomElement(ret)) {
+ return undefined;
+ }
+ return ret;
+}
function proxySandbox(context, methods, options) {
- var _a = (options || {}).disableLimit, disableLimit = _a === void 0 ? false : _a;
+ var _a = options || {}, _b = _a.disableLimit, disableLimit = _b === void 0 ? false : _b, _c = _a.scope, scope = _c === void 0 ? "expression" : _c;
var isProtectedVar = function (key) {
return key in context || key in (methods || {}) || globalVarNames.has(key);
};
var cache = {};
+ if (scope === "function") {
+ mockWindow = createMockWindow(mockWindow, functionBlacklist);
+ }
return new Proxy(mockWindow, {
has: function (target, p) {
// proxy all variables
@@ -1163,7 +1163,7 @@ function proxySandbox(context, methods, options) {
return value;
}
if (disableLimit) {
- return Reflect.get(window, p);
+ return getPropertyFromNativeWindow(p);
}
return Reflect.get(target, p, receiver);
},
@@ -1427,6 +1427,7 @@ var DefaultParser = /** @class */ (function () {
function evalJson(unevaledValue, context) {
return new RelaxedJsonParser(unevaledValue, context).parse();
}
+// this will also be used in node-service
var RelaxedJsonParser = /** @class */ (function (_super) {
__extends(RelaxedJsonParser, _super);
function RelaxedJsonParser(unevaledValue, context) {
@@ -1503,11 +1504,12 @@ var RelaxedJsonParser = /** @class */ (function (_super) {
}(DefaultParser));
function evalFunction(unevaledValue, context, methods, isAsync) {
try {
- return new ValueAndMsg(function (args, runInHost) {
+ return new ValueAndMsg(function (args, runInHost, scope) {
if (runInHost === void 0) { runInHost = false; }
+ if (scope === void 0) { scope = "function"; }
return evalFunc(unevaledValue.startsWith("return")
? unevaledValue + "\n"
- : "return ".concat(isAsync ? "async " : "", "function(){'use strict'; ").concat(unevaledValue, "\n}()"), args ? __assign(__assign({}, context), args) : context, methods, { disableLimit: runInHost }, isAsync);
+ : "return ".concat(isAsync ? "async " : "", "function(){'use strict'; ").concat(unevaledValue, "\n}()"), args ? __assign(__assign({}, context), args) : context, methods, { disableLimit: runInHost, scope: scope }, isAsync);
});
}
catch (err) {
@@ -3209,8 +3211,8 @@ function updateNodesV2Action(value) {
value: value,
};
}
-function wrapActionExtraInfo(action, extraCompInfos) {
- return __assign(__assign({}, action), { extraInfo: { compInfos: extraCompInfos } });
+function wrapActionExtraInfo(action, extraInfos) {
+ return __assign(__assign({}, action), { extraInfo: __assign(__assign({}, action.extraInfo), extraInfos) });
}
function deferAction(action) {
return __assign(__assign({}, action), { priority: "defer" });
@@ -7537,6 +7539,7 @@ exports.FetchCheckNode = FetchCheckNode;
exports.FunctionNode = FunctionNode;
exports.MultiBaseComp = MultiBaseComp;
exports.RecordNode = RecordNode;
+exports.RelaxedJsonParser = RelaxedJsonParser;
exports.SimpleAbstractComp = SimpleAbstractComp;
exports.SimpleComp = SimpleComp;
exports.SimpleNode = SimpleNode;
@@ -7558,6 +7561,7 @@ exports.evalFunc = evalFunc;
exports.evalFunctionResult = evalFunctionResult;
exports.evalNodeOrMinor = evalNodeOrMinor;
exports.evalPerfUtil = evalPerfUtil;
+exports.evalScript = evalScript;
exports.evalStyle = evalStyle;
exports.executeQueryAction = executeQueryAction;
exports.fromRecord = fromRecord;
diff --git a/client/packages/openblocks-core/lib/index.d.ts b/client/packages/openblocks-core/lib/index.d.ts
index e04fb951..a9f1a039 100644
--- a/client/packages/openblocks-core/lib/index.d.ts
+++ b/client/packages/openblocks-core/lib/index.d.ts
@@ -1,6 +1,6 @@
///
-import * as react from "react";
-import { ReactNode } from "react";
+import * as react from 'react';
+import { ReactNode } from 'react';
declare type EvalMethods = Record>;
declare type CodeType = undefined | "JSON" | "Function";
@@ -8,87 +8,85 @@ declare type CodeFunction = (args?: Record, runInHost?: boolean
declare type NodeToValue = NodeT extends Node ? ValueType : never;
declare type FetchInfo = {
- /**
- * whether any of dependencies' node has executing query
- */
- isFetching: boolean;
- /**
- * whether all dependencies' query have be executed once
- */
- ready: boolean;
+ /**
+ * whether any of dependencies' node has executing query
+ */
+ isFetching: boolean;
+ /**
+ * whether all dependencies' query have be executed once
+ */
+ ready: boolean;
};
/**
* keyof without optional key
*/
declare type NonOptionalKeys = {
- [k in keyof T]-?: undefined extends T[k] ? never : k;
+ [k in keyof T]-?: undefined extends T[k] ? never : k;
}[keyof T];
/**
* T extends {[key: string]: Node | undefined}
*/
declare type RecordOptionalNodeToValue = {
- [K in NonOptionalKeys]: NodeToValue;
+ [K in NonOptionalKeys]: NodeToValue;
};
interface FetchInfoOptions {
- ignoreManualDepReadyStatus?: boolean;
+ ignoreManualDepReadyStatus?: boolean;
}
/**
* the base structure for evaluate
*/
interface Node {
- readonly type: string;
- /**
- * calculate evaluate result
- * @param exposingNodes other dependent Nodes
- */
- evaluate(exposingNodes?: Record>, methods?: EvalMethods): T;
- /**
- * whether the current or its dependencies have cyclic dependencies
- * this function only can be used after evaluate() has been called
- */
- hasCycle(): boolean;
- /**
- * only available after evaluate
- */
- dependNames(): string[];
- dependValues(): Record;
- /**
- * filter the real dependencies, for boosting the evaluation
- * @warn
- * the results include direct dependencies and dependencies of dependencies.
- * since input node's dependencies don't belong to module in the module feature, the node name may duplicate.
- *
- * FIXME: this should be a protected function.
- */
- filterNodes(exposingNodes: Record>): Map, Set>;
- fetchInfo(exposingNodes: Record>, options?: FetchInfoOptions): FetchInfo;
+ readonly type: string;
+ /**
+ * calculate evaluate result
+ * @param exposingNodes other dependent Nodes
+ */
+ evaluate(exposingNodes?: Record>, methods?: EvalMethods): T;
+ /**
+ * whether the current or its dependencies have cyclic dependencies
+ * this function only can be used after evaluate() has been called
+ */
+ hasCycle(): boolean;
+ /**
+ * only available after evaluate
+ */
+ dependNames(): string[];
+ dependValues(): Record;
+ /**
+ * filter the real dependencies, for boosting the evaluation
+ * @warn
+ * the results include direct dependencies and dependencies of dependencies.
+ * since input node's dependencies don't belong to module in the module feature, the node name may duplicate.
+ *
+ * FIXME: this should be a protected function.
+ */
+ filterNodes(exposingNodes: Record>): Map, Set>;
+ fetchInfo(exposingNodes: Record>, options?: FetchInfoOptions): FetchInfo;
}
declare abstract class AbstractNode implements Node {
- readonly type: string;
- evalCache: EvalCache;
- constructor();
- evaluate(exposingNodes?: Record>, methods?: EvalMethods): T;
- hasCycle(): boolean;
- abstract getChildren(): Node[];
- dependNames(): string[];
- abstract dependValues(): Record;
- isHitEvalCache(exposingNodes?: Record>): boolean;
- abstract filterNodes(
- exposingNodes: Record>
- ): Map, Set>;
- /**
- * evaluate without cache
- */
- abstract justEval(exposingNodes: Record>, methods?: EvalMethods): T;
- abstract fetchInfo(exposingNodes: Record>): FetchInfo;
+ readonly type: string;
+ evalCache: EvalCache;
+ constructor();
+ evaluate(exposingNodes?: Record>, methods?: EvalMethods): T;
+ hasCycle(): boolean;
+ abstract getChildren(): Node[];
+ dependNames(): string[];
+ abstract dependValues(): Record;
+ isHitEvalCache(exposingNodes?: Record>): boolean;
+ abstract filterNodes(exposingNodes: Record>): Map, Set>;
+ /**
+ * evaluate without cache
+ */
+ abstract justEval(exposingNodes: Record>, methods?: EvalMethods): T;
+ abstract fetchInfo(exposingNodes: Record>): FetchInfo;
}
interface EvalCache {
- dependingNodeMap?: Map, Set>;
- value?: T;
- inEval?: boolean;
- cyclic?: boolean;
- inIsFetching?: boolean;
- inFilterNodes?: boolean;
+ dependingNodeMap?: Map, Set>;
+ value?: T;
+ inEval?: boolean;
+ cyclic?: boolean;
+ inIsFetching?: boolean;
+ inFilterNodes?: boolean;
}
/**
* check whether 2 dependingNodeMaps are equal
@@ -99,24 +97,21 @@ interface EvalCache {
* @param dependingNodeMap2 second dependingNodeMap
* @returns whether equals
*/
-declare function dependingNodeMapEquals(
- dependingNodeMap1: Map, Set> | undefined,
- dependingNodeMap2: Map, Set>
-): boolean;
+declare function dependingNodeMapEquals(dependingNodeMap1: Map, Set> | undefined, dependingNodeMap2: Map, Set>): boolean;
interface CachedValue {
- value: T;
- isCached: boolean;
+ value: T;
+ isCached: boolean;
}
declare class CachedNode extends AbstractNode> {
- type: string;
- child: AbstractNode;
- constructor(child: AbstractNode);
- filterNodes(exposingNodes: Record>): Map, Set>;
- justEval(exposingNodes: Record>, methods?: EvalMethods): CachedValue;
- getChildren(): Node[];
- dependValues(): Record;
- fetchInfo(exposingNodes: Record>): FetchInfo;
+ type: string;
+ child: AbstractNode;
+ constructor(child: AbstractNode);
+ filterNodes(exposingNodes: Record>): Map, Set>;
+ justEval(exposingNodes: Record>, methods?: EvalMethods): CachedValue;
+ getChildren(): Node[];
+ dependValues(): Record;
+ fetchInfo(exposingNodes: Record>): FetchInfo;
}
/**
* return a new node with two input nodes.
@@ -137,40 +132,37 @@ declare function evalNodeOrMinor(mainNode: AbstractNode, minorNode: Node extends AbstractNode {
- readonly child: Node;
- readonly func: (params: T) => OutputType;
- readonly type = "function";
- constructor(child: Node, func: (params: T) => OutputType);
- filterNodes(exposingNodes: Record>): Map, Set>;
- justEval(exposingNodes: Record>, methods?: EvalMethods): OutputType;
- getChildren(): Node[];
- dependValues(): Record;
- fetchInfo(exposingNodes: Record>, options?: FetchInfoOptions): FetchInfo;
-}
-declare function withFunction(
- child: Node,
- func: (params: T) => OutputType
-): FunctionNode;
+ readonly child: Node;
+ readonly func: (params: T) => OutputType;
+ readonly type = "function";
+ constructor(child: Node, func: (params: T) => OutputType);
+ filterNodes(exposingNodes: Record>): Map, Set>;
+ justEval(exposingNodes: Record>, methods?: EvalMethods): OutputType;
+ getChildren(): Node[];
+ dependValues(): Record;
+ fetchInfo(exposingNodes: Record>, options?: FetchInfoOptions): FetchInfo;
+}
+declare function withFunction(child: Node, func: (params: T) => OutputType): FunctionNode;
declare type ValueExtra = {
- segments?: {
- value: string;
- success: boolean;
- }[];
+ segments?: {
+ value: string;
+ success: boolean;
+ }[];
};
declare class ValueAndMsg {
- value: T;
- msg?: string;
- extra?: ValueExtra;
- midValue?: any;
- constructor(value: T, msg?: string, extra?: ValueExtra, midValue?: any);
- hasError(): boolean;
- getMsg(displayValueFn?: (value: T) => string): string;
+ value: T;
+ msg?: string;
+ extra?: ValueExtra;
+ midValue?: any;
+ constructor(value: T, msg?: string, extra?: ValueExtra, midValue?: any);
+ hasError(): boolean;
+ getMsg(displayValueFn?: (value: T) => string): string;
}
interface CodeNodeOptions {
- codeType?: CodeType;
- evalWithMethods?: boolean;
+ codeType?: CodeType;
+ evalWithMethods?: boolean;
}
/**
* user input node
@@ -182,73 +174,60 @@ interface CodeNodeOptions {
* FIXME(libin): distinguish Json CodeNodeļ¼since wrapContext may cause problems.
*/
declare class CodeNode extends AbstractNode> {
- readonly unevaledValue: string;
- readonly options?: CodeNodeOptions | undefined;
- readonly type = "input";
- private readonly codeType?;
- private readonly evalWithMethods;
- private directDepends;
- constructor(unevaledValue: string, options?: CodeNodeOptions | undefined);
- private convertedValue;
- filterNodes(exposingNodes: Record>): Map, Set>;
- private filterDirectDepends;
- justEval(
- exposingNodes: Record>,
- methods?: EvalMethods
- ): ValueAndMsg;
- getChildren(): Node[];
- dependValues(): Record;
- fetchInfo(exposingNodes: Record>, options?: FetchInfoOptions): FetchInfo;
+ readonly unevaledValue: string;
+ readonly options?: CodeNodeOptions | undefined;
+ readonly type = "input";
+ private readonly codeType?;
+ private readonly evalWithMethods;
+ private directDepends;
+ constructor(unevaledValue: string, options?: CodeNodeOptions | undefined);
+ private convertedValue;
+ filterNodes(exposingNodes: Record>): Map, Set>;
+ private filterDirectDepends;
+ justEval(exposingNodes: Record>, methods?: EvalMethods): ValueAndMsg;
+ getChildren(): Node[];
+ dependValues(): Record;
+ fetchInfo(exposingNodes: Record>, options?: FetchInfoOptions): FetchInfo;
}
/**
* generate node for unevaledValue
*/
-declare function fromUnevaledValue(
- unevaledValue: string
-): FunctionNode, unknown>;
+declare function fromUnevaledValue(unevaledValue: string): FunctionNode, unknown>;
/**
* evaluate to get FetchInfo or fetching status
*/
declare class FetchCheckNode extends AbstractNode {
- readonly child: Node;
- readonly options?: FetchInfoOptions | undefined;
- readonly type = "fetchCheck";
- constructor(child: Node, options?: FetchInfoOptions | undefined);
- filterNodes(exposingNodes: Record>): Map, Set>;
- justEval(exposingNodes: Record>): FetchInfo;
- getChildren(): Node[];
- dependValues(): Record;
- fetchInfo(exposingNodes: Record>): FetchInfo;
+ readonly child: Node;
+ readonly options?: FetchInfoOptions | undefined;
+ readonly type = "fetchCheck";
+ constructor(child: Node, options?: FetchInfoOptions | undefined);
+ filterNodes(exposingNodes: Record>): Map, Set>;
+ justEval(exposingNodes: Record>): FetchInfo;
+ getChildren(): Node[];
+ dependValues(): Record;
+ fetchInfo(exposingNodes: Record>): FetchInfo;
}
declare function isFetching(node: Node): Node;
declare type RecordNodeToValue = {
- [K in keyof T]: NodeToValue;
+ [K in keyof T]: NodeToValue;
};
/**
* the evaluated value is the record constructed by the children nodes
*/
-declare class RecordNode>> extends AbstractNode<
- RecordNodeToValue
-> {
- readonly children: T;
- readonly type = "record";
- constructor(children: T);
- filterNodes(exposingNodes: Record>): Map, Set>;
- justEval(
- exposingNodes: Record>,
- methods?: EvalMethods
- ): RecordNodeToValue;
- getChildren(): Node[];
- dependValues(): Record;
- fetchInfo(
- exposingNodes: Record>,
- options?: FetchInfoOptions
- ): {
- isFetching: boolean;
- ready: boolean;
- };
+declare class RecordNode>> extends AbstractNode> {
+ readonly children: T;
+ readonly type = "record";
+ constructor(children: T);
+ filterNodes(exposingNodes: Record>): Map, Set>;
+ justEval(exposingNodes: Record>, methods?: EvalMethods): RecordNodeToValue;
+ getChildren(): Node[];
+ dependValues(): Record;
+ fetchInfo(exposingNodes: Record>, options?: FetchInfoOptions): {
+ isFetching: boolean;
+ ready: boolean;
+ };
}
declare function fromRecord>>(record: T): RecordNode;
@@ -256,17 +235,17 @@ declare function fromRecord>>(record: T):
* directly provide data
*/
declare class SimpleNode extends AbstractNode {
- readonly value: T;
- readonly type = "simple";
- constructor(value: T);
- filterNodes(exposingNodes: Record>): Map, Set>;
- justEval(exposingNodes: Record>): T;
- getChildren(): Node[];
- dependValues(): Record;
- fetchInfo(exposingNodes: Record>): {
- isFetching: boolean;
- ready: boolean;
- };
+ readonly value: T;
+ readonly type = "simple";
+ constructor(value: T);
+ filterNodes(exposingNodes: Record>): Map, Set>;
+ justEval(exposingNodes: Record>): T;
+ getChildren(): Node[];
+ dependValues(): Record;
+ fetchInfo(exposingNodes: Record>): {
+ isFetching: boolean;
+ ready: boolean;
+ };
}
/**
* provide simple value, don't need to eval
@@ -275,23 +254,18 @@ declare function fromValue(value: T): SimpleNode;
declare function fromValueWithCache(value: T): SimpleNode;
declare class WrapNode extends AbstractNode {
- readonly delegate: Node;
- readonly moduleExposingNodes: Record>;
- readonly moduleExposingMethods?: EvalMethods | undefined;
- readonly inputNodes?: Record> | undefined;
- readonly type = "wrap";
- constructor(
- delegate: Node,
- moduleExposingNodes: Record>,
- moduleExposingMethods?: EvalMethods | undefined,
- inputNodes?: Record> | undefined
- );
- private wrap;
- filterNodes(exposingNodes: Record>): Map, Set>;
- justEval(exposingNodes: Record>, methods: EvalMethods): T;
- fetchInfo(exposingNodes: Record>): FetchInfo;
- getChildren(): Node[];
- dependValues(): Record;
+ readonly delegate: Node;
+ readonly moduleExposingNodes: Record>;
+ readonly moduleExposingMethods?: EvalMethods | undefined;
+ readonly inputNodes?: Record> | undefined;
+ readonly type = "wrap";
+ constructor(delegate: Node, moduleExposingNodes: Record>, moduleExposingMethods?: EvalMethods | undefined, inputNodes?: Record> | undefined);
+ private wrap;
+ filterNodes(exposingNodes: Record>): Map, Set>;
+ justEval(exposingNodes: Record>, methods: EvalMethods): T;
+ fetchInfo(exposingNodes: Record>): FetchInfo;
+ getChildren(): Node[];
+ dependValues(): Record;
}
declare type WrapContextFn = (params?: Record) => T;
@@ -301,43 +275,40 @@ declare function wrapContext(node: Node): Node>;
* build a new node by setting new dependent nodes in child node
*/
declare class WrapContextNodeV2 extends AbstractNode {
- readonly child: Node;
- readonly paramNodes: Record>;
- readonly type = "wrapContextV2";
- constructor(child: Node, paramNodes: Record>);
- filterNodes(exposingNodes: Record>): Map, Set>;
- justEval(exposingNodes: Record>, methods?: EvalMethods): T;
- getChildren(): Node[];
- dependValues(): Record;
- fetchInfo(exposingNodes: Record>): FetchInfo;
- private wrap;
+ readonly child: Node;
+ readonly paramNodes: Record>;
+ readonly type = "wrapContextV2";
+ constructor(child: Node, paramNodes: Record>);
+ filterNodes(exposingNodes: Record>): Map, Set>;
+ justEval(exposingNodes: Record>, methods?: EvalMethods): T;
+ getChildren(): Node[];
+ dependValues(): Record;
+ fetchInfo(exposingNodes: Record