@itwin/presentation-frontend 4.0.0-dev.52 → 4.0.0-dev.55

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.
Files changed (88) hide show
  1. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
  2. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +47 -47
  3. package/lib/cjs/presentation-frontend/Diagnostics.d.ts +14 -14
  4. package/lib/cjs/presentation-frontend/Diagnostics.js +61 -61
  5. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
  6. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js +20 -20
  7. package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
  8. package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +41 -41
  9. package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts +10 -10
  10. package/lib/cjs/presentation-frontend/LocalizationHelper.js +31 -31
  11. package/lib/cjs/presentation-frontend/Presentation.d.ts +73 -73
  12. package/lib/cjs/presentation-frontend/Presentation.js +159 -159
  13. package/lib/cjs/presentation-frontend/PresentationManager.d.ts +205 -205
  14. package/lib/cjs/presentation-frontend/PresentationManager.js +438 -438
  15. package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
  16. package/lib/cjs/presentation-frontend/RulesetManager.d.ts +63 -63
  17. package/lib/cjs/presentation-frontend/RulesetManager.js +85 -85
  18. package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
  19. package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +195 -195
  20. package/lib/cjs/presentation-frontend/StateTracker.d.ts +38 -38
  21. package/lib/cjs/presentation-frontend/StateTracker.js +128 -128
  22. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
  23. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
  24. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +519 -519
  25. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  26. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
  27. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +290 -290
  28. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts +52 -52
  29. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +97 -97
  30. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
  31. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +9 -9
  32. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
  33. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +33 -33
  34. package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
  35. package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +108 -108
  36. package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts +17 -17
  37. package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +40 -40
  38. package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts +139 -139
  39. package/lib/cjs/presentation-frontend/selection/SelectionManager.js +414 -414
  40. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
  41. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +91 -91
  42. package/lib/cjs/presentation-frontend.d.ts +34 -34
  43. package/lib/cjs/presentation-frontend.js +54 -50
  44. package/lib/cjs/presentation-frontend.js.map +1 -1
  45. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
  46. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +43 -43
  47. package/lib/esm/presentation-frontend/Diagnostics.d.ts +14 -14
  48. package/lib/esm/presentation-frontend/Diagnostics.js +56 -56
  49. package/lib/esm/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
  50. package/lib/esm/presentation-frontend/FrontendLoggerCategory.js +17 -17
  51. package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
  52. package/lib/esm/presentation-frontend/IpcRequestsHandler.js +37 -37
  53. package/lib/esm/presentation-frontend/LocalizationHelper.d.ts +10 -10
  54. package/lib/esm/presentation-frontend/LocalizationHelper.js +27 -27
  55. package/lib/esm/presentation-frontend/Presentation.d.ts +73 -73
  56. package/lib/esm/presentation-frontend/Presentation.js +155 -155
  57. package/lib/esm/presentation-frontend/PresentationManager.d.ts +205 -205
  58. package/lib/esm/presentation-frontend/PresentationManager.js +433 -433
  59. package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
  60. package/lib/esm/presentation-frontend/RulesetManager.d.ts +63 -63
  61. package/lib/esm/presentation-frontend/RulesetManager.js +81 -81
  62. package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
  63. package/lib/esm/presentation-frontend/RulesetVariablesManager.js +191 -191
  64. package/lib/esm/presentation-frontend/StateTracker.d.ts +38 -38
  65. package/lib/esm/presentation-frontend/StateTracker.js +124 -124
  66. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
  67. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
  68. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +514 -513
  69. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  70. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
  71. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +282 -282
  72. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts +52 -52
  73. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +93 -93
  74. package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
  75. package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +8 -8
  76. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
  77. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +29 -29
  78. package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
  79. package/lib/esm/presentation-frontend/selection/SelectionHandler.js +104 -104
  80. package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts +17 -17
  81. package/lib/esm/presentation-frontend/selection/SelectionHelper.js +36 -36
  82. package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts +139 -139
  83. package/lib/esm/presentation-frontend/selection/SelectionManager.js +409 -409
  84. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
  85. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +85 -85
  86. package/lib/esm/presentation-frontend.d.ts +34 -34
  87. package/lib/esm/presentation-frontend.js +38 -38
  88. package/package.json +15 -15
