@itwin/core-backend 4.0.0-dev.6 → 4.0.0-dev.61

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 (253) hide show
  1. package/CHANGELOG.md +89 -67
  2. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  3. package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
  4. package/lib/cjs/BackendHubAccess.js +41 -41
  5. package/lib/cjs/BackendHubAccess.js.map +1 -1
  6. package/lib/cjs/BackendLoggerCategory.d.ts +90 -91
  7. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
  8. package/lib/cjs/BackendLoggerCategory.js +98 -99
  9. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  10. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  11. package/lib/cjs/BisCoreSchema.js +60 -60
  12. package/lib/cjs/BriefcaseManager.d.ts +170 -170
  13. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  14. package/lib/cjs/BriefcaseManager.js +408 -414
  15. package/lib/cjs/BriefcaseManager.js.map +1 -1
  16. package/lib/cjs/Category.d.ts +153 -153
  17. package/lib/cjs/Category.js +243 -243
  18. package/lib/cjs/Category.js.map +1 -1
  19. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  20. package/lib/cjs/ChangeSummaryManager.js +444 -445
  21. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  22. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  23. package/lib/cjs/ChangedElementsDb.js +165 -165
  24. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  25. package/lib/cjs/ChangedElementsManager.js +88 -88
  26. package/lib/cjs/ChannelControl.d.ts +70 -0
  27. package/lib/cjs/ChannelControl.d.ts.map +1 -0
  28. package/lib/cjs/ChannelControl.js +89 -0
  29. package/lib/cjs/ChannelControl.js.map +1 -0
  30. package/lib/cjs/CheckpointManager.d.ts +121 -121
  31. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  32. package/lib/cjs/CheckpointManager.js +351 -349
  33. package/lib/cjs/CheckpointManager.js.map +1 -1
  34. package/lib/cjs/ClassRegistry.d.ts +79 -79
  35. package/lib/cjs/ClassRegistry.js +249 -245
  36. package/lib/cjs/ClassRegistry.js.map +1 -1
  37. package/lib/cjs/CloudSqlite.d.ts +355 -350
  38. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  39. package/lib/cjs/CloudSqlite.js +154 -153
  40. package/lib/cjs/CloudSqlite.js.map +1 -1
  41. package/lib/cjs/CodeService.d.ts +396 -396
  42. package/lib/cjs/CodeService.d.ts.map +1 -1
  43. package/lib/cjs/CodeService.js +63 -63
  44. package/lib/cjs/CodeService.js.map +1 -1
  45. package/lib/cjs/CodeSpecs.d.ts +55 -55
  46. package/lib/cjs/CodeSpecs.js +124 -124
  47. package/lib/cjs/ConcurrentQuery.d.ts +13 -13
  48. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  49. package/lib/cjs/ConcurrentQuery.js +36 -36
  50. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
  51. package/lib/cjs/CustomViewState3dCreator.d.ts.map +1 -1
  52. package/lib/cjs/CustomViewState3dCreator.js +82 -81
  53. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  54. package/lib/cjs/DevTools.d.ts +74 -71
  55. package/lib/cjs/DevTools.d.ts.map +1 -1
  56. package/lib/cjs/DevTools.js +156 -154
  57. package/lib/cjs/DevTools.js.map +1 -1
  58. package/lib/cjs/DisplayStyle.d.ts +106 -106
  59. package/lib/cjs/DisplayStyle.js +253 -256
  60. package/lib/cjs/DisplayStyle.js.map +1 -1
  61. package/lib/cjs/ECDb.d.ts +194 -191
  62. package/lib/cjs/ECDb.d.ts.map +1 -1
  63. package/lib/cjs/ECDb.js +353 -350
  64. package/lib/cjs/ECDb.js.map +1 -1
  65. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  66. package/lib/cjs/ECSchemaXmlContext.d.ts.map +1 -1
  67. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  68. package/lib/cjs/ECSqlStatement.d.ts +473 -473
  69. package/lib/cjs/ECSqlStatement.js +791 -791
  70. package/lib/cjs/Element.d.ts +1113 -1109
  71. package/lib/cjs/Element.d.ts.map +1 -1
  72. package/lib/cjs/Element.js +1424 -1427
  73. package/lib/cjs/Element.js.map +1 -1
  74. package/lib/cjs/ElementAspect.d.ts +176 -179
  75. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  76. package/lib/cjs/ElementAspect.js +203 -211
  77. package/lib/cjs/ElementAspect.js.map +1 -1
  78. package/lib/cjs/ElementGraphics.d.ts +9 -9
  79. package/lib/cjs/ElementGraphics.js +41 -41
  80. package/lib/cjs/ElementGraphics.js.map +1 -1
  81. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  82. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  83. package/lib/cjs/ElementTreeWalker.js +409 -409
  84. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  85. package/lib/cjs/Entity.d.ts +106 -106
  86. package/lib/cjs/Entity.d.ts.map +1 -1
  87. package/lib/cjs/Entity.js +134 -134
  88. package/lib/cjs/Entity.js.map +1 -1
  89. package/lib/cjs/EntityReferences.d.ts +49 -49
  90. package/lib/cjs/EntityReferences.d.ts.map +1 -1
  91. package/lib/cjs/EntityReferences.js +95 -95
  92. package/lib/cjs/ExportGraphics.d.ts +317 -317
  93. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  94. package/lib/cjs/ExportGraphics.js +208 -208
  95. package/lib/cjs/ExternalSource.d.ts +96 -96
  96. package/lib/cjs/ExternalSource.js +131 -131
  97. package/lib/cjs/ExternalSource.js.map +1 -1
  98. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  99. package/lib/cjs/GeoCoordConfig.js +85 -85
  100. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  101. package/lib/cjs/GeometrySummary.d.ts +4 -4
  102. package/lib/cjs/GeometrySummary.js +333 -333
  103. package/lib/cjs/GeometrySummary.js.map +1 -1
  104. package/lib/cjs/HubMock.d.ts +94 -94
  105. package/lib/cjs/HubMock.js +220 -222
  106. package/lib/cjs/HubMock.js.map +1 -1
  107. package/lib/cjs/IModelCloneContext.d.ts +8 -8
  108. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  109. package/lib/cjs/IModelCloneContext.js +15 -15
  110. package/lib/cjs/IModelDb.d.ts +1216 -1196
  111. package/lib/cjs/IModelDb.d.ts.map +1 -1
  112. package/lib/cjs/IModelDb.js +2387 -2392
  113. package/lib/cjs/IModelDb.js.map +1 -1
  114. package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
  115. package/lib/cjs/IModelElementCloneContext.js +159 -159
  116. package/lib/cjs/IModelHost.d.ts +356 -369
  117. package/lib/cjs/IModelHost.d.ts.map +1 -1
  118. package/lib/cjs/IModelHost.js +472 -496
  119. package/lib/cjs/IModelHost.js.map +1 -1
  120. package/lib/cjs/IModelJsFs.d.ts +62 -62
  121. package/lib/cjs/IModelJsFs.js +139 -140
  122. package/lib/cjs/IModelJsFs.js.map +1 -1
  123. package/lib/cjs/IpcHost.d.ts +104 -104
  124. package/lib/cjs/IpcHost.js +276 -278
  125. package/lib/cjs/IpcHost.js.map +1 -1
  126. package/lib/cjs/LineStyle.d.ts +311 -311
  127. package/lib/cjs/LineStyle.js +295 -295
  128. package/lib/cjs/LocalHub.d.ts +162 -162
  129. package/lib/cjs/LocalHub.d.ts.map +1 -1
  130. package/lib/cjs/LocalHub.js +579 -584
  131. package/lib/cjs/LocalHub.js.map +1 -1
  132. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  133. package/lib/cjs/LocalhostIpcHost.js +79 -81
  134. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  135. package/lib/cjs/Material.d.ts +131 -131
  136. package/lib/cjs/Material.js +180 -181
  137. package/lib/cjs/Material.js.map +1 -1
  138. package/lib/cjs/Model.d.ts +392 -392
  139. package/lib/cjs/Model.d.ts.map +1 -1
  140. package/lib/cjs/Model.js +489 -485
  141. package/lib/cjs/Model.js.map +1 -1
  142. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  143. package/lib/cjs/NativeAppStorage.js +202 -202
  144. package/lib/cjs/NativeAppStorage.js.map +1 -1
  145. package/lib/cjs/NativeHost.d.ts +52 -52
  146. package/lib/cjs/NativeHost.js +160 -163
  147. package/lib/cjs/NativeHost.js.map +1 -1
  148. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  149. package/lib/cjs/NavigationRelationship.js +225 -225
  150. package/lib/cjs/NavigationRelationship.js.map +1 -1
  151. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  152. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  153. package/lib/cjs/PromiseMemoizer.js +101 -101
  154. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  155. package/lib/cjs/PropertyStore.d.ts +132 -132
  156. package/lib/cjs/PropertyStore.js +11 -11
  157. package/lib/cjs/Relationship.d.ts +416 -416
  158. package/lib/cjs/Relationship.js +494 -494
  159. package/lib/cjs/Relationship.js.map +1 -1
  160. package/lib/cjs/RpcBackend.d.ts +5 -5
  161. package/lib/cjs/RpcBackend.js +32 -32
  162. package/lib/cjs/SQLiteDb.d.ts +219 -219
  163. package/lib/cjs/SQLiteDb.js +212 -214
  164. package/lib/cjs/SQLiteDb.js.map +1 -1
  165. package/lib/cjs/Schema.d.ts +55 -55
  166. package/lib/cjs/Schema.js +83 -83
  167. package/lib/cjs/Schema.js.map +1 -1
  168. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  169. package/lib/cjs/ServerBasedLocks.js +168 -168
  170. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  171. package/lib/cjs/SqliteStatement.d.ts +360 -360
  172. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  173. package/lib/cjs/SqliteStatement.js +586 -586
  174. package/lib/cjs/Texture.d.ts +58 -58
  175. package/lib/cjs/Texture.js +82 -82
  176. package/lib/cjs/Texture.js.map +1 -1
  177. package/lib/cjs/TileStorage.d.ts +18 -18
  178. package/lib/cjs/TileStorage.js +87 -90
  179. package/lib/cjs/TileStorage.js.map +1 -1
  180. package/lib/cjs/TxnManager.d.ts +202 -202
  181. package/lib/cjs/TxnManager.d.ts.map +1 -1
  182. package/lib/cjs/TxnManager.js +356 -356
  183. package/lib/cjs/TxnManager.js.map +1 -1
  184. package/lib/cjs/ViewDefinition.d.ts +435 -439
  185. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  186. package/lib/cjs/ViewDefinition.js +646 -646
  187. package/lib/cjs/ViewDefinition.js.map +1 -1
  188. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  189. package/lib/cjs/ViewStateHydrator.js +103 -103
  190. package/lib/cjs/core-backend.d.ts +183 -184
  191. package/lib/cjs/core-backend.d.ts.map +1 -1
  192. package/lib/cjs/core-backend.js +207 -204
  193. package/lib/cjs/core-backend.js.map +1 -1
  194. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  195. package/lib/cjs/domains/FunctionalElements.js +145 -145
  196. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  197. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  198. package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -1
  199. package/lib/cjs/domains/FunctionalSchema.js +39 -40
  200. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  201. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  202. package/lib/cjs/domains/GenericElements.js +263 -263
  203. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  204. package/lib/cjs/domains/GenericSchema.js +28 -28
  205. package/lib/cjs/rpc/multipart.d.ts +11 -11
  206. package/lib/cjs/rpc/multipart.js +71 -71
  207. package/lib/cjs/rpc/tracing.d.ts +28 -28
  208. package/lib/cjs/rpc/tracing.js +73 -74
  209. package/lib/cjs/rpc/tracing.js.map +1 -1
  210. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  211. package/lib/cjs/rpc/web/logging.js +43 -43
  212. package/lib/cjs/rpc/web/request.d.ts +6 -6
  213. package/lib/cjs/rpc/web/request.js +73 -74
  214. package/lib/cjs/rpc/web/request.js.map +1 -1
  215. package/lib/cjs/rpc/web/response.d.ts +6 -6
  216. package/lib/cjs/rpc/web/response.js +105 -106
  217. package/lib/cjs/rpc/web/response.js.map +1 -1
  218. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  219. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  220. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  221. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +293 -294
  222. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  223. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +20 -22
  224. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  225. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +187 -205
  226. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  227. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  228. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +166 -168
  229. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  230. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  231. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +42 -43
  232. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  233. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  234. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  235. package/lib/cjs/workspace/Settings.d.ts +186 -186
  236. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  237. package/lib/cjs/workspace/Settings.js +154 -155
  238. package/lib/cjs/workspace/Settings.js.map +1 -1
  239. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  240. package/lib/cjs/workspace/SettingsSchemas.js +190 -191
  241. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  242. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  243. package/lib/cjs/workspace/Workspace.js +537 -543
  244. package/lib/cjs/workspace/Workspace.js.map +1 -1
  245. package/package.json +19 -19
  246. package/lib/cjs/AliCloudStorageService.d.ts +0 -24
  247. package/lib/cjs/AliCloudStorageService.d.ts.map +0 -1
  248. package/lib/cjs/AliCloudStorageService.js +0 -72
  249. package/lib/cjs/AliCloudStorageService.js.map +0 -1
  250. package/lib/cjs/CloudStorageBackend.d.ts +0 -59
  251. package/lib/cjs/CloudStorageBackend.d.ts.map +0 -1
  252. package/lib/cjs/CloudStorageBackend.js +0 -174
  253. package/lib/cjs/CloudStorageBackend.js.map +0 -1
