@itwin/core-frontend 5.9.0-dev.1 → 5.9.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/lib/cjs/BriefcaseConnection.d.ts +4 -1
  3. package/lib/cjs/BriefcaseConnection.d.ts.map +1 -1
  4. package/lib/cjs/BriefcaseConnection.js +6 -3
  5. package/lib/cjs/BriefcaseConnection.js.map +1 -1
  6. package/lib/cjs/BriefcaseTxns.d.ts +58 -1
  7. package/lib/cjs/BriefcaseTxns.d.ts.map +1 -1
  8. package/lib/cjs/BriefcaseTxns.js +65 -0
  9. package/lib/cjs/BriefcaseTxns.js.map +1 -1
  10. package/lib/cjs/ContextRealityModelState.d.ts +2 -0
  11. package/lib/cjs/ContextRealityModelState.d.ts.map +1 -1
  12. package/lib/cjs/ContextRealityModelState.js +4 -0
  13. package/lib/cjs/ContextRealityModelState.js.map +1 -1
  14. package/lib/cjs/SheetViewState.d.ts.map +1 -1
  15. package/lib/cjs/SheetViewState.js +4 -3
  16. package/lib/cjs/SheetViewState.js.map +1 -1
  17. package/lib/cjs/Viewport.d.ts.map +1 -1
  18. package/lib/cjs/Viewport.js +14 -1
  19. package/lib/cjs/Viewport.js.map +1 -1
  20. package/lib/cjs/internal/SheetViewAttachments.d.ts +1 -1
  21. package/lib/cjs/internal/SheetViewAttachments.d.ts.map +1 -1
  22. package/lib/cjs/internal/SheetViewAttachments.js +2 -0
  23. package/lib/cjs/internal/SheetViewAttachments.js.map +1 -1
  24. package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.d.ts +1 -0
  25. package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
  26. package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js +19 -15
  27. package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
  28. package/lib/cjs/internal/tile/PrimaryTileTree.d.ts +1 -0
  29. package/lib/cjs/internal/tile/PrimaryTileTree.d.ts.map +1 -1
  30. package/lib/cjs/internal/tile/PrimaryTileTree.js +32 -2
  31. package/lib/cjs/internal/tile/PrimaryTileTree.js.map +1 -1
  32. package/lib/cjs/internal/tile/RealityModelTileTree.d.ts +1 -0
  33. package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
  34. package/lib/cjs/internal/tile/RealityModelTileTree.js +3 -0
  35. package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
  36. package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts +119 -22
  37. package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
  38. package/lib/cjs/quantity-formatting/QuantityFormatter.js +261 -59
  39. package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
  40. package/lib/cjs/tools/PrimitiveTool.d.ts +4 -1
  41. package/lib/cjs/tools/PrimitiveTool.d.ts.map +1 -1
  42. package/lib/cjs/tools/PrimitiveTool.js +5 -2
  43. package/lib/cjs/tools/PrimitiveTool.js.map +1 -1
  44. package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
  45. package/lib/cjs/tools/ToolAdmin.js +2 -2
  46. package/lib/cjs/tools/ToolAdmin.js.map +1 -1
  47. package/lib/esm/BriefcaseConnection.d.ts +4 -1
  48. package/lib/esm/BriefcaseConnection.d.ts.map +1 -1
  49. package/lib/esm/BriefcaseConnection.js +6 -3
  50. package/lib/esm/BriefcaseConnection.js.map +1 -1
  51. package/lib/esm/BriefcaseTxns.d.ts +58 -1
  52. package/lib/esm/BriefcaseTxns.d.ts.map +1 -1
  53. package/lib/esm/BriefcaseTxns.js +65 -0
  54. package/lib/esm/BriefcaseTxns.js.map +1 -1
  55. package/lib/esm/ContextRealityModelState.d.ts +2 -0
  56. package/lib/esm/ContextRealityModelState.d.ts.map +1 -1
  57. package/lib/esm/ContextRealityModelState.js +4 -0
  58. package/lib/esm/ContextRealityModelState.js.map +1 -1
  59. package/lib/esm/SheetViewState.d.ts.map +1 -1
  60. package/lib/esm/SheetViewState.js +4 -3
  61. package/lib/esm/SheetViewState.js.map +1 -1
  62. package/lib/esm/Viewport.d.ts.map +1 -1
  63. package/lib/esm/Viewport.js +14 -1
  64. package/lib/esm/Viewport.js.map +1 -1
  65. package/lib/esm/internal/SheetViewAttachments.d.ts +1 -1
  66. package/lib/esm/internal/SheetViewAttachments.d.ts.map +1 -1
  67. package/lib/esm/internal/SheetViewAttachments.js +2 -0
  68. package/lib/esm/internal/SheetViewAttachments.js.map +1 -1
  69. package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.d.ts +1 -0
  70. package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
  71. package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js +19 -15
  72. package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
  73. package/lib/esm/internal/tile/PrimaryTileTree.d.ts +1 -0
  74. package/lib/esm/internal/tile/PrimaryTileTree.d.ts.map +1 -1
  75. package/lib/esm/internal/tile/PrimaryTileTree.js +33 -3
  76. package/lib/esm/internal/tile/PrimaryTileTree.js.map +1 -1
  77. package/lib/esm/internal/tile/RealityModelTileTree.d.ts +1 -0
  78. package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
  79. package/lib/esm/internal/tile/RealityModelTileTree.js +3 -0
  80. package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
  81. package/lib/esm/quantity-formatting/QuantityFormatter.d.ts +119 -22
  82. package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
  83. package/lib/esm/quantity-formatting/QuantityFormatter.js +263 -61
  84. package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
  85. package/lib/esm/tools/PrimitiveTool.d.ts +4 -1
  86. package/lib/esm/tools/PrimitiveTool.d.ts.map +1 -1
  87. package/lib/esm/tools/PrimitiveTool.js +5 -2
  88. package/lib/esm/tools/PrimitiveTool.js.map +1 -1
  89. package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
  90. package/lib/esm/tools/ToolAdmin.js +3 -3
  91. package/lib/esm/tools/ToolAdmin.js.map +1 -1
  92. package/lib/public/scripts/parse-imdl-worker.js +1 -1
  93. package/lib/workers/webpack/parse-imdl-worker.js +1 -1
  94. package/package.json +22 -22
package/CHANGELOG.md CHANGED
@@ -1,6 +1,34 @@
1
1
  # Change Log - @itwin/core-frontend
2
2
 
3
- This log was last generated on Tue, 24 Mar 2026 14:30:44 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 16 Apr 2026 11:06:21 GMT and should not be manually modified.
4
+
5
+ ## 5.8.2
6
+ Thu, 16 Apr 2026 11:05:01 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 5.8.1
11
+ Fri, 10 Apr 2026 13:02:00 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 5.8.0
16
+ Thu, 02 Apr 2026 18:19:33 GMT
17
+
18
+ ### Minor changes
19
+
20
+ - Add support for the proposed BENTLEY_materials_line_style glTF extension, including line width and custom line-pattern rendering for glTF line primitives.
21
+
22
+ ### Updates
23
+
24
+ - Fix default KOQ -> QuantityType map value for CivilUnits.LENGTH
25
+ - Support geometry collection for reality meshes with glTF tiles
26
+ - Fix reality data not being reprojected correctly when its CRS is different than iModel
27
+ - New LockService interface and new BriefcaseConnection.locks property
28
+ - Update measure tool to fallback to QuantityType
29
+ - Fix crash when QuantityFormatter.setUnitsProvider is called after IModelApp shutdown — ToolAdmin no longer emits activeToolChanged with an undefined tool.
30
+ - Revert metric LengthEngineering default format back to meters (meter4) from millimeters (millimeter3).
31
+ - Add support for WMTS sparse tilesets
4
32
 
5
33
  ## 5.7.3
6
34
  Tue, 24 Mar 2026 14:29:17 GMT