@@ -1,196 +1,196 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module Core
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.RulesetVariablesManagerImpl = void 0;
11
- const core_bentley_1 = require("@itwin/core-bentley");
12
- const presentation_common_1 = require("@itwin/presentation-common");
13
- /** @internal */
14
- class RulesetVariablesManagerImpl {
15
- constructor(rulesetId, ipcHandler) {
16
- this._clientValues = new Map();
17
- this.onVariableChanged = new core_bentley_1.BeEvent();
18
- this._rulesetId = rulesetId;
19
- this._ipcHandler = ipcHandler;
20
- }
21
- getAllVariables() {
22
- const variables = [];
23
- for (const entry of this._clientValues)
24
- variables.push(entry[1]);
25
- return variables;
26
- }
27
- changeValueType(variable, toType) {
28
- switch (toType) {
29
- case presentation_common_1.VariableValueTypes.Bool:
30
- switch (variable.type) {
31
- case presentation_common_1.VariableValueTypes.Int: return (0 !== variable.value);
32
- case presentation_common_1.VariableValueTypes.Id64: return core_bentley_1.Id64.isValidId64(variable.value);
33
- default: return undefined;
34
- }
35
- case presentation_common_1.VariableValueTypes.Int:
36
- switch (variable.type) {
37
- case presentation_common_1.VariableValueTypes.Bool: return variable.value ? 1 : 0;
38
- case presentation_common_1.VariableValueTypes.Id64: return core_bentley_1.Id64.getUpperUint32(variable.value);
39
- default: return undefined;
40
- }
41
- case presentation_common_1.VariableValueTypes.IntArray:
42
- switch (variable.type) {
43
- case presentation_common_1.VariableValueTypes.Id64Array: return variable.value.map((id) => core_bentley_1.Id64.getUpperUint32(id));
44
- default: return undefined;
45
- }
46
- case presentation_common_1.VariableValueTypes.Id64:
47
- switch (variable.type) {
48
- case presentation_common_1.VariableValueTypes.Bool: return core_bentley_1.Id64.fromLocalAndBriefcaseIds(variable.value ? 1 : 0, 0);
49
- case presentation_common_1.VariableValueTypes.Int: return core_bentley_1.Id64.fromLocalAndBriefcaseIds(variable.value, 0);
50
- default: return undefined;
51
- }
52
- case presentation_common_1.VariableValueTypes.Id64Array:
53
- switch (variable.type) {
54
- case presentation_common_1.VariableValueTypes.IntArray: return variable.value.map((int) => core_bentley_1.Id64.fromLocalAndBriefcaseIds(int, 0));
55
- default: return undefined;
56
- }
57
- case presentation_common_1.VariableValueTypes.String:
58
- switch (variable.type) {
59
- case presentation_common_1.VariableValueTypes.IntArray:
60
- case presentation_common_1.VariableValueTypes.Id64Array:
61
- return undefined;
62
- default: variable.value.toString();
63
- }
64
- }
65
- return undefined;
66
- }
67
- async getValue(id, type) {
68
- const variable = this._clientValues.get(id);
69
- if (!variable)
70
- return undefined;
71
- if (variable.type !== type)
72
- return this.changeValueType(variable, type);
73
- return variable.value;
74
- }
75
- async setValue(variable) {
76
- const oldVariable = this._clientValues.get(variable.id);
77
- if (oldVariable && variablesEqual(oldVariable, variable))
78
- return;
79
- this._clientValues.set(variable.id, variable);
80
- if (this._ipcHandler) {
81
- await this._ipcHandler.setRulesetVariable({ rulesetId: this._rulesetId, variable });
82
- }
83
- this.onVariableChanged.raiseEvent(variable.id, oldVariable?.value, variable.value);
84
- }
85
- async unset(variableId) {
86
- const variable = this._clientValues.get(variableId);
87
- if (variable === undefined)
88
- return;
89
- this._clientValues.delete(variable.id);
90
- if (this._ipcHandler) {
91
- await this._ipcHandler.unsetRulesetVariable({ rulesetId: this._rulesetId, variableId });
92
- }
93
- this.onVariableChanged.raiseEvent(variable.id, variable.value, undefined);
94
- }
95
- /**
96
- * Retrieves `string` variable value.
97
- * Returns empty string if variable does not exist or does not convert to string.
98
- */
99
- async getString(variableId) {
100
- return await this.getValue(variableId, presentation_common_1.VariableValueTypes.String) || "";
101
- }
102
- /**
103
- * Sets `string` variable value
104
- */
105
- async setString(variableId, value) {
106
- await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.String, value });
107
- }
108
- /**
109
- * Retrieves `boolean` variable value.
110
- * Returns `false` if variable does not exist or does not convert to boolean.
111
- */
112
- async getBool(variableId) {
113
- return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Bool) || false;
114
- }
115
- /**
116
- * Sets `boolean` variable value
117
- */
118
- async setBool(variableId, value) {
119
- await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.Bool, value });
120
- }
121
- /**
122
- * Retrieves `number` variable value.
123
- * Returns `0` if variable does not exist or does not convert to integer.
124
- */
125
- async getInt(variableId) {
126
- return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Int) || 0;
127
- }
128
- /**
129
- * Sets `number` variable value
130
- */
131
- async setInt(variableId, value) {
132
- await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.Int, value });
133
- }
134
- /**
135
- * Retrieves `number[]` variable value.
136
- * Returns empty array if variable does not exist or does not convert to integer array.
137
- */
138
- async getInts(variableId) {
139
- return await this.getValue(variableId, presentation_common_1.VariableValueTypes.IntArray) || [];
140
- }
141
- /**
142
- * Sets `number[]` variable value
143
- */
144
- async setInts(variableId, value) {
145
- await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.IntArray, value: [...value] });
146
- }
147
- /**
148
- * Retrieves `Id64String` variable value.
149
- * Returns invalid Id64String if variable does not exist or does not convert to Id64String.
150
- */
151
- async getId64(variableId) {
152
- return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Id64) || core_bentley_1.Id64.invalid;
153
- }
154
- /**
155
- * Sets `Id64String` variable value
156
- */
157
- async setId64(variableId, value) {
158
- await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.Id64, value });
159
- }
160
- /**
161
- * Retrieves `Id64String[]` variable value.
162
- * Returns empty array if variable does not exist or does not convert to Id64String array.
163
- */
164
- async getId64s(variableId) {
165
- return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Id64Array) || [];
166
- }
167
- /**
168
- * Sets `Id64String[]` variable value
169
- */
170
- async setId64s(variableId, value) {
171
- await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.Id64Array, value: [...core_bentley_1.OrderedId64Iterable.sortArray(value)] });
172
- }
173
- }
174
- exports.RulesetVariablesManagerImpl = RulesetVariablesManagerImpl;
175
- function variablesEqual(lhs, rhs) {
176
- if (lhs.type !== rhs.type)
177
- return false;
178
- switch (lhs.type) {
179
- case presentation_common_1.VariableValueTypes.IntArray:
180
- case presentation_common_1.VariableValueTypes.Id64Array:
181
- (0, core_bentley_1.assert)(rhs.type === lhs.type);
182
- return arraysEqual(lhs.value, rhs.value);
183
- default:
184
- return lhs.value === rhs.value;
185
- }
186
- }
187
- function arraysEqual(lhs, rhs) {
188
- if (lhs.length !== rhs.length)
189
- return false;
190
- for (let i = 0; i < lhs.length; ++i) {
191
- if (lhs[i] !== rhs[i])
192
- return false;
193
- }
194
- return true;
195
- }
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Core
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.RulesetVariablesManagerImpl = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ const presentation_common_1 = require("@itwin/presentation-common");
13
+ /** @internal */
14
+ class RulesetVariablesManagerImpl {
15
+ constructor(rulesetId, ipcHandler) {
16
+ this._clientValues = new Map();
17
+ this.onVariableChanged = new core_bentley_1.BeEvent();
18
+ this._rulesetId = rulesetId;
19
+ this._ipcHandler = ipcHandler;
20
+ }
21
+ getAllVariables() {
22
+ const variables = [];
23
+ for (const entry of this._clientValues)
24
+ variables.push(entry[1]);
25
+ return variables;
26
+ }
27
+ changeValueType(variable, toType) {
28
+ switch (toType) {
29
+ case presentation_common_1.VariableValueTypes.Bool:
30
+ switch (variable.type) {
31
+ case presentation_common_1.VariableValueTypes.Int: return (0 !== variable.value);
32
+ case presentation_common_1.VariableValueTypes.Id64: return core_bentley_1.Id64.isValidId64(variable.value);
33
+ default: return undefined;
34
+ }
35
+ case presentation_common_1.VariableValueTypes.Int:
36
+ switch (variable.type) {
37
+ case presentation_common_1.VariableValueTypes.Bool: return variable.value ? 1 : 0;
38
+ case presentation_common_1.VariableValueTypes.Id64: return core_bentley_1.Id64.getUpperUint32(variable.value);
39
+ default: return undefined;
40
+ }
41
+ case presentation_common_1.VariableValueTypes.IntArray:
42
+ switch (variable.type) {
43
+ case presentation_common_1.VariableValueTypes.Id64Array: return variable.value.map((id) => core_bentley_1.Id64.getUpperUint32(id));
44
+ default: return undefined;
45
+ }
46
+ case presentation_common_1.VariableValueTypes.Id64:
47
+ switch (variable.type) {
48
+ case presentation_common_1.VariableValueTypes.Bool: return core_bentley_1.Id64.fromLocalAndBriefcaseIds(variable.value ? 1 : 0, 0);
49
+ case presentation_common_1.VariableValueTypes.Int: return core_bentley_1.Id64.fromLocalAndBriefcaseIds(variable.value, 0);
50
+ default: return undefined;
51
+ }
52
+ case presentation_common_1.VariableValueTypes.Id64Array:
53
+ switch (variable.type) {
54
+ case presentation_common_1.VariableValueTypes.IntArray: return variable.value.map((int) => core_bentley_1.Id64.fromLocalAndBriefcaseIds(int, 0));
55
+ default: return undefined;
56
+ }
57
+ case presentation_common_1.VariableValueTypes.String:
58
+ switch (variable.type) {
59
+ case presentation_common_1.VariableValueTypes.IntArray:
60
+ case presentation_common_1.VariableValueTypes.Id64Array:
61
+ return undefined;
62
+ default: variable.value.toString();
63
+ }
64
+ }
65
+ return undefined;
66
+ }
67
+ async getValue(id, type) {
68
+ const variable = this._clientValues.get(id);
69
+ if (!variable)
70
+ return undefined;
71
+ if (variable.type !== type)
72
+ return this.changeValueType(variable, type);
73
+ return variable.value;
74
+ }
75
+ async setValue(variable) {
76
+ const oldVariable = this._clientValues.get(variable.id);
77
+ if (oldVariable && variablesEqual(oldVariable, variable))
78
+ return;
79
+ this._clientValues.set(variable.id, variable);
80
+ if (this._ipcHandler) {
81
+ await this._ipcHandler.setRulesetVariable({ rulesetId: this._rulesetId, variable });
82
+ }
83
+ this.onVariableChanged.raiseEvent(variable.id, oldVariable?.value, variable.value);
84
+ }
85
+ async unset(variableId) {
86
+ const variable = this._clientValues.get(variableId);
87
+ if (variable === undefined)
88
+ return;
89
+ this._clientValues.delete(variable.id);
90
+ if (this._ipcHandler) {
91
+ await this._ipcHandler.unsetRulesetVariable({ rulesetId: this._rulesetId, variableId });
92
+ }
93
+ this.onVariableChanged.raiseEvent(variable.id, variable.value, undefined);
94
+ }
95
+ /**
96
+ * Retrieves `string` variable value.
97
+ * Returns empty string if variable does not exist or does not convert to string.
98
+ */
99
+ async getString(variableId) {
100
+ return await this.getValue(variableId, presentation_common_1.VariableValueTypes.String) || "";
101
+ }
102
+ /**
103
+ * Sets `string` variable value
104
+ */
105
+ async setString(variableId, value) {
106
+ await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.String, value });
107
+ }
108
+ /**
109
+ * Retrieves `boolean` variable value.
110
+ * Returns `false` if variable does not exist or does not convert to boolean.
111
+ */
112
+ async getBool(variableId) {
113
+ return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Bool) || false;
114
+ }
115
+ /**
116
+ * Sets `boolean` variable value
117
+ */
118
+ async setBool(variableId, value) {
119
+ await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.Bool, value });
120
+ }
121
+ /**
122
+ * Retrieves `number` variable value.
123
+ * Returns `0` if variable does not exist or does not convert to integer.
124
+ */
125
+ async getInt(variableId) {
126
+ return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Int) || 0;
127
+ }
128
+ /**
129
+ * Sets `number` variable value
130
+ */
131
+ async setInt(variableId, value) {
132
+ await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.Int, value });
133
+ }
134
+ /**
135
+ * Retrieves `number[]` variable value.
136
+ * Returns empty array if variable does not exist or does not convert to integer array.
137
+ */
138
+ async getInts(variableId) {
139
+ return await this.getValue(variableId, presentation_common_1.VariableValueTypes.IntArray) || [];
140
+ }
141
+ /**
142
+ * Sets `number[]` variable value
143
+ */
144
+ async setInts(variableId, value) {
145
+ await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.IntArray, value: [...value] });
146
+ }
147
+ /**
148
+ * Retrieves `Id64String` variable value.
149
+ * Returns invalid Id64String if variable does not exist or does not convert to Id64String.
150
+ */
151
+ async getId64(variableId) {
152
+ return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Id64) || core_bentley_1.Id64.invalid;
153
+ }
154
+ /**
155
+ * Sets `Id64String` variable value
156
+ */
157
+ async setId64(variableId, value) {
158
+ await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.Id64, value });
159
+ }
160
+ /**
161
+ * Retrieves `Id64String[]` variable value.
162
+ * Returns empty array if variable does not exist or does not convert to Id64String array.
163
+ */
164
+ async getId64s(variableId) {
165
+ return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Id64Array) || [];
166
+ }
167
+ /**
168
+ * Sets `Id64String[]` variable value
169
+ */
170
+ async setId64s(variableId, value) {
171
+ await this.setValue({ id: variableId, type: presentation_common_1.VariableValueTypes.Id64Array, value: [...core_bentley_1.OrderedId64Iterable.sortArray(value)] });
172
+ }
173
+ }
174
+ exports.RulesetVariablesManagerImpl = RulesetVariablesManagerImpl;
175
+ function variablesEqual(lhs, rhs) {
176
+ if (lhs.type !== rhs.type)
177
+ return false;
178
+ switch (lhs.type) {
179
+ case presentation_common_1.VariableValueTypes.IntArray:
180
+ case presentation_common_1.VariableValueTypes.Id64Array:
181
+ (0, core_bentley_1.assert)(rhs.type === lhs.type);
182
+ return arraysEqual(lhs.value, rhs.value);
183
+ default:
184
+ return lhs.value === rhs.value;
185
+ }
186
+ }
187
+ function arraysEqual(lhs, rhs) {
188
+ if (lhs.length !== rhs.length)
189
+ return false;
190
+ for (let i = 0; i < lhs.length; ++i) {
191
+ if (lhs[i] !== rhs[i])
192
+ return false;
193
+ }
194
+ return true;
195
+ }
196
196
  //# sourceMappingURL=RulesetVariablesManager.js.map
