@itwin/imodel-transformer 2.0.0-dev.9 → 2.0.0-experimental.1

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 (128) hide show
  1. package/README.md +13 -27
  2. package/lib/cjs/Algo.d.ts +0 -4
  3. package/lib/cjs/Algo.d.ts.map +1 -1
  4. package/lib/cjs/Algo.js +0 -11
  5. package/lib/cjs/Algo.js.map +1 -1
  6. package/lib/cjs/BigMap.d.ts.map +1 -1
  7. package/lib/cjs/BigMap.js.map +1 -1
  8. package/lib/cjs/BranchProvenanceInitializer.d.ts.map +1 -1
  9. package/lib/cjs/BranchProvenanceInitializer.js +26 -26
  10. package/lib/cjs/BranchProvenanceInitializer.js.map +1 -1
  11. package/lib/cjs/ChangedElementForest.d.ts +14 -0
  12. package/lib/cjs/ChangedElementForest.d.ts.map +1 -0
  13. package/lib/cjs/ChangedElementForest.js +86 -0
  14. package/lib/cjs/ChangedElementForest.js.map +1 -0
  15. package/lib/cjs/ChangesetScanner.d.ts +61 -0
  16. package/lib/cjs/ChangesetScanner.d.ts.map +1 -0
  17. package/lib/cjs/ChangesetScanner.js +104 -0
  18. package/lib/cjs/ChangesetScanner.js.map +1 -0
  19. package/lib/cjs/ECReferenceTypesCache.d.ts +0 -4
  20. package/lib/cjs/ECReferenceTypesCache.d.ts.map +1 -1
  21. package/lib/cjs/ECReferenceTypesCache.js +54 -102
  22. package/lib/cjs/ECReferenceTypesCache.js.map +1 -1
  23. package/lib/cjs/ECSqlReaderAsyncIterableIteratorAdapter.d.ts.map +1 -1
  24. package/lib/cjs/ECSqlReaderAsyncIterableIteratorAdapter.js.map +1 -1
  25. package/lib/cjs/ElementAspectCleanup.d.ts +56 -0
  26. package/lib/cjs/ElementAspectCleanup.d.ts.map +1 -0
  27. package/lib/cjs/ElementAspectCleanup.js +175 -0
  28. package/lib/cjs/ElementAspectCleanup.js.map +1 -0
  29. package/lib/cjs/ElementAspectExportCoordinator.d.ts +47 -0
  30. package/lib/cjs/ElementAspectExportCoordinator.d.ts.map +1 -0
  31. package/lib/cjs/ElementAspectExportCoordinator.js +160 -0
  32. package/lib/cjs/ElementAspectExportCoordinator.js.map +1 -0
  33. package/lib/cjs/ElementAspectExportProcessor.d.ts +44 -0
  34. package/lib/cjs/ElementAspectExportProcessor.d.ts.map +1 -0
  35. package/lib/cjs/ElementAspectExportProcessor.js +152 -0
  36. package/lib/cjs/ElementAspectExportProcessor.js.map +1 -0
  37. package/lib/cjs/ElementBulkDelete.d.ts +30 -0
  38. package/lib/cjs/ElementBulkDelete.d.ts.map +1 -0
  39. package/lib/cjs/ElementBulkDelete.js +358 -0
  40. package/lib/cjs/ElementBulkDelete.js.map +1 -0
  41. package/lib/cjs/EntityExistenceCache.d.ts +43 -0
  42. package/lib/cjs/EntityExistenceCache.d.ts.map +1 -0
  43. package/lib/cjs/EntityExistenceCache.js +91 -0
  44. package/lib/cjs/EntityExistenceCache.js.map +1 -0
  45. package/lib/cjs/EntityUnifier.d.ts +7 -7
  46. package/lib/cjs/EntityUnifier.d.ts.map +1 -1
  47. package/lib/cjs/EntityUnifier.js +55 -32
  48. package/lib/cjs/EntityUnifier.js.map +1 -1
  49. package/lib/cjs/IModelCloneContext.d.ts +8 -2
  50. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  51. package/lib/cjs/IModelCloneContext.js +42 -12
  52. package/lib/cjs/IModelCloneContext.js.map +1 -1
  53. package/lib/cjs/IModelExporter.d.ts +143 -30
  54. package/lib/cjs/IModelExporter.d.ts.map +1 -1
  55. package/lib/cjs/IModelExporter.js +871 -172
  56. package/lib/cjs/IModelExporter.js.map +1 -1
  57. package/lib/cjs/IModelImporter.d.ts +87 -31
  58. package/lib/cjs/IModelImporter.d.ts.map +1 -1
  59. package/lib/cjs/IModelImporter.js +361 -139
  60. package/lib/cjs/IModelImporter.js.map +1 -1
  61. package/lib/cjs/IModelTransformContext.d.ts +54 -0
  62. package/lib/cjs/IModelTransformContext.d.ts.map +1 -0
  63. package/lib/cjs/IModelTransformContext.js +3 -0
  64. package/lib/cjs/IModelTransformContext.js.map +1 -0
  65. package/lib/cjs/IModelTransformer.d.ts +132 -174
  66. package/lib/cjs/IModelTransformer.d.ts.map +1 -1
  67. package/lib/cjs/IModelTransformer.js +679 -1025
  68. package/lib/cjs/IModelTransformer.js.map +1 -1
  69. package/lib/cjs/IModelTransformerError.d.ts +84 -0
  70. package/lib/cjs/IModelTransformerError.d.ts.map +1 -0
  71. package/lib/cjs/IModelTransformerError.js +93 -0
  72. package/lib/cjs/IModelTransformerError.js.map +1 -0
  73. package/lib/cjs/ProvenanceManager.d.ts +195 -0
  74. package/lib/cjs/ProvenanceManager.d.ts.map +1 -0
  75. package/lib/cjs/ProvenanceManager.js +771 -0
  76. package/lib/cjs/ProvenanceManager.js.map +1 -0
  77. package/lib/cjs/SyncTypeResolver.d.ts +32 -0
  78. package/lib/cjs/SyncTypeResolver.d.ts.map +1 -0
  79. package/lib/cjs/SyncTypeResolver.js +92 -0
  80. package/lib/cjs/SyncTypeResolver.js.map +1 -0
  81. package/lib/cjs/TransformerLoggerCategory.d.ts +1 -1
  82. package/lib/cjs/TransformerLoggerCategory.js +1 -1
  83. package/lib/cjs/TransformerLoggerCategory.js.map +1 -1
  84. package/lib/cjs/TransformerPackageMetadata.d.ts +8 -0
  85. package/lib/cjs/TransformerPackageMetadata.d.ts.map +1 -0
  86. package/lib/cjs/TransformerPackageMetadata.js +47 -0
  87. package/lib/cjs/TransformerPackageMetadata.js.map +1 -0
  88. package/lib/cjs/imodel-transformer.d.ts +27 -0
  89. package/lib/cjs/imodel-transformer.d.ts.map +1 -1
  90. package/lib/cjs/imodel-transformer.js +61 -34
  91. package/lib/cjs/imodel-transformer.js.map +1 -1
  92. package/lib/cjs/schema-processing/DynamicSchemaUnionStrategy.d.ts +29 -0
  93. package/lib/cjs/schema-processing/DynamicSchemaUnionStrategy.d.ts.map +1 -0
  94. package/lib/cjs/schema-processing/DynamicSchemaUnionStrategy.js +212 -0
  95. package/lib/cjs/schema-processing/DynamicSchemaUnionStrategy.js.map +1 -0
  96. package/lib/cjs/schema-processing/SchemaProcessingCoordinator.d.ts +25 -0
  97. package/lib/cjs/schema-processing/SchemaProcessingCoordinator.d.ts.map +1 -0
  98. package/lib/cjs/schema-processing/SchemaProcessingCoordinator.js +196 -0
  99. package/lib/cjs/schema-processing/SchemaProcessingCoordinator.js.map +1 -0
  100. package/lib/cjs/schema-processing/SchemaProcessingStrategy.d.ts +59 -0
  101. package/lib/cjs/schema-processing/SchemaProcessingStrategy.d.ts.map +1 -0
  102. package/lib/cjs/schema-processing/SchemaProcessingStrategy.js +28 -0
  103. package/lib/cjs/schema-processing/SchemaProcessingStrategy.js.map +1 -0
  104. package/lib/cjs/schema-processing.d.ts +7 -0
  105. package/lib/cjs/schema-processing.d.ts.map +1 -0
  106. package/lib/cjs/schema-processing.js +27 -0
  107. package/lib/cjs/schema-processing.js.map +1 -0
  108. package/package.json +70 -57
  109. package/lib/cjs/DetachedExportElementAspectsStrategy.d.ts +0 -16
  110. package/lib/cjs/DetachedExportElementAspectsStrategy.d.ts.map +0 -1
  111. package/lib/cjs/DetachedExportElementAspectsStrategy.js +0 -106
  112. package/lib/cjs/DetachedExportElementAspectsStrategy.js.map +0 -1
  113. package/lib/cjs/ElementCascadingDeleter.d.ts +0 -22
  114. package/lib/cjs/ElementCascadingDeleter.d.ts.map +0 -1
  115. package/lib/cjs/ElementCascadingDeleter.js +0 -57
  116. package/lib/cjs/ElementCascadingDeleter.js.map +0 -1
  117. package/lib/cjs/EntityMap.d.ts +0 -26
  118. package/lib/cjs/EntityMap.d.ts.map +0 -1
  119. package/lib/cjs/EntityMap.js +0 -54
  120. package/lib/cjs/EntityMap.js.map +0 -1
  121. package/lib/cjs/ExportElementAspectsStrategy.d.ts +0 -35
  122. package/lib/cjs/ExportElementAspectsStrategy.d.ts.map +0 -1
  123. package/lib/cjs/ExportElementAspectsStrategy.js +0 -52
  124. package/lib/cjs/ExportElementAspectsStrategy.js.map +0 -1
  125. package/lib/cjs/ExportElementAspectsWithElementsStrategy.d.ts +0 -12
  126. package/lib/cjs/ExportElementAspectsWithElementsStrategy.d.ts.map +0 -1
  127. package/lib/cjs/ExportElementAspectsWithElementsStrategy.js +0 -47
  128. package/lib/cjs/ExportElementAspectsWithElementsStrategy.js.map +0 -1