@@ -1,90 +1,90 @@
1
- /** @packageDocumentation
2
- * @module iModels
3
- */
4
- import { Id64String } from "@itwin/core-bentley";
5
- import { ElementProps } from "@itwin/core-common";
6
- import { IModelJsNative } from "@bentley/imodeljs-native";
7
- import { Element } from "./Element";
8
- import { IModelDb } from "./IModelDb";
9
- import { SQLiteDb } from "./SQLiteDb";
10
- /** The context for transforming a *source* Element to a *target* Element and remapping internal identifiers to the target iModel.
11
- * @beta
12
- */
13
- export declare class IModelElementCloneContext {
14
- /** The source IModelDb. */
15
- readonly sourceDb: IModelDb;
16
- /** The target IModelDb. */
17
- readonly targetDb: IModelDb;
18
- /** The native import context */
19
- private _nativeContext;
20
- /** Construct a new IModelElementCloneContext. It must be initialized with `initialize`, consider using [[IModelElementCloneContext.create]] instead
21
- * @param sourceDb The source IModelDb.
22
- * @param targetDb If provided the target IModelDb. If not provided, the source and target are the same IModelDb.
23
- */
24
- constructor(sourceDb: IModelDb, targetDb?: IModelDb);
25
- /** perform necessary initialization to use a clone context, namely caching the reference types in the source's schemas */
26
- initialize(): Promise<void>;
27
- /** construct and initialize an IModelElementCloneContext at once, for where you construct in an async context */
28
- static create(...args: ConstructorParameters<typeof IModelElementCloneContext>): Promise<IModelElementCloneContext>;
29
- /** Returns `true` if this context is for transforming between 2 iModels and `false` if it for transforming within the same iModel. */
30
- get isBetweenIModels(): boolean;
31
- /** Dispose any native resources associated with this IModelElementCloneContext. */
32
- dispose(): void;
33
- /** Debugging aid that dumps the Id remapping details and other information to the specified output file.
34
- * @internal
35
- */
36
- dump(outputFileName: string): void;
37
- /** Add a rule that remaps the specified source [CodeSpec]($common) to the specified target [CodeSpec]($common).
38
- * @param sourceCodeSpecName The name of the CodeSpec from the source iModel.
39
- * @param targetCodeSpecName The name of the CodeSpec from the target iModel.
40
- * @throws [[IModelError]] if either CodeSpec could not be found.
41
- */
42
- remapCodeSpec(sourceCodeSpecName: string, targetCodeSpecName: string): void;
43
- /** Add a rule that remaps the specified source class to the specified target class. */
44
- remapElementClass(sourceClassFullName: string, targetClassFullName: string): void;
45
- /** Add a rule that remaps the specified source Element to the specified target Element. */
46
- remapElement(sourceId: Id64String, targetId: Id64String): void;
47
- /** Remove a rule that remaps the specified source Element. */
48
- removeElement(sourceId: Id64String): void;
49
- /** Look up a target CodeSpecId from the source CodeSpecId.
50
- * @returns the target CodeSpecId or [Id64.invalid]($bentley) if a mapping not found.
51
- */
52
- findTargetCodeSpecId(sourceId: Id64String): Id64String;
53
- /** Look up a target ElementId from the source ElementId.
54
- * @returns the target ElementId or [Id64.invalid]($bentley) if a mapping not found.
55
- */
56
- findTargetElementId(sourceElementId: Id64String): Id64String;
57
- /** Filter out geometry entries in the specified SubCategory from GeometryStreams in the target iModel.
58
- * @note It is not possible to filter out a *default* SubCategory. A request to do so will be ignored.
59
- * @see [SubCategory.isDefaultSubCategory]($backend)
60
- */
61
- filterSubCategory(sourceSubCategoryId: Id64String): void;
62
- /** Returns `true` if there are any SubCategories being filtered. */
63
- get hasSubCategoryFilter(): boolean;
64
- /** Returns `true` if this SubCategory is being filtered. */
65
- isSubCategoryFiltered(subCategoryId: Id64String): boolean;
66
- /** Import the specified font from the source iModel into the target iModel.
67
- * @internal
68
- */
69
- importFont(sourceFontNumber: number): void;
70
- /** Import a single CodeSpec from the source iModel into the target iModel.
71
- * @internal
72
- */
73
- importCodeSpec(sourceCodeSpecId: Id64String): void;
74
- /** Clone the specified source Element into ElementProps for the target iModel.
75
- * @internal
76
- */
77
- cloneElement(sourceElement: Element, cloneOptions?: IModelJsNative.CloneElementOptions): ElementProps;
78
- /**
79
- * serialize state to a sqlite database at a given path
80
- * assumes the database has not already had any context state serialized to it
81
- * @internal
82
- */
83
- saveStateToDb(db: SQLiteDb): void;
84
- /**
85
- * load state from a sqlite database at a given path
86
- * @internal
87
- */
88
- loadStateFromDb(db: SQLiteDb): void;
89
- }
1
+ /** @packageDocumentation
2
+ * @module iModels
3
+ */
4
+ import { Id64String } from "@itwin/core-bentley";
5
+ import { ElementProps } from "@itwin/core-common";
6
+ import { IModelJsNative } from "@bentley/imodeljs-native";
7
+ import { Element } from "./Element";
8
+ import { IModelDb } from "./IModelDb";
9
+ import { SQLiteDb } from "./SQLiteDb";
10
+ /** The context for transforming a *source* Element to a *target* Element and remapping internal identifiers to the target iModel.
11
+ * @beta
12
+ */
13
+ export declare class IModelElementCloneContext {
14
+ /** The source IModelDb. */
15
+ readonly sourceDb: IModelDb;
16
+ /** The target IModelDb. */
17
+ readonly targetDb: IModelDb;
18
+ /** The native import context */
19
+ private _nativeContext;
20
+ /** Construct a new IModelElementCloneContext. It must be initialized with `initialize`, consider using [[IModelElementCloneContext.create]] instead
21
+ * @param sourceDb The source IModelDb.
22
+ * @param targetDb If provided the target IModelDb. If not provided, the source and target are the same IModelDb.
23
+ */
24
+ constructor(sourceDb: IModelDb, targetDb?: IModelDb);
25
+ /** perform necessary initialization to use a clone context, namely caching the reference types in the source's schemas */
26
+ initialize(): Promise<void>;
27
+ /** construct and initialize an IModelElementCloneContext at once, for where you construct in an async context */
28
+ static create(...args: ConstructorParameters<typeof IModelElementCloneContext>): Promise<IModelElementCloneContext>;
29
+ /** Returns `true` if this context is for transforming between 2 iModels and `false` if it for transforming within the same iModel. */
30
+ get isBetweenIModels(): boolean;
31
+ /** Dispose any native resources associated with this IModelElementCloneContext. */
32
+ dispose(): void;
33
+ /** Debugging aid that dumps the Id remapping details and other information to the specified output file.
34
+ * @internal
35
+ */
36
+ dump(outputFileName: string): void;
37
+ /** Add a rule that remaps the specified source [CodeSpec]($common) to the specified target [CodeSpec]($common).
38
+ * @param sourceCodeSpecName The name of the CodeSpec from the source iModel.
39
+ * @param targetCodeSpecName The name of the CodeSpec from the target iModel.
40
+ * @throws [[IModelError]] if either CodeSpec could not be found.
41
+ */
42
+ remapCodeSpec(sourceCodeSpecName: string, targetCodeSpecName: string): void;
43
+ /** Add a rule that remaps the specified source class to the specified target class. */
44
+ remapElementClass(sourceClassFullName: string, targetClassFullName: string): void;
45
+ /** Add a rule that remaps the specified source Element to the specified target Element. */
46
+ remapElement(sourceId: Id64String, targetId: Id64String): void;
47
+ /** Remove a rule that remaps the specified source Element. */
48
+ removeElement(sourceId: Id64String): void;
49
+ /** Look up a target CodeSpecId from the source CodeSpecId.
50
+ * @returns the target CodeSpecId or [Id64.invalid]($bentley) if a mapping not found.
51
+ */
52
+ findTargetCodeSpecId(sourceId: Id64String): Id64String;
53
+ /** Look up a target ElementId from the source ElementId.
54
+ * @returns the target ElementId or [Id64.invalid]($bentley) if a mapping not found.
55
+ */
56
+ findTargetElementId(sourceElementId: Id64String): Id64String;
57
+ /** Filter out geometry entries in the specified SubCategory from GeometryStreams in the target iModel.
58
+ * @note It is not possible to filter out a *default* SubCategory. A request to do so will be ignored.
59
+ * @see [SubCategory.isDefaultSubCategory]($backend)
60
+ */
61
+ filterSubCategory(sourceSubCategoryId: Id64String): void;
62
+ /** Returns `true` if there are any SubCategories being filtered. */
63
+ get hasSubCategoryFilter(): boolean;
64
+ /** Returns `true` if this SubCategory is being filtered. */
65
+ isSubCategoryFiltered(subCategoryId: Id64String): boolean;
66
+ /** Import the specified font from the source iModel into the target iModel.
67
+ * @internal
68
+ */
69
+ importFont(sourceFontNumber: number): void;
70
+ /** Import a single CodeSpec from the source iModel into the target iModel.
71
+ * @internal
72
+ */
73
+ importCodeSpec(sourceCodeSpecId: Id64String): void;
74
+ /** Clone the specified source Element into ElementProps for the target iModel.
75
+ * @internal
76
+ */
77
+ cloneElement(sourceElement: Element, cloneOptions?: IModelJsNative.CloneElementOptions): ElementProps;
78
+ /**
79
+ * serialize state to a sqlite database at a given path
80
+ * assumes the database has not already had any context state serialized to it
81
+ * @internal
82
+ */
83
+ saveStateToDb(db: SQLiteDb): void;
84
+ /**
85
+ * load state from a sqlite database at a given path
86
+ * @internal
87
+ */
88
+ loadStateFromDb(db: SQLiteDb): void;
89
+ }
90
90
  //# sourceMappingURL=IModelElementCloneContext.d.ts.map