@@ -144,9 +144,12 @@ export declare class BriefcaseConnection extends IModelConnection {
144
144
  hasPendingTxns(): Promise<boolean>;
145
145
  /** Commit pending changes to this briefcase.
146
146
  * @param description Optional description of the changes.
147
+ * @deprecated Use methods on EditCommand instead.
147
148
  */
148
149
  saveChanges(description?: string): Promise<void>;
149
- /** Abandon pending changes to this briefcase. */
150
+ /** Abandon pending changes to this briefcase.
151
+ * @deprecated Use methods on EditCommand instead.
152
+ */
150
153
  abandonChanges(): Promise<void>;
151
154
  /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase
152
155
  * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.
@@ -1 +1 @@
1
- {"version":3,"file":"BriefcaseConnection.d.ts","sourceRoot":"","sources":["../../src/BriefcaseConnection.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAA2B,UAAU,EAAE,OAAO,EAAE,UAAU,EAAgB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxI,OAAO,EACL,wBAAwB,EAAE,cAAc,EAAE,mBAAmB,EACb,SAAS,EAAE,kBAAkB,EAAE,qBAAqB,EACrG,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAKtD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC;AAE1E;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,GAAG,KAAK,GAAG,KAAK,IAAI,CAAC;IAChG,wCAAwC;IACxC,mBAAmB,EAAE,CAAC,IAAI,EAAE,O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,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAOzJ,2DAA2D;IAC3D,IAAW,QAAQ,IAAI,OAAO,CAAoC;IAElE;;;OAGG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAanC,SAAS,CAAC,eAAe;IAKzB,2FAA2F;IAC9E,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/C;;;OAGG;IACU,WAAW,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7D;;OAEG;IACU,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5C;;;;OAIG;IACU,WAAW,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC/F;;;;OAIG;IACU,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAK3E;;OAEG;IACH,IAAW,YAAY,IAAI,qBAAqB,GAAG,SAAS,CAE3D;IAED;;;OAGG;IACU,wBAAwB,IAAI,OAAO,CAAC,OAAO,CAAC;IAIzD;;;;;OAKG;IACU,iBAAiB,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAIhE;;OAEG;IACH,SAAgB,sBAAsB,4BAAiC,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAI;CAChG"}
@@ -248,13 +248,16 @@ class BriefcaseConnection extends IModelConnection_1.IModelConnection {
248
248
  }
249
249
  /** Commit pending changes to this briefcase.
250
250
  * @param description Optional description of the changes.
251
+ * @deprecated Use methods on EditCommand instead.
251
252
  */
252
253
  async saveChanges(description) {
253
- await IpcApp_1.IpcApp.appFunctionIpc.saveChanges(this.key, description);
254
+ await IpcApp_1.IpcApp.appFunctionIpc.saveChanges(this.key, description); // eslint-disable-line @typescript-eslint/no-deprecated
254
255
  }
255
- /** Abandon pending changes to this briefcase. */
256
+ /** Abandon pending changes to this briefcase.
257
+ * @deprecated Use methods on EditCommand instead.
258
+ */
256
259
  async abandonChanges() {
257
- await IpcApp_1.IpcApp.appFunctionIpc.abandonChanges(this.key);
260
+ await IpcApp_1.IpcApp.appFunctionIpc.abandonChanges(this.key); // eslint-disable-line @typescript-eslint/no-deprecated
258
261
  }
259
262
  /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase
260
263
  * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.
@@ -1 +1 @@
1
- {"version":3,"file":"BriefcaseConnection.js","sourceRoot":"","sources":["../../src/BriefcaseConnection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAwI;AACxI,oDAG4B;AAC5B,mDAAgD;AAChD,mEAAgE;AAChE,2CAAwC;AACxC,yDAAsD;AACtD,qCAAkC;AAClC,8CAAqE;AACrE,yCAAsC;AA8CtC;;;GAGG;AACH,MAAM,kBAAkB;IACd,aAAa,CAAyB;IAC7B,UAAU,CAAsB;IAChC,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,cAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC3C,SAAS,GAAmB,EAAE,CAAC;IAEhD,YAAmB,SAA8B;QAC/C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,iCAAiC;QACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,EAAE;YAChF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC7B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACtC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;YAClD,CAAC;QACH,CAAC,CAAC,CAAC,CAAC;QAEJ,8BAA8B;QAC9B,IAAI,CAAC,SAAS,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CAChG;AAjMD,kDAiMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IModelConnection\n */\n\nimport { assert, BeEvent, CompressedId64Set, Guid, GuidString, Id64Set, Id64String, IModelStatus, OpenMode } from \"@itwin/core-bentley\";\nimport {\n BriefcaseConnectionProps, ChangesetIndex, ChangesetIndexAndId, getPullChangesIpcChannel, IModelError,\n PullChangesOptions as IpcAppPullChangesOptions, LockState, OpenBriefcaseProps, StandaloneOpenOptions,\n} from \"@itwin/core-common\";\nimport { BriefcaseTxns } from \"./BriefcaseTxns\";\nimport { GraphicalEditingScope } from \"./GraphicalEditingScope\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { IpcApp } from \"./IpcApp\";\nimport { disposeTileTreesForGeometricModels } from \"./tile/internal\";\nimport { Viewport } from \"./Viewport\";\n\n/**\n * Download progress information.\n * @public\n */\nexport interface DownloadProgressInfo {\n /** Bytes downloaded. */\n loaded: number;\n /** Total size of the download in bytes. */\n total: number;\n}\n\n/**\n * Called to show progress during a download.\n * @public\n */\nexport type OnDownloadProgress = (progress: DownloadProgressInfo) => void;\n\n/**\n * Partial interface of AbortSignal.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal\n * @beta\n */\nexport interface GenericAbortSignal {\n /** Add Listener for abort signal. */\n addEventListener: (type: \"abort\", listener: (this: GenericAbortSignal, ev: any) => any) => void;\n /** Remove Listener for abort signal. */\n removeEventListener: (type: \"abort\", listener: (this: GenericAbortSignal, ev: any) => any) => void;\n}\n\n/**\n * Options for pulling iModel changes.\n * @public\n */\nexport interface PullChangesOptions {\n /** Function called regularly to report progress of changes download. */\n downloadProgressCallback?: OnDownloadProgress;\n /** Interval for calling progress callback (in milliseconds). */\n progressInterval?: number;\n /** Signal for cancelling the download.\n * @beta\n */\n abortSignal?: GenericAbortSignal;\n}\n\n/** Keeps track of changes to models, buffering them until synchronization points.\n * While a GraphicalEditingScope is open, the changes are buffered until the scope exits, at which point they are processed.\n * Otherwise, the buffered changes are processed after undo/redo, commit, or pull+merge changes.\n */\nclass ModelChangeMonitor {\n private _editingScope?: GraphicalEditingScope;\n private readonly _briefcase: BriefcaseConnection;\n private readonly _deletedModels = new Set<string>();\n private readonly _modelIdToGuid = new Map<string, string>();\n private readonly _removals: VoidFunction[] = [];\n\n public constructor(briefcase: BriefcaseConnection) {\n this._briefcase = briefcase;\n\n // Buffer updated geometry guids.\n this._removals.push(briefcase.txns.onModelGeometryChanged.addListener((changes) => {\n for (const change of changes) {\n this._deletedModels.delete(change.id);\n this._modelIdToGuid.set(change.id, change.guid);\n }\n }));\n\n // Buffer deletions of models.\n this._removals.push(briefcase.txns.onModelsChanged.addListener((changes) => {\n if (changes.deleted) {\n for (const id of CompressedId64Set.iterable(changes.deleted)) {\n this._modelIdToGuid.delete(id);\n this._deletedModels.add(id);\n }\n }\n }));\n\n // Outside of an editing scope, we want to update viewport contents after commit, undo/redo, or merging changes.\n const maybeProcess = async () => {\n if (this.editingScope)\n return;\n\n const modelIds = Array.from(this._modelIdToGuid.keys());\n if (modelIds.length > 0)\n await IModelApp.tileAdmin.purgeTileTrees(this._briefcase, modelIds);\n\n this.processBuffered();\n };\n\n this._removals.push(briefcase.txns.onCommitted.addListener(maybeProcess));\n this._removals.push(briefcase.txns.onReplayedExternalTxns.addListener(maybeProcess));\n this._removals.push(briefcase.txns.onAfterUndoRedo.addListener(maybeProcess));\n this._removals.push(briefcase.txns.onChangesPulled.addListener(maybeProcess));\n }\n\n public async close(): Promise<void> {\n for (const removal of this._removals)\n removal();\n\n this._removals.length = 0;\n\n if (this._editingScope) {\n await this._editingScope.exit();\n this._editingScope = undefined;\n }\n }\n\n public get editingScope(): GraphicalEditingScope | undefined {\n return this._editingScope;\n }\n\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\n if (this._editingScope)\n throw new Error(\"Cannot create an editing scope for an iModel that already has one\");\n\n this._editingScope = await GraphicalEditingScope.enter(this._briefcase);\n\n const removeGeomListener = this._editingScope.onGeometryChanges.addListener((changes) => {\n const modelIds = [];\n for (const change of changes)\n modelIds.push(change.id);\n\n this.invalidateScenes(modelIds);\n });\n\n this._editingScope.onExited.addOnce((scope) => {\n assert(scope === this._editingScope);\n this._editingScope = undefined;\n removeGeomListener();\n this.processBuffered();\n });\n\n return this._editingScope;\n }\n\n private processBuffered(): void {\n const models = this._briefcase.models;\n for (const [id, guid] of this._modelIdToGuid) {\n const model = models.getLoaded(id)?.asGeometricModel;\n if (model)\n model.geometryGuid = guid;\n }\n\n const modelIds = new Set<string>(this._modelIdToGuid.keys());\n for (const deleted of this._deletedModels) {\n modelIds.add(deleted);\n models.unload(deleted);\n }\n\n this.invalidateScenes(modelIds);\n disposeTileTreesForGeometricModels(modelIds, this._briefcase);\n\n this._briefcase.onBufferedModelChanges.raiseEvent(modelIds);\n\n this._modelIdToGuid.clear();\n this._deletedModels.clear();\n }\n\n private invalidateScenes(changedModels: Iterable<Id64String>): void {\n for (const user of IModelApp.tileAdmin.tileUsers) {\n if (user instanceof Viewport && user.iModel === this._briefcase) {\n for (const modelId of changedModels) {\n if (user.view.viewsModel(modelId)) {\n user.invalidateScene();\n user.setFeatureOverrideProviderChanged();\n break;\n }\n }\n }\n }\n }\n}\n\n/**\n * Provides access to lock information in the iModel.\n * @see [[BriefcaseConnection.locks]]\n * @alpha\n */\nexport interface LockService {\n /** Get all elements with exclusive locks owned by other briefcases. */\n getExclusiveForeignLocks(): Promise<Id64Set>;\n /** Get all elements with shared locks owned by other briefcases. */\n getSharedForeignLocks(): Promise<Id64Set>;\n /** Check whether it's possible to acquire a lock for the element. */\n checkElementLockAvailability(elementId: Id64String, lock: LockState): Promise<boolean>;\n}\n\n/** Function for creating a [[LockService]] for a [[BriefcaseConnection]].\n * @alpha\n */\nexport type LockServiceFactory = (iModel: BriefcaseConnection) => Promise<LockService>;\n\n/** Settings that can be used to control the behavior of [[Tool]]s that modify a [[BriefcaseConnection]].\n * For example, tools that want to create new elements can consult the briefcase's editor tool settings to\n * determine into which model and category to insert the elements.\n * Specialized tools are free to ignore these settings.\n * @see [[BriefcaseConnection.editorToolSettings]] to query or modify the current settings for a briefcase.\n * @see [CreateElementTool]($editor-frontend) for an example of a tool that uses these settings.\n * @beta\n */\nexport class BriefcaseEditorToolSettings {\n private _category?: Id64String;\n private _model?: Id64String;\n\n /** An event raised just after the default [[category]] is changed. */\n public readonly onCategoryChanged = new BeEvent<(previousCategory: Id64String | undefined) => void>();\n\n /** An event raised just after the default [[model]] is changed. */\n public readonly onModelChanged = new BeEvent<(previousModel: Id64String | undefined) => void>();\n\n /** The [Category]($backend) into which new elements should be inserted by default.\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate category.\n * @see [[onCategoryChanged]] to be notified when this property is modified.\n * @see [CreateElementTool.targetCategory]($editor-frontend) for an example of a tool that uses this setting.\n */\n public get category(): Id64String | undefined {\n return this._category;\n }\n public set category(category: Id64String | undefined) {\n const previousCategory = this.category;\n if (category !== this.category) {\n this._category = category;\n this.onCategoryChanged.raiseEvent(previousCategory);\n }\n }\n\n /** The [Model]($backend) into which new elements should be inserted by default.\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate model.\n * @see [[onModelChanged]] to be notified when this property is modified.\n * @see [CreateElementTool.targetModelId]($editor-frontend) for an example of a tool that uses this setting.\n */\n public get model(): Id64String | undefined {\n return this._model;\n }\n public set model(model: Id64String | undefined) {\n const previousModel = this.model;\n if (model !== this.model) {\n this._model = model;\n this.onModelChanged.raiseEvent(previousModel);\n }\n }\n}\n\n/** A connection to an editable briefcase on the backend. This class uses [Ipc]($docs/learning/IpcInterface.md) to communicate\n * to the backend and may only be used by [[IpcApp]]s.\n * @public\n */\nexport class BriefcaseConnection extends IModelConnection {\n protected _isClosed?: boolean;\n private readonly _modelsMonitor: ModelChangeMonitor;\n private _locks?: LockService;\n\n /** The ID of the briefcase.\n * @beta\n */\n public readonly briefcaseId?: number;\n\n /** Default settings that can be used to control the behavior of [[Tool]]s that modify this briefcase.\n * @beta\n */\n public readonly editorToolSettings = new BriefcaseEditorToolSettings();\n\n /** Manages local changes to the briefcase via [Txns]($docs/learning/InteractiveEditing.md). */\n public readonly txns: BriefcaseTxns;\n\n /** Information about locks held on this iModel.\n * @note This is intended to be used by tools and other UI elements, to provide information about the current lock state. Implementations are expected to cache lock information and so may not reflect changes to locks immediately.\n * @alpha\n */\n public get locks(): LockService | undefined { return this._locks; }\n\n public override isBriefcaseConnection(): this is BriefcaseConnection { return true; }\n\n /** The Guid that identifies the iTwin that owns this iModel. */\n public override get iTwinId(): GuidString { return super.iTwinId ?? Guid.empty; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\n\n /** The Guid that identifies this iModel. */\n public override get iModelId(): GuidString { return super.iModelId ?? Guid.empty; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\n\n protected constructor(props: BriefcaseConnectionProps, openMode: OpenMode) {\n super(props);\n this._openMode = openMode;\n this.briefcaseId = props.briefcaseId;\n this.txns = new BriefcaseTxns(this);\n this._modelsMonitor = new ModelChangeMonitor(this);\n if (OpenMode.ReadWrite === this._openMode)\n this.txns.onAfterUndoRedo.addListener(async () => { await IModelApp.toolAdmin.restartPrimitiveTool(); });\n\n this.categories.cache.attachToBriefcase(this);\n }\n\n /** Open a BriefcaseConnection to a [BriefcaseDb]($backend). */\n public static async openFile(briefcaseProps: OpenBriefcaseProps): Promise<BriefcaseConnection>;\n\n /** Open a BriefcaseConnection to a [BriefcaseDb]($backend).\n * @alpha\n */\n public static async openFile(briefcaseProps: OpenBriefcaseProps, lockServiceFactory?: LockServiceFactory): Promise<BriefcaseConnection>\n\n public static async openFile(briefcaseProps: OpenBriefcaseProps, lockServiceFactory?: LockServiceFactory): Promise<BriefcaseConnection> {\n const iModelProps = await IpcApp.appFunctionIpc.openBriefcase(briefcaseProps);\n const connection = new this({ ...briefcaseProps, ...iModelProps }, briefcaseProps.readonly ? OpenMode.Readonly : OpenMode.ReadWrite);\n if (lockServiceFactory)\n connection._locks = await lockServiceFactory(connection);\n\n IModelConnection.onOpen.raiseEvent(connection);\n return connection;\n }\n\n /** Open a BriefcaseConnection to a [StandaloneDb]($backend)\n * @note StandaloneDbs, by definition, may not push or pull changes. Attempting to do so will throw exceptions.\n */\n public static async openStandalone(filePath: string, openMode: OpenMode = OpenMode.ReadWrite, opts?: StandaloneOpenOptions): Promise<BriefcaseConnection> {\n const openResponse = await IpcApp.appFunctionIpc.openStandalone(filePath, openMode, opts);\n const connection = new this(openResponse, openMode);\n IModelConnection.onOpen.raiseEvent(connection);\n return connection;\n }\n\n /** Returns `true` if [[close]] has already been called. */\n public get isClosed(): boolean { return this._isClosed === true; }\n\n /**\n * Close this BriefcaseConnection.\n * @note make sure to call [[saveChanges]] before calling this method. Unsaved local changes are abandoned.\n */\n public async close(): Promise<void> {\n if (this.isClosed)\n return;\n\n await this._modelsMonitor.close();\n\n this.beforeClose();\n this.txns[Symbol.dispose]();\n\n this._isClosed = true;\n await IpcApp.appFunctionIpc.closeIModel(this._fileKey);\n }\n\n protected requireTimeline() {\n if (this.iTwinId === Guid.empty)\n throw new IModelError(IModelStatus.WrongIModel, \"iModel has no timeline\");\n }\n\n /** Query if there are any pending Txns in this briefcase that are waiting to be pushed. */\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\n return this.txns.hasPendingTxns();\n }\n\n /** Commit pending changes to this briefcase.\n * @param description Optional description of the changes.\n */\n public async saveChanges(description?: string): Promise<void> {\n await IpcApp.appFunctionIpc.saveChanges(this.key, description);\n }\n\n /** Abandon pending changes to this briefcase. */\n public async abandonChanges(): Promise<void> {\n await IpcApp.appFunctionIpc.abandonChanges(this.key);\n }\n\n /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase\n * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.\n * @param options Options for pulling changes.\n * @see [[BriefcaseTxns.onChangesPulled]] for the event dispatched after changes are pulled.\n */\n public async pullChanges(toIndex?: ChangesetIndex, options?: PullChangesOptions): Promise<void> {\n const removeListeners: VoidFunction[] = [];\n const shouldReportProgress = !!options?.downloadProgressCallback;\n\n if (shouldReportProgress) {\n const handleProgress = (_evt: Event, data: { loaded: number, total: number }) => {\n options?.downloadProgressCallback?.(data);\n };\n\n const removeProgressListener = IpcApp.addListener(\n getPullChangesIpcChannel(this.iModelId),\n handleProgress,\n );\n removeListeners.push(removeProgressListener);\n }\n\n if (options?.abortSignal) {\n const abort = () => void IpcApp.appFunctionIpc.cancelPullChangesRequest(this.key);\n options?.abortSignal.addEventListener(\"abort\", abort);\n removeListeners.push(() => options?.abortSignal?.removeEventListener(\"abort\", abort));\n }\n\n this.requireTimeline();\n const ipcAppOptions: IpcAppPullChangesOptions = {\n reportProgress: shouldReportProgress,\n progressInterval: options?.progressInterval,\n enableCancellation: !!options?.abortSignal,\n };\n try {\n this.changeset = await IpcApp.appFunctionIpc.pullChanges(this.key, toIndex, ipcAppOptions);\n } finally {\n removeListeners.forEach((remove) => remove());\n }\n }\n\n /** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.\n * @param description The description for the changeset\n * @returns the changesetId of the pushed changes\n * @see [[BriefcaseTxns.onChangesPushed]] for the event dispatched after changes are pushed.\n */\n public async pushChanges(description: string): Promise<ChangesetIndexAndId> {\n this.requireTimeline();\n return IpcApp.appFunctionIpc.pushChanges(this.key, description);\n }\n\n /** The current graphical editing scope, if one is in progress.\n * @see [[enterEditingScope]] to begin graphical editing.\n */\n public get editingScope(): GraphicalEditingScope | undefined {\n return this._modelsMonitor.editingScope;\n }\n\n /** Return whether graphical editing is supported for this briefcase. It is not supported if the briefcase is read-only, or the briefcase contains a version of\n * the BisCore ECSchema older than v0.1.11.\n * @see [[enterEditingScope]] to enable graphical editing.\n */\n public async supportsGraphicalEditing(): Promise<boolean> {\n return IpcApp.appFunctionIpc.isGraphicalEditingSupported(this.key);\n }\n\n /** Begin a new graphical editing scope.\n * @throws Error if an editing scope already exists or one could not be created.\n * @see [[GraphicalEditingScope.exit]] to exit the scope.\n * @see [[supportsGraphicalEditing]] to determine whether this method should be expected to succeed.\n * @see [[editingScope]] to obtain the current editing scope, if one is in progress.\n */\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\n return this._modelsMonitor.enterEditingScope();\n }\n\n /** Strictly for tests - dispatched from ModelChangeMonitor.processBuffered.\n * @internal\n */\n public readonly onBufferedModelChanges = new BeEvent<(changedModelIds: Set<string>) => void>();\n}\n"]}
1
+ {"version":3,"file":"BriefcaseConnection.js","sourceRoot":"","sources":["../../src/BriefcaseConnection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAwI;AACxI,oDAG4B;AAC5B,mDAAgD;AAChD,mEAAgE;AAChE,2CAAwC;AACxC,yDAAsD;AACtD,qCAAkC;AAClC,8CAAqE;AACrE,yCAAsC;AA8CtC;;;GAGG;AACH,MAAM,kBAAkB;IACd,aAAa,CAAyB;IAC7B,UAAU,CAAsB;IAChC,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,cAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC3C,SAAS,GAAmB,EAAE,CAAC;IAEhD,YAAmB,SAA8B;QAC/C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,iCAAiC;QACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,EAAE;YAChF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC7B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACtC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,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,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;IACjD,CAAC;IAED;;OAEG;IACa,sBAAsB,GAAG,IAAI,sBAAO,EAA0C,CAAC;CAChG;AApMD,kDAoMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IModelConnection\n */\n\nimport { assert, BeEvent, CompressedId64Set, Guid, GuidString, Id64Set, Id64String, IModelStatus, OpenMode } from \"@itwin/core-bentley\";\nimport {\n BriefcaseConnectionProps, ChangesetIndex, ChangesetIndexAndId, getPullChangesIpcChannel, IModelError,\n PullChangesOptions as IpcAppPullChangesOptions, LockState, OpenBriefcaseProps, StandaloneOpenOptions,\n} from \"@itwin/core-common\";\nimport { BriefcaseTxns } from \"./BriefcaseTxns\";\nimport { GraphicalEditingScope } from \"./GraphicalEditingScope\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { IpcApp } from \"./IpcApp\";\nimport { disposeTileTreesForGeometricModels } from \"./tile/internal\";\nimport { Viewport } from \"./Viewport\";\n\n/**\n * Download progress information.\n * @public\n */\nexport interface DownloadProgressInfo {\n /** Bytes downloaded. */\n loaded: number;\n /** Total size of the download in bytes. */\n total: number;\n}\n\n/**\n * Called to show progress during a download.\n * @public\n */\nexport type OnDownloadProgress = (progress: DownloadProgressInfo) => void;\n\n/**\n * Partial interface of AbortSignal.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal\n * @beta\n */\nexport interface GenericAbortSignal {\n /** Add Listener for abort signal. */\n addEventListener: (type: \"abort\", listener: (this: GenericAbortSignal, ev: any) => any) => void;\n /** Remove Listener for abort signal. */\n removeEventListener: (type: \"abort\", listener: (this: GenericAbortSignal, ev: any) => any) => void;\n}\n\n/**\n * Options for pulling iModel changes.\n * @public\n */\nexport interface PullChangesOptions {\n /** Function called regularly to report progress of changes download. */\n downloadProgressCallback?: OnDownloadProgress;\n /** Interval for calling progress callback (in milliseconds). */\n progressInterval?: number;\n /** Signal for cancelling the download.\n * @beta\n */\n abortSignal?: GenericAbortSignal;\n}\n\n/** Keeps track of changes to models, buffering them until synchronization points.\n * While a GraphicalEditingScope is open, the changes are buffered until the scope exits, at which point they are processed.\n * Otherwise, the buffered changes are processed after undo/redo, commit, or pull+merge changes.\n */\nclass ModelChangeMonitor {\n private _editingScope?: GraphicalEditingScope;\n private readonly _briefcase: BriefcaseConnection;\n private readonly _deletedModels = new Set<string>();\n private readonly _modelIdToGuid = new Map<string, string>();\n private readonly _removals: VoidFunction[] = [];\n\n public constructor(briefcase: BriefcaseConnection) {\n this._briefcase = briefcase;\n\n // Buffer updated geometry guids.\n this._removals.push(briefcase.txns.onModelGeometryChanged.addListener((changes) => {\n for (const change of changes) {\n this._deletedModels.delete(change.id);\n this._modelIdToGuid.set(change.id, change.guid);\n }\n }));\n\n // Buffer deletions of models.\n this._removals.push(briefcase.txns.onModelsChanged.addListener((changes) => {\n if (changes.deleted) {\n for (const id of CompressedId64Set.iterable(changes.deleted)) {\n this._modelIdToGuid.delete(id);\n this._deletedModels.add(id);\n }\n }\n }));\n\n // Outside of an editing scope, we want to update viewport contents after commit, undo/redo, or merging changes.\n const maybeProcess = async () => {\n if (this.editingScope)\n return;\n\n const modelIds = Array.from(this._modelIdToGuid.keys());\n if (modelIds.length > 0)\n await IModelApp.tileAdmin.purgeTileTrees(this._briefcase, modelIds);\n\n this.processBuffered();\n };\n\n this._removals.push(briefcase.txns.onCommitted.addListener(maybeProcess));\n this._removals.push(briefcase.txns.onReplayedExternalTxns.addListener(maybeProcess));\n this._removals.push(briefcase.txns.onAfterUndoRedo.addListener(maybeProcess));\n this._removals.push(briefcase.txns.onChangesPulled.addListener(maybeProcess));\n }\n\n public async close(): Promise<void> {\n for (const removal of this._removals)\n removal();\n\n this._removals.length = 0;\n\n if (this._editingScope) {\n await this._editingScope.exit();\n this._editingScope = undefined;\n }\n }\n\n public get editingScope(): GraphicalEditingScope | undefined {\n return this._editingScope;\n }\n\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\n if (this._editingScope)\n throw new Error(\"Cannot create an editing scope for an iModel that already has one\");\n\n this._editingScope = await GraphicalEditingScope.enter(this._briefcase);\n\n const removeGeomListener = this._editingScope.onGeometryChanges.addListener((changes) => {\n const modelIds = [];\n for (const change of changes)\n modelIds.push(change.id);\n\n this.invalidateScenes(modelIds);\n });\n\n this._editingScope.onExited.addOnce((scope) => {\n assert(scope === this._editingScope);\n this._editingScope = undefined;\n removeGeomListener();\n this.processBuffered();\n });\n\n return this._editingScope;\n }\n\n private processBuffered(): void {\n const models = this._briefcase.models;\n for (const [id, guid] of this._modelIdToGuid) {\n const model = models.getLoaded(id)?.asGeometricModel;\n if (model)\n model.geometryGuid = guid;\n }\n\n const modelIds = new Set<string>(this._modelIdToGuid.keys());\n for (const deleted of this._deletedModels) {\n modelIds.add(deleted);\n models.unload(deleted);\n }\n\n this.invalidateScenes(modelIds);\n disposeTileTreesForGeometricModels(modelIds, this._briefcase);\n\n this._briefcase.onBufferedModelChanges.raiseEvent(modelIds);\n\n this._modelIdToGuid.clear();\n this._deletedModels.clear();\n }\n\n private invalidateScenes(changedModels: Iterable<Id64String>): void {\n for (const user of IModelApp.tileAdmin.tileUsers) {\n if (user instanceof Viewport && user.iModel === this._briefcase) {\n for (const modelId of changedModels) {\n if (user.view.viewsModel(modelId)) {\n user.invalidateScene();\n user.setFeatureOverrideProviderChanged();\n break;\n }\n }\n }\n }\n }\n}\n\n/**\n * Provides access to lock information in the iModel.\n * @see [[BriefcaseConnection.locks]]\n * @alpha\n */\nexport interface LockService {\n /** Get all elements with exclusive locks owned by other briefcases. */\n getExclusiveForeignLocks(): Promise<Id64Set>;\n /** Get all elements with shared locks owned by other briefcases. */\n getSharedForeignLocks(): Promise<Id64Set>;\n /** Check whether it's possible to acquire a lock for the element. */\n checkElementLockAvailability(elementId: Id64String, lock: LockState): Promise<boolean>;\n}\n\n/** Function for creating a [[LockService]] for a [[BriefcaseConnection]].\n * @alpha\n */\nexport type LockServiceFactory = (iModel: BriefcaseConnection) => Promise<LockService>;\n\n/** Settings that can be used to control the behavior of [[Tool]]s that modify a [[BriefcaseConnection]].\n * For example, tools that want to create new elements can consult the briefcase's editor tool settings to\n * determine into which model and category to insert the elements.\n * Specialized tools are free to ignore these settings.\n * @see [[BriefcaseConnection.editorToolSettings]] to query or modify the current settings for a briefcase.\n * @see [CreateElementTool]($editor-frontend) for an example of a tool that uses these settings.\n * @beta\n */\nexport class BriefcaseEditorToolSettings {\n private _category?: Id64String;\n private _model?: Id64String;\n\n /** An event raised just after the default [[category]] is changed. */\n public readonly onCategoryChanged = new BeEvent<(previousCategory: Id64String | undefined) => void>();\n\n /** An event raised just after the default [[model]] is changed. */\n public readonly onModelChanged = new BeEvent<(previousModel: Id64String | undefined) => void>();\n\n /** The [Category]($backend) into which new elements should be inserted by default.\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate category.\n * @see [[onCategoryChanged]] to be notified when this property is modified.\n * @see [CreateElementTool.targetCategory]($editor-frontend) for an example of a tool that uses this setting.\n */\n public get category(): Id64String | undefined {\n return this._category;\n }\n public set category(category: Id64String | undefined) {\n const previousCategory = this.category;\n if (category !== this.category) {\n this._category = category;\n this.onCategoryChanged.raiseEvent(previousCategory);\n }\n }\n\n /** The [Model]($backend) into which new elements should be inserted by default.\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate model.\n * @see [[onModelChanged]] to be notified when this property is modified.\n * @see [CreateElementTool.targetModelId]($editor-frontend) for an example of a tool that uses this setting.\n */\n public get model(): Id64String | undefined {\n return this._model;\n }\n public set model(model: Id64String | undefined) {\n const previousModel = this.model;\n if (model !== this.model) {\n this._model = model;\n this.onModelChanged.raiseEvent(previousModel);\n }\n }\n}\n\n/** A connection to an editable briefcase on the backend. This class uses [Ipc]($docs/learning/IpcInterface.md) to communicate\n * to the backend and may only be used by [[IpcApp]]s.\n * @public\n */\nexport class BriefcaseConnection extends IModelConnection {\n protected _isClosed?: boolean;\n private readonly _modelsMonitor: ModelChangeMonitor;\n private _locks?: LockService;\n\n /** The ID of the briefcase.\n * @beta\n */\n public readonly briefcaseId?: number;\n\n /** Default settings that can be used to control the behavior of [[Tool]]s that modify this briefcase.\n * @beta\n */\n public readonly editorToolSettings = new BriefcaseEditorToolSettings();\n\n /** Manages local changes to the briefcase via [Txns]($docs/learning/InteractiveEditing.md). */\n public readonly txns: BriefcaseTxns;\n\n /** Information about locks held on this iModel.\n * @note This is intended to be used by tools and other UI elements, to provide information about the current lock state. Implementations are expected to cache lock information and so may not reflect changes to locks immediately.\n * @alpha\n */\n public get locks(): LockService | undefined { return this._locks; }\n\n public override isBriefcaseConnection(): this is BriefcaseConnection { return true; }\n\n /** The Guid that identifies the iTwin that owns this iModel. */\n public override get iTwinId(): GuidString { return super.iTwinId ?? Guid.empty; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\n\n /** The Guid that identifies this iModel. */\n public override get iModelId(): GuidString { return super.iModelId ?? Guid.empty; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\n\n protected constructor(props: BriefcaseConnectionProps, openMode: OpenMode) {\n super(props);\n this._openMode = openMode;\n this.briefcaseId = props.briefcaseId;\n this.txns = new BriefcaseTxns(this);\n this._modelsMonitor = new ModelChangeMonitor(this);\n if (OpenMode.ReadWrite === this._openMode)\n this.txns.onAfterUndoRedo.addListener(async () => { await IModelApp.toolAdmin.restartPrimitiveTool(); });\n\n this.categories.cache.attachToBriefcase(this);\n }\n\n /** Open a BriefcaseConnection to a [BriefcaseDb]($backend). */\n public static async openFile(briefcaseProps: OpenBriefcaseProps): Promise<BriefcaseConnection>;\n\n /** Open a BriefcaseConnection to a [BriefcaseDb]($backend).\n * @alpha\n */\n public static async openFile(briefcaseProps: OpenBriefcaseProps, lockServiceFactory?: LockServiceFactory): Promise<BriefcaseConnection>\n\n public static async openFile(briefcaseProps: OpenBriefcaseProps, lockServiceFactory?: LockServiceFactory): Promise<BriefcaseConnection> {\n const iModelProps = await IpcApp.appFunctionIpc.openBriefcase(briefcaseProps);\n const connection = new this({ ...briefcaseProps, ...iModelProps }, briefcaseProps.readonly ? OpenMode.Readonly : OpenMode.ReadWrite);\n if (lockServiceFactory)\n connection._locks = await lockServiceFactory(connection);\n\n IModelConnection.onOpen.raiseEvent(connection);\n return connection;\n }\n\n /** Open a BriefcaseConnection to a [StandaloneDb]($backend)\n * @note StandaloneDbs, by definition, may not push or pull changes. Attempting to do so will throw exceptions.\n */\n public static async openStandalone(filePath: string, openMode: OpenMode = OpenMode.ReadWrite, opts?: StandaloneOpenOptions): Promise<BriefcaseConnection> {\n const openResponse = await IpcApp.appFunctionIpc.openStandalone(filePath, openMode, opts);\n const connection = new this(openResponse, openMode);\n IModelConnection.onOpen.raiseEvent(connection);\n return connection;\n }\n\n /** Returns `true` if [[close]] has already been called. */\n public get isClosed(): boolean { return this._isClosed === true; }\n\n /**\n * Close this BriefcaseConnection.\n * @note make sure to call [[saveChanges]] before calling this method. Unsaved local changes are abandoned.\n */\n public async close(): Promise<void> {\n if (this.isClosed)\n return;\n\n await this._modelsMonitor.close();\n\n this.beforeClose();\n this.txns[Symbol.dispose]();\n\n this._isClosed = true;\n await IpcApp.appFunctionIpc.closeIModel(this._fileKey);\n }\n\n protected requireTimeline() {\n if (this.iTwinId === Guid.empty)\n throw new IModelError(IModelStatus.WrongIModel, \"iModel has no timeline\");\n }\n\n /** Query if there are any pending Txns in this briefcase that are waiting to be pushed. */\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\n return this.txns.hasPendingTxns();\n }\n\n /** Commit pending changes to this briefcase.\n * @param description Optional description of the changes.\n * @deprecated Use methods on EditCommand instead.\n */\n public async saveChanges(description?: string): Promise<void> {\n await IpcApp.appFunctionIpc.saveChanges(this.key, description); // eslint-disable-line @typescript-eslint/no-deprecated\n }\n\n /** Abandon pending changes to this briefcase.\n * @deprecated Use methods on EditCommand instead.\n */\n public async abandonChanges(): Promise<void> {\n await IpcApp.appFunctionIpc.abandonChanges(this.key); // eslint-disable-line @typescript-eslint/no-deprecated\n }\n\n /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase\n * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.\n * @param options Options for pulling changes.\n * @see [[BriefcaseTxns.onChangesPulled]] for the event dispatched after changes are pulled.\n */\n public async pullChanges(toIndex?: ChangesetIndex, options?: PullChangesOptions): Promise<void> {\n const removeListeners: VoidFunction[] = [];\n const shouldReportProgress = !!options?.downloadProgressCallback;\n\n if (shouldReportProgress) {\n const handleProgress = (_evt: Event, data: { loaded: number, total: number }) => {\n options?.downloadProgressCallback?.(data);\n };\n\n const removeProgressListener = IpcApp.addListener(\n getPullChangesIpcChannel(this.iModelId),\n handleProgress,\n );\n removeListeners.push(removeProgressListener);\n }\n\n if (options?.abortSignal) {\n const abort = () => void IpcApp.appFunctionIpc.cancelPullChangesRequest(this.key);\n options?.abortSignal.addEventListener(\"abort\", abort);\n removeListeners.push(() => options?.abortSignal?.removeEventListener(\"abort\", abort));\n }\n\n this.requireTimeline();\n const ipcAppOptions: IpcAppPullChangesOptions = {\n reportProgress: shouldReportProgress,\n progressInterval: options?.progressInterval,\n enableCancellation: !!options?.abortSignal,\n };\n try {\n this.changeset = await IpcApp.appFunctionIpc.pullChanges(this.key, toIndex, ipcAppOptions);\n } finally {\n removeListeners.forEach((remove) => remove());\n }\n }\n\n /** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.\n * @param description The description for the changeset\n * @returns the changesetId of the pushed changes\n * @see [[BriefcaseTxns.onChangesPushed]] for the event dispatched after changes are pushed.\n */\n public async pushChanges(description: string): Promise<ChangesetIndexAndId> {\n this.requireTimeline();\n return IpcApp.appFunctionIpc.pushChanges(this.key, description);\n }\n\n /** The current graphical editing scope, if one is in progress.\n * @see [[enterEditingScope]] to begin graphical editing.\n */\n public get editingScope(): GraphicalEditingScope | undefined {\n return this._modelsMonitor.editingScope;\n }\n\n /** Return whether graphical editing is supported for this briefcase. It is not supported if the briefcase is read-only, or the briefcase contains a version of\n * the BisCore ECSchema older than v0.1.11.\n * @see [[enterEditingScope]] to enable graphical editing.\n */\n public async supportsGraphicalEditing(): Promise<boolean> {\n return IpcApp.appFunctionIpc.isGraphicalEditingSupported(this.key);\n }\n\n /** Begin a new graphical editing scope.\n * @throws Error if an editing scope already exists or one could not be created.\n * @see [[GraphicalEditingScope.exit]] to exit the scope.\n * @see [[supportsGraphicalEditing]] to determine whether this method should be expected to succeed.\n * @see [[editingScope]] to obtain the current editing scope, if one is in progress.\n */\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\n return this._modelsMonitor.enterEditingScope();\n }\n\n /** Strictly for tests - dispatched from ModelChangeMonitor.processBuffered.\n * @internal\n */\n public readonly onBufferedModelChanges = new BeEvent<(changedModelIds: Set<string>) => void>();\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * @module IModelConnection
3
3
  */
4
4
  import { BeEvent, IModelStatus } from "@itwin/core-bentley";
5
- import { ChangesetIdWithIndex, ChangesetIndexAndId, ChangesetProps, EcefLocationProps, GeographicCRSProps, ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, RootSubjectProps, TxnNotifications, TxnProps } from "@itwin/core-common";
5
+ import { ChangesetIdWithIndex, ChangesetIndexAndId, ChangesetProps, EcefLocationProps, GeographicCRSProps, ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, ReinstateTxnArgs, ReverseTxnArgs, RootSubjectProps, TxnNotifications, TxnProps } from "@itwin/core-common";
6
6
  import { Range3dProps, XYZProps } from "@itwin/core-geometry";
7
7
  import { BriefcaseConnection } from "./BriefcaseConnection";
8
8
  import { NotificationHandler } from "./IpcApp";
@@ -161,6 +161,21 @@ export declare class BriefcaseTxns extends BriefcaseNotificationHandler implemen
161
161
  * @see [[isUndoPossible]] to determine if any reversible operations exist.
162
162
  */
163
163
  reverseSingleTxn(): Promise<IModelStatus>;
164
+ /** Reverse (undo) the most recent operation to this briefcase in the current session. By default, this method also
165
+ * abandons the locks that were acquired for that operation.
166
+ * @beta
167
+ * @note This method will also abandon locks associated with any later, reversed Txns, if they have not
168
+ * already been abandoned. For example, if a call to [[reverseTxns]] reverses Txn 2 without abandoning
169
+ * its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated
170
+ * with _both_ Txn 1 and Txn 2.
171
+ * @note If there are any outstanding uncommitted changes, they are reversed.
172
+ * @note The term "operation" is used rather than Txn, since multiple Txns can be grouped together via [TxnManager.beginMultiTxnOperation]($backend). So,
173
+ * even though this method reverses only one operation, multiple Txns may be reversed if they were grouped together when they were made.
174
+ * @note If there are no reversible operations, this method does nothing and returns Success.
175
+ * @param args Optional arguments to control the behavior of the reverse operation, such as whether to retain locks.
176
+ * @returns A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.
177
+ */
178
+ reverseSingleTxnAsync(args?: ReverseTxnArgs): Promise<void>;
164
179
  /** Reverse (undo) the most recent operation(s) to the briefcase in the current session.
165
180
  * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will
166
181
  * be reinstated together when/if [[reinstateTxn]] is called.
@@ -170,12 +185,43 @@ export declare class BriefcaseTxns extends BriefcaseNotificationHandler implemen
170
185
  * @note If numOperations is too large only the number of reversible operations are reversed.
171
186
  */
172
187
  reverseTxns(numOperations: number): Promise<IModelStatus>;
188
+ /** Reverse (undo) the most recent operation(s) to the briefcase in the current session. By default, this method also
189
+ * abandons the locks that were acquired for those operations.
190
+ * @beta
191
+ * @note This method will also abandon locks associated with any later, reversed Txns, if they have not
192
+ * already been abandoned. For example, if a call to [[reverseTxns]] reverses Txn 2 without abandoning
193
+ * its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated
194
+ * with _both_ Txn 1 and Txn 2.
195
+ * @note If you do not want to abandon any locks, set [ReverseTxnArgs.retainLocks]($common) to true.
196
+ * @note If there are any outstanding uncommitted changes, they are reversed.
197
+ * @note The term "operation" is used rather than Txn, since multiple Txns can be grouped together via [[beginMultiTxnOperation]]. So,
198
+ * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.
199
+ * @note If numOperations is too large only the operations are reversible are reversed.
200
+ * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will
201
+ * be reinstated together when/if ReinstateTxn is called.
202
+ * @param args Optional arguments to control the behavior of the reverse operation, such as whether to retain locks.
203
+ * @returns A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.
204
+ */
205
+ reverseTxnsAsync(numOperations: number, args?: ReverseTxnArgs): Promise<void>;
173
206
  /** Reverse (undo) all changes back to the beginning of the session.
174
207
  * @see [[reinstateTxn]] to redo changes.
175
208
  * @see [[reverseSingleTxn]] to undo only the most recent operation.
176
209
  * @see [[isUndoPossible]] to determine if any reversible operations exist.
177
210
  */
178
211
  reverseAll(): Promise<IModelStatus>;
212
+ /** Reverse (undo) all operations back to the beginning of the session. By default, this method also
213
+ * abandons the locks that were acquired for those operations.
214
+ * @beta
215
+ * @note This method will also abandon locks associated with any later, reversed Txns, if they have not
216
+ * already been abandoned. For example, if a call to [[reverseTxns]] reverses Txn 2 without abandoning
217
+ * its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated
218
+ * with _both_ Txn 1 and Txn 2.
219
+ * @note If there are any outstanding uncommitted changes, they are reversed.
220
+ * @note If there are no reversible operations, this method does nothing and returns Success.
221
+ * @param args Optional arguments to control the behavior of the reverse operation, such as whether to retain locks.
222
+ * @returns A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.
223
+ */
224
+ reverseAllTxnsAsync(args?: ReverseTxnArgs): Promise<void>;
179
225
  /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it
180
226
  * may take multiple calls to this method to reinstate all reversed operations.
181
227
  * @returns Success if a reversed transaction was reinstated, error status otherwise.
@@ -184,6 +230,17 @@ export declare class BriefcaseTxns extends BriefcaseNotificationHandler implemen
184
230
  * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.
185
231
  */
186
232
  reinstateTxn(): Promise<IModelStatus>;
233
+ /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it
234
+ * may take multiple calls to this method to reinstate all reversed operations. This method also
235
+ * re-acquires the locks that were abandoned when those operations were reversed.
236
+ * @beta
237
+ * @param args Optional arguments to control the behavior of the reinstate operation.
238
+ * @returns Success if a reversed transaction was reinstated, error status otherwise.
239
+ * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.
240
+ * @see [[isRedoPossible]] to determine if any reinstatable operations exist.
241
+ * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.
242
+ */
243
+ reinstateTxnAsync(args?: ReinstateTxnArgs): Promise<void>;
187
244
  /** Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed
188
245
  * and reopened.)
189
246
  * @note This can be quite disconcerting to the user expecting to be able to undo previously made changes. It should only be used
@@ -1 +1 @@
1
- {"version":3,"file":"BriefcaseTxns.d.ts","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EAAE,cAAc,EAAgB,iBAAiB,EAAiB,kBAAkB,EACvG,sBAAsB,EAAE,yBAAyB,EAAkB,gBAAgB,EAAE,gBAAgB,EACrG,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoB,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAU,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAiB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAErE;;;;GAIG;AACH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AAgB;IAIzD,gBAAgB;IACT,2BAA2B,CAAC,KAAK,EAAE,YAAY;IAItD,gBAAgB;IACT,yBAAyB,CAAC,MAAM,EAAE,QAAQ;IAIjD,gBAAgB;IACT,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS;IAIpE,gBAAgB;IACT,uCAAuC,CAAC,GAAG,EAAE,kBAAkB,GAAG,SAAS;IAIlF,gBAAgB;IACT,oBAAoB,CAAC,SAAS,EAAE,oBAAoB;IAG3D,gBAAgB;IACT,kBAAkB,CAAC,SAAS,EAAE,oBAAoB;IAGzD,gBAAgB;IACT,+BAA+B,CAAC,OAAO,EAAE,cAAc,EAAE;IAGhE,gBAAgB;IACT,6BAA6B,CAAC,OAAO,EAAE,cAAc,EAAE;IAG9D,gBAAgB;IACT,8BAA8B;IAGrC,gBAAgB;IACT,4BAA4B,CAAC,IAAI,EAAE,QAAQ,EAAE;IAGpD,gBAAgB;IACT,6BAA6B;IAGpC,gBAAgB;IACT,2BAA2B;IAGlC,gBAAgB;IACT,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE;IAGzC,gBAAgB;IACT,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE;IAGvC,gBAAgB;IACT,oBAAoB,CAAC,GAAG,EAAE,QAAQ;IAGzC,gBAAgB;IACT,kBAAkB,CAAC,GAAG,EAAE,QAAQ;CAGxC"}
@@ -215,6 +215,23 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
215
215
  async reverseSingleTxn() {
216
216
  return this.reverseTxns(1);
217
217
  }
218
+ /** Reverse (undo) the most recent operation to this briefcase in the current session. By default, this method also
219
+ * abandons the locks that were acquired for that operation.
220
+ * @beta
221
+ * @note This method will also abandon locks associated with any later, reversed Txns, if they have not
222
+ * already been abandoned. For example, if a call to [[reverseTxns]] reverses Txn 2 without abandoning
223
+ * its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated
224
+ * with _both_ Txn 1 and Txn 2.
225
+ * @note If there are any outstanding uncommitted changes, they are reversed.
226
+ * @note The term "operation" is used rather than Txn, since multiple Txns can be grouped together via [TxnManager.beginMultiTxnOperation]($backend). So,
227
+ * even though this method reverses only one operation, multiple Txns may be reversed if they were grouped together when they were made.
228
+ * @note If there are no reversible operations, this method does nothing and returns Success.
229
+ * @param args Optional arguments to control the behavior of the reverse operation, such as whether to retain locks.
230
+ * @returns A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.
231
+ */
232
+ async reverseSingleTxnAsync(args) {
233
+ await this.reverseTxnsAsync(1, args);
234
+ }
218
235
  /** Reverse (undo) the most recent operation(s) to the briefcase in the current session.
219
236
  * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will
220
237
  * be reinstated together when/if [[reinstateTxn]] is called.
@@ -226,6 +243,26 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
226
243
  async reverseTxns(numOperations) {
227
244
  return IpcApp_1.IpcApp.appFunctionIpc.reverseTxns(this._iModel.key, numOperations);
228
245
  }
246
+ /** Reverse (undo) the most recent operation(s) to the briefcase in the current session. By default, this method also
247
+ * abandons the locks that were acquired for those operations.
248
+ * @beta
249
+ * @note This method will also abandon locks associated with any later, reversed Txns, if they have not
250
+ * already been abandoned. For example, if a call to [[reverseTxns]] reverses Txn 2 without abandoning
251
+ * its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated
252
+ * with _both_ Txn 1 and Txn 2.
253
+ * @note If you do not want to abandon any locks, set [ReverseTxnArgs.retainLocks]($common) to true.
254
+ * @note If there are any outstanding uncommitted changes, they are reversed.
255
+ * @note The term "operation" is used rather than Txn, since multiple Txns can be grouped together via [[beginMultiTxnOperation]]. So,
256
+ * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.
257
+ * @note If numOperations is too large only the operations are reversible are reversed.
258
+ * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will
259
+ * be reinstated together when/if ReinstateTxn is called.
260
+ * @param args Optional arguments to control the behavior of the reverse operation, such as whether to retain locks.
261
+ * @returns A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.
262
+ */
263
+ async reverseTxnsAsync(numOperations, args) {
264
+ return IpcApp_1.IpcApp.appFunctionIpc.reverseTxnsAsync(this._iModel.key, numOperations, args);
265
+ }
229
266
  /** Reverse (undo) all changes back to the beginning of the session.
230
267
  * @see [[reinstateTxn]] to redo changes.
231
268
  * @see [[reverseSingleTxn]] to undo only the most recent operation.
@@ -234,6 +271,21 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
234
271
  async reverseAll() {
235
272
  return IpcApp_1.IpcApp.appFunctionIpc.reverseAllTxn(this._iModel.key);
236
273
  }
274
+ /** Reverse (undo) all operations back to the beginning of the session. By default, this method also
275
+ * abandons the locks that were acquired for those operations.
276
+ * @beta
277
+ * @note This method will also abandon locks associated with any later, reversed Txns, if they have not
278
+ * already been abandoned. For example, if a call to [[reverseTxns]] reverses Txn 2 without abandoning
279
+ * its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated
280
+ * with _both_ Txn 1 and Txn 2.
281
+ * @note If there are any outstanding uncommitted changes, they are reversed.
282
+ * @note If there are no reversible operations, this method does nothing and returns Success.
283
+ * @param args Optional arguments to control the behavior of the reverse operation, such as whether to retain locks.
284
+ * @returns A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.
285
+ */
286
+ async reverseAllTxnsAsync(args) {
287
+ return IpcApp_1.IpcApp.appFunctionIpc.reverseAllTxnsAsync(this._iModel.key, args);
288
+ }
237
289
  /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it
238
290
  * may take multiple calls to this method to reinstate all reversed operations.
239
291
  * @returns Success if a reversed transaction was reinstated, error status otherwise.
@@ -244,6 +296,19 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
244
296
  async reinstateTxn() {
245
297
  return IpcApp_1.IpcApp.appFunctionIpc.reinstateTxn(this._iModel.key);
246
298
  }
299
+ /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it
300
+ * may take multiple calls to this method to reinstate all reversed operations. This method also
301
+ * re-acquires the locks that were abandoned when those operations were reversed.
302
+ * @beta
303
+ * @param args Optional arguments to control the behavior of the reinstate operation.
304
+ * @returns Success if a reversed transaction was reinstated, error status otherwise.
305
+ * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.
306
+ * @see [[isRedoPossible]] to determine if any reinstatable operations exist.
307
+ * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.
308
+ */
309
+ async reinstateTxnAsync(args) {
310
+ return IpcApp_1.IpcApp.appFunctionIpc.reinstateTxnAsync(this._iModel.key, args);
311
+ }
247
312
  /** Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed
248
313
  * and reopened.)
249
314
  * @note This can be quite disconcerting to the user expecting to be able to undo previously made changes. It should only be used
@@ -1 +1 @@
1
- {"version":3,"file":"BriefcaseTxns.js","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAC5D,oDAK4B;AAC5B,wDAAgF;AAEhF,qCAAuD;AACvD,yDAAqE;AAErE;;;;GAIG;AACH,MAAsB,4BAA6B,SAAQ,4BAAmB;IACxD;IAApB,YAAoB,IAAY;QAAI,KAAK,EAAE,CAAC;QAAxB,SAAI,GAAJ,IAAI,CAAQ;IAAa,CAAC;IAE9C,IAAW,WAAW,KAAK,OAAO,GAAG,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;CACjF;AAJD,oEAIC;AAED;;;;GAIG;AACH,MAAa,aAAc,SAAQ,4BAA4B;IAC5C,OAAO,CAAsB;IACtC,QAAQ,CAAkB;IAElC,gBAAgB;IAChB,IAAW,oBAAoB;QAC7B,OAAO,4BAAc,CAAC,IAAI,CAAC;IAC7B,CAAC;IAED;;OAEG;IACa,iBAAiB,GAAG,IAAI,sBAAO,EAAuC,CAAC;I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IACtC,CAAC;IACD,gBAAgB;IACT,eAAe,CAAC,IAAgB;QACrC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,gBAAgB;IACT,oBAAoB,CAAC,GAAa;QACvC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,gBAAgB;IACT,kBAAkB,CAAC,GAAa;QACrC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;CACF;AA9YD,sCA8YC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IModelConnection\n */\n\nimport { BeEvent, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n ChangesetIdWithIndex,\n ChangesetIndexAndId, ChangesetProps, EcefLocation, EcefLocationProps, GeographicCRS, GeographicCRSProps, ipcAppChannels,\n ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, RemoveFunction, RootSubjectProps, TxnNotifications,\n TxnProps,\n} from \"@itwin/core-common\";\nimport { Point3d, Range3d, Range3dProps, XYZProps } from \"@itwin/core-geometry\";\nimport { BriefcaseConnection } from \"./BriefcaseConnection\";\nimport { IpcApp, NotificationHandler } from \"./IpcApp\";\nimport { EntityChanges, TxnEntityChanges } from \"./TxnEntityChanges\";\n\n/**\n * Base class for notification handlers for events from the backend that are specific to a [[BriefcaseConnection]].\n * @see [[BriefcaseTxns]].\n * @public\n */\nexport abstract class BriefcaseNotificationHandler extends NotificationHandler {\n constructor(private _key: string) { super(); }\n public abstract get briefcaseChannelName(): string;\n public get channelName() { return `${this.briefcaseChannelName}/${this._key}`; }\n}\n\n/** Manages local changes to a [[BriefcaseConnection]] via [Txns]($docs/learning/InteractiveEditing.md).\n * @see [[BriefcaseConnection.txns]].\n * @see [TxnManager]($backend) for the backend counterpart.\n * @public\n */\nexport class BriefcaseTxns extends BriefcaseNotificationHandler implements TxnNotifications {\n private readonly _iModel: BriefcaseConnection;\n private _cleanup?: RemoveFunction;\n\n /** @internal */\n public get briefcaseChannelName() {\n return ipcAppChannels.txns;\n }\n\n /** Event raised after Txn validation or changeset application to indicate the set of changed elements.\n * @note If there are many changed elements in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\n */\n public readonly onElementsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\n\n /** Event raised after Txn validation or changeset application to indicate the set of changed models.\n * @note If there are many changed models in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\n */\n public readonly onModelsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\n\n /** Event raised after the geometry within one or more [[GeometricModelState]]s is modified by applying a changeset or validation of a transaction.\n * A model's geometry can change as a result of:\n * - Insertion or deletion of a geometric element within the model; or\n * - Modification of an existing element's geometric properties; or\n * - An explicit request to flag it as changed via [IModelDb.Models.updateModel]($backend).\n */\n public readonly onModelGeometryChanged = new BeEvent<(changes: ReadonlyArray<ModelIdAndGeometryGuid>) => void>();\n\n /** Event raised before a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], unless there are no changes to save.\n * @see [[onCommitted]] for the event raised after the operation.\n */\n public readonly onCommit = new BeEvent<() => void>();\n\n /** Event raised after a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], even if there were no changes to save.\n * The event supplies the following information:\n * - `hasPendingTxns`: true if the briefcase has local changes not yet pushed to the server.\n * - `time`: the time at which changes were saved on the backend (obtained via `Date.now()`).\n * @see [[onCommit]] for the event raised before the operation.\n */\n public readonly onCommitted = new BeEvent<(hasPendingTxns: boolean, time: number) => void>();\n\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\n * @see [[onReplayedExternalTxns]] for the event raised after all such changes have been applied.\n */\n public readonly onReplayExternalTxns = new BeEvent<() => void>();\n\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\n * @see [[onReplayExternalTxns]] for the event raised before the changes are applied.\n */\n public readonly onReplayedExternalTxns = new BeEvent<() => void>();\n\n /** Event raised after a changeset has been applied to the briefcase.\n * Changesets may be applied as a result of [[BriefcaseConnection.pullChanges]], or by undo/redo operations.\n */\n public readonly onChangesApplied = new BeEvent<() => void>();\n\n /** Event raised before an undo/redo operation is performed.\n * @see [[onAfterUndoRedo]] for the event raised after the operation.\n */\n public readonly onBeforeUndoRedo = new BeEvent<(isUndo: boolean) => void>();\n\n /** Event raised after an undo/redo operation is performed.\n * @see [[onBeforeUndoRedo]] for the event raised before to the operation.\n */\n public readonly onAfterUndoRedo = new BeEvent<(isUndo: boolean) => void>();\n\n /** Event raised after changes are pulled and merged into the briefcase.\n * @see [[BriefcaseConnection.pullAndMergeChanges]].\n */\n public readonly onChangesPulled = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\n\n /** Event raised after the briefcase's local changes are pushed.\n * @see [[BriefcaseConnection.pushChanges]].\n */\n public readonly onChangesPushed = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\n\n /** Event raised before pull merge process begins.\n * @alpha\n */\n public readonly onPullMergeBegin = new BeEvent<(changeset: ChangesetIdWithIndex) => void>();\n\n /** Event raised before a rebase operation begins.\n * @alpha\n */\n public readonly onRebaseBegin = new BeEvent<(txns: TxnProps[]) => void>();\n\n /** Event raised before a transaction is rebased.\n * @alpha\n */\n public readonly onRebaseTxnBegin = new BeEvent<(txnProps: TxnProps) => void>();\n\n /**\n * Event raised after a transaction is rebased.\n * @alpha\n */\n public readonly onRebaseTxnEnd = new BeEvent<(txnProps: TxnProps) => void>();\n\n /**\n * Event raised after a rebase operation ends.\n * @alpha\n */\n public readonly onRebaseEnd = new BeEvent<(txns: TxnProps[]) => void>();\n\n /**\n * Event raised after the pull merge process ends.\n * @alpha\n */\n public readonly onPullMergeEnd = new BeEvent<(changeset: ChangesetIdWithIndex) => void>();\n\n /** Event raised before incoming changes are applied.\n * @alpha\n */\n public readonly onApplyIncomingChangesBegin = new BeEvent<(changesets: ChangesetProps[]) => void>();\n\n /** Event raised after incoming changes are applied.\n * @alpha\n */\n public readonly onApplyIncomingChangesEnd = new BeEvent<(changes: ChangesetProps[]) => void>();\n\n /** Event raised before local changes are reversed.\n * @alpha\n */\n public readonly onReverseLocalChangesBegin = new BeEvent<() => void>();\n\n /** Event raised after local changes are reversed.\n * @alpha\n */\n public readonly onReverseLocalChangesEnd = new BeEvent<(txns: TxnProps[]) => void>();\n\n /** Event raised before downloading changesets begins.\n * @alpha\n */\n public readonly onDownloadChangesetsBegin = new BeEvent<() => void>();\n\n /** Event raised after downloading changesets ends.\n * @alpha\n */\n public readonly onDownloadChangesetsEnd = new BeEvent<() => void>();\n\n /** @internal */\n public constructor(iModel: BriefcaseConnection) {\n super(iModel.key);\n this._iModel = iModel;\n this._cleanup = this.registerImpl();\n }\n\n /** @internal */\n public [Symbol.dispose](): void {\n if (this._cleanup) {\n this._cleanup();\n this._cleanup = undefined;\n\n this.onAfterUndoRedo.clear();\n this.onApplyIncomingChangesBegin.clear();\n this.onApplyIncomingChangesEnd.clear();\n this.onBeforeUndoRedo.clear();\n this.onChangesApplied.clear();\n this.onChangesPulled.clear();\n this.onChangesPushed.clear();\n this.onCommit.clear();\n this.onCommitted.clear();\n this.onDownloadChangesetsBegin.clear();\n this.onDownloadChangesetsEnd.clear();\n this.onElementsChanged.clear();\n this.onModelGeometryChanged.clear();\n this.onModelsChanged.clear();\n this.onPullMergeBegin.clear();\n this.onPullMergeEnd.clear();\n this.onRebaseBegin.clear();\n this.onRebaseEnd.clear();\n this.onRebaseTxnBegin.clear();\n this.onRebaseTxnEnd.clear();\n this.onReverseLocalChangesBegin.clear();\n this.onReverseLocalChangesEnd.clear();\n }\n }\n\n /** Query if the briefcase has any pending Txns waiting to be pushed. */\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\n return IpcApp.appFunctionIpc.hasPendingTxns(this._iModel.key);\n }\n\n /** Determine if any reversible (undoable) changes exist.\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\n */\n public async isUndoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\n return IpcApp.appFunctionIpc.isUndoPossible(this._iModel.key);\n }\n\n /** Determine if any reinstatable (redoable) changes exist.\n * @see [[reinstateTxn]] to redo changes.\n */\n public async isRedoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\n return IpcApp.appFunctionIpc.isRedoPossible(this._iModel.key);\n }\n\n /** Get the description of the operation that would be reversed by calling [[reverseTxns]]`(1)`.\n * This is useful for showing the operation that would be undone, for example in a menu.\n */\n public async getUndoString(): Promise<string> {\n return IpcApp.appFunctionIpc.getUndoString(this._iModel.key);\n }\n\n /** Get a description of the operation that would be reinstated by calling [[reinstateTxn]].\n * This is useful for showing the operation that would be redone, in a pull-down menu for example.\n */\n public async getRedoString(): Promise<string> {\n return IpcApp.appFunctionIpc.getRedoString(this._iModel.key);\n }\n\n /** Reverse (undo) the most recent operation.\n * @see [[reinstateTxn]] to redo operations.\n * @see [[reverseAll]] to undo all operations.\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\n */\n public async reverseSingleTxn(): Promise<IModelStatus> {\n return this.reverseTxns(1);\n }\n\n /** Reverse (undo) the most recent operation(s) to the briefcase in the current session.\n * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will\n * be reinstated together when/if [[reinstateTxn]] is called.\n * @note If there are any outstanding uncommitted changes, they are reversed.\n * @note The term \"operation\" is used rather than Txn, since multiple Txns can be grouped together via [TxnManager.beginMultiTxnOperation]($backend). So,\n * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.\n * @note If numOperations is too large only the number of reversible operations are reversed.\n */\n public async reverseTxns(numOperations: number): Promise<IModelStatus> {\n return IpcApp.appFunctionIpc.reverseTxns(this._iModel.key, numOperations);\n }\n\n /** Reverse (undo) all changes back to the beginning of the session.\n * @see [[reinstateTxn]] to redo changes.\n * @see [[reverseSingleTxn]] to undo only the most recent operation.\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\n */\n public async reverseAll(): Promise<IModelStatus> {\n return IpcApp.appFunctionIpc.reverseAllTxn(this._iModel.key);\n }\n\n /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it\n * may take multiple calls to this method to reinstate all reversed operations.\n * @returns Success if a reversed transaction was reinstated, error status otherwise.\n * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.\n * @see [[isRedoPossible]] to determine if any reinstatable operations exist.\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\n */\n public async reinstateTxn(): Promise<IModelStatus> {\n return IpcApp.appFunctionIpc.reinstateTxn(this._iModel.key);\n }\n\n /** Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed\n * and reopened.)\n * @note This can be quite disconcerting to the user expecting to be able to undo previously made changes. It should only be used\n * under extreme circumstances where damage to the file or session could happen if the currently committed are reversed. Use sparingly and with care.\n * Probably a good idea to alert the user it happened.\n */\n public async restartTxnSession(): Promise<void> {\n await IpcApp.appFunctionIpc.restartTxnSession(this._iModel.key);\n }\n\n /** @internal */\n public notifyElementsChanged(changed: NotifyEntitiesChangedArgs): void {\n this.onElementsChanged.raiseEvent(new EntityChanges(changed));\n }\n\n /** @internal */\n public notifyModelsChanged(changed: NotifyEntitiesChangedArgs): void {\n this.onModelsChanged.raiseEvent(new EntityChanges(changed));\n }\n\n /** @internal */\n public notifyGeometryGuidsChanged(changes: ModelIdAndGeometryGuid[]): void {\n this.onModelGeometryChanged.raiseEvent(changes);\n }\n\n /** @internal */\n public notifyCommit() {\n this.onCommit.raiseEvent();\n }\n\n /** @internal */\n public notifyCommitted(hasPendingTxns: boolean, time: number) {\n this.onCommitted.raiseEvent(hasPendingTxns, time);\n }\n\n /** @internal */\n public notifyReplayExternalTxns() {\n this.onReplayExternalTxns.raiseEvent();\n }\n\n /** @internal */\n public notifyReplayedExternalTxns() {\n this.onReplayedExternalTxns.raiseEvent();\n }\n\n /** @internal */\n public notifyChangesApplied() {\n this.onChangesApplied.raiseEvent();\n }\n\n /** @internal */\n public notifyBeforeUndoRedo(isUndo: boolean) {\n this.onBeforeUndoRedo.raiseEvent(isUndo);\n }\n\n /** @internal */\n public notifyAfterUndoRedo(isUndo: boolean) {\n this.onAfterUndoRedo.raiseEvent(isUndo);\n }\n\n /** @internal */\n public notifyPulledChanges(parentChangeset: ChangesetIndexAndId) {\n this.onChangesPulled.raiseEvent(parentChangeset);\n }\n\n /** @internal */\n public notifyPushedChanges(parentChangeset: ChangesetIndexAndId) {\n this.onChangesPushed.raiseEvent(parentChangeset);\n }\n\n /** @internal */\n public notifyIModelNameChanged(name: string) {\n this._iModel.name = name;\n }\n\n /** @internal */\n public notifyRootSubjectChanged(subject: RootSubjectProps) {\n this._iModel.rootSubject = subject;\n }\n\n /** @internal */\n public notifyProjectExtentsChanged(range: Range3dProps) {\n this._iModel.projectExtents = Range3d.fromJSON(range);\n }\n\n /** @internal */\n public notifyGlobalOriginChanged(origin: XYZProps) {\n this._iModel.globalOrigin = Point3d.fromJSON(origin);\n }\n\n /** @internal */\n public notifyEcefLocationChanged(ecef: EcefLocationProps | undefined) {\n this._iModel.ecefLocation = ecef ? new EcefLocation(ecef) : undefined;\n }\n\n /** @internal */\n public notifyGeographicCoordinateSystemChanged(gcs: GeographicCRSProps | undefined) {\n this._iModel.geographicCoordinateSystem = gcs ? new GeographicCRS(gcs) : undefined;\n }\n\n /** @internal */\n public notifyPullMergeBegin(changeset: ChangesetIdWithIndex) {\n this.onPullMergeBegin.raiseEvent(changeset);\n }\n /** @internal */\n public notifyPullMergeEnd(changeset: ChangesetIdWithIndex) {\n this.onPullMergeEnd.raiseEvent(changeset);\n }\n /** @internal */\n public notifyApplyIncomingChangesBegin(changes: ChangesetProps[]) {\n this.onApplyIncomingChangesBegin.raiseEvent(changes);\n }\n /** @internal */\n public notifyApplyIncomingChangesEnd(changes: ChangesetProps[]) {\n this.onApplyIncomingChangesEnd.raiseEvent(changes);\n }\n /** @internal */\n public notifyReverseLocalChangesBegin() {\n this.onReverseLocalChangesBegin.raiseEvent();\n }\n /** @internal */\n public notifyReverseLocalChangesEnd(txns: TxnProps[]) {\n this.onReverseLocalChangesEnd.raiseEvent(txns);\n }\n /** @internal */\n public notifyDownloadChangesetsBegin() {\n this.onDownloadChangesetsBegin.raiseEvent();\n }\n /** @internal */\n public notifyDownloadChangesetsEnd() {\n this.onDownloadChangesetsEnd.raiseEvent();\n }\n /** @internal */\n public notifyRebaseBegin(txns: TxnProps[]) {\n this.onRebaseBegin.raiseEvent(txns);\n }\n /** @internal */\n public notifyRebaseEnd(txns: TxnProps[]) {\n this.onRebaseEnd.raiseEvent(txns);\n }\n /** @internal */\n public notifyRebaseTxnBegin(txn: TxnProps) {\n this.onRebaseTxnBegin.raiseEvent(txn);\n }\n /** @internal */\n public notifyRebaseTxnEnd(txn: TxnProps) {\n this.onRebaseTxnEnd.raiseEvent(txn);\n }\n}\n"]}
1
+ {"version":3,"file":"BriefcaseTxns.js","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAC5D,oDAK4B;AAC5B,wDAAgF;AAEhF,qCAAuD;AACvD,yDAAqE;AAErE;;;;GAIG;AACH,MAAsB,4BAA6B,SAAQ,4BAAmB;IACxD;IAApB,YAAoB,IAAY;QAAI,KAAK,EAAE,CAAC;QAAxB,SAAI,GAAJ,IAAI,CAAQ;IAAa,CAAC;IAE9C,IAAW,WAAW,KAAK,OAAO,GAAG,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;CACjF;AAJD,oEAIC;AAED;;;;GAIG;AACH,MAAa,aAAc,SAAQ,4BAA4B;IAC5C,OAAO,CAAsB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sCAmdC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IModelConnection\n */\n\nimport { BeEvent, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n ChangesetIdWithIndex,\n ChangesetIndexAndId, ChangesetProps, EcefLocation, EcefLocationProps, GeographicCRS, GeographicCRSProps, ipcAppChannels,\n ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, ReinstateTxnArgs, RemoveFunction, ReverseTxnArgs, RootSubjectProps, TxnNotifications,\n TxnProps,\n} from \"@itwin/core-common\";\nimport { Point3d, Range3d, Range3dProps, XYZProps } from \"@itwin/core-geometry\";\nimport { BriefcaseConnection } from \"./BriefcaseConnection\";\nimport { IpcApp, NotificationHandler } from \"./IpcApp\";\nimport { EntityChanges, TxnEntityChanges } from \"./TxnEntityChanges\";\n\n/**\n * Base class for notification handlers for events from the backend that are specific to a [[BriefcaseConnection]].\n * @see [[BriefcaseTxns]].\n * @public\n */\nexport abstract class BriefcaseNotificationHandler extends NotificationHandler {\n constructor(private _key: string) { super(); }\n public abstract get briefcaseChannelName(): string;\n public get channelName() { return `${this.briefcaseChannelName}/${this._key}`; }\n}\n\n/** Manages local changes to a [[BriefcaseConnection]] via [Txns]($docs/learning/InteractiveEditing.md).\n * @see [[BriefcaseConnection.txns]].\n * @see [TxnManager]($backend) for the backend counterpart.\n * @public\n */\nexport class BriefcaseTxns extends BriefcaseNotificationHandler implements TxnNotifications {\n private readonly _iModel: BriefcaseConnection;\n private _cleanup?: RemoveFunction;\n\n /** @internal */\n public get briefcaseChannelName() {\n return ipcAppChannels.txns;\n }\n\n /** Event raised after Txn validation or changeset application to indicate the set of changed elements.\n * @note If there are many changed elements in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\n */\n public readonly onElementsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\n\n /** Event raised after Txn validation or changeset application to indicate the set of changed models.\n * @note If there are many changed models in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\n */\n public readonly onModelsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\n\n /** Event raised after the geometry within one or more [[GeometricModelState]]s is modified by applying a changeset or validation of a transaction.\n * A model's geometry can change as a result of:\n * - Insertion or deletion of a geometric element within the model; or\n * - Modification of an existing element's geometric properties; or\n * - An explicit request to flag it as changed via [IModelDb.Models.updateModel]($backend).\n */\n public readonly onModelGeometryChanged = new BeEvent<(changes: ReadonlyArray<ModelIdAndGeometryGuid>) => void>();\n\n /** Event raised before a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], unless there are no changes to save.\n * @see [[onCommitted]] for the event raised after the operation.\n */\n public readonly onCommit = new BeEvent<() => void>();\n\n /** Event raised after a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], even if there were no changes to save.\n * The event supplies the following information:\n * - `hasPendingTxns`: true if the briefcase has local changes not yet pushed to the server.\n * - `time`: the time at which changes were saved on the backend (obtained via `Date.now()`).\n * @see [[onCommit]] for the event raised before the operation.\n */\n public readonly onCommitted = new BeEvent<(hasPendingTxns: boolean, time: number) => void>();\n\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\n * @see [[onReplayedExternalTxns]] for the event raised after all such changes have been applied.\n */\n public readonly onReplayExternalTxns = new BeEvent<() => void>();\n\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\n * @see [[onReplayExternalTxns]] for the event raised before the changes are applied.\n */\n public readonly onReplayedExternalTxns = new BeEvent<() => void>();\n\n /** Event raised after a changeset has been applied to the briefcase.\n * Changesets may be applied as a result of [[BriefcaseConnection.pullChanges]], or by undo/redo operations.\n */\n public readonly onChangesApplied = new BeEvent<() => void>();\n\n /** Event raised before an undo/redo operation is performed.\n * @see [[onAfterUndoRedo]] for the event raised after the operation.\n */\n public readonly onBeforeUndoRedo = new BeEvent<(isUndo: boolean) => void>();\n\n /** Event raised after an undo/redo operation is performed.\n * @see [[onBeforeUndoRedo]] for the event raised before to the operation.\n */\n public readonly onAfterUndoRedo = new BeEvent<(isUndo: boolean) => void>();\n\n /** Event raised after changes are pulled and merged into the briefcase.\n * @see [[BriefcaseConnection.pullAndMergeChanges]].\n */\n public readonly onChangesPulled = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\n\n /** Event raised after the briefcase's local changes are pushed.\n * @see [[BriefcaseConnection.pushChanges]].\n */\n public readonly onChangesPushed = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\n\n /** Event raised before pull merge process begins.\n * @alpha\n */\n public readonly onPullMergeBegin = new BeEvent<(changeset: ChangesetIdWithIndex) => void>();\n\n /** Event raised before a rebase operation begins.\n * @alpha\n */\n public readonly onRebaseBegin = new BeEvent<(txns: TxnProps[]) => void>();\n\n /** Event raised before a transaction is rebased.\n * @alpha\n */\n public readonly onRebaseTxnBegin = new BeEvent<(txnProps: TxnProps) => void>();\n\n /**\n * Event raised after a transaction is rebased.\n * @alpha\n */\n public readonly onRebaseTxnEnd = new BeEvent<(txnProps: TxnProps) => void>();\n\n /**\n * Event raised after a rebase operation ends.\n * @alpha\n */\n public readonly onRebaseEnd = new BeEvent<(txns: TxnProps[]) => void>();\n\n /**\n * Event raised after the pull merge process ends.\n * @alpha\n */\n public readonly onPullMergeEnd = new BeEvent<(changeset: ChangesetIdWithIndex) => void>();\n\n /** Event raised before incoming changes are applied.\n * @alpha\n */\n public readonly onApplyIncomingChangesBegin = new BeEvent<(changesets: ChangesetProps[]) => void>();\n\n /** Event raised after incoming changes are applied.\n * @alpha\n */\n public readonly onApplyIncomingChangesEnd = new BeEvent<(changes: ChangesetProps[]) => void>();\n\n /** Event raised before local changes are reversed.\n * @alpha\n */\n public readonly onReverseLocalChangesBegin = new BeEvent<() => void>();\n\n /** Event raised after local changes are reversed.\n * @alpha\n */\n public readonly onReverseLocalChangesEnd = new BeEvent<(txns: TxnProps[]) => void>();\n\n /** Event raised before downloading changesets begins.\n * @alpha\n */\n public readonly onDownloadChangesetsBegin = new BeEvent<() => void>();\n\n /** Event raised after downloading changesets ends.\n * @alpha\n */\n public readonly onDownloadChangesetsEnd = new BeEvent<() => void>();\n\n /** @internal */\n public constructor(iModel: BriefcaseConnection) {\n super(iModel.key);\n this._iModel = iModel;\n this._cleanup = this.registerImpl();\n }\n\n /** @internal */\n public [Symbol.dispose](): void {\n if (this._cleanup) {\n this._cleanup();\n this._cleanup = undefined;\n\n this.onAfterUndoRedo.clear();\n this.onApplyIncomingChangesBegin.clear();\n this.onApplyIncomingChangesEnd.clear();\n this.onBeforeUndoRedo.clear();\n this.onChangesApplied.clear();\n this.onChangesPulled.clear();\n this.onChangesPushed.clear();\n this.onCommit.clear();\n this.onCommitted.clear();\n this.onDownloadChangesetsBegin.clear();\n this.onDownloadChangesetsEnd.clear();\n this.onElementsChanged.clear();\n this.onModelGeometryChanged.clear();\n this.onModelsChanged.clear();\n this.onPullMergeBegin.clear();\n this.onPullMergeEnd.clear();\n this.onRebaseBegin.clear();\n this.onRebaseEnd.clear();\n this.onRebaseTxnBegin.clear();\n this.onRebaseTxnEnd.clear();\n this.onReverseLocalChangesBegin.clear();\n this.onReverseLocalChangesEnd.clear();\n }\n }\n\n /** Query if the briefcase has any pending Txns waiting to be pushed. */\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\n return IpcApp.appFunctionIpc.hasPendingTxns(this._iModel.key);\n }\n\n /** Determine if any reversible (undoable) changes exist.\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\n */\n public async isUndoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\n return IpcApp.appFunctionIpc.isUndoPossible(this._iModel.key);\n }\n\n /** Determine if any reinstatable (redoable) changes exist.\n * @see [[reinstateTxn]] to redo changes.\n */\n public async isRedoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\n return IpcApp.appFunctionIpc.isRedoPossible(this._iModel.key);\n }\n\n /** Get the description of the operation that would be reversed by calling [[reverseTxns]]`(1)`.\n * This is useful for showing the operation that would be undone, for example in a menu.\n */\n public async getUndoString(): Promise<string> {\n return IpcApp.appFunctionIpc.getUndoString(this._iModel.key);\n }\n\n /** Get a description of the operation that would be reinstated by calling [[reinstateTxn]].\n * This is useful for showing the operation that would be redone, in a pull-down menu for example.\n */\n public async getRedoString(): Promise<string> {\n return IpcApp.appFunctionIpc.getRedoString(this._iModel.key);\n }\n\n /** Reverse (undo) the most recent operation.\n * @see [[reinstateTxn]] to redo operations.\n * @see [[reverseAll]] to undo all operations.\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\n */\n public async reverseSingleTxn(): Promise<IModelStatus> {\n return this.reverseTxns(1);\n }\n\n /** Reverse (undo) the most recent operation to this briefcase in the current session. By default, this method also\n * abandons the locks that were acquired for that operation.\n * @beta\n * @note This method will also abandon locks associated with any later, reversed Txns, if they have not\n * already been abandoned. For example, if a call to [[reverseTxns]] reverses Txn 2 without abandoning\n * its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated\n * with _both_ Txn 1 and Txn 2.\n * @note If there are any outstanding uncommitted changes, they are reversed.\n * @note The term \"operation\" is used rather than Txn, since multiple Txns can be grouped together via [TxnManager.beginMultiTxnOperation]($backend). So,\n * even though this method reverses only one operation, multiple Txns may be reversed if they were grouped together when they were made.\n * @note If there are no reversible operations, this method does nothing and returns Success.\n * @param args Optional arguments to control the behavior of the reverse operation, such as whether to retain locks.\n * @returns A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.\n */\n public async reverseSingleTxnAsync(args?: ReverseTxnArgs): Promise<void> {\n await this.reverseTxnsAsync(1, args);\n }\n\n /** Reverse (undo) the most recent operation(s) to the briefcase in the current session.\n * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will\n * be reinstated together when/if [[reinstateTxn]] is called.\n * @note If there are any outstanding uncommitted changes, they are reversed.\n * @note The term \"operation\" is used rather than Txn, since multiple Txns can be grouped together via [TxnManager.beginMultiTxnOperation]($backend). So,\n * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.\n * @note If numOperations is too large only the number of reversible operations are reversed.\n */\n public async reverseTxns(numOperations: number): Promise<IModelStatus> {\n return IpcApp.appFunctionIpc.reverseTxns(this._iModel.key, numOperations);\n }\n\n /** Reverse (undo) the most recent operation(s) to the briefcase in the current session. By default, this method also\n * abandons the locks that were acquired for those operations.\n * @beta\n * @note This method will also abandon locks associated with any later, reversed Txns, if they have not\n * already been abandoned. For example, if a call to [[reverseTxns]] reverses Txn 2 without abandoning\n * its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated\n * with _both_ Txn 1 and Txn 2.\n * @note If you do not want to abandon any locks, set [ReverseTxnArgs.retainLocks]($common) to true.\n * @note If there are any outstanding uncommitted changes, they are reversed.\n * @note The term \"operation\" is used rather than Txn, since multiple Txns can be grouped together via [[beginMultiTxnOperation]]. So,\n * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.\n * @note If numOperations is too large only the operations are reversible are reversed.\n * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will\n * be reinstated together when/if ReinstateTxn is called.\n * @param args Optional arguments to control the behavior of the reverse operation, such as whether to retain locks.\n * @returns A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.\n */\n public async reverseTxnsAsync(numOperations: number, args?: ReverseTxnArgs): Promise<void> {\n return IpcApp.appFunctionIpc.reverseTxnsAsync(this._iModel.key, numOperations, args);\n }\n\n /** Reverse (undo) all changes back to the beginning of the session.\n * @see [[reinstateTxn]] to redo changes.\n * @see [[reverseSingleTxn]] to undo only the most recent operation.\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\n */\n public async reverseAll(): Promise<IModelStatus> {\n return IpcApp.appFunctionIpc.reverseAllTxn(this._iModel.key);\n }\n\n /** Reverse (undo) all operations back to the beginning of the session. By default, this method also\n * abandons the locks that were acquired for those operations.\n * @beta\n * @note This method will also abandon locks associated with any later, reversed Txns, if they have not\n * already been abandoned. For example, if a call to [[reverseTxns]] reverses Txn 2 without abandoning\n * its locks, and then this method is called to reverse Txn 1, it will abandon the locks associated\n * with _both_ Txn 1 and Txn 2.\n * @note If there are any outstanding uncommitted changes, they are reversed.\n * @note If there are no reversible operations, this method does nothing and returns Success.\n * @param args Optional arguments to control the behavior of the reverse operation, such as whether to retain locks.\n * @returns A Promise that resolves to success if the transactions were reversed, or rejects with an IModelError otherwise.\n */\n public async reverseAllTxnsAsync(args?: ReverseTxnArgs): Promise<void> {\n return IpcApp.appFunctionIpc.reverseAllTxnsAsync(this._iModel.key, args);\n }\n\n /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it\n * may take multiple calls to this method to reinstate all reversed operations.\n * @returns Success if a reversed transaction was reinstated, error status otherwise.\n * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.\n * @see [[isRedoPossible]] to determine if any reinstatable operations exist.\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\n */\n public async reinstateTxn(): Promise<IModelStatus> {\n return IpcApp.appFunctionIpc.reinstateTxn(this._iModel.key);\n }\n\n /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it\n * may take multiple calls to this method to reinstate all reversed operations. This method also\n * re-acquires the locks that were abandoned when those operations were reversed.\n * @beta\n * @param args Optional arguments to control the behavior of the reinstate operation.\n * @returns Success if a reversed transaction was reinstated, error status otherwise.\n * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.\n * @see [[isRedoPossible]] to determine if any reinstatable operations exist.\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\n */\n public async reinstateTxnAsync(args?: ReinstateTxnArgs): Promise<void> {\n return IpcApp.appFunctionIpc.reinstateTxnAsync(this._iModel.key, args);\n }\n\n /** Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed\n * and reopened.)\n * @note This can be quite disconcerting to the user expecting to be able to undo previously made changes. It should only be used\n * under extreme circumstances where damage to the file or session could happen if the currently committed are reversed. Use sparingly and with care.\n * Probably a good idea to alert the user it happened.\n */\n public async restartTxnSession(): Promise<void> {\n await IpcApp.appFunctionIpc.restartTxnSession(this._iModel.key);\n }\n\n /** @internal */\n public notifyElementsChanged(changed: NotifyEntitiesChangedArgs): void {\n this.onElementsChanged.raiseEvent(new EntityChanges(changed));\n }\n\n /** @internal */\n public notifyModelsChanged(changed: NotifyEntitiesChangedArgs): void {\n this.onModelsChanged.raiseEvent(new EntityChanges(changed));\n }\n\n /** @internal */\n public notifyGeometryGuidsChanged(changes: ModelIdAndGeometryGuid[]): void {\n this.onModelGeometryChanged.raiseEvent(changes);\n }\n\n /** @internal */\n public notifyCommit() {\n this.onCommit.raiseEvent();\n }\n\n /** @internal */\n public notifyCommitted(hasPendingTxns: boolean, time: number) {\n this.onCommitted.raiseEvent(hasPendingTxns, time);\n }\n\n /** @internal */\n public notifyReplayExternalTxns() {\n this.onReplayExternalTxns.raiseEvent();\n }\n\n /** @internal */\n public notifyReplayedExternalTxns() {\n this.onReplayedExternalTxns.raiseEvent();\n }\n\n /** @internal */\n public notifyChangesApplied() {\n this.onChangesApplied.raiseEvent();\n }\n\n /** @internal */\n public notifyBeforeUndoRedo(isUndo: boolean) {\n this.onBeforeUndoRedo.raiseEvent(isUndo);\n }\n\n /** @internal */\n public notifyAfterUndoRedo(isUndo: boolean) {\n this.onAfterUndoRedo.raiseEvent(isUndo);\n }\n\n /** @internal */\n public notifyPulledChanges(parentChangeset: ChangesetIndexAndId) {\n this.onChangesPulled.raiseEvent(parentChangeset);\n }\n\n /** @internal */\n public notifyPushedChanges(parentChangeset: ChangesetIndexAndId) {\n this.onChangesPushed.raiseEvent(parentChangeset);\n }\n\n /** @internal */\n public notifyIModelNameChanged(name: string) {\n this._iModel.name = name;\n }\n\n /** @internal */\n public notifyRootSubjectChanged(subject: RootSubjectProps) {\n this._iModel.rootSubject = subject;\n }\n\n /** @internal */\n public notifyProjectExtentsChanged(range: Range3dProps) {\n this._iModel.projectExtents = Range3d.fromJSON(range);\n }\n\n /** @internal */\n public notifyGlobalOriginChanged(origin: XYZProps) {\n this._iModel.globalOrigin = Point3d.fromJSON(origin);\n }\n\n /** @internal */\n public notifyEcefLocationChanged(ecef: EcefLocationProps | undefined) {\n this._iModel.ecefLocation = ecef ? new EcefLocation(ecef) : undefined;\n }\n\n /** @internal */\n public notifyGeographicCoordinateSystemChanged(gcs: GeographicCRSProps | undefined) {\n this._iModel.geographicCoordinateSystem = gcs ? new GeographicCRS(gcs) : undefined;\n }\n\n /** @internal */\n public notifyPullMergeBegin(changeset: ChangesetIdWithIndex) {\n this.onPullMergeBegin.raiseEvent(changeset);\n }\n /** @internal */\n public notifyPullMergeEnd(changeset: ChangesetIdWithIndex) {\n this.onPullMergeEnd.raiseEvent(changeset);\n }\n /** @internal */\n public notifyApplyIncomingChangesBegin(changes: ChangesetProps[]) {\n this.onApplyIncomingChangesBegin.raiseEvent(changes);\n }\n /** @internal */\n public notifyApplyIncomingChangesEnd(changes: ChangesetProps[]) {\n this.onApplyIncomingChangesEnd.raiseEvent(changes);\n }\n /** @internal */\n public notifyReverseLocalChangesBegin() {\n this.onReverseLocalChangesBegin.raiseEvent();\n }\n /** @internal */\n public notifyReverseLocalChangesEnd(txns: TxnProps[]) {\n this.onReverseLocalChangesEnd.raiseEvent(txns);\n }\n /** @internal */\n public notifyDownloadChangesetsBegin() {\n this.onDownloadChangesetsBegin.raiseEvent();\n }\n /** @internal */\n public notifyDownloadChangesetsEnd() {\n this.onDownloadChangesetsEnd.raiseEvent();\n }\n /** @internal */\n public notifyRebaseBegin(txns: TxnProps[]) {\n this.onRebaseBegin.raiseEvent(txns);\n }\n /** @internal */\n public notifyRebaseEnd(txns: TxnProps[]) {\n this.onRebaseEnd.raiseEvent(txns);\n }\n /** @internal */\n public notifyRebaseTxnBegin(txn: TxnProps) {\n this.onRebaseTxnBegin.raiseEvent(txn);\n }\n /** @internal */\n public notifyRebaseTxnEnd(txn: TxnProps) {\n this.onRebaseTxnEnd.raiseEvent(txn);\n }\n}\n"]}
@@ -25,6 +25,8 @@ export declare class ContextRealityModelState extends ContextRealityModel {
25
25
  constructor(props: ContextRealityModelProps, iModel: IModelConnection, displayStyle: DisplayStyleState);
26
26
  /** The tile tree reference responsible for drawing the reality model into a [[Viewport]]. */
27
27
  get treeRef(): TileTreeReference;
28
+ /** @internal */
29
+ detachLayerListeners(): void;
28
30
  /** The set of available [[ActiveSpatialClassifier]]s that can be used to classify the reality model. */
29
31
  get classifiers(): SpatialClassifiersState;
30
32
  /** The transient Id assigned to this reality model at run-time. */
@@ -1 +1 @@
1
- {"version":3,"file":"ContextRealityModelState.d.ts","sourceRoot":"","sources":["../../src/ContextRealityModelState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAwC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/I,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAwF,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE1I;;;;;;;GAOG;AACH,qBAAa,wBAAyB,SAAQ,mBAAmB;IAC/D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiC;IAC1D,6DAA6D;IAC7D,SAAgB,MAAM,EAAE,gBAAgB,CAAC;IACzC,8EAA8E;IAC9E,SAAyB,WAAW,EAAE,oBAAoB,CAAC;IAE3D,gBAAgB;gBACG,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB;IAsC7G,6FAA6F;IAC7F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CAE7B;CACF"}
@@ -68,6 +68,10 @@ class ContextRealityModelState extends core_common_1.ContextRealityModel {
68
68
  }
69
69
  /** The tile tree reference responsible for drawing the reality model into a [[Viewport]]. */
70
70
  get treeRef() { return this._treeRef; }
71
+ /** @internal */
72
+ detachLayerListeners() {
73
+ this._treeRef.detachLayerListeners();
74
+ }
71
75
  /** The set of available [[ActiveSpatialClassifier]]s that can be used to classify the reality model. */
72
76
  get classifiers() {
73
77
  (0, core_bentley_1.assert)(super.classifiers instanceof SpatialClassifiersState_1.SpatialClassifiersState);