@@ -1,10 +1,23 @@
1
1
  /** @packageDocumentation
2
2
  * @module iModels
3
3
  */
4
- import { Id64String } from "@itwin/core-bentley";
4
+ import { DbResult, Id64String, ITwinError } from "@itwin/core-bentley";
5
5
  import { ElementAspectProps, ElementProps, EntityProps, ModelProps } from "@itwin/core-common";
6
- import { ElementAspect, ElementMultiAspect, Entity, IModelDb, RelationshipProps } from "@itwin/core-backend";
6
+ import { BulkDeleteElementsStatus, EditTxn, ElementAspect, ElementMultiAspect, Entity, IModelDb, RelationshipProps } from "@itwin/core-backend";
7
7
  import type { RelationshipPropsForDelete } from "./IModelTransformer";
8
+ import { ElementAspectCleanup } from "./ElementAspectCleanup";
9
+ import { EntityExistenceCache } from "./EntityExistenceCache";
10
+ /** Error thrown when native bulk deletion fails to delete one or more requested element trees.
11
+ * @beta
12
+ */
13
+ export interface ElementBulkDeleteError extends ITwinError {
14
+ /** Status returned by the native bulk-delete operation. */
15
+ readonly status: BulkDeleteElementsStatus;
16
+ /** SQLite status returned by the native delete statement. */
17
+ readonly sqlDeleteStatus: DbResult;
18
+ /** Target roots that the native operation did not delete. */
19
+ readonly failedIds: ReadonlySet<Id64String>;
20
+ }
8
21
  /** Options provided to [[IModelImporter.optimizeGeometry]] specifying post-processing optimizations to be applied to the iModel's geometry.
9
22
  * @beta
10
23
  */