@@ -1,160 +1,160 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IModelElementCloneContext = void 0;
4
- /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
8
- /** @packageDocumentation
9
- * @module iModels
10
- */
11
- const core_bentley_1 = require("@itwin/core-bentley");
12
- const core_common_1 = require("@itwin/core-common");
13
- const Category_1 = require("./Category");
14
- const IModelHost_1 = require("./IModelHost");
15
- /** The context for transforming a *source* Element to a *target* Element and remapping internal identifiers to the target iModel.
16
- * @beta
17
- */
18
- class IModelElementCloneContext {
19
- /** Construct a new IModelElementCloneContext. It must be initialized with `initialize`, consider using [[IModelElementCloneContext.create]] instead
20
- * @param sourceDb The source IModelDb.
21
- * @param targetDb If provided the target IModelDb. If not provided, the source and target are the same IModelDb.
22
- */
23
- constructor(sourceDb, targetDb) {
24
- this.sourceDb = sourceDb;
25
- this.targetDb = (undefined !== targetDb) ? targetDb : sourceDb;
26
- this._nativeContext = new IModelHost_1.IModelHost.platform.ImportContext(this.sourceDb.nativeDb, this.targetDb.nativeDb);
27
- }
28
- /** perform necessary initialization to use a clone context, namely caching the reference types in the source's schemas */
29
- async initialize() {
30
- }
31
- /** construct and initialize an IModelElementCloneContext at once, for where you construct in an async context */
32
- static async create(...args) {
33
- const instance = new this(...args);
34
- await instance.initialize();
35
- return instance;
36
- }
37
- /** Returns `true` if this context is for transforming between 2 iModels and `false` if it for transforming within the same iModel. */
38
- get isBetweenIModels() { return this.sourceDb !== this.targetDb; }
39
- /** Dispose any native resources associated with this IModelElementCloneContext. */
40
- dispose() { this._nativeContext.dispose(); }
41
- /** Debugging aid that dumps the Id remapping details and other information to the specified output file.
42
- * @internal
43
- */
44
- dump(outputFileName) { this._nativeContext.dump(outputFileName); }
45
- /** Add a rule that remaps the specified source [CodeSpec]($common) to the specified target [CodeSpec]($common).
46
- * @param sourceCodeSpecName The name of the CodeSpec from the source iModel.
47
- * @param targetCodeSpecName The name of the CodeSpec from the target iModel.
48
- * @throws [[IModelError]] if either CodeSpec could not be found.
49
- */
50
- remapCodeSpec(sourceCodeSpecName, targetCodeSpecName) {
51
- const sourceCodeSpec = this.sourceDb.codeSpecs.getByName(sourceCodeSpecName);
52
- const targetCodeSpec = this.targetDb.codeSpecs.getByName(targetCodeSpecName);
53
- this._nativeContext.addCodeSpecId(sourceCodeSpec.id, targetCodeSpec.id);
54
- }
55
- /** Add a rule that remaps the specified source class to the specified target class. */
56
- remapElementClass(sourceClassFullName, targetClassFullName) {
57
- this._nativeContext.addClass(sourceClassFullName, targetClassFullName);
58
- }
59
- /** Add a rule that remaps the specified source Element to the specified target Element. */
60
- remapElement(sourceId, targetId) {
61
- this._nativeContext.addElementId(sourceId, targetId);
62
- }
63
- /** Remove a rule that remaps the specified source Element. */
64
- removeElement(sourceId) {
65
- this._nativeContext.removeElementId(sourceId);
66
- }
67
- /** Look up a target CodeSpecId from the source CodeSpecId.
68
- * @returns the target CodeSpecId or [Id64.invalid]($bentley) if a mapping not found.
69
- */
70
- findTargetCodeSpecId(sourceId) {
71
- if (core_bentley_1.Id64.invalid === sourceId) {
72
- return core_bentley_1.Id64.invalid;
73
- }
74
- return this._nativeContext.findCodeSpecId(sourceId);
75
- }
76
- /** Look up a target ElementId from the source ElementId.
77
- * @returns the target ElementId or [Id64.invalid]($bentley) if a mapping not found.
78
- */
79
- findTargetElementId(sourceElementId) {
80
- if (core_bentley_1.Id64.invalid === sourceElementId) {
81
- return core_bentley_1.Id64.invalid;
82
- }
83
- return this._nativeContext.findElementId(sourceElementId);
84
- }
85
- /** Filter out geometry entries in the specified SubCategory from GeometryStreams in the target iModel.
86
- * @note It is not possible to filter out a *default* SubCategory. A request to do so will be ignored.
87
- * @see [SubCategory.isDefaultSubCategory]($backend)
88
- */
89
- filterSubCategory(sourceSubCategoryId) {
90
- const sourceSubCategory = this.sourceDb.elements.tryGetElement(sourceSubCategoryId, Category_1.SubCategory);
91
- if (sourceSubCategory && !sourceSubCategory.isDefaultSubCategory) {
92
- this._nativeContext.filterSubCategoryId(sourceSubCategoryId);
93
- }
94
- }
95
- /** Returns `true` if there are any SubCategories being filtered. */
96
- get hasSubCategoryFilter() {
97
- return this._nativeContext.hasSubCategoryFilter();
98
- }
99
- /** Returns `true` if this SubCategory is being filtered. */
100
- isSubCategoryFiltered(subCategoryId) {
101
- return this._nativeContext.isSubCategoryFiltered(subCategoryId);
102
- }
103
- /** Import the specified font from the source iModel into the target iModel.
104
- * @internal
105
- */
106
- importFont(sourceFontNumber) {
107
- this.targetDb.clearFontMap(); // so it will be reloaded with new font info
108
- this._nativeContext.importFont(sourceFontNumber);
109
- }
110
- /** Import a single CodeSpec from the source iModel into the target iModel.
111
- * @internal
112
- */
113
- importCodeSpec(sourceCodeSpecId) {
114
- this._nativeContext.importCodeSpec(sourceCodeSpecId);
115
- }
116
- /** Clone the specified source Element into ElementProps for the target iModel.
117
- * @internal
118
- */
119
- cloneElement(sourceElement, cloneOptions) {
120
- const targetElementProps = this._nativeContext.cloneElement(sourceElement.id, cloneOptions);
121
- // Ensure that all NavigationProperties in targetElementProps have a defined value so "clearing" changes will be part of the JSON used for update
122
- sourceElement.forEachProperty((propertyName, meta) => {
123
- if ((meta.isNavigation) && (undefined === sourceElement[propertyName])) {
124
- targetElementProps[propertyName] = core_common_1.RelatedElement.none;
125
- }
126
- }, false); // exclude custom because C++ has already handled them
127
- if (this.isBetweenIModels) {
128
- // The native C++ cloneElement strips off federationGuid, want to put it back if transformation is between iModels
129
- targetElementProps.federationGuid = sourceElement.federationGuid;
130
- if (core_common_1.CodeScopeSpec.Type.Repository === this.targetDb.codeSpecs.getById(targetElementProps.code.spec).scopeType) {
131
- targetElementProps.code.scope = core_common_1.IModel.rootSubjectId;
132
- }
133
- }
134
- // unlike other references, code cannot be null. If it is null, use an empty code instead
135
- if (targetElementProps.code.scope === core_bentley_1.Id64.invalid || targetElementProps.code.spec === core_bentley_1.Id64.invalid) {
136
- targetElementProps.code = core_common_1.Code.createEmpty();
137
- }
138
- const jsClass = this.sourceDb.getJsClass(sourceElement.classFullName);
139
- // eslint-disable-next-line @typescript-eslint/dot-notation
140
- jsClass["onCloned"](this, sourceElement.toJSON(), targetElementProps);
141
- return targetElementProps;
142
- }
143
- /**
144
- * serialize state to a sqlite database at a given path
145
- * assumes the database has not already had any context state serialized to it
146
- * @internal
147
- */
148
- saveStateToDb(db) {
149
- this._nativeContext.saveStateToDb(db.nativeDb);
150
- }
151
- /**
152
- * load state from a sqlite database at a given path
153
- * @internal
154
- */
155
- loadStateFromDb(db) {
156
- this._nativeContext.loadStateFromDb(db.nativeDb);
157
- }
158
- }
159
- exports.IModelElementCloneContext = IModelElementCloneContext;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IModelElementCloneContext = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ /** @packageDocumentation
9
+ * @module iModels
10
+ */
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ const core_common_1 = require("@itwin/core-common");
13
+ const Category_1 = require("./Category");
14
+ const IModelHost_1 = require("./IModelHost");
15
+ /** The context for transforming a *source* Element to a *target* Element and remapping internal identifiers to the target iModel.
16
+ * @beta
17
+ */
18
+ class IModelElementCloneContext {
19
+ /** Construct a new IModelElementCloneContext. It must be initialized with `initialize`, consider using [[IModelElementCloneContext.create]] instead
20
+ * @param sourceDb The source IModelDb.
21
+ * @param targetDb If provided the target IModelDb. If not provided, the source and target are the same IModelDb.
22
+ */
23
+ constructor(sourceDb, targetDb) {
24
+ this.sourceDb = sourceDb;
25
+ this.targetDb = (undefined !== targetDb) ? targetDb : sourceDb;
26
+ this._nativeContext = new IModelHost_1.IModelHost.platform.ImportContext(this.sourceDb.nativeDb, this.targetDb.nativeDb);
27
+ }
28
+ /** perform necessary initialization to use a clone context, namely caching the reference types in the source's schemas */
29
+ async initialize() {
30
+ }
31
+ /** construct and initialize an IModelElementCloneContext at once, for where you construct in an async context */
32
+ static async create(...args) {
33
+ const instance = new this(...args);
34
+ await instance.initialize();
35
+ return instance;
36
+ }
37
+ /** Returns `true` if this context is for transforming between 2 iModels and `false` if it for transforming within the same iModel. */
38
+ get isBetweenIModels() { return this.sourceDb !== this.targetDb; }
39
+ /** Dispose any native resources associated with this IModelElementCloneContext. */
40
+ dispose() { this._nativeContext.dispose(); }
41
+ /** Debugging aid that dumps the Id remapping details and other information to the specified output file.
42
+ * @internal
43
+ */
44
+ dump(outputFileName) { this._nativeContext.dump(outputFileName); }
45
+ /** Add a rule that remaps the specified source [CodeSpec]($common) to the specified target [CodeSpec]($common).
46
+ * @param sourceCodeSpecName The name of the CodeSpec from the source iModel.
47
+ * @param targetCodeSpecName The name of the CodeSpec from the target iModel.
48
+ * @throws [[IModelError]] if either CodeSpec could not be found.
49
+ */
50
+ remapCodeSpec(sourceCodeSpecName, targetCodeSpecName) {
51
+ const sourceCodeSpec = this.sourceDb.codeSpecs.getByName(sourceCodeSpecName);
52
+ const targetCodeSpec = this.targetDb.codeSpecs.getByName(targetCodeSpecName);
53
+ this._nativeContext.addCodeSpecId(sourceCodeSpec.id, targetCodeSpec.id);
54
+ }
55
+ /** Add a rule that remaps the specified source class to the specified target class. */
56
+ remapElementClass(sourceClassFullName, targetClassFullName) {
57
+ this._nativeContext.addClass(sourceClassFullName, targetClassFullName);
58
+ }
59
+ /** Add a rule that remaps the specified source Element to the specified target Element. */
60
+ remapElement(sourceId, targetId) {
61
+ this._nativeContext.addElementId(sourceId, targetId);
62
+ }
63
+ /** Remove a rule that remaps the specified source Element. */
64
+ removeElement(sourceId) {
65
+ this._nativeContext.removeElementId(sourceId);
66
+ }
67
+ /** Look up a target CodeSpecId from the source CodeSpecId.
68
+ * @returns the target CodeSpecId or [Id64.invalid]($bentley) if a mapping not found.
69
+ */
70
+ findTargetCodeSpecId(sourceId) {
71
+ if (core_bentley_1.Id64.invalid === sourceId) {
72
+ return core_bentley_1.Id64.invalid;
73
+ }
74
+ return this._nativeContext.findCodeSpecId(sourceId);
75
+ }
76
+ /** Look up a target ElementId from the source ElementId.
77
+ * @returns the target ElementId or [Id64.invalid]($bentley) if a mapping not found.
78
+ */
79
+ findTargetElementId(sourceElementId) {
80
+ if (core_bentley_1.Id64.invalid === sourceElementId) {
81
+ return core_bentley_1.Id64.invalid;
82
+ }
83
+ return this._nativeContext.findElementId(sourceElementId);
84
+ }
85
+ /** Filter out geometry entries in the specified SubCategory from GeometryStreams in the target iModel.
86
+ * @note It is not possible to filter out a *default* SubCategory. A request to do so will be ignored.
87
+ * @see [SubCategory.isDefaultSubCategory]($backend)
88
+ */
89
+ filterSubCategory(sourceSubCategoryId) {
90
+ const sourceSubCategory = this.sourceDb.elements.tryGetElement(sourceSubCategoryId, Category_1.SubCategory);
91
+ if (sourceSubCategory && !sourceSubCategory.isDefaultSubCategory) {
92
+ this._nativeContext.filterSubCategoryId(sourceSubCategoryId);
93
+ }
94
+ }
95
+ /** Returns `true` if there are any SubCategories being filtered. */
96
+ get hasSubCategoryFilter() {
97
+ return this._nativeContext.hasSubCategoryFilter();
98
+ }
99
+ /** Returns `true` if this SubCategory is being filtered. */
100
+ isSubCategoryFiltered(subCategoryId) {
101
+ return this._nativeContext.isSubCategoryFiltered(subCategoryId);
102
+ }
103
+ /** Import the specified font from the source iModel into the target iModel.
104
+ * @internal
105
+ */
106
+ importFont(sourceFontNumber) {
107
+ this.targetDb.clearFontMap(); // so it will be reloaded with new font info
108
+ this._nativeContext.importFont(sourceFontNumber);
109
+ }
110
+ /** Import a single CodeSpec from the source iModel into the target iModel.
111
+ * @internal
112
+ */
113
+ importCodeSpec(sourceCodeSpecId) {
114
+ this._nativeContext.importCodeSpec(sourceCodeSpecId);
115
+ }
116
+ /** Clone the specified source Element into ElementProps for the target iModel.
117
+ * @internal
118
+ */
119
+ cloneElement(sourceElement, cloneOptions) {
120
+ const targetElementProps = this._nativeContext.cloneElement(sourceElement.id, cloneOptions);
121
+ // Ensure that all NavigationProperties in targetElementProps have a defined value so "clearing" changes will be part of the JSON used for update
122
+ sourceElement.forEachProperty((propertyName, meta) => {
123
+ if ((meta.isNavigation) && (undefined === sourceElement[propertyName])) {
124
+ targetElementProps[propertyName] = core_common_1.RelatedElement.none;
125
+ }
126
+ }, false); // exclude custom because C++ has already handled them
127
+ if (this.isBetweenIModels) {
128
+ // The native C++ cloneElement strips off federationGuid, want to put it back if transformation is between iModels
129
+ targetElementProps.federationGuid = sourceElement.federationGuid;
130
+ if (core_common_1.CodeScopeSpec.Type.Repository === this.targetDb.codeSpecs.getById(targetElementProps.code.spec).scopeType) {
131
+ targetElementProps.code.scope = core_common_1.IModel.rootSubjectId;
132
+ }
133
+ }
134
+ // unlike other references, code cannot be null. If it is null, use an empty code instead
135
+ if (targetElementProps.code.scope === core_bentley_1.Id64.invalid || targetElementProps.code.spec === core_bentley_1.Id64.invalid) {
136
+ targetElementProps.code = core_common_1.Code.createEmpty();
137
+ }
138
+ const jsClass = this.sourceDb.getJsClass(sourceElement.classFullName);
139
+ // eslint-disable-next-line @typescript-eslint/dot-notation
140
+ jsClass["onCloned"](this, sourceElement.toJSON(), targetElementProps);
141
+ return targetElementProps;
142
+ }
143
+ /**
144
+ * serialize state to a sqlite database at a given path
145
+ * assumes the database has not already had any context state serialized to it
146
+ * @internal
147
+ */
148
+ saveStateToDb(db) {
149
+ this._nativeContext.saveStateToDb(db.nativeDb);
150
+ }
151
+ /**
152
+ * load state from a sqlite database at a given path
153
+ * @internal
154
+ */
155
+ loadStateFromDb(db) {
156
+ this._nativeContext.loadStateFromDb(db.nativeDb);
157
+ }
158
+ }
159
+ exports.IModelElementCloneContext = IModelElementCloneContext;
160
160
  //# sourceMappingURL=IModelElementCloneContext.js.map