@itwin/core-bentley 5.13.1 → 5.14.0-dev.10

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/CHANGELOG.md CHANGED
@@ -1,11 +1,6 @@
1
1
  # Change Log - @itwin/core-bentley
2
2
 
3
- This log was last generated on Tue, 08 Sep 2026 18:43:29 GMT and should not be manually modified.
4
-
5
- ## 5.13.1
6
- Tue, 08 Sep 2026 18:43:29 GMT
7
-
8
- _Version update only_
3
+ This log was last generated on Thu, 03 Sep 2026 18:51:17 GMT and should not be manually modified.
9
4
 
10
5
  ## 5.13.0
11
6
  Thu, 03 Sep 2026 18:49:55 GMT
@@ -0,0 +1,42 @@
1
+ /** @packageDocumentation
2
+ * @module Collections
3
+ */
4
+ import { BeEvent } from "./BeEvent";
5
+ /** A standard [Map<K,V>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) that emits an event when its contents change.
6
+ * @public
7
+ */
8
+ export declare class ObservableMap<K, V> extends Map<K, V> {
9
+ /** @internal */
10
+ get [Symbol.toStringTag](): string;
11
+ /** Emitted after any change to the contents of this map. */
12
+ readonly onChanged: BeEvent<() => void>;
13
+ /** Construct a new ObservableMap.
14
+ * @param elements Optional elements with which to populate the new map.
15
+ */
16
+ constructor(elements?: Iterable<readonly [K, V]> | undefined);
17
+ /** Invokes [Map.set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set), raising
18
+ * the [[onChanged]] event unless `key` is already present with the same `value`.
19
+ */
20
+ set(key: K, value: V): this;
21
+ /** Invokes [Map.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete), raising
22
+ * the [[onChanged]] event if the key was removed from the map.
23
+ */
24
+ delete(key: K): boolean;
25
+ /** If this map is not already empty, invokes [Map.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear)
26
+ * and raises the [[onChanged]] event.
27
+ */
28
+ clear(): void;
29
+ /** Add or update multiple entries in the map, raising [[onChanged]] only once after all items are set, if the contents of
30
+ * the map changed as a result.
31
+ * This is more efficient than calling [[set]] in a loop when listeners need not be notified of each individual change.
32
+ * @param items The entries to add or update.
33
+ */
34
+ setAll(items: Iterable<readonly [K, V]>): void;
35
+ /** Delete multiple keys from the map, raising [[onChanged]] only once after all keys are deleted.
36
+ * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.
37
+ * @param keys The keys to delete.
38
+ * @returns The number of keys that were actually deleted (i.e., were present in the map).
39
+ */
40
+ deleteAll(keys: Iterable<K>): number;
41
+ }
42
+ //# sourceMappingURL=ObservableMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObservableMap.d.ts","sourceRoot":"","sources":["../../src/ObservableMap.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,qBAAa,aAAa,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAChD,gBAAgB;IAChB,IAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,WAA8B;IAEtE,4DAA4D;IAC5D,SAAgB,SAAS,gBAAqB,IAAI,EAAI;IAEtD;;OAEG;gBACgB,QAAQ,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS;IASnE;;OAEG;IACa,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAY3C;;OAEG;IACa,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IASvC;;OAEG;IACa,KAAK,IAAI,IAAI;IAO7B;;;;OAIG;IACI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI;IAgBrD;;;;OAIG;IACI,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;CAiB5C"}
@@ -0,0 +1,105 @@
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 Collections
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ObservableMap = void 0;
11
+ const BeEvent_1 = require("./BeEvent");
12
+ /** A standard [Map<K,V>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) that emits an event when its contents change.
13
+ * @public
14
+ */
15
+ class ObservableMap extends Map {
16
+ /** @internal */
17
+ get [Symbol.toStringTag]() { return "ObservableMap"; }
18
+ /** Emitted after any change to the contents of this map. */
19
+ onChanged = new BeEvent_1.BeEvent();
20
+ /** Construct a new ObservableMap.
21
+ * @param elements Optional elements with which to populate the new map.
22
+ */
23
+ constructor(elements) {
24
+ // IMPORTANT: do not pass `elements` to `super()`. It will invoke `set` which is overridden to invoke `onChanged.raiseEvent`, but
25
+ // `onChanged` is not initialized until `super()` returns.
26
+ super();
27
+ if (elements)
28
+ this.setAll(elements);
29
+ }
30
+ /** Invokes [Map.set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set), raising
31
+ * the [[onChanged]] event unless `key` is already present with the same `value`.
32
+ */
33
+ set(key, value) {
34
+ const valueChanged = !this.has(key) || !Object.is(this.get(key), value);
35
+ if (valueChanged)
36
+ super.set(key, value);
37
+ if (valueChanged) {
38
+ this.onChanged.raiseEvent();
39
+ }
40
+ return this;
41
+ }
42
+ /** Invokes [Map.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete), raising
43
+ * the [[onChanged]] event if the key was removed from the map.
44
+ */
45
+ delete(key) {
46
+ const ret = super.delete(key);
47
+ if (ret) {
48
+ this.onChanged.raiseEvent();
49
+ }
50
+ return ret;
51
+ }
52
+ /** If this map is not already empty, invokes [Map.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear)
53
+ * and raises the [[onChanged]] event.
54
+ */
55
+ clear() {
56
+ if (0 !== this.size) {
57
+ super.clear();
58
+ this.onChanged.raiseEvent();
59
+ }
60
+ }
61
+ /** Add or update multiple entries in the map, raising [[onChanged]] only once after all items are set, if the contents of
62
+ * the map changed as a result.
63
+ * This is more efficient than calling [[set]] in a loop when listeners need not be notified of each individual change.
64
+ * @param items The entries to add or update.
65
+ */
66
+ setAll(items) {
67
+ let changed = false;
68
+ try {
69
+ for (const [key, value] of items) {
70
+ if (!this.has(key) || !Object.is(this.get(key), value)) {
71
+ super.set(key, value);
72
+ changed = true;
73
+ }
74
+ }
75
+ }
76
+ finally {
77
+ if (changed) {
78
+ this.onChanged.raiseEvent();
79
+ }
80
+ }
81
+ }
82
+ /** Delete multiple keys from the map, raising [[onChanged]] only once after all keys are deleted.
83
+ * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.
84
+ * @param keys The keys to delete.
85
+ * @returns The number of keys that were actually deleted (i.e., were present in the map).
86
+ */
87
+ deleteAll(keys) {
88
+ const prevSize = this.size;
89
+ let deletedAny = false;
90
+ try {
91
+ for (const key of keys) {
92
+ if (super.delete(key))
93
+ deletedAny = true;
94
+ }
95
+ }
96
+ finally {
97
+ if (deletedAny) {
98
+ this.onChanged.raiseEvent();
99
+ }
100
+ }
101
+ return prevSize - this.size;
102
+ }
103
+ }
104
+ exports.ObservableMap = ObservableMap;
105
+ //# sourceMappingURL=ObservableMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObservableMap.js","sourceRoot":"","sources":["../../src/ObservableMap.ts"],"names":[],"mappings":";AACA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,uCAAoC;AAEpC;;GAEG;AACH,MAAa,aAAo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AAC;QACpB,IAAI,CAAC;YACH,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;gBACjC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;oBACvD,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;oBACtB,OAAO,GAAG,IAAI,CAAC;gBACjB,CAAC;YACH,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,IAAiB;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3B,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC;YACH,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACvB,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;oBACnB,UAAU,GAAG,IAAI,CAAC;YACtB,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,UAAU,EAAE,CAAC;gBACf,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAC9B,CAAC;CAEF;AAnGD,sCAmGC","sourcesContent":["\r\n/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Collections\r\n */\r\n\r\nimport { BeEvent } from \"./BeEvent\";\r\n\r\n/** A standard [Map<K,V>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) that emits an event when its contents change.\r\n * @public\r\n */\r\nexport class ObservableMap<K, V> extends Map<K, V> {\r\n /** @internal */\r\n public override get [Symbol.toStringTag]() { return \"ObservableMap\"; }\r\n\r\n /** Emitted after any change to the contents of this map. */\r\n public readonly onChanged = new BeEvent<() => void>();\r\n\r\n /** Construct a new ObservableMap.\r\n * @param elements Optional elements with which to populate the new map.\r\n */\r\n public constructor(elements?: Iterable<readonly [K, V]> | undefined) {\r\n // IMPORTANT: do not pass `elements` to `super()`. It will invoke `set` which is overridden to invoke `onChanged.raiseEvent`, but\r\n // `onChanged` is not initialized until `super()` returns.\r\n super();\r\n\r\n if (elements)\r\n this.setAll(elements);\r\n }\r\n\r\n /** Invokes [Map.set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set), raising\r\n * the [[onChanged]] event unless `key` is already present with the same `value`.\r\n */\r\n public override set(key: K, value: V): this {\r\n const valueChanged = !this.has(key) || !Object.is(this.get(key), value);\r\n if (valueChanged)\r\n super.set(key, value);\r\n\r\n if (valueChanged) {\r\n this.onChanged.raiseEvent();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Invokes [Map.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete), raising\r\n * the [[onChanged]] event if the key was removed from the map.\r\n */\r\n public override delete(key: K): boolean {\r\n const ret = super.delete(key);\r\n if (ret) {\r\n this.onChanged.raiseEvent();\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n /** If this map is not already empty, invokes [Map.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear)\r\n * and raises the [[onChanged]] event.\r\n */\r\n public override clear(): void {\r\n if (0 !== this.size) {\r\n super.clear();\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n\r\n /** Add or update multiple entries in the map, raising [[onChanged]] only once after all items are set, if the contents of\r\n * the map changed as a result.\r\n * This is more efficient than calling [[set]] in a loop when listeners need not be notified of each individual change.\r\n * @param items The entries to add or update.\r\n */\r\n public setAll(items: Iterable<readonly [K, V]>): void {\r\n let changed = false;\r\n try {\r\n for (const [key, value] of items) {\r\n if (!this.has(key) || !Object.is(this.get(key), value)) {\r\n super.set(key, value);\r\n changed = true;\r\n }\r\n }\r\n } finally {\r\n if (changed) {\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n }\r\n\r\n /** Delete multiple keys from the map, raising [[onChanged]] only once after all keys are deleted.\r\n * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.\r\n * @param keys The keys to delete.\r\n * @returns The number of keys that were actually deleted (i.e., were present in the map).\r\n */\r\n public deleteAll(keys: Iterable<K>): number {\r\n const prevSize = this.size;\r\n let deletedAny = false;\r\n try {\r\n for (const key of keys) {\r\n if (super.delete(key))\r\n deletedAny = true;\r\n }\r\n } finally {\r\n if (deletedAny) {\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n\r\n return prevSize - this.size;\r\n }\r\n\r\n}\r\n"]}
@@ -6,6 +6,8 @@ import { BeEvent } from "./BeEvent";
6
6
  * @public