@@ -48,6 +61,19 @@ export interface IModelImportOptions {
48
61
  export declare class IModelImporter {
49
62
  /** The read/write target iModel. */
50
63
  readonly targetDb: IModelDb;
64
+ /** The [[EditTxn]] used for write operations on the target iModel.
65
+ * @beta
66
+ */
67
+ protected readonly _editTxn: EditTxn;
68
+ /** The [[EditTxn]] used for write operations on the target iModel.
69
+ * @beta
70
+ */
71
+ get editTxn(): EditTxn;
72
+ private readonly _elementAspectCleanup;
73
+ /** Deletes replaceable ElementAspects that an owner batch did not reuse, through this importer's customized deletion callback.
74
+ * @internal
75
+ */
76
+ get elementAspectCleanup(): ElementAspectCleanup;
51
77
  /** resolved initialization options for the importer
52
78
  * @beta
53
79
  */
@@ -61,6 +87,7 @@ export declare class IModelImporter {
61
87
  * To resolve code values to their intended values call [[IModelImporter.resolveDuplicateCodeValues]].
62
88
  */
63
89
  private _duplicateCodeValueMap;
90
+ private readonly _entityExistenceCaches;
64
91
  /**
65
92
  * A set of elementIds that the transformer adds to while exporting elements to indicate that the element already exists in the target.
66
93
  * Defaults to an empty set.
@@ -74,9 +101,10 @@ export declare class IModelImporter {
74
101
  * @note This set should stay small, as right after the transformer pushes to it, the importer will remove from the set.
75
102
  */
76
103
  private _elementsToUpdateDuringPreserveIds;
77
- /** The set of elements that should not be updated by this IModelImporter.
78
- * Defaults to an empty set.
104
+ /** The set of target elements that this importer must not directly update or request for deletion.
105
+ * Defaults to an empty set and is populated by consumers or custom transformers.
79
106
  * @note Adding an element to this set is typically necessary when remapping a source element to one that already exists in the target and already has the desired properties.
107
+ * @note Deletion protection applies only when the exact element ID is passed to [[deleteElement]] or [[deleteElements]]. It does not protect the element from deletion through a parent, containing model, or other cascading dependency. Consumers that need to preserve such an element must also add every requested deletion root whose cascade would delete it.
80
108
  */
81
109
  readonly doNotUpdateElementIds: Set<string>;
82
110
  /** This set is ONLY used for elements that are always present even in an "empty" iModel. We will use this set to filter out changes to root elements if [[IModelTransformOptions.skipPropagateChangesToRootElements]] is false. */
@@ -88,10 +116,18 @@ export declare class IModelImporter {
88
116
  /** */
89
117
  private _modelPropertiesToIgnore;
90
118
  /** Construct a new IModelImporter
91
- * @param targetDb The target IModelDb
119
+ * @param editTxn The [[EditTxn]] to use for write operations on the target iModel. The target db is derived from `editTxn.iModel`.
92
120
  * @param options The options that specify how the import should be done.
93
121
  */
94
- constructor(targetDb: IModelDb, options?: IModelImportOptions);
122
+ constructor(editTxn: EditTxn, options?: IModelImportOptions);
123
+ /** Register a transformation-scoped existence cache for delete invalidation.
124
+ * @internal
125
+ */
126
+ registerEntityExistenceCache(cache: EntityExistenceCache): void;
127
+ /** Stop invalidating a transformation-scoped existence cache.
128
+ * @internal
129
+ */
130
+ unregisterEntityExistenceCache(cache: EntityExistenceCache): void;
95
131
  /**
96
132
  * Checks [[IModelImportOptions.skipPropagateChangesToRootElements]], [[IModelImporter.rootElementIds]], and [[IModelImporter.doNotUpdateElementIds]] and returns true for 'do not update', false for do 'update'.
97
133
  */
@@ -101,15 +137,15 @@ export declare class IModelImporter {
101
137
  */
102
138
  markElementToUpdateDuringPreserveIds(elementId: Id64String): void;
103
139
  /** Import the specified ModelProps (either as an insert or an update) into the target iModel. */
104
- importModel(modelProps: ModelProps): void;
140
+ importModel(modelProps: ModelProps): Promise<void>;
105
141
  /** Create a new Model from the specified ModelProps and insert it into the target iModel.
106
142
  * @note A subclass may override this method to customize insert behavior but should call `super.onInsertModel`.
107
143
  */
108
- protected onInsertModel(modelProps: ModelProps): Id64String;
144
+ protected onInsertModel(modelProps: ModelProps): Promise<Id64String>;
109
145
  /** Update an existing Model in the target iModel from the specified ModelProps.
110
146
  * @note A subclass may override this method to customize update behavior but should call `super.onUpdateModel`.
111
147
  */
112
- protected onUpdateModel(modelProps: ModelProps): void;
148
+ protected onUpdateModel(modelProps: ModelProps): Promise<void>;
113
149
  /** Format a Model for the Logger. */
114
150
  private formatModelForLogger;
115
151
  /**
@@ -118,23 +154,31 @@ export declare class IModelImporter {
118
154
  */
119
155
  private tryUpdateElement;
120
156
  /** Import the specified ElementProps (either as an insert or an update) into the target iModel. */
121
- importElement(elementProps: ElementProps): Id64String;
157
+ importElement(elementProps: ElementProps): Promise<Id64String>;
122
158
  /** Create a new Element from the specified ElementProps and insert it into the target iModel.
123
159
  * @returns The Id of the newly inserted Element.
124
160
  * @note A subclass may override this method to customize insert behavior but should call `super.onInsertElement`.
125
161
  */
126
- protected onInsertElement(elementProps: ElementProps): Id64String;
162
+ protected onInsertElement(elementProps: ElementProps): Promise<Id64String>;
127
163
  /** Update an existing Element in the target iModel from the specified ElementProps.
128
164
  * @note A subclass may override this method to customize update behavior but should call `super.onUpdateElement`.
129
165
  */
130
- protected onUpdateElement(elementProps: ElementProps): void;
131
- /** Delete the specified Element (and all its children) from the target iModel.
132
- * Will delete special elements like definition elements and subjects.
133
- * @note A subclass may override this method to customize delete behavior but should call `super.onDeleteElement`.
166
+ protected onUpdateElement(elementProps: ElementProps): Promise<void>;
167
+ /** Deletes one target element tree through [[deleteElements]]. */
168
+ deleteElement(elementId: Id64String): Promise<void>;
169
+ /** Adds roots required by code-scope dependencies, then deletes the target element trees in as few native operations as their references allow.
170
+ * Usually one native operation is enough. When a tree contains a definition, such as a category, that another deleted element uses, the elements that use it are deleted first.
171
+ * Elements that something outside the deleted trees still references are kept, with a warning, and the rest are deleted.
172
+ * @note An override must call `super.onDeleteElements` once to perform the deletion.
134
173
  */
135
- protected onDeleteElement(elementId: Id64String): void;
136
- /** Delete the specified Element from the target iModel. */
137
- deleteElement(elementId: Id64String): void;
174
+ protected onDeleteElements(elementIds: ReadonlySet<Id64String>): Promise<void>;
175
+ private deleteElementRoots;
176
+ /** Deletes target element trees, using one native operation unless references between the trees require more.
177
+ * Requested roots in [[doNotUpdateElementIds]] are skipped. This does not prevent an element in that set from being deleted as part of another root's cascade.
178
+ * Elements that something outside the deleted trees still references are kept, along with their child elements and sub-models and the elements that contain them. A warning lists them.
179
+ * @throws [[ElementBulkDeleteError]] if a native operation fails for any root, for example because geometry outside the deleted trees uses a geometry part in them, or because of a reference in a domain schema. The transformer does not check those references first. Deletions from that and earlier native operations stay pending in the caller-owned transaction. Abandon the transaction before retrying.
180
+ */
181
+ deleteElements(elementIds: ReadonlySet<Id64String>): Promise<void>;
138
182
  /** Delete the specified Model from the target iModel.
139
183
  * @note A subclass may override this method to customize delete behavior but should call `super.onDeleteModel`.
140
184
  */
@@ -143,48 +187,59 @@ export declare class IModelImporter {
143
187
  deleteModel(modelId: Id64String): Promise<void>;
144
188
  /** Format an Element for the Logger. */
145
189
  private formatElementForLogger;
146
- /** Import an ElementUniqueAspect into the target iModel. */
147
- importElementUniqueAspect(aspectProps: ElementAspectProps): Id64String;
190
+ /** Import an ElementUniqueAspect into the target iModel.
191
+ * @note Only an existing aspect of exactly `aspectProps.classFullName` on the owner is reused, and it is updated only when its properties differ.
192
+ * If there is none, the owner's unique aspects of a base or derived class are deleted through [[onDeleteElementAspect]] before the aspect is inserted, because iModel unique-aspect writes treat those classes as one slot.
193
+ * @returns the ID of the reused or inserted aspect
194
+ */
195
+ importElementUniqueAspect(aspectProps: ElementAspectProps): Promise<Id64String>;
196
+ /** Returns the element's target aspects of exactly `classFullName`, in ECInstanceId order.
197
+ * Inside a transformer owner batch these come from the batch's loaded aspects; otherwise from the target iModel.
198
+ */
199
+ private getTargetAspects;
200
+ /** Returns the element's unique aspects whose class is a base or derived class of `classFullName`, excluding that class itself. */
201
+ private queryRelatedUniqueAspectIds;
148
202
  /** Import the collection of ElementMultiAspects into the target iModel.
149
203
  * @param aspectPropsArray The ElementMultiAspects to import
150
204
  * @param filterFunc Optional filter func that is used to exclude target ElementMultiAspects that were added during iModel transformation from the update detection logic.
151
205
  * @note For insert vs. update reasons, it is important to process all ElementMultiAspects owned by an Element at once since we don't have aspect-specific provenance.
206
+ * @note Aspects are grouped by `classFullName`. Each group is matched in order only against existing target aspects of exactly that class: matches are updated when their properties differ, extra props are inserted, and extra target aspects of that class are deleted. Target aspects of other classes, including derived classes, are not changed.
152
207
  * @returns the array of ids of the resulting ElementMultiAspects, in the same order of the aspectPropsArray parameter
153
208
  */
154
209
  importElementMultiAspects(aspectPropsArray: ElementAspectProps[],
155
210
  /** caller must use this to enforce any aspects added by IModelTransformer are not considered for update */
156
- filterFunc?: (a: ElementMultiAspect) => boolean): Id64String[];
211
+ filterFunc?: (a: ElementMultiAspect) => boolean): Promise<Id64String[]>;
157
212
  /** Insert the ElementAspect into the target iModel.
158
213
  * @note A subclass may override this method to customize insert behavior but should call `super.onInsertElementAspect`.
159
214
  */
160
- protected onInsertElementAspect(aspectProps: ElementAspectProps): Id64String;
215
+ protected onInsertElementAspect(aspectProps: ElementAspectProps): Promise<Id64String>;
161
216
  /** Update the ElementAspect within the target iModel.
162
217
  * @note A subclass may override this method to customize update behavior but should call `super.onUpdateElementAspect`.
163
218
  */
164
- protected onUpdateElementAspect(aspectProps: ElementAspectProps): void;
219
+ protected onUpdateElementAspect(aspectProps: ElementAspectProps): Promise<void>;
165
220
  /** Delete the specified ElementAspect from the target iModel.
166
221
  * @note A subclass may override this method to customize delete behavior but should call `super.onDeleteElementAspect`.
167
222
  */
168
- protected onDeleteElementAspect(targetElementAspect: ElementAspect): void;
223
+ protected onDeleteElementAspect(targetElementAspect: ElementAspect): Promise<void>;
169
224
  /** Format an ElementAspect for the Logger. */
170
225
  private formatElementAspectForLogger;
171
226
  /** Import the specified RelationshipProps (either as an insert or an update) into the target iModel.
172
227
  * @returns The instance Id of the inserted or updated Relationship.
173
228
  */
174
- importRelationship(relationshipProps: RelationshipProps): Id64String;
229
+ importRelationship(relationshipProps: RelationshipProps): Promise<Id64String>;
175
230
  /** Create a new Relationship from the specified RelationshipProps and insert it into the target iModel.
176
231
  * @returns The instance Id of the newly inserted relationship.
177
232
  * @note A subclass may override this method to customize insert behavior but should call `super.onInsertRelationship`.
178
233
  */
179
- protected onInsertRelationship(relationshipProps: RelationshipProps): Id64String;
234
+ protected onInsertRelationship(relationshipProps: RelationshipProps): Promise<Id64String>;
180
235
  /** Update an existing Relationship in the target iModel from the specified RelationshipProps.
181
236
  * @note A subclass may override this method to customize update behavior but should call `super.onUpdateRelationship`.
182
237
  */
183
- protected onUpdateRelationship(relationshipProps: RelationshipProps): void;
238
+ protected onUpdateRelationship(relationshipProps: RelationshipProps): Promise<void>;
184
239
  /** Delete the specified Relationship from the target iModel. */
185
- protected onDeleteRelationship(relationshipProps: RelationshipPropsForDelete): void;
240
+ protected onDeleteRelationship(relationshipProps: RelationshipPropsForDelete): Promise<void>;
186
241
  /** Delete the specified Relationship from the target iModel. */
187
- deleteRelationship(relationshipProps: RelationshipPropsForDelete): void;
242
+ deleteRelationship(relationshipProps: RelationshipPropsForDelete): Promise<void>;
188
243
  /** Format a Relationship for the Logger. */
189
244
  private formatRelationshipForLogger;
190
245
  /** Tracks incremental progress */
@@ -192,7 +247,7 @@ export declare class IModelImporter {
192
247
  /** This method is called when IModelImporter has made incremental progress based on the [[progressInterval]] setting.
193
248
  * @note A subclass may override this method to report custom progress but should call `super.onProgress`.
194
249
  */
195
- protected onProgress(): void;
250
+ protected onProgress(): Promise<void>;
196
251
  /** Optionally compute the projectExtents for the target iModel depending on the options for this IModelImporter.
197
252
  * @note This method is automatically called from [IModelTransformer.process]($transformer).
198
253
  * @see [IModelDb.computeProjectExtents]($backend), [[autoExtendProjectExtents]]
@@ -208,7 +263,8 @@ export declare class IModelImporter {
208
263
  * Needs to be called to perform necessary cleanup operations.
209
264
  * By not calling `finalize` there is a risk that data imported into targetDb will not be as expected.
210
265
  *
211
- * @note No need to call this If using [[IModelTransformer]] as it automatically invokes this method.
266
+ * @note [[IModelTransformer.process]] invokes this method automatically. Call it explicitly after
267
+ * composing the transformer's lower-level subset processing methods.
212
268
  */
213
269
  finalize(): void;
214
270
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IModelImporter.d.ts","sourceRoot":"","sources":["../../src/IModelImporter.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAGL,UAAU,EAGX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIL,kBAAkB,EAClB,YAAY,EACZ,WAAW,EAGX,UAAU,EAGX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,MAAM,EACN,QAAQ,EAER,iBAAiB,EAGlB,MAAM,qBAAqB,CAAC;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