@@ -1,39 +1,39 @@
1
- /** @packageDocumentation
2
- * @module Core
3
- */
4
- import { IModelConnection } from "@itwin/core-frontend";
5
- import { NodeKey } from "@itwin/presentation-common";
6
- import { IpcRequestsHandler } from "./IpcRequestsHandler";
7
- /**
8
- * Data structure that describes information used by [[StateTracker]] to identify node.
9
- * @internal
10
- */
11
- export interface NodeIdentifier {
12
- id: string;
13
- key: NodeKey;
14
- }
15
- /**
16
- * @internal
17
- */
18
- export interface NodeState {
19
- isExpanded?: boolean;
20
- instanceFilter?: string;
21
- }
22
- /**
23
- * The tracker stores up-to-date UI state of the hierarchies on the frontend and reports
24
- * just the state changes to the backend as soon as component sends in a new hierarchy state.
25
- *
26
- * @internal
27
- */
28
- export declare class StateTracker {
29
- private _hierarchyStates;
30
- private _ipcRequestsHandler;
31
- constructor(ipcRequestsHandler: IpcRequestsHandler);
32
- private updateHierarchyStateIfNeeded;
33
- onHierarchyClosed(imodel: IModelConnection, rulesetId: string, sourceId: string): Promise<void>;
34
- onHierarchyStateChanged(imodel: IModelConnection, rulesetId: string, sourceId: string, newHierarchyState: Array<{
35
- node: NodeIdentifier | undefined;
36
- state: NodeState;
37
- }>): Promise<void>;
38
- }
1
+ /** @packageDocumentation
2
+ * @module Core
3
+ */
4
+ import { IModelConnection } from "@itwin/core-frontend";
5
+ import { NodeKey } from "@itwin/presentation-common";
6
+ import { IpcRequestsHandler } from "./IpcRequestsHandler";
7
+ /**
8
+ * Data structure that describes information used by [[StateTracker]] to identify node.
9
+ * @internal
10
+ */
11
+ export interface NodeIdentifier {
12
+ id: string;
13
+ key: NodeKey;
14
+ }
15
+ /**
16
+ * @internal
17
+ */
18
+ export interface NodeState {
19
+ isExpanded?: boolean;
20
+ instanceFilter?: string;
21
+ }
22
+ /**
23
+ * The tracker stores up-to-date UI state of the hierarchies on the frontend and reports
24
+ * just the state changes to the backend as soon as component sends in a new hierarchy state.
25
+ *
26
+ * @internal
27
+ */
28
+ export declare class StateTracker {
29
+ private _hierarchyStates;
30
+ private _ipcRequestsHandler;
31
+ constructor(ipcRequestsHandler: IpcRequestsHandler);
32
+ private updateHierarchyStateIfNeeded;
33
+ onHierarchyClosed(imodel: IModelConnection, rulesetId: string, sourceId: string): Promise<void>;
34
+ onHierarchyStateChanged(imodel: IModelConnection, rulesetId: string, sourceId: string, newHierarchyState: Array<{
35
+ node: NodeIdentifier | undefined;
36
+ state: NodeState;
37
+ }>): Promise<void>;
38
+ }
39
39
  //# sourceMappingURL=StateTracker.d.ts.map