@flowgram.ai/variable-core 0.2.26 → 0.2.28
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/dist/esm/index.js +7 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +50 -45
- package/dist/index.d.ts +50 -45
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -28,7 +28,7 @@ declare class ScopeOutputData {
|
|
|
28
28
|
protected variableTable: IVariableTable;
|
|
29
29
|
protected memo: {
|
|
30
30
|
<T>(key: string | symbol, fn: () => T): T;
|
|
31
|
-
clear: (key?:
|
|
31
|
+
clear: (key?: string | symbol) => void;
|
|
32
32
|
};
|
|
33
33
|
get variableEngine(): VariableEngine;
|
|
34
34
|
get globalVariableTable(): IVariableTable;
|
|
@@ -39,11 +39,11 @@ declare class ScopeOutputData {
|
|
|
39
39
|
/**
|
|
40
40
|
* listen to variable list change
|
|
41
41
|
*/
|
|
42
|
-
get onVariableListChange(): (observer: (variables: VariableDeclaration
|
|
42
|
+
get onVariableListChange(): (observer: (variables: VariableDeclaration[]) => void) => _flowgram_ai_utils.Disposable;
|
|
43
43
|
/**
|
|
44
44
|
* listen to any variable update in list
|
|
45
45
|
*/
|
|
46
|
-
get onAnyVariableChange(): (observer: (changedVariable: VariableDeclaration
|
|
46
|
+
get onAnyVariableChange(): (observer: (changedVariable: VariableDeclaration) => void) => _flowgram_ai_utils.Disposable;
|
|
47
47
|
/**
|
|
48
48
|
* listen to variable list change + any variable update in list
|
|
49
49
|
*/
|
|
@@ -74,7 +74,7 @@ declare class ScopeAvailableData {
|
|
|
74
74
|
readonly scope: Scope;
|
|
75
75
|
protected memo: {
|
|
76
76
|
<T>(key: string | symbol, fn: () => T): T;
|
|
77
|
-
clear: (key?:
|
|
77
|
+
clear: (key?: string | symbol) => void;
|
|
78
78
|
};
|
|
79
79
|
get globalVariableTable(): IVariableTable;
|
|
80
80
|
protected refresh$: Subject<void>;
|
|
@@ -195,7 +195,7 @@ declare class Scope<ScopeMeta extends Record<string, any> = Record<string, any>>
|
|
|
195
195
|
*/
|
|
196
196
|
protected memo: {
|
|
197
197
|
<T>(key: string | symbol, fn: () => T): T;
|
|
198
|
-
clear: (key?:
|
|
198
|
+
clear: (key?: string | symbol) => void;
|
|
199
199
|
};
|
|
200
200
|
toDispose: DisposableCollection;
|
|
201
201
|
constructor(options: {
|
|
@@ -417,33 +417,33 @@ declare enum ASTKind {
|
|
|
417
417
|
* 类型相关
|
|
418
418
|
* - 内部默认实现一套基于 JSON 类型的类型 AST 节点
|
|
419
419
|
*/
|
|
420
|
-
String = "String"
|
|
421
|
-
Number = "Number"
|
|
422
|
-
Integer = "Integer"
|
|
423
|
-
Boolean = "Boolean"
|
|
424
|
-
Object = "Object"
|
|
425
|
-
Array = "Array"
|
|
426
|
-
Map = "Map"
|
|
427
|
-
Union = "Union"
|
|
428
|
-
Any = "Any"
|
|
429
|
-
CustomType = "CustomType"
|
|
420
|
+
String = "String",// 字符串
|
|
421
|
+
Number = "Number",// 数字
|
|
422
|
+
Integer = "Integer",// 整数
|
|
423
|
+
Boolean = "Boolean",// 布尔值
|
|
424
|
+
Object = "Object",// Object
|
|
425
|
+
Array = "Array",// Array
|
|
426
|
+
Map = "Map",// Map
|
|
427
|
+
Union = "Union",// 联合类型,常用于类型判断,一般不对业务透出
|
|
428
|
+
Any = "Any",// 任意类型,常用于业务判断
|
|
429
|
+
CustomType = "CustomType",// 自定义类型,用于业务自定义类型
|
|
430
430
|
/**
|
|
431
431
|
* 声明
|
|
432
432
|
*/
|
|
433
|
-
Property = "Property"
|
|
434
|
-
VariableDeclaration = "VariableDeclaration"
|
|
435
|
-
VariableDeclarationList = "VariableDeclarationList"
|
|
433
|
+
Property = "Property",// Object 下钻的字段定义
|
|
434
|
+
VariableDeclaration = "VariableDeclaration",// 变量声明
|
|
435
|
+
VariableDeclarationList = "VariableDeclarationList",// 变量声明
|
|
436
436
|
/**
|
|
437
437
|
* 表达式
|
|
438
438
|
*/
|
|
439
|
-
KeyPathExpression = "KeyPathExpression"
|
|
440
|
-
EnumerateExpression = "EnumerateExpression"
|
|
441
|
-
WrapArrayExpression = "WrapArrayExpression"
|
|
439
|
+
KeyPathExpression = "KeyPathExpression",// 通过路径系统访问变量上的字段
|
|
440
|
+
EnumerateExpression = "EnumerateExpression",// 对指定的数据进行遍历
|
|
441
|
+
WrapArrayExpression = "WrapArrayExpression",// Wrap with Array Type
|
|
442
442
|
/**
|
|
443
443
|
* 通用 AST 节点
|
|
444
444
|
*/
|
|
445
|
-
ListNode = "ListNode"
|
|
446
|
-
DataNode = "DataNode"
|
|
445
|
+
ListNode = "ListNode",// 通用 List<ASTNode> 存储节点
|
|
446
|
+
DataNode = "DataNode",// 通用的数据存储节点
|
|
447
447
|
MapNode = "MapNode"
|
|
448
448
|
}
|
|
449
449
|
interface CreateASTParams {
|
|
@@ -522,10 +522,10 @@ declare enum ASTNodeFlags {
|
|
|
522
522
|
/**
|
|
523
523
|
* 变量类型
|
|
524
524
|
*/
|
|
525
|
-
BasicType = 8
|
|
526
|
-
DrilldownType = 16
|
|
527
|
-
EnumerateType = 32
|
|
528
|
-
UnionType = 64
|
|
525
|
+
BasicType = 8,// 基础类型
|
|
526
|
+
DrilldownType = 16,// 可下钻的变量类型
|
|
527
|
+
EnumerateType = 32,// 可遍历的变量类型
|
|
528
|
+
UnionType = 64,// 复合类型,暂时不存在
|
|
529
529
|
VariableType = 120
|
|
530
530
|
}
|
|
531
531
|
|
|
@@ -1049,16 +1049,16 @@ declare namespace ASTFactory {
|
|
|
1049
1049
|
kind: ASTKind;
|
|
1050
1050
|
};
|
|
1051
1051
|
const createArray: (json: ArrayJSON) => {
|
|
1052
|
-
items?: ASTNodeJSONOrKind
|
|
1052
|
+
items?: ASTNodeJSONOrKind;
|
|
1053
1053
|
kind: ASTKind;
|
|
1054
1054
|
};
|
|
1055
1055
|
const createMap: (json: MapJSON) => {
|
|
1056
|
-
keyType?: ASTNodeJSONOrKind
|
|
1057
|
-
valueType?: ASTNodeJSONOrKind
|
|
1056
|
+
keyType?: ASTNodeJSONOrKind;
|
|
1057
|
+
valueType?: ASTNodeJSONOrKind;
|
|
1058
1058
|
kind: ASTKind;
|
|
1059
1059
|
};
|
|
1060
1060
|
const createUnion: (json: UnionJSON) => {
|
|
1061
|
-
types?: ASTNodeJSONOrKind[]
|
|
1061
|
+
types?: ASTNodeJSONOrKind[];
|
|
1062
1062
|
kind: ASTKind;
|
|
1063
1063
|
};
|
|
1064
1064
|
const createCustomType: (json: CustomTypeJSON) => {
|
|
@@ -1069,23 +1069,23 @@ declare namespace ASTFactory {
|
|
|
1069
1069
|
* 声明相关
|
|
1070
1070
|
*/
|
|
1071
1071
|
const createVariableDeclaration: <VariableMeta = any>(json: VariableDeclarationJSON<VariableMeta>) => {
|
|
1072
|
-
key?:
|
|
1073
|
-
type?: ASTNodeJSONOrKind
|
|
1074
|
-
initializer?: ASTNodeJSON
|
|
1072
|
+
key?: Identifier;
|
|
1073
|
+
type?: ASTNodeJSONOrKind;
|
|
1074
|
+
initializer?: ASTNodeJSON;
|
|
1075
1075
|
meta?: VariableMeta | undefined;
|
|
1076
|
-
order?: number
|
|
1076
|
+
order?: number;
|
|
1077
1077
|
kind: ASTKind;
|
|
1078
1078
|
};
|
|
1079
1079
|
const createProperty: <VariableMeta = any>(json: PropertyJSON<VariableMeta>) => {
|
|
1080
|
-
key:
|
|
1081
|
-
type?: ASTNodeJSONOrKind
|
|
1082
|
-
initializer?: ASTNodeJSON
|
|
1080
|
+
key: Identifier;
|
|
1081
|
+
type?: ASTNodeJSONOrKind;
|
|
1082
|
+
initializer?: ASTNodeJSON;
|
|
1083
1083
|
meta?: VariableMeta | undefined;
|
|
1084
1084
|
kind: ASTKind;
|
|
1085
1085
|
};
|
|
1086
1086
|
const createVariableDeclarationList: (json: VariableDeclarationListJSON) => {
|
|
1087
1087
|
declarations?: VariableDeclarationJSON<any>[] | undefined;
|
|
1088
|
-
startOrder?: number
|
|
1088
|
+
startOrder?: number;
|
|
1089
1089
|
kind: ASTKind;
|
|
1090
1090
|
};
|
|
1091
1091
|
/**
|
|
@@ -1106,14 +1106,19 @@ declare namespace ASTFactory {
|
|
|
1106
1106
|
/**
|
|
1107
1107
|
* 通过 AST Class 创建
|
|
1108
1108
|
*/
|
|
1109
|
-
const create: <
|
|
1110
|
-
new (...args: any[]): ASTNode<JSON_1, any>;
|
|
1109
|
+
const create: <JSON extends ASTNodeJSON>(targetType: {
|
|
1111
1110
|
kind: string;
|
|
1112
|
-
|
|
1111
|
+
new (...args: any[]): ASTNode<JSON>;
|
|
1112
|
+
}, json: JSON) => {
|
|
1113
1113
|
kind: string;
|
|
1114
|
-
} &
|
|
1114
|
+
} & JSON;
|
|
1115
1115
|
}
|
|
1116
1116
|
|
|
1117
|
+
/**
|
|
1118
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
1119
|
+
* SPDX-License-Identifier: MIT
|
|
1120
|
+
*/
|
|
1121
|
+
|
|
1117
1122
|
declare namespace ASTMatch {
|
|
1118
1123
|
/**
|
|
1119
1124
|
* 类型相关
|
|
@@ -1137,7 +1142,7 @@ declare namespace ASTMatch {
|
|
|
1137
1142
|
* 表达式相关
|
|
1138
1143
|
*/
|
|
1139
1144
|
const isEnumerateExpression: (node?: ASTNode) => node is EnumerateExpression;
|
|
1140
|
-
const isKeyPathExpression: (node?: ASTNode) => node is KeyPathExpression
|
|
1145
|
+
const isKeyPathExpression: (node?: ASTNode) => node is KeyPathExpression;
|
|
1141
1146
|
/**
|
|
1142
1147
|
* Check AST Match by ASTClass
|
|
1143
1148
|
*/
|
|
@@ -1201,7 +1206,7 @@ declare class VariableEngine implements Disposable {
|
|
|
1201
1206
|
protected toDispose: DisposableCollection;
|
|
1202
1207
|
protected memo: {
|
|
1203
1208
|
<T>(key: string | symbol, fn: () => T): T;
|
|
1204
|
-
clear: (key?:
|
|
1209
|
+
clear: (key?: string | symbol) => void;
|
|
1205
1210
|
};
|
|
1206
1211
|
protected scopeMap: Map<string | symbol, Scope<Record<string, any>>>;
|
|
1207
1212
|
globalEvent$: Subject<GlobalEventActionType>;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ declare class ScopeOutputData {
|
|
|
28
28
|
protected variableTable: IVariableTable;
|
|
29
29
|
protected memo: {
|
|
30
30
|
<T>(key: string | symbol, fn: () => T): T;
|
|
31
|
-
clear: (key?:
|
|
31
|
+
clear: (key?: string | symbol) => void;
|
|
32
32
|
};
|
|
33
33
|
get variableEngine(): VariableEngine;
|
|
34
34
|
get globalVariableTable(): IVariableTable;
|
|
@@ -39,11 +39,11 @@ declare class ScopeOutputData {
|
|
|
39
39
|
/**
|
|
40
40
|
* listen to variable list change
|
|
41
41
|
*/
|
|
42
|
-
get onVariableListChange(): (observer: (variables: VariableDeclaration
|
|
42
|
+
get onVariableListChange(): (observer: (variables: VariableDeclaration[]) => void) => _flowgram_ai_utils.Disposable;
|
|
43
43
|
/**
|
|
44
44
|
* listen to any variable update in list
|
|
45
45
|
*/
|
|
46
|
-
get onAnyVariableChange(): (observer: (changedVariable: VariableDeclaration
|
|
46
|
+
get onAnyVariableChange(): (observer: (changedVariable: VariableDeclaration) => void) => _flowgram_ai_utils.Disposable;
|
|
47
47
|
/**
|
|
48
48
|
* listen to variable list change + any variable update in list
|
|
49
49
|
*/
|
|
@@ -74,7 +74,7 @@ declare class ScopeAvailableData {
|
|
|
74
74
|
readonly scope: Scope;
|
|
75
75
|
protected memo: {
|
|
76
76
|
<T>(key: string | symbol, fn: () => T): T;
|
|
77
|
-
clear: (key?:
|
|
77
|
+
clear: (key?: string | symbol) => void;
|
|
78
78
|
};
|
|
79
79
|
get globalVariableTable(): IVariableTable;
|
|
80
80
|
protected refresh$: Subject<void>;
|
|
@@ -195,7 +195,7 @@ declare class Scope<ScopeMeta extends Record<string, any> = Record<string, any>>
|
|
|
195
195
|
*/
|
|
196
196
|
protected memo: {
|
|
197
197
|
<T>(key: string | symbol, fn: () => T): T;
|
|
198
|
-
clear: (key?:
|
|
198
|
+
clear: (key?: string | symbol) => void;
|
|
199
199
|
};
|
|
200
200
|
toDispose: DisposableCollection;
|
|
201
201
|
constructor(options: {
|
|
@@ -417,33 +417,33 @@ declare enum ASTKind {
|
|
|
417
417
|
* 类型相关
|
|
418
418
|
* - 内部默认实现一套基于 JSON 类型的类型 AST 节点
|
|
419
419
|
*/
|
|
420
|
-
String = "String"
|
|
421
|
-
Number = "Number"
|
|
422
|
-
Integer = "Integer"
|
|
423
|
-
Boolean = "Boolean"
|
|
424
|
-
Object = "Object"
|
|
425
|
-
Array = "Array"
|
|
426
|
-
Map = "Map"
|
|
427
|
-
Union = "Union"
|
|
428
|
-
Any = "Any"
|
|
429
|
-
CustomType = "CustomType"
|
|
420
|
+
String = "String",// 字符串
|
|
421
|
+
Number = "Number",// 数字
|
|
422
|
+
Integer = "Integer",// 整数
|
|
423
|
+
Boolean = "Boolean",// 布尔值
|
|
424
|
+
Object = "Object",// Object
|
|
425
|
+
Array = "Array",// Array
|
|
426
|
+
Map = "Map",// Map
|
|
427
|
+
Union = "Union",// 联合类型,常用于类型判断,一般不对业务透出
|
|
428
|
+
Any = "Any",// 任意类型,常用于业务判断
|
|
429
|
+
CustomType = "CustomType",// 自定义类型,用于业务自定义类型
|
|
430
430
|
/**
|
|
431
431
|
* 声明
|
|
432
432
|
*/
|
|
433
|
-
Property = "Property"
|
|
434
|
-
VariableDeclaration = "VariableDeclaration"
|
|
435
|
-
VariableDeclarationList = "VariableDeclarationList"
|
|
433
|
+
Property = "Property",// Object 下钻的字段定义
|
|
434
|
+
VariableDeclaration = "VariableDeclaration",// 变量声明
|
|
435
|
+
VariableDeclarationList = "VariableDeclarationList",// 变量声明
|
|
436
436
|
/**
|
|
437
437
|
* 表达式
|
|
438
438
|
*/
|
|
439
|
-
KeyPathExpression = "KeyPathExpression"
|
|
440
|
-
EnumerateExpression = "EnumerateExpression"
|
|
441
|
-
WrapArrayExpression = "WrapArrayExpression"
|
|
439
|
+
KeyPathExpression = "KeyPathExpression",// 通过路径系统访问变量上的字段
|
|
440
|
+
EnumerateExpression = "EnumerateExpression",// 对指定的数据进行遍历
|
|
441
|
+
WrapArrayExpression = "WrapArrayExpression",// Wrap with Array Type
|
|
442
442
|
/**
|
|
443
443
|
* 通用 AST 节点
|
|
444
444
|
*/
|
|
445
|
-
ListNode = "ListNode"
|
|
446
|
-
DataNode = "DataNode"
|
|
445
|
+
ListNode = "ListNode",// 通用 List<ASTNode> 存储节点
|
|
446
|
+
DataNode = "DataNode",// 通用的数据存储节点
|
|
447
447
|
MapNode = "MapNode"
|
|
448
448
|
}
|
|
449
449
|
interface CreateASTParams {
|
|
@@ -522,10 +522,10 @@ declare enum ASTNodeFlags {
|
|
|
522
522
|
/**
|
|
523
523
|
* 变量类型
|
|
524
524
|
*/
|
|
525
|
-
BasicType = 8
|
|
526
|
-
DrilldownType = 16
|
|
527
|
-
EnumerateType = 32
|
|
528
|
-
UnionType = 64
|
|
525
|
+
BasicType = 8,// 基础类型
|
|
526
|
+
DrilldownType = 16,// 可下钻的变量类型
|
|
527
|
+
EnumerateType = 32,// 可遍历的变量类型
|
|
528
|
+
UnionType = 64,// 复合类型,暂时不存在
|
|
529
529
|
VariableType = 120
|
|
530
530
|
}
|
|
531
531
|
|
|
@@ -1049,16 +1049,16 @@ declare namespace ASTFactory {
|
|
|
1049
1049
|
kind: ASTKind;
|
|
1050
1050
|
};
|
|
1051
1051
|
const createArray: (json: ArrayJSON) => {
|
|
1052
|
-
items?: ASTNodeJSONOrKind
|
|
1052
|
+
items?: ASTNodeJSONOrKind;
|
|
1053
1053
|
kind: ASTKind;
|
|
1054
1054
|
};
|
|
1055
1055
|
const createMap: (json: MapJSON) => {
|
|
1056
|
-
keyType?: ASTNodeJSONOrKind
|
|
1057
|
-
valueType?: ASTNodeJSONOrKind
|
|
1056
|
+
keyType?: ASTNodeJSONOrKind;
|
|
1057
|
+
valueType?: ASTNodeJSONOrKind;
|
|
1058
1058
|
kind: ASTKind;
|
|
1059
1059
|
};
|
|
1060
1060
|
const createUnion: (json: UnionJSON) => {
|
|
1061
|
-
types?: ASTNodeJSONOrKind[]
|
|
1061
|
+
types?: ASTNodeJSONOrKind[];
|
|
1062
1062
|
kind: ASTKind;
|
|
1063
1063
|
};
|
|
1064
1064
|
const createCustomType: (json: CustomTypeJSON) => {
|
|
@@ -1069,23 +1069,23 @@ declare namespace ASTFactory {
|
|
|
1069
1069
|
* 声明相关
|
|
1070
1070
|
*/
|
|
1071
1071
|
const createVariableDeclaration: <VariableMeta = any>(json: VariableDeclarationJSON<VariableMeta>) => {
|
|
1072
|
-
key?:
|
|
1073
|
-
type?: ASTNodeJSONOrKind
|
|
1074
|
-
initializer?: ASTNodeJSON
|
|
1072
|
+
key?: Identifier;
|
|
1073
|
+
type?: ASTNodeJSONOrKind;
|
|
1074
|
+
initializer?: ASTNodeJSON;
|
|
1075
1075
|
meta?: VariableMeta | undefined;
|
|
1076
|
-
order?: number
|
|
1076
|
+
order?: number;
|
|
1077
1077
|
kind: ASTKind;
|
|
1078
1078
|
};
|
|
1079
1079
|
const createProperty: <VariableMeta = any>(json: PropertyJSON<VariableMeta>) => {
|
|
1080
|
-
key:
|
|
1081
|
-
type?: ASTNodeJSONOrKind
|
|
1082
|
-
initializer?: ASTNodeJSON
|
|
1080
|
+
key: Identifier;
|
|
1081
|
+
type?: ASTNodeJSONOrKind;
|
|
1082
|
+
initializer?: ASTNodeJSON;
|
|
1083
1083
|
meta?: VariableMeta | undefined;
|
|
1084
1084
|
kind: ASTKind;
|
|
1085
1085
|
};
|
|
1086
1086
|
const createVariableDeclarationList: (json: VariableDeclarationListJSON) => {
|
|
1087
1087
|
declarations?: VariableDeclarationJSON<any>[] | undefined;
|
|
1088
|
-
startOrder?: number
|
|
1088
|
+
startOrder?: number;
|
|
1089
1089
|
kind: ASTKind;
|
|
1090
1090
|
};
|
|
1091
1091
|
/**
|
|
@@ -1106,14 +1106,19 @@ declare namespace ASTFactory {
|
|
|
1106
1106
|
/**
|
|
1107
1107
|
* 通过 AST Class 创建
|
|
1108
1108
|
*/
|
|
1109
|
-
const create: <
|
|
1110
|
-
new (...args: any[]): ASTNode<JSON_1, any>;
|
|
1109
|
+
const create: <JSON extends ASTNodeJSON>(targetType: {
|
|
1111
1110
|
kind: string;
|
|
1112
|
-
|
|
1111
|
+
new (...args: any[]): ASTNode<JSON>;
|
|
1112
|
+
}, json: JSON) => {
|
|
1113
1113
|
kind: string;
|
|
1114
|
-
} &
|
|
1114
|
+
} & JSON;
|
|
1115
1115
|
}
|
|
1116
1116
|
|
|
1117
|
+
/**
|
|
1118
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
1119
|
+
* SPDX-License-Identifier: MIT
|
|
1120
|
+
*/
|
|
1121
|
+
|
|
1117
1122
|
declare namespace ASTMatch {
|
|
1118
1123
|
/**
|
|
1119
1124
|
* 类型相关
|
|
@@ -1137,7 +1142,7 @@ declare namespace ASTMatch {
|
|
|
1137
1142
|
* 表达式相关
|
|
1138
1143
|
*/
|
|
1139
1144
|
const isEnumerateExpression: (node?: ASTNode) => node is EnumerateExpression;
|
|
1140
|
-
const isKeyPathExpression: (node?: ASTNode) => node is KeyPathExpression
|
|
1145
|
+
const isKeyPathExpression: (node?: ASTNode) => node is KeyPathExpression;
|
|
1141
1146
|
/**
|
|
1142
1147
|
* Check AST Match by ASTClass
|
|
1143
1148
|
*/
|
|
@@ -1201,7 +1206,7 @@ declare class VariableEngine implements Disposable {
|
|
|
1201
1206
|
protected toDispose: DisposableCollection;
|
|
1202
1207
|
protected memo: {
|
|
1203
1208
|
<T>(key: string | symbol, fn: () => T): T;
|
|
1204
|
-
clear: (key?:
|
|
1209
|
+
clear: (key?: string | symbol) => void;
|
|
1205
1210
|
};
|
|
1206
1211
|
protected scopeMap: Map<string | symbol, Scope<Record<string, any>>>;
|
|
1207
1212
|
globalEvent$: Subject<GlobalEventActionType>;
|
package/dist/index.js
CHANGED
|
@@ -118,6 +118,7 @@ var VariableTable = class {
|
|
|
118
118
|
constructor(parentTable) {
|
|
119
119
|
this.parentTable = parentTable;
|
|
120
120
|
this.table = /* @__PURE__ */ new Map();
|
|
121
|
+
this.toDispose = new import_utils2.DisposableCollection();
|
|
121
122
|
this.onDataChangeEmitter = new import_utils2.Emitter();
|
|
122
123
|
this.variables$ = new import_rxjs.Subject();
|
|
123
124
|
// 监听变量列表中的单个变量变化
|
|
@@ -139,6 +140,11 @@ var VariableTable = class {
|
|
|
139
140
|
*/
|
|
140
141
|
this.onDataChange = this.onDataChangeEmitter.event;
|
|
141
142
|
this._version = 0;
|
|
143
|
+
this.toDispose.pushAll([
|
|
144
|
+
this.onDataChangeEmitter,
|
|
145
|
+
// active share()
|
|
146
|
+
this.onAnyVariableChange(() => null)
|
|
147
|
+
]);
|
|
142
148
|
}
|
|
143
149
|
/**
|
|
144
150
|
* listen to any variable update in list
|
|
@@ -228,7 +234,7 @@ var VariableTable = class {
|
|
|
228
234
|
this.parentTable?.fireChange();
|
|
229
235
|
this.variables$.complete();
|
|
230
236
|
this.variables$.unsubscribe();
|
|
231
|
-
this.
|
|
237
|
+
this.toDispose.dispose();
|
|
232
238
|
}
|
|
233
239
|
};
|
|
234
240
|
|