@itwin/core-i18n 5.7.0-dev.12 → 5.7.0-dev.14

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.
@@ -21491,6 +21491,10 @@ class ObservableSet extends Set {
21491
21491
  onDeleted = new _BeEvent__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
21492
21492
  /** Emitted after this set's contents are cleared. */
21493
21493
  onCleared = new _BeEvent__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
21494
+ /** Emitted after multiple items are added to this set via [[addAll]]. */
21495
+ onBatchAdded = new _BeEvent__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
21496
+ /** Emitted after multiple items are deleted from this set via [[deleteAll]]. */
21497
+ onBatchDeleted = new _BeEvent__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
21494
21498
  /** Construct a new ObservableSet.
21495
21499
  * @param elements Optional elements with which to populate the new set.
21496
21500
  */
@@ -21523,6 +21527,32 @@ class ObservableSet extends Set {
21523
21527
  this.onCleared.raiseEvent();
21524
21528
  }
21525
21529
  }
21530
+ /** Add multiple items to the set, raising [[onBatchAdded]] only once after all items are added.
21531
+ * This is more efficient than calling [[add]] in a loop when listeners need not be notified of each individual addition.
21532
+ * @param items The items to add.
21533
+ * @returns The number of items that were actually added (i.e., were not already present).
21534
+ */
21535
+ addAll(items) {
21536
+ const prevSize = this.size;
21537
+ for (const item of items)
21538
+ super.add(item);
21539
+ if (this.size !== prevSize)
21540
+ this.onBatchAdded.raiseEvent();
21541
+ return this.size - prevSize;
21542
+ }
21543
+ /** Delete multiple items from the set, raising [[onBatchDeleted]] only once after all items are deleted.
21544
+ * This is more efficient than calling [[delete]] in a loop when listeners need not be notified of each individual deletion.
21545
+ * @param items The items to delete.
21546
+ * @returns The number of items that were actually deleted (i.e., were present in the set).
21547
+ */
21548
+ deleteAll(items) {
21549
+ const prevSize = this.size;
21550
+ for (const item of items)
21551
+ super.delete(item);
21552
+ if (this.size !== prevSize)
21553
+ this.onBatchDeleted.raiseEvent();
21554
+ return prevSize - this.size;
21555
+ }
21526
21556
  }
21527
21557
 
21528
21558