7
7
  */
8
8
  export declare class ObservableSet<T> extends Set<T> {
9
+ /** @internal */
10
+ get [Symbol.toStringTag](): string;
9
11
  /** Emitted after `item` is added to this set. */
10
12
  readonly onAdded: BeEvent<(item: T) => void>;
11
13
  /** Emitted after `item` is deleted from this set. */
@@ -16,10 +18,16 @@ export declare class ObservableSet<T> extends Set<T> {
16
18
  readonly onBatchAdded: BeEvent<() => void>;
17
19
  /** Emitted after multiple items are deleted from this set via [[deleteAll]]. */
18
20
  readonly onBatchDeleted: BeEvent<() => void>;
21
+ /** Emitted after any change to the contents of this set. */
22
+ readonly onChanged: BeEvent<() => void>;
19
23
  /** Construct a new ObservableSet.
20
24
  * @param elements Optional elements with which to populate the new set.
21
25
  */
22
26
  constructor(elements?: Iterable<T> | undefined);
27
+ /** Invokes [Set.add](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add), raising
28
+ * the [[onAdded]] event if the item was not already present in the set.
29
+ */
30
+ add(item: T): this;
23
31
  /** Invokes [Set.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete), raising
24
32
  * the [[onDeleted]] event if the item was removed from the set.
25
33
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ObservableSet.d.ts","sourceRoot":"","sources":["../../src/ObservableSet.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,qBAAa,aAAa,CAAC,CAAC,CAAE,SAAQ,GAAG,CAAC,CAAC,CAAC;IAC1C,iDAAiD;IACjD,SAAgB,OAAO,iBAAsB,CAAC,KAAK,IAAI,EAAI;IAC3D,qDAAqD;IACrD,SAAgB,SAAS,iBAAsB,CAAC,KAAK,IAAI,EAAI;IAC7D,qDAAqD;IACrD,SAAgB,SAAS,gBAAqB,IAAI,EAAI;IACtD,yEAAyE;IACzE,SAAgB,YAAY,gBAAqB,IAAI,EAAI;IACzD,gFAAgF;IAChF,SAAgB,cAAc,gBAAqB,IAAI,EAAI;IAE3D;;OAEG;gBACgB,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS;IAcrD;;OAEG;IACa,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO;IAQxC;;OAEG;IACa,KAAK,IAAI,IAAI;IAO7B;;;;OAIG;IACI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;IAWzC;;;;OAIG;IACI,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;CAU7C"}
1
+ {"version":3,"file":"ObservableSet.d.ts","sourceRoot":"","sources":["../../src/ObservableSet.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,qBAAa,aAAa,CAAC,CAAC,CAAE,SAAQ,GAAG,CAAC,CAAC,CAAC;IAC1C,gBAAgB;IAChB,IAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,WAA8B;IAEtE,iDAAiD;IACjD,SAAgB,OAAO,iBAAsB,CAAC,KAAK,IAAI,EAAI;IAC3D,qDAAqD;IACrD,SAAgB,SAAS,iBAAsB,CAAC,KAAK,IAAI,EAAI;IAC7D,qDAAqD;IACrD,SAAgB,SAAS,gBAAqB,IAAI,EAAI;IACtD,yEAAyE;IACzE,SAAgB,YAAY,gBAAqB,IAAI,EAAI;IACzD,gFAAgF;IAChF,SAAgB,cAAc,gBAAqB,IAAI,EAAI;IAC3D,4DAA4D;IAC5D,SAAgB,SAAS,gBAAqB,IAAI,EAAI;IAEtD;;OAEG;gBACgB,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS;IASrD;;OAEG;IACa,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAWlC;;OAEG;IACa,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO;IAUxC;;OAEG;IACa,KAAK,IAAI,IAAI;IAQ7B;;;;OAIG;IACI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;IAoBzC;;;;OAIG;IACI,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;CAmB7C"}
@@ -13,6 +13,8 @@ const BeEvent_1 = require("./BeEvent");
13
13
  * @public
14
14
  */
15
15
  class ObservableSet extends Set {
16
+ /** @internal */
17
+ get [Symbol.toStringTag]() { return "ObservableSet"; }
16
18
  /** Emitted after `item` is added to this set. */
17
19
  onAdded = new BeEvent_1.BeEvent();
18
20
  /** Emitted after `item` is deleted from this set. */
@@ -23,27 +25,39 @@ class ObservableSet extends Set {
23
25
  onBatchAdded = new BeEvent_1.BeEvent();
24
26
  /** Emitted after multiple items are deleted from this set via [[deleteAll]]. */
25
27
  onBatchDeleted = new BeEvent_1.BeEvent();
28
+ /** Emitted after any change to the contents of this set. */
29
+ onChanged = new BeEvent_1.BeEvent();
26
30
  /** Construct a new ObservableSet.
27
31
  * @param elements Optional elements with which to populate the new set.
28
32
  */
29
33
  constructor(elements) {
30
- // NB: Set constructor will invoke add(). Do not override until initialized.
31
- super(elements);
32
- this.add = (item) => {
33
- const prevSize = this.size;
34
- const ret = super.add(item);
35
- if (this.size !== prevSize)
36
- this.onAdded.raiseEvent(item);
37
- return ret;
38
- };
34
+ // IMPORTANT: do not pass `elements` to `super()`. It will invoke `add` which is overridden to invoke `onAdded.raiseEvent`, but
35
+ // `onAdded` is not initialized until `super()` returns.
36
+ super();
37
+ if (elements)
38
+ this.addAll(elements);
39
+ }
40
+ /** Invokes [Set.add](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add), raising
41
+ * the [[onAdded]] event if the item was not already present in the set.
42
+ */
43
+ add(item) {
44
+ const prevSize = this.size;
45
+ const ret = super.add(item);
46
+ if (this.size !== prevSize) {
47
+ this.onAdded.raiseEvent(item);
48
+ this.onChanged.raiseEvent();
49
+ }
50
+ return ret;
39
51
  }
40
52
  /** Invokes [Set.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete), raising
41
53
  * the [[onDeleted]] event if the item was removed from the set.
42
54
  */
43
55
  delete(item) {
44
56
  const ret = super.delete(item);
45
- if (ret)
57
+ if (ret) {
46
58
  this.onDeleted.raiseEvent(item);
59
+ this.onChanged.raiseEvent();
60
+ }
47
61
  return ret;
48
62
  }
49
63
  /** If this set is not already empty, invokes [Set.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear)
@@ -53,6 +67,7 @@ class ObservableSet extends Set {
53
67
  if (0 !== this.size) {
54
68
  super.clear();
55
69
  this.onCleared.raiseEvent();
70
+ this.onChanged.raiseEvent();
56
71
  }
57
72
  }
58
73
  /** Add multiple items to the set, raising [[onBatchAdded]] only once after all items are added.
@@ -62,10 +77,21 @@ class ObservableSet extends Set {
62
77
  */
63
78
  addAll(items) {
64
79
  const prevSize = this.size;
65
- for (const item of items)
66
- super.add(item);
67
- if (this.size !== prevSize)
68
- this.onBatchAdded.raiseEvent();
80
+ let addedAny = false;
81
+ try {
82
+ for (const item of items) {
83
+ const prevSetSize = this.size;
84
+ super.add(item);
85
+ if (this.size !== prevSetSize)
86
+ addedAny = true;
87
+ }
88
+ }
89
+ finally {
90
+ if (addedAny) {
91
+ this.onBatchAdded.raiseEvent();
92
+ this.onChanged.raiseEvent();
93
+ }
94
+ }
69
95
  return this.size - prevSize;
70
96
  }
71
97
  /** Delete multiple items from the set, raising [[onBatchDeleted]] only once after all items are deleted.
@@ -75,10 +101,21 @@ class ObservableSet extends Set {
75
101
  */
76
102
  deleteAll(items) {
77
103
  const prevSize = this.size;
78
- for (const item of items)
79
- super.delete(item);
80
- if (this.size !== prevSize)
81
- this.onBatchDeleted.raiseEvent();
104
+ let deletedAny = false;
105
+ try {
106
+ for (const item of items) {
107
+ const prevSetSize = this.size;
108
+ super.delete(item);
109
+ if (this.size !== prevSetSize)
110
+ deletedAny = true;
111
+ }
112
+ }
113
+ finally {
114
+ if (deletedAny) {
115
+ this.onBatchDeleted.raiseEvent();
116
+ this.onChanged.raiseEvent();
117
+ }
118
+ }
82
119
  return prevSize - this.size;
83
120
  }
84
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ObservableSet.js","sourceRoot":"","sources":["../../src/ObservableSet.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,uCAAoC;AAEpC;;GAEG;AACH,MAAa,aAAiB,SAAQ,GAAM;IAC1C,iDAAiD;IACjC,OAAO,GAAG,IAAI,iBAAO,EAAqB,CAAC;IAC3D,qDAAqD;IACrC,SAAS,GAAG,IAAI,iBAAO,EAAqB,CAAC;IAC7D,qDAAqD;I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AE,CAAC;QAEjC,OAAO,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,KAAkB;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK;YACtB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAErB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;YACxB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;QAEnC,OAAO,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAjFD,sCAiFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Collections\r\n */\r\n\r\nimport { BeEvent } from \"./BeEvent\";\r\n\r\n/** A standard [Set<T>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) that emits events when its contents change.\r\n * @public\r\n */\r\nexport class ObservableSet<T> extends Set<T> {\r\n /** Emitted after `item` is added to this set. */\r\n public readonly onAdded = new BeEvent<(item: T) => void>();\r\n /** Emitted after `item` is deleted from this set. */\r\n public readonly onDeleted = new BeEvent<(item: T) => void>();\r\n /** Emitted after this set's contents are cleared. */\r\n public readonly onCleared = new BeEvent<() => void>();\r\n /** Emitted after multiple items are added to this set via [[addAll]]. */\r\n public readonly onBatchAdded = new BeEvent<() => void>();\r\n /** Emitted after multiple items are deleted from this set via [[deleteAll]]. */\r\n public readonly onBatchDeleted = new BeEvent<() => void>();\r\n\r\n /** Construct a new ObservableSet.\r\n * @param elements Optional elements with which to populate the new set.\r\n */\r\n public constructor(elements?: Iterable<T> | undefined) {\r\n // NB: Set constructor will invoke add(). Do not override until initialized.\r\n super(elements);\r\n\r\n this.add = (item: T) => {\r\n const prevSize = this.size;\r\n const ret = super.add(item);\r\n if (this.size !== prevSize)\r\n this.onAdded.raiseEvent(item);\r\n\r\n return ret;\r\n };\r\n }\r\n\r\n /** Invokes [Set.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete), raising\r\n * the [[onDeleted]] event if the item was removed from the set.\r\n */\r\n public override delete(item: T): boolean {\r\n const ret = super.delete(item);\r\n if (ret)\r\n this.onDeleted.raiseEvent(item);\r\n\r\n return ret;\r\n }\r\n\r\n /** If this set is not already empty, invokes [Set.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear)\r\n * and raises the [[onCleared]] event.\r\n */\r\n public override clear(): void {\r\n if (0 !== this.size) {\r\n super.clear();\r\n this.onCleared.raiseEvent();\r\n }\r\n }\r\n\r\n /** Add multiple items to the set, raising [[onBatchAdded]] only once after all items are added.\r\n * This is more efficient than calling [[add]] in a loop when listeners need not be notified of each individual addition.\r\n * @param items The items to add.\r\n * @returns The number of items that were actually added (i.e., were not already present).\r\n */\r\n public addAll(items: Iterable<T>): number {\r\n const prevSize = this.size;\r\n for (const item of items)\r\n super.add(item);\r\n\r\n if (this.size !== prevSize)\r\n this.onBatchAdded.raiseEvent();\r\n\r\n return this.size - prevSize;\r\n }\r\n\r\n /** Delete multiple items from the set, raising [[onBatchDeleted]] only once after all items are deleted.\r\n * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.\r\n * @param items The items to delete.\r\n * @returns The number of items that were actually deleted (i.e., were present in the set).\r\n */\r\n public deleteAll(items: Iterable<T>): number {\r\n const prevSize = this.size;\r\n for (const item of items)\r\n super.delete(item);\r\n\r\n if (this.size !== prevSize)\r\n this.onBatchDeleted.raiseEvent();\r\n\r\n return prevSize - this.size;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ObservableSet.js","sourceRoot":"","sources":["../../src/ObservableSet.ts"],"names":[],"mappings":";AAAA;;;+FAG+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AAM,CAAC,IAAI,CAAC,CAAC;gBACnB,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW;oBAC3B,UAAU,GAAG,IAAI,CAAC;YACtB,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,UAAU,EAAE,CAAC;gBACf,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;gBACjC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AApHD,sCAoHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Collections\r\n */\r\n\r\nimport { BeEvent } from \"./BeEvent\";\r\n\r\n/** A standard [Set<T>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) that emits events when its contents change.\r\n * @public\r\n */\r\nexport class ObservableSet<T> extends Set<T> {\r\n /** @internal */\r\n public override get [Symbol.toStringTag]() { return \"ObservableSet\"; }\r\n\r\n /** Emitted after `item` is added to this set. */\r\n public readonly onAdded = new BeEvent<(item: T) => void>();\r\n /** Emitted after `item` is deleted from this set. */\r\n public readonly onDeleted = new BeEvent<(item: T) => void>();\r\n /** Emitted after this set's contents are cleared. */\r\n public readonly onCleared = new BeEvent<() => void>();\r\n /** Emitted after multiple items are added to this set via [[addAll]]. */\r\n public readonly onBatchAdded = new BeEvent<() => void>();\r\n /** Emitted after multiple items are deleted from this set via [[deleteAll]]. */\r\n public readonly onBatchDeleted = new BeEvent<() => void>();\r\n /** Emitted after any change to the contents of this set. */\r\n public readonly onChanged = new BeEvent<() => void>();\r\n\r\n /** Construct a new ObservableSet.\r\n * @param elements Optional elements with which to populate the new set.\r\n */\r\n public constructor(elements?: Iterable<T> | undefined) {\r\n // IMPORTANT: do not pass `elements` to `super()`. It will invoke `add` which is overridden to invoke `onAdded.raiseEvent`, but\r\n // `onAdded` is not initialized until `super()` returns.\r\n super();\r\n\r\n if (elements)\r\n this.addAll(elements);\r\n }\r\n\r\n /** Invokes [Set.add](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add), raising\r\n * the [[onAdded]] event if the item was not already present in the set.\r\n */\r\n public override add(item: T): this {\r\n const prevSize = this.size;\r\n const ret = super.add(item);\r\n if (this.size !== prevSize) {\r\n this.onAdded.raiseEvent(item);\r\n this.onChanged.raiseEvent();\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n /** Invokes [Set.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete), raising\r\n * the [[onDeleted]] event if the item was removed from the set.\r\n */\r\n public override delete(item: T): boolean {\r\n const ret = super.delete(item);\r\n if (ret) {\r\n this.onDeleted.raiseEvent(item);\r\n this.onChanged.raiseEvent();\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n /** If this set is not already empty, invokes [Set.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear)\r\n * and raises the [[onCleared]] event.\r\n */\r\n public override clear(): void {\r\n if (0 !== this.size) {\r\n super.clear();\r\n this.onCleared.raiseEvent();\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n\r\n /** Add multiple items to the set, raising [[onBatchAdded]] only once after all items are added.\r\n * This is more efficient than calling [[add]] in a loop when listeners need not be notified of each individual addition.\r\n * @param items The items to add.\r\n * @returns The number of items that were actually added (i.e., were not already present).\r\n */\r\n public addAll(items: Iterable<T>): number {\r\n const prevSize = this.size;\r\n let addedAny = false;\r\n try {\r\n for (const item of items) {\r\n const prevSetSize = this.size;\r\n super.add(item);\r\n if (this.size !== prevSetSize)\r\n addedAny = true;\r\n }\r\n } finally {\r\n if (addedAny) {\r\n this.onBatchAdded.raiseEvent();\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n\r\n return this.size - prevSize;\r\n }\r\n\r\n /** Delete multiple items from the set, raising [[onBatchDeleted]] only once after all items are deleted.\r\n * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.\r\n * @param items The items to delete.\r\n * @returns The number of items that were actually deleted (i.e., were present in the set).\r\n */\r\n public deleteAll(items: Iterable<T>): number {\r\n const prevSize = this.size;\r\n let deletedAny = false;\r\n try {\r\n for (const item of items) {\r\n const prevSetSize = this.size;\r\n super.delete(item);\r\n if (this.size !== prevSetSize)\r\n deletedAny = true;\r\n }\r\n } finally {\r\n if (deletedAny) {\r\n this.onBatchDeleted.raiseEvent();\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n\r\n return prevSize - this.size;\r\n }\r\n}\r\n"]}
@@ -18,6 +18,7 @@ export * from "./JsonSchema";
18
18
  export * from "./JsonUtils";
19
19
  export * from "./Logger";
20
20
  export * from "./LRUMap";
21
+ export * from "./ObservableMap";
21
22
  export * from "./ObservableSet";
22
23
  export * from "./OneAtATimeAction";
23
24
  export * from "./OrderedId64Iterable";
@@ -1 +1 @@
1
- {"version":3,"file":"core-bentley.d.ts","sourceRoot":"","sources":["../../src/core-bentley.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC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AC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,0BAA0B,CAAC;AAEzC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
@@ -38,6 +38,7 @@ __exportStar(require("./JsonSchema"), exports);
38
38
  __exportStar(require("./JsonUtils"), exports);
39
39
  __exportStar(require("./Logger"), exports);
40
40
  __exportStar(require("./LRUMap"), exports);
41
+ __exportStar(require("./ObservableMap"), exports);
41
42
  __exportStar(require("./ObservableSet"), exports);
42
43
  __exportStar(require("./OneAtATimeAction"), exports);
43
44
  __exportStar(require("./OrderedId64Iterable"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"core-bentley.js","sourceRoot":"","sources":["../../src/core-bentley.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,gDAA8B;AAC9B,2CAAyB;AACzB,4CAA0B;AAC1B,iDAA+B;AAC/B,0DAAwC;AACxC,mDAAiC;AACjC,6CAA2B;AAC3B,+CAA6B;AAC7B,+CAA6B;AAC7B,4CAA0B;AAC1B,sDAAoC;AACpC,+CAA6B;AAC7B,+CAA6B;AAC7B,2CAAyB;AACzB,uCAAqB;AACrB,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC;AAChC,qDAAmC;AACnC,wDAAsC;AACtC,+CAA6B;AAC7B,mDAAiC;AACjC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,gDAA8B;AAC9B,yCAAuB;AACvB,4CAA0B;AAC1B,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC;AACnC,qDAAmC;AACnC,iDAA+B;AAC/B,iDAA+B;AAE/B,oFAAoF;AACpF,2DAAyC;AAEzC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./AccessToken\";\r\nexport * from \"./Assert\";\r\nexport * from \"./BeEvent\";\r\nexport * from \"./BentleyError\";\r\nexport * from \"./BentleyLoggerCategory\";\r\nexport * from \"./StatusCategory\";\r\nexport * from \"./BeSQLite\";\r\nexport * from \"./ByteStream\";\r\nexport * from \"./ClassUtils\";\r\nexport * from \"./Compare\";\r\nexport * from \"./CompressedId64Set\";\r\nexport * from \"./Dictionary\";\r\nexport * from \"./Disposable\";\r\nexport * from \"./Expect\";\r\nexport * from \"./Id\";\r\nexport * from \"./IndexMap\";\r\nexport * from \"./JsonSchema\";\r\nexport * from \"./JsonUtils\";\r\nexport * from \"./Logger\";\r\nexport * from \"./LRUMap\";\r\nexport * from \"./ObservableSet\";\r\nexport * from \"./OneAtATimeAction\";\r\nexport * from \"./OrderedId64Iterable\";\r\nexport * from \"./OrderedSet\";\r\nexport * from \"./partitionArray\";\r\nexport * from \"./PriorityQueue\";\r\nexport * from \"./ProcessDetector\";\r\nexport * from \"./SortedArray\";\r\nexport * from \"./StringUtils\";\r\nexport * from \"./Time\";\r\nexport * from \"./Tracing\";\r\nexport * from \"./TupleKeyedMap\";\r\nexport * from \"./TypedArrayBuilder\";\r\nexport * from \"./UnexpectedErrors\";\r\nexport * from \"./UtilityFunctions\";\r\nexport * from \"./UtilityTypes\";\r\nexport * from \"./YieldManager\";\r\n\r\n// Temporarily (until 5.0) export top-level internal APIs to avoid breaking callers.\r\nexport * from \"./internal/cross-package\";\r\n\r\n/** @docs-package-description\r\n * The core-bentley package contains classes to solve problems that are common for both client and server use cases.\r\n */\r\n/**\r\n * @docs-group-description BeSQLite\r\n * Classes for working with SQLite databases. SQLite underlies IModelDb and ECDb - see [Executing ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n/**\r\n * @docs-group-description Errors\r\n * Classes for working with errors.\r\n */\r\n/**\r\n * @docs-group-description Events\r\n * Classes for raising and handling events.\r\n */\r\n/**\r\n * @docs-group-description Ids\r\n * Classes for working with unique identifiers.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Classes for configuring and logging diagnostic messages - see [Learning about Logging]($docs/learning/common/Logging.md)\r\n */\r\n/**\r\n * @docs-group-description Collections\r\n * Specialized, customizable collection classes like priority queues.\r\n */\r\n/**\r\n * @docs-group-description Json\r\n * utilities for dealing with Json strings and files.\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description ProcessDetector\r\n * Functions for determining the type of the current JavaScript process.\r\n */\r\n"]}
1
+ {"version":3,"file":"core-bentley.js","sourceRoot":"","sources":["../../src/core-bentley.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,gDAA8B;AAC9B,2CAAyB;AACzB,4CAA0B;AAC1B,iDAA+B;AAC/B,0DAAwC;AACxC,mDAAiC;AACjC,6CAA2B;AAC3B,+CAA6B;AAC7B,+CAA6B;AAC7B,4CAA0B;AAC1B,sDAAoC;AACpC,+CAA6B;AAC7B,+CAA6B;AAC7B,2CAAyB;AACzB,uCAAqB;AACrB,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC;AAChC,kDAAgC;AAChC,qDAAmC;AACnC,wDAAsC;AACtC,+CAA6B;AAC7B,mDAAiC;AACjC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,gDAA8B;AAC9B,yCAAuB;AACvB,4CAA0B;AAC1B,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC;AACnC,qDAAmC;AACnC,iDAA+B;AAC/B,iDAA+B;AAE/B,oFAAoF;AACpF,2DAAyC;AAEzC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./AccessToken\";\r\nexport * from \"./Assert\";\r\nexport * from \"./BeEvent\";\r\nexport * from \"./BentleyError\";\r\nexport * from \"./BentleyLoggerCategory\";\r\nexport * from \"./StatusCategory\";\r\nexport * from \"./BeSQLite\";\r\nexport * from \"./ByteStream\";\r\nexport * from \"./ClassUtils\";\r\nexport * from \"./Compare\";\r\nexport * from \"./CompressedId64Set\";\r\nexport * from \"./Dictionary\";\r\nexport * from \"./Disposable\";\r\nexport * from \"./Expect\";\r\nexport * from \"./Id\";\r\nexport * from \"./IndexMap\";\r\nexport * from \"./JsonSchema\";\r\nexport * from \"./JsonUtils\";\r\nexport * from \"./Logger\";\r\nexport * from \"./LRUMap\";\r\nexport * from \"./ObservableMap\";\r\nexport * from \"./ObservableSet\";\r\nexport * from \"./OneAtATimeAction\";\r\nexport * from \"./OrderedId64Iterable\";\r\nexport * from \"./OrderedSet\";\r\nexport * from \"./partitionArray\";\r\nexport * from \"./PriorityQueue\";\r\nexport * from \"./ProcessDetector\";\r\nexport * from \"./SortedArray\";\r\nexport * from \"./StringUtils\";\r\nexport * from \"./Time\";\r\nexport * from \"./Tracing\";\r\nexport * from \"./TupleKeyedMap\";\r\nexport * from \"./TypedArrayBuilder\";\r\nexport * from \"./UnexpectedErrors\";\r\nexport * from \"./UtilityFunctions\";\r\nexport * from \"./UtilityTypes\";\r\nexport * from \"./YieldManager\";\r\n\r\n// Temporarily (until 5.0) export top-level internal APIs to avoid breaking callers.\r\nexport * from \"./internal/cross-package\";\r\n\r\n/** @docs-package-description\r\n * The core-bentley package contains classes to solve problems that are common for both client and server use cases.\r\n */\r\n/**\r\n * @docs-group-description BeSQLite\r\n * Classes for working with SQLite databases. SQLite underlies IModelDb and ECDb - see [Executing ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n/**\r\n * @docs-group-description Errors\r\n * Classes for working with errors.\r\n */\r\n/**\r\n * @docs-group-description Events\r\n * Classes for raising and handling events.\r\n */\r\n/**\r\n * @docs-group-description Ids\r\n * Classes for working with unique identifiers.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Classes for configuring and logging diagnostic messages - see [Learning about Logging]($docs/learning/common/Logging.md)\r\n */\r\n/**\r\n * @docs-group-description Collections\r\n * Specialized, customizable collection classes like priority queues.\r\n */\r\n/**\r\n * @docs-group-description Json\r\n * utilities for dealing with Json strings and files.\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description ProcessDetector\r\n * Functions for determining the type of the current JavaScript process.\r\n */\r\n"]}
@@ -0,0 +1,42 @@
1
+ /** @packageDocumentation
2
+ * @module Collections
3
+ */
4
+ import { BeEvent } from "./BeEvent";
5
+ /** A standard [Map<K,V>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) that emits an event when its contents change.
6
+ * @public
7
+ */
8
+ export declare class ObservableMap<K, V> extends Map<K, V> {
9
+ /** @internal */
10
+ get [Symbol.toStringTag](): string;
11
+ /** Emitted after any change to the contents of this map. */
12
+ readonly onChanged: BeEvent<() => void>;
13
+ /** Construct a new ObservableMap.
14
+ * @param elements Optional elements with which to populate the new map.
15
+ */
16
+ constructor(elements?: Iterable<readonly [K, V]> | undefined);
17
+ /** Invokes [Map.set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set), raising
18
+ * the [[onChanged]] event unless `key` is already present with the same `value`.
19
+ */
20
+ set(key: K, value: V): this;
21
+ /** Invokes [Map.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete), raising
22
+ * the [[onChanged]] event if the key was removed from the map.
23
+ */
24
+ delete(key: K): boolean;
25
+ /** If this map is not already empty, invokes [Map.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear)
26
+ * and raises the [[onChanged]] event.
27
+ */
28
+ clear(): void;
29
+ /** Add or update multiple entries in the map, raising [[onChanged]] only once after all items are set, if the contents of
30
+ * the map changed as a result.
31
+ * This is more efficient than calling [[set]] in a loop when listeners need not be notified of each individual change.
32
+ * @param items The entries to add or update.
33
+ */
34
+ setAll(items: Iterable<readonly [K, V]>): void;
35
+ /** Delete multiple keys from the map, raising [[onChanged]] only once after all keys are deleted.
36
+ * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.
37
+ * @param keys The keys to delete.
38
+ * @returns The number of keys that were actually deleted (i.e., were present in the map).
39
+ */
40
+ deleteAll(keys: Iterable<K>): number;
41
+ }
42
+ //# sourceMappingURL=ObservableMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObservableMap.d.ts","sourceRoot":"","sources":["../../src/ObservableMap.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,qBAAa,aAAa,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAChD,gBAAgB;IAChB,IAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,WAA8B;IAEtE,4DAA4D;IAC5D,SAAgB,SAAS,gBAAqB,IAAI,EAAI;IAEtD;;OAEG;gBACgB,QAAQ,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS;IASnE;;OAEG;IACa,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAY3C;;OAEG;IACa,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IASvC;;OAEG;IACa,KAAK,IAAI,IAAI;IAO7B;;;;OAIG;IACI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI;IAgBrD;;;;OAIG;IACI,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;CAiB5C"}
@@ -0,0 +1,101 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Collections
7
+ */
8
+ import { BeEvent } from "./BeEvent";
9
+ /** A standard [Map<K,V>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) that emits an event when its contents change.
10
+ * @public
11
+ */
12
+ export class ObservableMap extends Map {
13
+ /** @internal */
14
+ get [Symbol.toStringTag]() { return "ObservableMap"; }
15
+ /** Emitted after any change to the contents of this map. */
16
+ onChanged = new BeEvent();
17
+ /** Construct a new ObservableMap.
18
+ * @param elements Optional elements with which to populate the new map.
19
+ */
20
+ constructor(elements) {
21
+ // IMPORTANT: do not pass `elements` to `super()`. It will invoke `set` which is overridden to invoke `onChanged.raiseEvent`, but
22
+ // `onChanged` is not initialized until `super()` returns.
23
+ super();
24
+ if (elements)
25
+ this.setAll(elements);
26
+ }
27
+ /** Invokes [Map.set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set), raising
28
+ * the [[onChanged]] event unless `key` is already present with the same `value`.
29
+ */
30
+ set(key, value) {
31
+ const valueChanged = !this.has(key) || !Object.is(this.get(key), value);
32
+ if (valueChanged)
33
+ super.set(key, value);
34
+ if (valueChanged) {
35
+ this.onChanged.raiseEvent();
36
+ }
37
+ return this;
38
+ }
39
+ /** Invokes [Map.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete), raising
40
+ * the [[onChanged]] event if the key was removed from the map.
41
+ */
42
+ delete(key) {
43
+ const ret = super.delete(key);
44
+ if (ret) {
45
+ this.onChanged.raiseEvent();
46
+ }
47
+ return ret;
48
+ }
49
+ /** If this map is not already empty, invokes [Map.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear)
50
+ * and raises the [[onChanged]] event.
51
+ */
52
+ clear() {
53
+ if (0 !== this.size) {
54
+ super.clear();
55
+ this.onChanged.raiseEvent();
56
+ }
57
+ }
58
+ /** Add or update multiple entries in the map, raising [[onChanged]] only once after all items are set, if the contents of
59
+ * the map changed as a result.
60
+ * This is more efficient than calling [[set]] in a loop when listeners need not be notified of each individual change.
61
+ * @param items The entries to add or update.
62
+ */
63
+ setAll(items) {
64
+ let changed = false;
65
+ try {
66
+ for (const [key, value] of items) {
67
+ if (!this.has(key) || !Object.is(this.get(key), value)) {
68
+ super.set(key, value);
69
+ changed = true;
70
+ }
71
+ }
72
+ }
73
+ finally {
74
+ if (changed) {
75
+ this.onChanged.raiseEvent();
76
+ }
77
+ }
78
+ }
79
+ /** Delete multiple keys from the map, raising [[onChanged]] only once after all keys are deleted.
80
+ * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.
81
+ * @param keys The keys to delete.
82
+ * @returns The number of keys that were actually deleted (i.e., were present in the map).
83
+ */
84
+ deleteAll(keys) {
85
+ const prevSize = this.size;
86
+ let deletedAny = false;
87
+ try {
88
+ for (const key of keys) {
89
+ if (super.delete(key))
90
+ deletedAny = true;
91
+ }
92
+ }
93
+ finally {
94
+ if (deletedAny) {
95
+ this.onChanged.raiseEvent();
96
+ }
97
+ }
98
+ return prevSize - this.size;
99
+ }
100
+ }
101
+ //# sourceMappingURL=ObservableMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObservableMap.js","sourceRoot":"","sources":["../../src/ObservableMap.ts"],"names":[],"mappings":"AACA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,MAAM,OAAO,aAAoB,SAAQ,GAAS;IAChD,gBAAgB;IAChB,IAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,OAAO,eAAe,CAAC,CAAC,CAAC;IAEtE,4DAA4D;IAC5C,SAAS,GAAG,IAAI,OAAO,EAAc,CAAC;IAEtD;;OAEG;IACH,YAAmB,QAAgD;QACjE,iIAAiI;QACjI,0DAA0D;QAC1D,KAAK,EAAE,CAAC;QAER,IAAI,QAAQ;YACV,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;IAED;;OAEG;IACa,GAAG,CAAC,GAAM,EAAE,KAAQ;QAClC,MAAM,YAAY,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QACxE,IAAI,YAAY;YACd,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAExB,IAAI,YAAY,EAAE,CA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H,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACvB,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;oBACnB,UAAU,GAAG,IAAI,CAAC;YACtB,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,UAAU,EAAE,CAAC;gBACf,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAC9B,CAAC;CAEF","sourcesContent":["\r\n/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Collections\r\n */\r\n\r\nimport { BeEvent } from \"./BeEvent\";\r\n\r\n/** A standard [Map<K,V>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) that emits an event when its contents change.\r\n * @public\r\n */\r\nexport class ObservableMap<K, V> extends Map<K, V> {\r\n /** @internal */\r\n public override get [Symbol.toStringTag]() { return \"ObservableMap\"; }\r\n\r\n /** Emitted after any change to the contents of this map. */\r\n public readonly onChanged = new BeEvent<() => void>();\r\n\r\n /** Construct a new ObservableMap.\r\n * @param elements Optional elements with which to populate the new map.\r\n */\r\n public constructor(elements?: Iterable<readonly [K, V]> | undefined) {\r\n // IMPORTANT: do not pass `elements` to `super()`. It will invoke `set` which is overridden to invoke `onChanged.raiseEvent`, but\r\n // `onChanged` is not initialized until `super()` returns.\r\n super();\r\n\r\n if (elements)\r\n this.setAll(elements);\r\n }\r\n\r\n /** Invokes [Map.set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set), raising\r\n * the [[onChanged]] event unless `key` is already present with the same `value`.\r\n */\r\n public override set(key: K, value: V): this {\r\n const valueChanged = !this.has(key) || !Object.is(this.get(key), value);\r\n if (valueChanged)\r\n super.set(key, value);\r\n\r\n if (valueChanged) {\r\n this.onChanged.raiseEvent();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Invokes [Map.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete), raising\r\n * the [[onChanged]] event if the key was removed from the map.\r\n */\r\n public override delete(key: K): boolean {\r\n const ret = super.delete(key);\r\n if (ret) {\r\n this.onChanged.raiseEvent();\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n /** If this map is not already empty, invokes [Map.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear)\r\n * and raises the [[onChanged]] event.\r\n */\r\n public override clear(): void {\r\n if (0 !== this.size) {\r\n super.clear();\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n\r\n /** Add or update multiple entries in the map, raising [[onChanged]] only once after all items are set, if the contents of\r\n * the map changed as a result.\r\n * This is more efficient than calling [[set]] in a loop when listeners need not be notified of each individual change.\r\n * @param items The entries to add or update.\r\n */\r\n public setAll(items: Iterable<readonly [K, V]>): void {\r\n let changed = false;\r\n try {\r\n for (const [key, value] of items) {\r\n if (!this.has(key) || !Object.is(this.get(key), value)) {\r\n super.set(key, value);\r\n changed = true;\r\n }\r\n }\r\n } finally {\r\n if (changed) {\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n }\r\n\r\n /** Delete multiple keys from the map, raising [[onChanged]] only once after all keys are deleted.\r\n * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.\r\n * @param keys The keys to delete.\r\n * @returns The number of keys that were actually deleted (i.e., were present in the map).\r\n */\r\n public deleteAll(keys: Iterable<K>): number {\r\n const prevSize = this.size;\r\n let deletedAny = false;\r\n try {\r\n for (const key of keys) {\r\n if (super.delete(key))\r\n deletedAny = true;\r\n }\r\n } finally {\r\n if (deletedAny) {\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n\r\n return prevSize - this.size;\r\n }\r\n\r\n}\r\n"]}
@@ -6,6 +6,8 @@ import { BeEvent } from "./BeEvent";
6
6
  * @public
7
7
  */
8
8
  export declare class ObservableSet<T> extends Set<T> {
9
+ /** @internal */
10
+ get [Symbol.toStringTag](): string;
9
11
  /** Emitted after `item` is added to this set. */
10
12
  readonly onAdded: BeEvent<(item: T) => void>;
11
13
  /** Emitted after `item` is deleted from this set. */
@@ -16,10 +18,16 @@ export declare class ObservableSet<T> extends Set<T> {
16
18
  readonly onBatchAdded: BeEvent<() => void>;
17
19
  /** Emitted after multiple items are deleted from this set via [[deleteAll]]. */
18
20
  readonly onBatchDeleted: BeEvent<() => void>;
21
+ /** Emitted after any change to the contents of this set. */
22
+ readonly onChanged: BeEvent<() => void>;
19
23
  /** Construct a new ObservableSet.
20
24
  * @param elements Optional elements with which to populate the new set.
21
25
  */
22
26
  constructor(elements?: Iterable<T> | undefined);
27
+ /** Invokes [Set.add](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add), raising
28
+ * the [[onAdded]] event if the item was not already present in the set.
29
+ */
30
+ add(item: T): this;
23
31
  /** Invokes [Set.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete), raising
24
32
  * the [[onDeleted]] event if the item was removed from the set.
25
33
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ObservableSet.d.ts","sourceRoot":"","sources":["../../src/ObservableSet.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,qBAAa,aAAa,CAAC,CAAC,CAAE,SAAQ,GAAG,CAAC,CAAC,CAAC;IAC1C,iDAAiD;IACjD,SAAgB,OAAO,iBAAsB,CAAC,KAAK,IAAI,EAAI;IAC3D,qDAAqD;IACrD,SAAgB,SAAS,iBAAsB,CAAC,KAAK,IAAI,EAAI;IAC7D,qDAAqD;IACrD,SAAgB,SAAS,gBAAqB,IAAI,EAAI;IACtD,yEAAyE;IACzE,SA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;IACa,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO;IAUxC;;OAEG;IACa,KAAK,IAAI,IAAI;IAQ7B;;;;OAIG;IACI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;IAoBzC;;;;OAIG;IACI,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM;CAmB7C"}
@@ -10,6 +10,8 @@ import { BeEvent } from "./BeEvent";
10
10
  * @public
11
11
  */
12
12
  export class ObservableSet extends Set {
13
+ /** @internal */
14
+ get [Symbol.toStringTag]() { return "ObservableSet"; }
13
15
  /** Emitted after `item` is added to this set. */
14
16
  onAdded = new BeEvent();
15
17
  /** Emitted after `item` is deleted from this set. */
@@ -20,27 +22,39 @@ export class ObservableSet extends Set {
20
22
  onBatchAdded = new BeEvent();
21
23
  /** Emitted after multiple items are deleted from this set via [[deleteAll]]. */
22
24
  onBatchDeleted = new BeEvent();
25
+ /** Emitted after any change to the contents of this set. */
26
+ onChanged = new BeEvent();
23
27
  /** Construct a new ObservableSet.
24
28
  * @param elements Optional elements with which to populate the new set.
25
29
  */
26
30
  constructor(elements) {
27
- // NB: Set constructor will invoke add(). Do not override until initialized.
28
- super(elements);
29
- this.add = (item) => {
30
- const prevSize = this.size;
31
- const ret = super.add(item);
32
- if (this.size !== prevSize)
33
- this.onAdded.raiseEvent(item);
34
- return ret;
35
- };
31
+ // IMPORTANT: do not pass `elements` to `super()`. It will invoke `add` which is overridden to invoke `onAdded.raiseEvent`, but
32
+ // `onAdded` is not initialized until `super()` returns.
33
+ super();
34
+ if (elements)
35
+ this.addAll(elements);
36
+ }
37
+ /** Invokes [Set.add](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add), raising
38
+ * the [[onAdded]] event if the item was not already present in the set.
39
+ */
40
+ add(item) {
41
+ const prevSize = this.size;
42
+ const ret = super.add(item);
43
+ if (this.size !== prevSize) {
44
+ this.onAdded.raiseEvent(item);
45
+ this.onChanged.raiseEvent();
46
+ }
47
+ return ret;
36
48
  }
37
49
  /** Invokes [Set.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete), raising
38
50
  * the [[onDeleted]] event if the item was removed from the set.
39
51
  */
40
52
  delete(item) {
41
53
  const ret = super.delete(item);
42
- if (ret)
54
+ if (ret) {
43
55
  this.onDeleted.raiseEvent(item);
56
+ this.onChanged.raiseEvent();
57
+ }
44
58
  return ret;
45
59
  }
46
60
  /** If this set is not already empty, invokes [Set.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear)
@@ -50,6 +64,7 @@ export class ObservableSet extends Set {
50
64
  if (0 !== this.size) {
51
65
  super.clear();
52
66
  this.onCleared.raiseEvent();
67
+ this.onChanged.raiseEvent();
53
68
  }
54
69
  }
55
70
  /** Add multiple items to the set, raising [[onBatchAdded]] only once after all items are added.
@@ -59,10 +74,21 @@ export class ObservableSet extends Set {
59
74
  */
60
75
  addAll(items) {
61
76
  const prevSize = this.size;
62
- for (const item of items)
63
- super.add(item);
64
- if (this.size !== prevSize)
65
- this.onBatchAdded.raiseEvent();
77
+ let addedAny = false;
78
+ try {
79
+ for (const item of items) {
80
+ const prevSetSize = this.size;
81
+ super.add(item);
82
+ if (this.size !== prevSetSize)
83
+ addedAny = true;
84
+ }
85
+ }
86
+ finally {
87
+ if (addedAny) {
88
+ this.onBatchAdded.raiseEvent();
89
+ this.onChanged.raiseEvent();
90
+ }
91
+ }
66
92
  return this.size - prevSize;
67
93
  }
68
94
  /** Delete multiple items from the set, raising [[onBatchDeleted]] only once after all items are deleted.
@@ -72,10 +98,21 @@ export class ObservableSet extends Set {
72
98
  */
73
99
  deleteAll(items) {
74
100
  const prevSize = this.size;
75
- for (const item of items)
76
- super.delete(item);
77
- if (this.size !== prevSize)
78
- this.onBatchDeleted.raiseEvent();
101
+ let deletedAny = false;
102
+ try {
103
+ for (const item of items) {
104
+ const prevSetSize = this.size;
105
+ super.delete(item);
106
+ if (this.size !== prevSetSize)
107
+ deletedAny = true;
108
+ }
109
+ }
110
+ finally {
111
+ if (deletedAny) {
112
+ this.onBatchDeleted.raiseEvent();
113
+ this.onChanged.raiseEvent();
114
+ }
115
+ }
79
116
  return prevSize - this.size;
80
117
  }
81
118
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ObservableSet.js","sourceRoot":"","sources":["../../src/ObservableSet.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,MAAM,OAAO,aAAiB,SAAQ,GAAM;IAC1C,iDAAiD;IACjC,OAAO,GAAG,IAAI,OAAO,EAAqB,CAAC;IAC3D,qDAAqD;IACrC,SAAS,GAAG,IAAI,OAAO,EAAqB,CAAC;IAC7D,qDAAqD;IACrC,SAAS,GAAG,IAAI,OAAO,EAAc,CAAC;IACtD,yEAAyE;IACzD,YAAY,GAAG,IAAI,OAAO,EAAc,CAAC;IACzD,gFAAgF;IAChE,cAAc,GAAG,IAAI,OAAO,EAAc,CAAC;IAE3D;;OAEG;IACH,YAAmB,QAAkC;QACnD,4EAA4E;QAC5E,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,IAAI,CAAC,GAAG,GAAG,CAAC,IAAO,EAAE,EAAE;YACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;YAC3B,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;gBACxB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAEhC,OAAO,GAAG,CAAC;QACb,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACa,MAAM,CAAC,IAAO;QAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,GAAG;YACL,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAElC,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;OAEG;IACa,KAAK;QACnB,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;YACpB,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;QAC9B,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,KAAkB;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK;YACtB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAElB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;YACxB,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;QAEjC,OAAO,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,KAAkB;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK;YACtB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAErB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;YACxB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;QAEnC,OAAO,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Collections\r\n */\r\n\r\nimport { BeEvent } from \"./BeEvent\";\r\n\r\n/** A standard [Set<T>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) that emits events when its contents change.\r\n * @public\r\n */\r\nexport class ObservableSet<T> extends Set<T> {\r\n /** Emitted after `item` is added to this set. */\r\n public readonly onAdded = new BeEvent<(item: T) => void>();\r\n /** Emitted after `item` is deleted from this set. */\r\n public readonly onDeleted = new BeEvent<(item: T) => void>();\r\n /** Emitted after this set's contents are cleared. */\r\n public readonly onCleared = new BeEvent<() => void>();\r\n /** Emitted after multiple items are added to this set via [[addAll]]. */\r\n public readonly onBatchAdded = new BeEvent<() => void>();\r\n /** Emitted after multiple items are deleted from this set via [[deleteAll]]. */\r\n public readonly onBatchDeleted = new BeEvent<() => void>();\r\n\r\n /** Construct a new ObservableSet.\r\n * @param elements Optional elements with which to populate the new set.\r\n */\r\n public constructor(elements?: Iterable<T> | undefined) {\r\n // NB: Set constructor will invoke add(). Do not override until initialized.\r\n super(elements);\r\n\r\n this.add = (item: T) => {\r\n const prevSize = this.size;\r\n const ret = super.add(item);\r\n if (this.size !== prevSize)\r\n this.onAdded.raiseEvent(item);\r\n\r\n return ret;\r\n };\r\n }\r\n\r\n /** Invokes [Set.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete), raising\r\n * the [[onDeleted]] event if the item was removed from the set.\r\n */\r\n public override delete(item: T): boolean {\r\n const ret = super.delete(item);\r\n if (ret)\r\n this.onDeleted.raiseEvent(item);\r\n\r\n return ret;\r\n }\r\n\r\n /** If this set is not already empty, invokes [Set.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear)\r\n * and raises the [[onCleared]] event.\r\n */\r\n public override clear(): void {\r\n if (0 !== this.size) {\r\n super.clear();\r\n this.onCleared.raiseEvent();\r\n }\r\n }\r\n\r\n /** Add multiple items to the set, raising [[onBatchAdded]] only once after all items are added.\r\n * This is more efficient than calling [[add]] in a loop when listeners need not be notified of each individual addition.\r\n * @param items The items to add.\r\n * @returns The number of items that were actually added (i.e., were not already present).\r\n */\r\n public addAll(items: Iterable<T>): number {\r\n const prevSize = this.size;\r\n for (const item of items)\r\n super.add(item);\r\n\r\n if (this.size !== prevSize)\r\n this.onBatchAdded.raiseEvent();\r\n\r\n return this.size - prevSize;\r\n }\r\n\r\n /** Delete multiple items from the set, raising [[onBatchDeleted]] only once after all items are deleted.\r\n * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.\r\n * @param items The items to delete.\r\n * @returns The number of items that were actually deleted (i.e., were present in the set).\r\n */\r\n public deleteAll(items: Iterable<T>): number {\r\n const prevSize = this.size;\r\n for (const item of items)\r\n super.delete(item);\r\n\r\n if (this.size !== prevSize)\r\n this.onBatchDeleted.raiseEvent();\r\n\r\n return prevSize - this.size;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ObservableSet.js","sourceRoot":"","sources":["../../src/ObservableSet.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,MAAM,OAAO,aAAiB,SAAQ,GAAM;IAC1C,gBAAgB;IAChB,IAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,OAAO,eAAe,CAAC,CAAC,CAAC;IAEtE,iDAAiD;IACjC,OAAO,GAAG,IAAI,OAAO,EAAqB,CAAC;IAC3D,qDAAqD;IACrC,SAAS,GAAG,IAAI,OAAO,EAAqB,CAAC;IAC7D,qDAAqD;IACrC,SAAS,GAAG,IAAI,OAAO,EAAc,CAAC;IACtD,yEAAyE;IACzD,YAAY,GAAG,IAAI,OAAO,EAAc,CAAC;IACzD,gFAAgF;IAChE,cAAc,GAAG,IAAI,OAAO,EAAc,CAAC;IAC3D,4DAA4D;IAC5C,SAAS,GAAG,IAAI,OAAO,EAAc,CAAC;IAEtD;;OAEG;IACH,YAAmB,QAAkC;QACnD,+HAA+H;QAC/H,wDAAwD;QACxD,KAAK,EAAE,CAAC;QAER,IAAI,QAAQ;YACV,IAAI,CAAC,MAA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,IAAI,CAAC,IAAI,KAAK,WAAW;oBAC3B,QAAQ,GAAG,IAAI,CAAC;YACpB,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;gBAC/B,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,KAAkB;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3B,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC;YACH,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC;gBAC9B,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACnB,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW;oBAC3B,UAAU,GAAG,IAAI,CAAC;YACtB,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,UAAU,EAAE,CAAC;gBACf,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;gBACjC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Collections\r\n */\r\n\r\nimport { BeEvent } from \"./BeEvent\";\r\n\r\n/** A standard [Set<T>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) that emits events when its contents change.\r\n * @public\r\n */\r\nexport class ObservableSet<T> extends Set<T> {\r\n /** @internal */\r\n public override get [Symbol.toStringTag]() { return \"ObservableSet\"; }\r\n\r\n /** Emitted after `item` is added to this set. */\r\n public readonly onAdded = new BeEvent<(item: T) => void>();\r\n /** Emitted after `item` is deleted from this set. */\r\n public readonly onDeleted = new BeEvent<(item: T) => void>();\r\n /** Emitted after this set's contents are cleared. */\r\n public readonly onCleared = new BeEvent<() => void>();\r\n /** Emitted after multiple items are added to this set via [[addAll]]. */\r\n public readonly onBatchAdded = new BeEvent<() => void>();\r\n /** Emitted after multiple items are deleted from this set via [[deleteAll]]. */\r\n public readonly onBatchDeleted = new BeEvent<() => void>();\r\n /** Emitted after any change to the contents of this set. */\r\n public readonly onChanged = new BeEvent<() => void>();\r\n\r\n /** Construct a new ObservableSet.\r\n * @param elements Optional elements with which to populate the new set.\r\n */\r\n public constructor(elements?: Iterable<T> | undefined) {\r\n // IMPORTANT: do not pass `elements` to `super()`. It will invoke `add` which is overridden to invoke `onAdded.raiseEvent`, but\r\n // `onAdded` is not initialized until `super()` returns.\r\n super();\r\n\r\n if (elements)\r\n this.addAll(elements);\r\n }\r\n\r\n /** Invokes [Set.add](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add), raising\r\n * the [[onAdded]] event if the item was not already present in the set.\r\n */\r\n public override add(item: T): this {\r\n const prevSize = this.size;\r\n const ret = super.add(item);\r\n if (this.size !== prevSize) {\r\n this.onAdded.raiseEvent(item);\r\n this.onChanged.raiseEvent();\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n /** Invokes [Set.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete), raising\r\n * the [[onDeleted]] event if the item was removed from the set.\r\n */\r\n public override delete(item: T): boolean {\r\n const ret = super.delete(item);\r\n if (ret) {\r\n this.onDeleted.raiseEvent(item);\r\n this.onChanged.raiseEvent();\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n /** If this set is not already empty, invokes [Set.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear)\r\n * and raises the [[onCleared]] event.\r\n */\r\n public override clear(): void {\r\n if (0 !== this.size) {\r\n super.clear();\r\n this.onCleared.raiseEvent();\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n\r\n /** Add multiple items to the set, raising [[onBatchAdded]] only once after all items are added.\r\n * This is more efficient than calling [[add]] in a loop when listeners need not be notified of each individual addition.\r\n * @param items The items to add.\r\n * @returns The number of items that were actually added (i.e., were not already present).\r\n */\r\n public addAll(items: Iterable<T>): number {\r\n const prevSize = this.size;\r\n let addedAny = false;\r\n try {\r\n for (const item of items) {\r\n const prevSetSize = this.size;\r\n super.add(item);\r\n if (this.size !== prevSetSize)\r\n addedAny = true;\r\n }\r\n } finally {\r\n if (addedAny) {\r\n this.onBatchAdded.raiseEvent();\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n\r\n return this.size - prevSize;\r\n }\r\n\r\n /** Delete multiple items from the set, raising [[onBatchDeleted]] only once after all items are deleted.\r\n * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.\r\n * @param items The items to delete.\r\n * @returns The number of items that were actually deleted (i.e., were present in the set).\r\n */\r\n public deleteAll(items: Iterable<T>): number {\r\n const prevSize = this.size;\r\n let deletedAny = false;\r\n try {\r\n for (const item of items) {\r\n const prevSetSize = this.size;\r\n super.delete(item);\r\n if (this.size !== prevSetSize)\r\n deletedAny = true;\r\n }\r\n } finally {\r\n if (deletedAny) {\r\n this.onBatchDeleted.raiseEvent();\r\n this.onChanged.raiseEvent();\r\n }\r\n }\r\n\r\n return prevSize - this.size;\r\n }\r\n}\r\n"]}
@@ -18,6 +18,7 @@ export * from "./JsonSchema";
18
18
  export * from "./JsonUtils";
19
19
  export * from "./Logger";
20
20
  export * from "./LRUMap";
21
+ export * from "./ObservableMap";
21
22
  export * from "./ObservableSet";
22
23
  export * from "./OneAtATimeAction";
23
24
  export * from "./OrderedId64Iterable";
@@ -1 +1 @@
1
- {"version":3,"file":"core-bentley.d.ts","sourceRoot":"","sources":["../../src/core-bentley.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,0BAA0B,CAAC;AAEzC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
1
+ {"version":3,"file":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ema";
22
22
  export * from "./JsonUtils";
23
23
  export * from "./Logger";
24
24
  export * from "./LRUMap";
25
+ export * from "./ObservableMap";
25
26
  export * from "./ObservableSet";
26
27
  export * from "./OneAtATimeAction";
27
28
  export * from "./OrderedId64Iterable";
@@ -1 +1 @@
1
- {"version":3,"file":"core-bentley.js","sourceRoot":"","sources":["../../src/core-bentley.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAE/B,oFAAoF;AACpF,cAAc,0BAA0B,CAAC;AAEzC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./AccessToken\";\r\nexport * from \"./Assert\";\r\nexport * from \"./BeEvent\";\r\nexport * from \"./BentleyError\";\r\nexport * from \"./BentleyLoggerCategory\";\r\nexport * from \"./StatusCategory\";\r\nexport * from \"./BeSQLite\";\r\nexport * from \"./ByteStream\";\r\nexport * from \"./ClassUtils\";\r\nexport * from \"./Compare\";\r\nexport * from \"./CompressedId64Set\";\r\nexport * from \"./Dictionary\";\r\nexport * from \"./Disposable\";\r\nexport * from \"./Expect\";\r\nexport * from \"./Id\";\r\nexport * from \"./IndexMap\";\r\nexport * from \"./JsonSchema\";\r\nexport * from \"./JsonUtils\";\r\nexport * from \"./Logger\";\r\nexport * from \"./LRUMap\";\r\nexport * from \"./ObservableSet\";\r\nexport * from \"./OneAtATimeAction\";\r\nexport * from \"./OrderedId64Iterable\";\r\nexport * from \"./OrderedSet\";\r\nexport * from \"./partitionArray\";\r\nexport * from \"./PriorityQueue\";\r\nexport * from \"./ProcessDetector\";\r\nexport * from \"./SortedArray\";\r\nexport * from \"./StringUtils\";\r\nexport * from \"./Time\";\r\nexport * from \"./Tracing\";\r\nexport * from \"./TupleKeyedMap\";\r\nexport * from \"./TypedArrayBuilder\";\r\nexport * from \"./UnexpectedErrors\";\r\nexport * from \"./UtilityFunctions\";\r\nexport * from \"./UtilityTypes\";\r\nexport * from \"./YieldManager\";\r\n\r\n// Temporarily (until 5.0) export top-level internal APIs to avoid breaking callers.\r\nexport * from \"./internal/cross-package\";\r\n\r\n/** @docs-package-description\r\n * The core-bentley package contains classes to solve problems that are common for both client and server use cases.\r\n */\r\n/**\r\n * @docs-group-description BeSQLite\r\n * Classes for working with SQLite databases. SQLite underlies IModelDb and ECDb - see [Executing ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n/**\r\n * @docs-group-description Errors\r\n * Classes for working with errors.\r\n */\r\n/**\r\n * @docs-group-description Events\r\n * Classes for raising and handling events.\r\n */\r\n/**\r\n * @docs-group-description Ids\r\n * Classes for working with unique identifiers.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Classes for configuring and logging diagnostic messages - see [Learning about Logging]($docs/learning/common/Logging.md)\r\n */\r\n/**\r\n * @docs-group-description Collections\r\n * Specialized, customizable collection classes like priority queues.\r\n */\r\n/**\r\n * @docs-group-description Json\r\n * utilities for dealing with Json strings and files.\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description ProcessDetector\r\n * Functions for determining the type of the current JavaScript process.\r\n */\r\n"]}
1
+ {"version":3,"file":"core-bentley.js","sourceRoot":"","sources":["../../src/core-bentley.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAE/B,oFAAoF;AACpF,cAAc,0BAA0B,CAAC;AAEzC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./AccessToken\";\r\nexport * from \"./Assert\";\r\nexport * from \"./BeEvent\";\r\nexport * from \"./BentleyError\";\r\nexport * from \"./BentleyLoggerCategory\";\r\nexport * from \"./StatusCategory\";\r\nexport * from \"./BeSQLite\";\r\nexport * from \"./ByteStream\";\r\nexport * from \"./ClassUtils\";\r\nexport * from \"./Compare\";\r\nexport * from \"./CompressedId64Set\";\r\nexport * from \"./Dictionary\";\r\nexport * from \"./Disposable\";\r\nexport * from \"./Expect\";\r\nexport * from \"./Id\";\r\nexport * from \"./IndexMap\";\r\nexport * from \"./JsonSchema\";\r\nexport * from \"./JsonUtils\";\r\nexport * from \"./Logger\";\r\nexport * from \"./LRUMap\";\r\nexport * from \"./ObservableMap\";\r\nexport * from \"./ObservableSet\";\r\nexport * from \"./OneAtATimeAction\";\r\nexport * from \"./OrderedId64Iterable\";\r\nexport * from \"./OrderedSet\";\r\nexport * from \"./partitionArray\";\r\nexport * from \"./PriorityQueue\";\r\nexport * from \"./ProcessDetector\";\r\nexport * from \"./SortedArray\";\r\nexport * from \"./StringUtils\";\r\nexport * from \"./Time\";\r\nexport * from \"./Tracing\";\r\nexport * from \"./TupleKeyedMap\";\r\nexport * from \"./TypedArrayBuilder\";\r\nexport * from \"./UnexpectedErrors\";\r\nexport * from \"./UtilityFunctions\";\r\nexport * from \"./UtilityTypes\";\r\nexport * from \"./YieldManager\";\r\n\r\n// Temporarily (until 5.0) export top-level internal APIs to avoid breaking callers.\r\nexport * from \"./internal/cross-package\";\r\n\r\n/** @docs-package-description\r\n * The core-bentley package contains classes to solve problems that are common for both client and server use cases.\r\n */\r\n/**\r\n * @docs-group-description BeSQLite\r\n * Classes for working with SQLite databases. SQLite underlies IModelDb and ECDb - see [Executing ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n/**\r\n * @docs-group-description Errors\r\n * Classes for working with errors.\r\n */\r\n/**\r\n * @docs-group-description Events\r\n * Classes for raising and handling events.\r\n */\r\n/**\r\n * @docs-group-description Ids\r\n * Classes for working with unique identifiers.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Classes for configuring and logging diagnostic messages - see [Learning about Logging]($docs/learning/common/Logging.md)\r\n */\r\n/**\r\n * @docs-group-description Collections\r\n * Specialized, customizable collection classes like priority queues.\r\n */\r\n/**\r\n * @docs-group-description Json\r\n * utilities for dealing with Json strings and files.\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description ProcessDetector\r\n * Functions for determining the type of the current JavaScript process.\r\n */\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-bentley",
3
- "version": "5.13.1",
3
+ "version": "5.14.0-dev.10",
4
4
  "description": "Bentley JavaScript core components",
5
5
  "main": "lib/cjs/core-bentley.js",
6
6
  "module": "lib/esm/core-bentley.js",
@@ -30,7 +30,7 @@
30
30
  "rimraf": "^6.0.1",
31
31
  "typescript": "~5.6.2",
32
32
  "vitest": "^4.1.10",
33
- "@itwin/build-tools": "5.13.1"
33
+ "@itwin/build-tools": "5.14.0-dev.10"
34
34
  },
35
35
  "nyc": {
36
36
  "extends": "./node_modules/@itwin/build-tools/.nycrc"