@itwin/core-backend 4.0.0-dev.10 → 4.0.0-dev.100

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 (270) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/lib/cjs/BackendHubAccess.d.ts +226 -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/BlobContainerService.d.ts +120 -0
  13. package/lib/cjs/BlobContainerService.d.ts.map +1 -0
  14. package/lib/cjs/BlobContainerService.js +18 -0
  15. package/lib/cjs/BlobContainerService.js.map +1 -0
  16. package/lib/cjs/BriefcaseManager.d.ts +184 -170
  17. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  18. package/lib/cjs/BriefcaseManager.js +421 -414
  19. package/lib/cjs/BriefcaseManager.js.map +1 -1
  20. package/lib/cjs/Category.d.ts +153 -153
  21. package/lib/cjs/Category.js +243 -243
  22. package/lib/cjs/Category.js.map +1 -1
  23. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  24. package/lib/cjs/ChangeSummaryManager.js +444 -445
  25. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  26. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  27. package/lib/cjs/ChangedElementsDb.js +165 -165
  28. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  29. package/lib/cjs/ChangedElementsManager.js +88 -88
  30. package/lib/cjs/ChannelControl.d.ts +70 -0
  31. package/lib/cjs/ChannelControl.d.ts.map +1 -0
  32. package/lib/cjs/ChannelControl.js +89 -0
  33. package/lib/cjs/ChannelControl.js.map +1 -0
  34. package/lib/cjs/CheckpointManager.d.ts +121 -121
  35. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  36. package/lib/cjs/CheckpointManager.js +351 -349
  37. package/lib/cjs/CheckpointManager.js.map +1 -1
  38. package/lib/cjs/ClassRegistry.d.ts +79 -79
  39. package/lib/cjs/ClassRegistry.js +249 -245
  40. package/lib/cjs/ClassRegistry.js.map +1 -1
  41. package/lib/cjs/CloudSqlite.d.ts +572 -350
  42. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  43. package/lib/cjs/CloudSqlite.js +374 -153
  44. package/lib/cjs/CloudSqlite.js.map +1 -1
  45. package/lib/cjs/CodeService.d.ts +399 -396
  46. package/lib/cjs/CodeService.d.ts.map +1 -1
  47. package/lib/cjs/CodeService.js +63 -63
  48. package/lib/cjs/CodeService.js.map +1 -1
  49. package/lib/cjs/CodeSpecs.d.ts +58 -55
  50. package/lib/cjs/CodeSpecs.d.ts.map +1 -1
  51. package/lib/cjs/CodeSpecs.js +154 -124
  52. package/lib/cjs/CodeSpecs.js.map +1 -1
  53. package/lib/cjs/ConcurrentQuery.d.ts +13 -13
  54. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  55. package/lib/cjs/ConcurrentQuery.js +36 -36
  56. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
  57. package/lib/cjs/CustomViewState3dCreator.d.ts.map +1 -1
  58. package/lib/cjs/CustomViewState3dCreator.js +80 -81
  59. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  60. package/lib/cjs/DevTools.d.ts +74 -71
  61. package/lib/cjs/DevTools.d.ts.map +1 -1
  62. package/lib/cjs/DevTools.js +156 -154
  63. package/lib/cjs/DevTools.js.map +1 -1
  64. package/lib/cjs/DisplayStyle.d.ts +104 -106
  65. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  66. package/lib/cjs/DisplayStyle.js +251 -256
  67. package/lib/cjs/DisplayStyle.js.map +1 -1
  68. package/lib/cjs/ECDb.d.ts +194 -191
  69. package/lib/cjs/ECDb.d.ts.map +1 -1
  70. package/lib/cjs/ECDb.js +351 -350
  71. package/lib/cjs/ECDb.js.map +1 -1
  72. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  73. package/lib/cjs/ECSchemaXmlContext.d.ts.map +1 -1
  74. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  75. package/lib/cjs/ECSqlStatement.d.ts +473 -473
  76. package/lib/cjs/ECSqlStatement.js +791 -791
  77. package/lib/cjs/Element.d.ts +1105 -1109
  78. package/lib/cjs/Element.d.ts.map +1 -1
  79. package/lib/cjs/Element.js +1416 -1427
  80. package/lib/cjs/Element.js.map +1 -1
  81. package/lib/cjs/ElementAspect.d.ts +175 -179
  82. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  83. package/lib/cjs/ElementAspect.js +202 -211
  84. package/lib/cjs/ElementAspect.js.map +1 -1
  85. package/lib/cjs/ElementGraphics.d.ts +9 -9
  86. package/lib/cjs/ElementGraphics.js +41 -41
  87. package/lib/cjs/ElementGraphics.js.map +1 -1
  88. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  89. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  90. package/lib/cjs/ElementTreeWalker.js +409 -409
  91. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  92. package/lib/cjs/Entity.d.ts +102 -106
  93. package/lib/cjs/Entity.d.ts.map +1 -1
  94. package/lib/cjs/Entity.js +118 -134
  95. package/lib/cjs/Entity.js.map +1 -1
  96. package/lib/cjs/EntityReferences.d.ts +49 -49
  97. package/lib/cjs/EntityReferences.d.ts.map +1 -1
  98. package/lib/cjs/EntityReferences.js +95 -95
  99. package/lib/cjs/ExportGraphics.d.ts +317 -317
  100. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  101. package/lib/cjs/ExportGraphics.js +208 -208
  102. package/lib/cjs/ExternalSource.d.ts +95 -96
  103. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  104. package/lib/cjs/ExternalSource.js +130 -131
  105. package/lib/cjs/ExternalSource.js.map +1 -1
  106. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  107. package/lib/cjs/GeoCoordConfig.js +85 -85
  108. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  109. package/lib/cjs/GeometrySummary.d.ts +4 -4
  110. package/lib/cjs/GeometrySummary.js +333 -333
  111. package/lib/cjs/GeometrySummary.js.map +1 -1
  112. package/lib/cjs/HubMock.d.ts +94 -94
  113. package/lib/cjs/HubMock.js +220 -222
  114. package/lib/cjs/HubMock.js.map +1 -1
  115. package/lib/cjs/IModelCloneContext.d.ts +8 -8
  116. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  117. package/lib/cjs/IModelCloneContext.js +15 -15
  118. package/lib/cjs/IModelDb.d.ts +1222 -1196
  119. package/lib/cjs/IModelDb.d.ts.map +1 -1
  120. package/lib/cjs/IModelDb.js +2389 -2392
  121. package/lib/cjs/IModelDb.js.map +1 -1
  122. package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
  123. package/lib/cjs/IModelElementCloneContext.js +159 -159
  124. package/lib/cjs/IModelHost.d.ts +370 -369
  125. package/lib/cjs/IModelHost.d.ts.map +1 -1
  126. package/lib/cjs/IModelHost.js +476 -496
  127. package/lib/cjs/IModelHost.js.map +1 -1
  128. package/lib/cjs/IModelJsFs.d.ts +62 -62
  129. package/lib/cjs/IModelJsFs.js +139 -140
  130. package/lib/cjs/IModelJsFs.js.map +1 -1
  131. package/lib/cjs/IpcHost.d.ts +104 -104
  132. package/lib/cjs/IpcHost.js +276 -278
  133. package/lib/cjs/IpcHost.js.map +1 -1
  134. package/lib/cjs/LineStyle.d.ts +311 -311
  135. package/lib/cjs/LineStyle.js +295 -295
  136. package/lib/cjs/LocalHub.d.ts +162 -162
  137. package/lib/cjs/LocalHub.d.ts.map +1 -1
  138. package/lib/cjs/LocalHub.js +579 -584
  139. package/lib/cjs/LocalHub.js.map +1 -1
  140. package/lib/cjs/LocalhostIpcHost.d.ts +21 -20
  141. package/lib/cjs/LocalhostIpcHost.d.ts.map +1 -1
  142. package/lib/cjs/LocalhostIpcHost.js +79 -81
  143. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  144. package/lib/cjs/Material.d.ts +131 -131
  145. package/lib/cjs/Material.d.ts.map +1 -1
  146. package/lib/cjs/Material.js +185 -181
  147. package/lib/cjs/Material.js.map +1 -1
  148. package/lib/cjs/Model.d.ts +391 -392
  149. package/lib/cjs/Model.d.ts.map +1 -1
  150. package/lib/cjs/Model.js +487 -485
  151. package/lib/cjs/Model.js.map +1 -1
  152. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  153. package/lib/cjs/NativeAppStorage.js +202 -202
  154. package/lib/cjs/NativeAppStorage.js.map +1 -1
  155. package/lib/cjs/NativeHost.d.ts +52 -52
  156. package/lib/cjs/NativeHost.d.ts.map +1 -1
  157. package/lib/cjs/NativeHost.js +158 -163
  158. package/lib/cjs/NativeHost.js.map +1 -1
  159. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  160. package/lib/cjs/NavigationRelationship.js +225 -225
  161. package/lib/cjs/NavigationRelationship.js.map +1 -1
  162. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  163. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  164. package/lib/cjs/PromiseMemoizer.js +101 -101
  165. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  166. package/lib/cjs/PropertyStore.d.ts +123 -132
  167. package/lib/cjs/PropertyStore.d.ts.map +1 -1
  168. package/lib/cjs/PropertyStore.js +179 -11
  169. package/lib/cjs/PropertyStore.js.map +1 -1
  170. package/lib/cjs/Relationship.d.ts +413 -416
  171. package/lib/cjs/Relationship.d.ts.map +1 -1
  172. package/lib/cjs/Relationship.js +491 -494
  173. package/lib/cjs/Relationship.js.map +1 -1
  174. package/lib/cjs/RpcBackend.d.ts +5 -5
  175. package/lib/cjs/RpcBackend.js +32 -32
  176. package/lib/cjs/SQLiteDb.d.ts +317 -219
  177. package/lib/cjs/SQLiteDb.d.ts.map +1 -1
  178. package/lib/cjs/SQLiteDb.js +318 -214
  179. package/lib/cjs/SQLiteDb.js.map +1 -1
  180. package/lib/cjs/Schema.d.ts +55 -55
  181. package/lib/cjs/Schema.js +83 -83
  182. package/lib/cjs/Schema.js.map +1 -1
  183. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  184. package/lib/cjs/ServerBasedLocks.js +168 -168
  185. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  186. package/lib/cjs/SqliteStatement.d.ts +360 -360
  187. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  188. package/lib/cjs/SqliteStatement.js +586 -586
  189. package/lib/cjs/Texture.d.ts +58 -58
  190. package/lib/cjs/Texture.js +82 -82
  191. package/lib/cjs/Texture.js.map +1 -1
  192. package/lib/cjs/TileStorage.d.ts +44 -18
  193. package/lib/cjs/TileStorage.d.ts.map +1 -1
  194. package/lib/cjs/TileStorage.js +109 -90
  195. package/lib/cjs/TileStorage.js.map +1 -1
  196. package/lib/cjs/TxnManager.d.ts +202 -202
  197. package/lib/cjs/TxnManager.d.ts.map +1 -1
  198. package/lib/cjs/TxnManager.js +356 -356
  199. package/lib/cjs/TxnManager.js.map +1 -1
  200. package/lib/cjs/ViewDefinition.d.ts +429 -439
  201. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  202. package/lib/cjs/ViewDefinition.js +640 -646
  203. package/lib/cjs/ViewDefinition.js.map +1 -1
  204. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  205. package/lib/cjs/ViewStateHydrator.js +103 -103
  206. package/lib/cjs/core-backend.d.ts +181 -184
  207. package/lib/cjs/core-backend.d.ts.map +1 -1
  208. package/lib/cjs/core-backend.js +205 -204
  209. package/lib/cjs/core-backend.js.map +1 -1
  210. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  211. package/lib/cjs/domains/FunctionalElements.js +145 -145
  212. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  213. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  214. package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -1
  215. package/lib/cjs/domains/FunctionalSchema.js +39 -40
  216. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  217. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  218. package/lib/cjs/domains/GenericElements.js +263 -263
  219. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  220. package/lib/cjs/domains/GenericSchema.js +28 -28
  221. package/lib/cjs/rpc/multipart.d.ts +11 -11
  222. package/lib/cjs/rpc/multipart.js +71 -71
  223. package/lib/cjs/rpc/tracing.d.ts +28 -28
  224. package/lib/cjs/rpc/tracing.js +73 -74
  225. package/lib/cjs/rpc/tracing.js.map +1 -1
  226. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  227. package/lib/cjs/rpc/web/logging.js +43 -43
  228. package/lib/cjs/rpc/web/request.d.ts +6 -6
  229. package/lib/cjs/rpc/web/request.js +73 -74
  230. package/lib/cjs/rpc/web/request.js.map +1 -1
  231. package/lib/cjs/rpc/web/response.d.ts +6 -6
  232. package/lib/cjs/rpc/web/response.js +105 -106
  233. package/lib/cjs/rpc/web/response.js.map +1 -1
  234. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  235. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  236. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  237. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +293 -294
  238. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  239. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +20 -22
  240. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  241. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +193 -205
  242. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  243. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  244. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +166 -168
  245. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  246. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  247. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +42 -43
  248. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  249. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  250. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  251. package/lib/cjs/workspace/Settings.d.ts +186 -186
  252. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  253. package/lib/cjs/workspace/Settings.js +155 -155
  254. package/lib/cjs/workspace/Settings.js.map +1 -1
  255. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  256. package/lib/cjs/workspace/SettingsSchemas.js +190 -191
  257. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  258. package/lib/cjs/workspace/Workspace.d.ts +411 -414
  259. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  260. package/lib/cjs/workspace/Workspace.js +521 -543
  261. package/lib/cjs/workspace/Workspace.js.map +1 -1
  262. package/package.json +25 -28
  263. package/lib/cjs/AliCloudStorageService.d.ts +0 -24
  264. package/lib/cjs/AliCloudStorageService.d.ts.map +0 -1
  265. package/lib/cjs/AliCloudStorageService.js +0 -72
  266. package/lib/cjs/AliCloudStorageService.js.map +0 -1
  267. package/lib/cjs/CloudStorageBackend.d.ts +0 -59
  268. package/lib/cjs/CloudStorageBackend.d.ts.map +0 -1
  269. package/lib/cjs/CloudStorageBackend.js +0 -174
  270. package/lib/cjs/CloudStorageBackend.js.map +0 -1
@@ -1,417 +1,414 @@
1
- /** @packageDocumentation
2
- * @module Relationships
3
- */
4
- import { Id64String } from "@itwin/core-bentley";
5
- import { EntityReferenceSet, RelationshipProps, SourceAndTarget } from "@itwin/core-common";
6
- import { Entity } from "./Entity";
7
- import { IModelDb } from "./IModelDb";
8
- export type { SourceAndTarget, RelationshipProps } from "@itwin/core-common";
9
- /** Base class for all link table ECRelationships
10
- * @public
11
- */
12
- export declare class Relationship extends Entity {
13
- /** @internal */
14
- static get className(): string;
15
- readonly sourceId: Id64String;
16
- readonly targetId: Id64String;
17
- /** @internal */
18
- constructor(props: RelationshipProps, iModel: IModelDb);
19
- /** @internal */
20
- toJSON(): RelationshipProps;
21
- /**
22
- * Callback invoked by saveChanges on an ElementDrivesElement relationship when its input has changed or is the output of some upstream relationship whose input has changed.
23
- * This callback is invoked after the input element has been processed by upstream relationships.
24
- * A subclass of ElementDrivesElement can re-implement this static method to take some action. onRootChanged may modify the output element only.
25
- * @param _props The ElementDrivesElement relationship instance.
26
- * @param _iModel The iModel
27
- */
28
- static onRootChanged(_props: RelationshipProps, _iModel: IModelDb): void;
29
- /**
30
- * Callback invoked by saveChanges on an ElementDrivesElement relationship when the relationship instance has been deleted.
31
- * A subclass of ElementDrivesElement can re-implement this static method to take some action.
32
- * @param _props The deleted ElementDrivesElement relationship instance.
33
- * @param _iModel The iModel
34
- */
35
- static onDeletedDependency(_props: RelationshipProps, _iModel: IModelDb): void;
36
- /** Insert this Relationship into the iModel. */
37
- insert(): Id64String;
38
- /** Update this Relationship in the iModel. */
39
- update(): void;
40
- /** Delete this Relationship from the iModel. */
41
- delete(): void;
42
- static getInstance<T extends Relationship>(iModel: IModelDb, criteria: Id64String | SourceAndTarget): T;
43
- }
44
- /** A Relationship where one Element refers to another Element
45
- * @public
46
- */
47
- export declare class ElementRefersToElements extends Relationship {
48
- /** @internal */
49
- static get className(): string;
50
- /** Create an instance of the Relationship.
51
- * @param iModel The iModel that will contain the relationship
52
- * @param sourceId The sourceId of the relationship, that is, the driver element
53
- * @param targetId The targetId of the relationship, that is, the driven element
54
- * @return an instance of the specified class.
55
- */
56
- static create<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String): T;
57
- /** Insert a new instance of the Relationship.
58
- * @param iModel The iModel that will contain the relationship
59
- * @param sourceId The sourceId of the relationship, that is, the driver element
60
- * @param targetId The targetId of the relationship, that is, the driven element
61
- * @return The Id of the inserted Relationship.
62
- */
63
- static insert<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String): Id64String;
64
- /** @internal */
65
- protected collectReferenceConcreteIds(referenceIds: EntityReferenceSet): void;
66
- }
67
- /** Relates a [[DrawingGraphic]] to the [[Element]] that it represents
68
- * @public
69
- */
70
- export declare class DrawingGraphicRepresentsElement extends ElementRefersToElements {
71
- /** @internal */
72
- static get className(): string;
73
- }
74
- /** Relates a [[GraphicalElement3d]] to the [[Element]] that it represents
75
- * @public
76
- */
77
- export declare class GraphicalElement3dRepresentsElement extends ElementRefersToElements {
78
- /** @internal */
79
- static get className(): string;
80
- }
81
- /** Relates a [[SynchronizationConfigLink]] to N [[ExternalSource]] instances.
82
- * Each relationship instance represents an external source processed by the synchronization configuration.
83
- * @note The associated ECClass was added to the BisCore schema in version 1.0.13
84
- * @beta
85
- */
86
- export declare class SynchronizationConfigProcessesSources extends ElementRefersToElements {
87
- /** @internal */
88
- static get className(): string;
89
- }
90
- /** Relates a [[SynchronizationConfigLink]] to *root* [[ExternalSource]] instances.
91
- * @note The associated ECClass was added to the BisCore schema in version 1.0.13
92
- * @beta
93
- */
94
- export declare class SynchronizationConfigSpecifiesRootSources extends SynchronizationConfigProcessesSources {
95
- /** @internal */
96
- static get className(): string;
97
- }
98
- /** Properties that are common to all types of link table ECRelationships
99
- * @public
100
- */
101
- export interface ElementGroupsMembersProps extends RelationshipProps {
102
- memberPriority: number;
103
- }
104
- /** An ElementRefersToElements relationship where one Element *groups* a set of other Elements.
105
- * @public
106
- */
107
- export declare class ElementGroupsMembers extends ElementRefersToElements {
108
- /** @internal */
109
- static get className(): string;
110
- memberPriority: number;
111
- constructor(props: ElementGroupsMembersProps, iModel: IModelDb);
112
- static create<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String, memberPriority?: number): T;
113
- }
114
- /** Relates a [[DefinitionGroup]] to its [[DefinitionElement]] members.
115
- * @note The associated ECClass was added to the BisCore schema in version 1.0.10
116
- * @public
117
- */
118
- export declare class DefinitionGroupGroupsDefinitions extends ElementGroupsMembers {
119
- /** @internal */
120
- static get className(): string;
121
- }
122
- /** Represents group membership where the group Element (and its properties) impart information about the member Elements above mere membership.
123
- * Implies that properties of the group should be considered as properties of its members.
124
- * @note The associated ECClass was added to the BisCore schema in version 1.0.11
125
- * @public
126
- */
127
- export declare class GroupImpartsToMembers extends ElementGroupsMembers {
128
- /** @internal */
129
- static get className(): string;
130
- }
131
- /** Relates an [[ExternalSourceGroup]] to its [[ExternalSource]] members.
132
- * @note The associated ECClass was added to the BisCore schema in version 1.0.13
133
- * @beta
134
- */
135
- export declare class ExternalSourceGroupGroupsSources extends ElementGroupsMembers {
136
- /** @internal */
137
- static get className(): string;
138
- }
139
- /** Properties that are common to all types of ElementDrivesElements
140
- * @beta
141
- */
142
- export interface ElementDrivesElementProps extends RelationshipProps {
143
- status: number;
144
- priority: number;
145
- }
146
- /** A Relationship indicating that one Element *drives* another Element.
147
- * An ElementDrivesElement relationship defines a one-way "driving" relationship from the source to the target.
148
- * When the source of an ElementDrivesElement relationship changes, the ElementDrivesElement itself can get a callback, and both the source and target elements can get callbacks.
149
- * By inserting ElementDrivesElement relationships, an app can create and store an acyclic directed graph of dependencies between elements.
150
- *
151
- * # Defining dependencies
152
- * Create an ElementDrivesElement relationship to specify that the source element drives the target element.
153
- * For example, to specify that element e1 drives element e2, create a relationship between them like this:
154
- * ```ts
155
- * const ede = ElementDrivesElement.create(iModel, e1id, e2id);
156
- * ede.insert();
157
- * ```
158
- * This creates a persistent relationship. The fact that e1 drives e2 is persisted in the iModel.
159
- *
160
- * # Defining dependency graphs
161
- * When you create multiple ElementDrivesElement relationships, you create a network of dependencies. The target of one may be the source of another.
162
- * A change in the content of an DgnElement can therefore trigger changes to many downstream elements.
163
- *
164
- * For example, to make element e1 drive element e2 and e2 drive another element, e3, create two relationships like this:
165
- * ```ts
166
- * const ede12 = ElementDrivesElement.create(iModel, e1id, e2id);
167
- * const ede23 = ElementDrivesElement.create(iModel, e2id, e3id);
168
- * ede12.insert();
169
- * ede23.insert();
170
- * ```
171
- * Those two relationships create this graph:
172
- * ```
173
- * e1 --> e2 --> e3
174
- * ```
175
- * Where the "-->" is meant to represent a driving relationship.
176
- *
177
- * The order in which you create the relationships does not matter.
178
- * The graph indicates that e3 depends on e2 and e2 depends on e1.
179
- *
180
- * An ElementDrivesElement relationship is between one source element and one target element.
181
- * Many ElementDrivesElement relationships can point to a given element, and many can point out of it.
182
- * Thus, you can define many:many relationships.
183
- * For example:
184
- * ```ts
185
- * const ede12 = ElementDrivesElement.create(iModel, e1id, e2id);
186
- * const ede112 = ElementDrivesElement.create(iModel, e11id, e2id);
187
- * const ede23 = ElementDrivesElement.create(iModel, e2id, e3id);
188
- * const ede231 = ElementDrivesElement.create(iModel, e2id, e31id);
189
- * ede12.insert();
190
- * ede112.insert();
191
- * ede23.insert();
192
- * ede231.insert();
193
- * ```
194
- * Creates this graph:
195
- * ```
196
- * e1 e3
197
- * \ /
198
- * e2
199
- * / \
200
- * e11 e31
201
- * ```
202
- * e2 depends on both e1 and e11. e2 then drives e3 and e31.
203
- *
204
- * In an ElementDrivesElement dependency graph, the relationships are the "edges" and the Elements are the "nodes".
205
- * The following terms are used when referring to the elements (nodes) in a dependency graph:
206
- * * Inputs - The sources of all edges that point to the element. This includes all upstream elements that flow into the element.
207
- * * Outputs - The targets of all edges that point out of the element. This includes all downstream elements.
208
- *
209
- * # Subgraph Processing
210
- * When changes are made, only the part of the overall graph that is affected will be processed. So, for example,
211
- * suppose we have this graph:
212
- * ```
213
- * e1 --> e2 --> e3
214
- * ```
215
- * If e1 changes, then the subgraph to be processed is equal to the full graph, as shown.
216
- *
217
- * If only e2 changes, then the subgraph to be processed is just:
218
- * ```
219
- * e2 --> e3
220
- * ```
221
- * If only e3 changes, then the subgraph consists of e3 by itself.
222
- *
223
- * Returning to the second example above, suppose we have this graph:
224
- * ```
225
- * e1 e3
226
- * \ /
227
- * e2
228
- * / \
229
- * e11 e31
230
- * ```
231
- * If e1 is changed, the affected subgraph is:
232
- * ```
233
- * e1 e3
234
- * \ /
235
- * e2
236
- * \
237
- * e31
238
- * ```
239
- * If e2 is changed, the affected subgraph is:
240
- * ```
241
- * e3
242
- * /
243
- * e2
244
- * \
245
- * e31
246
- * ```
247
- * # Callbacks
248
- * Once the affected subgraph to process is found, it propagates changes through it by making callbacks.
249
- * Classes for both elements (nodes) and ElementDrivesElements relationships (edges) can receive callbacks.
250
- *
251
- * ## ElementDrivesElement Callbacks
252
- * The following callbacks are invoked on ElementDrivesElement relationship classes (edges):
253
- * * onRootChanged
254
- * * onDeletedDependency
255
- *
256
- * Note that these are static methods. Their default implementations do nothing.
257
- * To receive and act on these callbacks, a domain should define a subclass of ElementDrivesElement and use that to create relationships.
258
- * The subclass should then implement the callbacks that it would like to act on.
259
- *
260
- * A ElementDrivesElement subclass callback is expected to make changes to the output element only!
261
- *
262
- * ## Element Callbacks
263
- * The following callbacks are invoked on Element classes (nodes):
264
- * * Element.onBeforeOutputsHandled
265
- * * Element.onAllInputsHandled
266
- *
267
- * ## Order
268
- * Callbacks are invoked by BriefcaseDb.saveChanges.
269
- * They are invoked in dependency (topological) order: driving elements first, then driven elements.
270
- *
271
- * Each callback is invoked only once. No matter how many times a given element was changed during the transaction,
272
- * a callback such as ElementDrivesElement.onRootChanged will be invoked only once.
273
- * In the same way, no matter how many of its inputs were changed, a callback such as Element.onAllInputsHandled will be
274
- * invoked only once.
275
- *
276
- * For example, suppose we have a graph:
277
- * ```
278
- * e1 --> e2 --> e3
279
- * ```
280
- *
281
- * Suppose that e1 is directly modified. No callbacks are made at that time.
282
- * Later, when BriefcaseDb.saveChanges is called, the following callbacks are made, in order:
283
- * 1. Element.onBeforeOutputsHandled e1
284
- * 1. ElementDrivesElement.onRootChanged e1->e2
285
- * 1. Element.onAllInputsHandled e2
286
- * 1. ElementDrivesElement.onRootChanged e2->e3
287
- * 1. Element.onAllInputsHandled e3
288
- *
289
- * Suppose that e3 is modified directly and BriefcaseDb.saveChanges is called.
290
- * Since no input to a relationship was changed, the sub-graph will be empty, and no callbacks will be made.
291
- *
292
- * Returning to the second example above, suppose we have this graph:
293
- * ```
294
- * e1 e3
295
- * \ /
296
- * e2
297
- * / \
298
- * e11 e31
299
- * ```
300
- * If e1 is changed and BriefcaseDb.saveChanges is called, the subgraph is:
301
- * ```
302
- * e1 e3
303
- * \ /
304
- * e2
305
- * \
306
- * e31
307
- * ```
308
- * The callbacks are:
309
- * 1. Element.onBeforeOutputsHandled e1
310
- * 1. ElementDrivesElement.onRootChanged e1->e2
311
- * 1. Element.onAllInputsHandled e2
312
- * 1. ElementDrivesElement.onRootChanged e2->e3
313
- * 1. Element.onAllInputsHandled e3
314
- * 1. ElementDrivesElement.onRootChanged e2->e31
315
- * 1. Element.onAllInputsHandled e31
316
- *
317
- * (The ElementDrivesElement.)
318
- *
319
- * #Errors
320
- * Circular dependencies are not permitted. If a cycle is detected, that is treated as a fatal error. All ElementDrivesElement relationships
321
- * involved in a cycle will have their status set to 1, indicating a failure.
322
- *
323
- * A callback may call txnManager.reportError to reject an invalid change. It can classify the error as fatal or just a warning.
324
- * A callback make set the status value of an ElementDrivesElement instance to 1 to indicate a processing failure in that edge.
325
- *
326
- * After BriefcaseDb.saveChanges is called, an app should check db.txns.validationErrors and db.txns.hasFatalError to find out if graph-evaluation failed.
327
- *
328
- * @beta
329
- */
330
- export declare class ElementDrivesElement extends Relationship {
331
- /** @internal */
332
- static get className(): string;
333
- /** Relationship status
334
- * * 0 indicates no errors. Set after a successful evaluation.
335
- * * 1 indicates that this driving relationship could not be evaluated. The callback itself can set this to indicate that it failed to process the input changes. Also, it is set if the relationship is part of a circular dependency.
336
- * * 0x80 The app or callback can set this to indicate to not propagate changes through this relationship.
337
- */
338
- status: number;
339
- /** Affects the order in which relationships are processed in the case where two relationships have the same output. */
340
- priority: number;
341
- /** @internal */
342
- constructor(props: ElementDrivesElementProps, iModel: IModelDb);
343
- static create<T extends ElementDrivesElement>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String, priority?: number): T;
344
- toJSON(): ElementDrivesElementProps;
345
- /** @internal */
346
- protected collectReferenceConcreteIds(referenceIds: EntityReferenceSet): void;
347
- }
348
- /** The third (and last) possible link-table relationship base class in an iModel.
349
- * Has no external use, but is included for completeness of the [Entity.collectReferenceConcreteIds]($backend)
350
- * implementations for link-table relationships. Generating the types of the source and target automatically would require
351
- * coupling this package with ecschema-metadata which we do not want to do.
352
- * @internal
353
- */
354
- export declare class ModelSelectorRefersToModels extends Relationship {
355
- /** @internal */
356
- static get className(): string;
357
- /** @internal */
358
- protected collectReferenceConcreteIds(referenceIds: EntityReferenceSet): void;
359
- }
360
- /** Manages [[Relationship]]s.
361
- * @public
362
- */
363
- export declare class Relationships {
364
- private _iModel;
365
- /** @internal */
366
- constructor(iModel: IModelDb);
367
- /** Create a new instance of a Relationship.
368
- * @param props The properties of the new Relationship.
369
- * @throws [[IModelError]] if there is a problem creating the Relationship.
370
- */
371
- createInstance(props: RelationshipProps): Relationship;
372
- /** Check classFullName to ensure it is a link table relationship class. */
373
- private checkRelationshipClass;
374
- /** Insert a new relationship instance into the iModel. The relationship provided must be subclass of BisCore:ElementRefersToElements or BisCore:ElementDrivesElement.
375
- * @param props The properties of the new relationship.
376
- * @returns The Id of the newly inserted relationship.
377
- * @note The id property of the props object is set as a side effect of this function.
378
- */
379
- insertInstance(props: RelationshipProps): Id64String;
380
- /** Update the properties of an existing relationship instance in the iModel.
381
- * @param props the properties of the relationship instance to update. Any properties that are not present will be left unchanged.
382
- */
383
- updateInstance(props: RelationshipProps): void;
384
- /** Delete an Relationship instance from this iModel. */
385
- deleteInstance(props: RelationshipProps): void;
386
- /** Get the props of a Relationship instance
387
- * @param relClassFullName The full class name of the relationship in the form of "schema:class"
388
- * @param criteria Either the relationship instanceId or the source and target Ids
389
- * @throws [IModelError]($common) if the relationship is not found or cannot be loaded.
390
- * @see tryGetInstanceProps
391
- */
392
- getInstanceProps<T extends RelationshipProps>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T;
393
- /** Get the props of a Relationship instance
394
- * @param relClassFullName The full class name of the relationship in the form of "schema:class"
395
- * @param criteria Either the relationship instanceId or the source and target Ids
396
- * @returns The RelationshipProps or `undefined` if the relationship is not found.
397
- * @note Useful for cases when a relationship may or may not exist and throwing an `Error` would be overkill.
398
- * @see getInstanceProps
399
- */
400
- tryGetInstanceProps<T extends RelationshipProps>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T | undefined;
401
- /** Get a Relationship instance
402
- * @param relClassFullName The full class name of the relationship in the form of "schema:class"
403
- * @param criteria Either the relationship instanceId or the source and target Ids
404
- * @throws [IModelError]($common) if the relationship is not found or cannot be loaded.
405
- * @see tryGetInstance
406
- */
407
- getInstance<T extends Relationship>(relClassSqlName: string, criteria: Id64String | SourceAndTarget): T;
408
- /** Get a Relationship instance
409
- * @param relClassFullName The full class name of the relationship in the form of "schema:class"
410
- * @param criteria Either the relationship instanceId or the source and target Ids
411
- * @returns The relationship or `undefined` if the relationship is not found.
412
- * @note Useful for cases when a relationship may or may not exist and throwing an `Error` would be overkill.
413
- * @see getInstance
414
- */
415
- tryGetInstance<T extends Relationship>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T | undefined;
416
- }
1
+ /** @packageDocumentation
2
+ * @module Relationships
3
+ */
4
+ import { Id64String } from "@itwin/core-bentley";
5
+ import { EntityReferenceSet, RelationshipProps, SourceAndTarget } from "@itwin/core-common";
6
+ import { Entity } from "./Entity";
7
+ import { IModelDb } from "./IModelDb";
8
+ export type { SourceAndTarget, RelationshipProps } from "@itwin/core-common";
9
+ /** Base class for all link table ECRelationships
10
+ * @public
11
+ */
12
+ export declare class Relationship extends Entity {
13
+ /** @internal */
14
+ static get className(): string;
15
+ readonly sourceId: Id64String;
16
+ readonly targetId: Id64String;
17
+ /** @internal */
18
+ constructor(props: RelationshipProps, iModel: IModelDb);
19
+ /** @internal */
20
+ toJSON(): RelationshipProps;
21
+ /**
22
+ * Callback invoked by saveChanges on an ElementDrivesElement relationship when its input has changed or is the output of some upstream relationship whose input has changed.
23
+ * This callback is invoked after the input element has been processed by upstream relationships.
24
+ * A subclass of ElementDrivesElement can re-implement this static method to take some action. onRootChanged may modify the output element only.
25
+ * @param _props The ElementDrivesElement relationship instance.
26
+ * @param _iModel The iModel
27
+ */
28
+ static onRootChanged(_props: RelationshipProps, _iModel: IModelDb): void;
29
+ /**
30
+ * Callback invoked by saveChanges on an ElementDrivesElement relationship when the relationship instance has been deleted.
31
+ * A subclass of ElementDrivesElement can re-implement this static method to take some action.
32
+ * @param _props The deleted ElementDrivesElement relationship instance.
33
+ * @param _iModel The iModel
34
+ */
35
+ static onDeletedDependency(_props: RelationshipProps, _iModel: IModelDb): void;
36
+ /** Insert this Relationship into the iModel. */
37
+ insert(): Id64String;
38
+ /** Update this Relationship in the iModel. */
39
+ update(): void;
40
+ /** Delete this Relationship from the iModel. */
41
+ delete(): void;
42
+ static getInstance<T extends Relationship>(iModel: IModelDb, criteria: Id64String | SourceAndTarget): T;
43
+ }
44
+ /** A Relationship where one Element refers to another Element
45
+ * @public
46
+ */
47
+ export declare class ElementRefersToElements extends Relationship {
48
+ /** @internal */
49
+ static get className(): string;
50
+ /** Create an instance of the Relationship.
51
+ * @param iModel The iModel that will contain the relationship
52
+ * @param sourceId The sourceId of the relationship, that is, the driver element
53
+ * @param targetId The targetId of the relationship, that is, the driven element
54
+ * @return an instance of the specified class.
55
+ */
56
+ static create<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String): T;
57
+ /** Insert a new instance of the Relationship.
58
+ * @param iModel The iModel that will contain the relationship
59
+ * @param sourceId The sourceId of the relationship, that is, the driver element
60
+ * @param targetId The targetId of the relationship, that is, the driven element
61
+ * @return The Id of the inserted Relationship.
62
+ */
63
+ static insert<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String): Id64String;
64
+ protected collectReferenceIds(referenceIds: EntityReferenceSet): void;
65
+ }
66
+ /** Relates a [[DrawingGraphic]] to the [[Element]] that it represents
67
+ * @public
68
+ */
69
+ export declare class DrawingGraphicRepresentsElement extends ElementRefersToElements {
70
+ /** @internal */
71
+ static get className(): string;
72
+ }
73
+ /** Relates a [[GraphicalElement3d]] to the [[Element]] that it represents
74
+ * @public
75
+ */
76
+ export declare class GraphicalElement3dRepresentsElement extends ElementRefersToElements {
77
+ /** @internal */
78
+ static get className(): string;
79
+ }
80
+ /** Relates a [[SynchronizationConfigLink]] to N [[ExternalSource]] instances.
81
+ * Each relationship instance represents an external source processed by the synchronization configuration.
82
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.13
83
+ * @beta
84
+ */
85
+ export declare class SynchronizationConfigProcessesSources extends ElementRefersToElements {
86
+ /** @internal */
87
+ static get className(): string;
88
+ }
89
+ /** Relates a [[SynchronizationConfigLink]] to *root* [[ExternalSource]] instances.
90
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.13
91
+ * @beta
92
+ */
93
+ export declare class SynchronizationConfigSpecifiesRootSources extends SynchronizationConfigProcessesSources {
94
+ /** @internal */
95
+ static get className(): string;
96
+ }
97
+ /** Properties that are common to all types of link table ECRelationships
98
+ * @public
99
+ */
100
+ export interface ElementGroupsMembersProps extends RelationshipProps {
101
+ memberPriority: number;
102
+ }
103
+ /** An ElementRefersToElements relationship where one Element *groups* a set of other Elements.
104
+ * @public
105
+ */
106
+ export declare class ElementGroupsMembers extends ElementRefersToElements {
107
+ /** @internal */
108
+ static get className(): string;
109
+ memberPriority: number;
110
+ constructor(props: ElementGroupsMembersProps, iModel: IModelDb);
111
+ static create<T extends ElementRefersToElements>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String, memberPriority?: number): T;
112
+ }
113
+ /** Relates a [[DefinitionGroup]] to its [[DefinitionElement]] members.
114
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.10
115
+ * @public
116
+ */
117
+ export declare class DefinitionGroupGroupsDefinitions extends ElementGroupsMembers {
118
+ /** @internal */
119
+ static get className(): string;
120
+ }
121
+ /** Represents group membership where the group Element (and its properties) impart information about the member Elements above mere membership.
122
+ * Implies that properties of the group should be considered as properties of its members.
123
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.11
124
+ * @public
125
+ */
126
+ export declare class GroupImpartsToMembers extends ElementGroupsMembers {
127
+ /** @internal */
128
+ static get className(): string;
129
+ }
130
+ /** Relates an [[ExternalSourceGroup]] to its [[ExternalSource]] members.
131
+ * @note The associated ECClass was added to the BisCore schema in version 1.0.13
132
+ * @beta
133
+ */
134
+ export declare class ExternalSourceGroupGroupsSources extends ElementGroupsMembers {
135
+ /** @internal */
136
+ static get className(): string;
137
+ }
138
+ /** Properties that are common to all types of ElementDrivesElements
139
+ * @beta
140
+ */
141
+ export interface ElementDrivesElementProps extends RelationshipProps {
142
+ status: number;
143
+ priority: number;
144
+ }
145
+ /** A Relationship indicating that one Element *drives* another Element.
146
+ * An ElementDrivesElement relationship defines a one-way "driving" relationship from the source to the target.
147
+ * When the source of an ElementDrivesElement relationship changes, the ElementDrivesElement itself can get a callback, and both the source and target elements can get callbacks.
148
+ * By inserting ElementDrivesElement relationships, an app can create and store an acyclic directed graph of dependencies between elements.
149
+ *
150
+ * # Defining dependencies
151
+ * Create an ElementDrivesElement relationship to specify that the source element drives the target element.
152
+ * For example, to specify that element e1 drives element e2, create a relationship between them like this:
153
+ * ```ts
154
+ * const ede = ElementDrivesElement.create(iModel, e1id, e2id);
155
+ * ede.insert();
156
+ * ```
157
+ * This creates a persistent relationship. The fact that e1 drives e2 is persisted in the iModel.
158
+ *
159
+ * # Defining dependency graphs
160
+ * When you create multiple ElementDrivesElement relationships, you create a network of dependencies. The target of one may be the source of another.
161
+ * A change in the content of an DgnElement can therefore trigger changes to many downstream elements.
162
+ *
163
+ * For example, to make element e1 drive element e2 and e2 drive another element, e3, create two relationships like this:
164
+ * ```ts
165
+ * const ede12 = ElementDrivesElement.create(iModel, e1id, e2id);
166
+ * const ede23 = ElementDrivesElement.create(iModel, e2id, e3id);
167
+ * ede12.insert();
168
+ * ede23.insert();
169
+ * ```
170
+ * Those two relationships create this graph:
171
+ * ```
172
+ * e1 --> e2 --> e3
173
+ * ```
174
+ * Where the "-->" is meant to represent a driving relationship.
175
+ *
176
+ * The order in which you create the relationships does not matter.
177
+ * The graph indicates that e3 depends on e2 and e2 depends on e1.
178
+ *
179
+ * An ElementDrivesElement relationship is between one source element and one target element.
180
+ * Many ElementDrivesElement relationships can point to a given element, and many can point out of it.
181
+ * Thus, you can define many:many relationships.
182
+ * For example:
183
+ * ```ts
184
+ * const ede12 = ElementDrivesElement.create(iModel, e1id, e2id);
185
+ * const ede112 = ElementDrivesElement.create(iModel, e11id, e2id);
186
+ * const ede23 = ElementDrivesElement.create(iModel, e2id, e3id);
187
+ * const ede231 = ElementDrivesElement.create(iModel, e2id, e31id);
188
+ * ede12.insert();
189
+ * ede112.insert();
190
+ * ede23.insert();
191
+ * ede231.insert();
192
+ * ```
193
+ * Creates this graph:
194
+ * ```
195
+ * e1 e3
196
+ * \ /
197
+ * e2
198
+ * / \
199
+ * e11 e31
200
+ * ```
201
+ * e2 depends on both e1 and e11. e2 then drives e3 and e31.
202
+ *
203
+ * In an ElementDrivesElement dependency graph, the relationships are the "edges" and the Elements are the "nodes".
204
+ * The following terms are used when referring to the elements (nodes) in a dependency graph:
205
+ * * Inputs - The sources of all edges that point to the element. This includes all upstream elements that flow into the element.
206
+ * * Outputs - The targets of all edges that point out of the element. This includes all downstream elements.
207
+ *
208
+ * # Subgraph Processing
209
+ * When changes are made, only the part of the overall graph that is affected will be processed. So, for example,
210
+ * suppose we have this graph:
211
+ * ```
212
+ * e1 --> e2 --> e3
213
+ * ```
214
+ * If e1 changes, then the subgraph to be processed is equal to the full graph, as shown.
215
+ *
216
+ * If only e2 changes, then the subgraph to be processed is just:
217
+ * ```
218
+ * e2 --> e3
219
+ * ```
220
+ * If only e3 changes, then the subgraph consists of e3 by itself.
221
+ *
222
+ * Returning to the second example above, suppose we have this graph:
223
+ * ```
224
+ * e1 e3
225
+ * \ /
226
+ * e2
227
+ * / \
228
+ * e11 e31
229
+ * ```
230
+ * If e1 is changed, the affected subgraph is:
231
+ * ```
232
+ * e1 e3
233
+ * \ /
234
+ * e2
235
+ * \
236
+ * e31
237
+ * ```
238
+ * If e2 is changed, the affected subgraph is:
239
+ * ```
240
+ * e3
241
+ * /
242
+ * e2
243
+ * \
244
+ * e31
245
+ * ```
246
+ * # Callbacks
247
+ * Once the affected subgraph to process is found, it propagates changes through it by making callbacks.
248
+ * Classes for both elements (nodes) and ElementDrivesElements relationships (edges) can receive callbacks.
249
+ *
250
+ * ## ElementDrivesElement Callbacks
251
+ * The following callbacks are invoked on ElementDrivesElement relationship classes (edges):
252
+ * * onRootChanged
253
+ * * onDeletedDependency
254
+ *
255
+ * Note that these are static methods. Their default implementations do nothing.
256
+ * To receive and act on these callbacks, a domain should define a subclass of ElementDrivesElement and use that to create relationships.
257
+ * The subclass should then implement the callbacks that it would like to act on.
258
+ *
259
+ * A ElementDrivesElement subclass callback is expected to make changes to the output element only!
260
+ *
261
+ * ## Element Callbacks
262
+ * The following callbacks are invoked on Element classes (nodes):
263
+ * * Element.onBeforeOutputsHandled
264
+ * * Element.onAllInputsHandled
265
+ *
266
+ * ## Order
267
+ * Callbacks are invoked by BriefcaseDb.saveChanges.
268
+ * They are invoked in dependency (topological) order: driving elements first, then driven elements.
269
+ *
270
+ * Each callback is invoked only once. No matter how many times a given element was changed during the transaction,
271
+ * a callback such as ElementDrivesElement.onRootChanged will be invoked only once.
272
+ * In the same way, no matter how many of its inputs were changed, a callback such as Element.onAllInputsHandled will be
273
+ * invoked only once.
274
+ *
275
+ * For example, suppose we have a graph:
276
+ * ```
277
+ * e1 --> e2 --> e3
278
+ * ```
279
+ *
280
+ * Suppose that e1 is directly modified. No callbacks are made at that time.
281
+ * Later, when BriefcaseDb.saveChanges is called, the following callbacks are made, in order:
282
+ * 1. Element.onBeforeOutputsHandled e1
283
+ * 1. ElementDrivesElement.onRootChanged e1->e2
284
+ * 1. Element.onAllInputsHandled e2
285
+ * 1. ElementDrivesElement.onRootChanged e2->e3
286
+ * 1. Element.onAllInputsHandled e3
287
+ *
288
+ * Suppose that e3 is modified directly and BriefcaseDb.saveChanges is called.
289
+ * Since no input to a relationship was changed, the sub-graph will be empty, and no callbacks will be made.
290
+ *
291
+ * Returning to the second example above, suppose we have this graph:
292
+ * ```
293
+ * e1 e3
294
+ * \ /
295
+ * e2
296
+ * / \
297
+ * e11 e31
298
+ * ```
299
+ * If e1 is changed and BriefcaseDb.saveChanges is called, the subgraph is:
300
+ * ```
301
+ * e1 e3
302
+ * \ /
303
+ * e2
304
+ * \
305
+ * e31
306
+ * ```
307
+ * The callbacks are:
308
+ * 1. Element.onBeforeOutputsHandled e1
309
+ * 1. ElementDrivesElement.onRootChanged e1->e2
310
+ * 1. Element.onAllInputsHandled e2
311
+ * 1. ElementDrivesElement.onRootChanged e2->e3
312
+ * 1. Element.onAllInputsHandled e3
313
+ * 1. ElementDrivesElement.onRootChanged e2->e31
314
+ * 1. Element.onAllInputsHandled e31
315
+ *
316
+ * (The ElementDrivesElement.)
317
+ *
318
+ * #Errors
319
+ * Circular dependencies are not permitted. If a cycle is detected, that is treated as a fatal error. All ElementDrivesElement relationships
320
+ * involved in a cycle will have their status set to 1, indicating a failure.
321
+ *
322
+ * A callback may call txnManager.reportError to reject an invalid change. It can classify the error as fatal or just a warning.
323
+ * A callback make set the status value of an ElementDrivesElement instance to 1 to indicate a processing failure in that edge.
324
+ *
325
+ * After BriefcaseDb.saveChanges is called, an app should check db.txns.validationErrors and db.txns.hasFatalError to find out if graph-evaluation failed.
326
+ *
327
+ * @beta
328
+ */
329
+ export declare class ElementDrivesElement extends Relationship {
330
+ /** @internal */
331
+ static get className(): string;
332
+ /** Relationship status
333
+ * * 0 indicates no errors. Set after a successful evaluation.
334
+ * * 1 indicates that this driving relationship could not be evaluated. The callback itself can set this to indicate that it failed to process the input changes. Also, it is set if the relationship is part of a circular dependency.
335
+ * * 0x80 The app or callback can set this to indicate to not propagate changes through this relationship.
336
+ */
337
+ status: number;
338
+ /** Affects the order in which relationships are processed in the case where two relationships have the same output. */
339
+ priority: number;
340
+ /** @internal */
341
+ constructor(props: ElementDrivesElementProps, iModel: IModelDb);
342
+ static create<T extends ElementDrivesElement>(iModel: IModelDb, sourceId: Id64String, targetId: Id64String, priority?: number): T;
343
+ toJSON(): ElementDrivesElementProps;
344
+ protected collectReferenceIds(referenceIds: EntityReferenceSet): void;
345
+ }
346
+ /** The third (and last) possible link-table relationship base class in an iModel.
347
+ * Has no external use, but is included for completeness of the [Entity.collectReferenceIds]($backend)
348
+ * implementations for link-table relationships. Generating the types of the source and target automatically would require
349
+ * coupling this package with ecschema-metadata which we do not want to do.
350
+ * @internal
351
+ */
352
+ export declare class ModelSelectorRefersToModels extends Relationship {
353
+ /** @internal */
354
+ static get className(): string;
355
+ protected collectReferenceIds(referenceIds: EntityReferenceSet): void;
356
+ }
357
+ /** Manages [[Relationship]]s.
358
+ * @public
359
+ */
360
+ export declare class Relationships {
361
+ private _iModel;
362
+ /** @internal */
363
+ constructor(iModel: IModelDb);
364
+ /** Create a new instance of a Relationship.
365
+ * @param props The properties of the new Relationship.
366
+ * @throws [[IModelError]] if there is a problem creating the Relationship.
367
+ */
368
+ createInstance(props: RelationshipProps): Relationship;
369
+ /** Check classFullName to ensure it is a link table relationship class. */
370
+ private checkRelationshipClass;
371
+ /** Insert a new relationship instance into the iModel. The relationship provided must be subclass of BisCore:ElementRefersToElements or BisCore:ElementDrivesElement.
372
+ * @param props The properties of the new relationship.
373
+ * @returns The Id of the newly inserted relationship.
374
+ * @note The id property of the props object is set as a side effect of this function.
375
+ */
376
+ insertInstance(props: RelationshipProps): Id64String;
377
+ /** Update the properties of an existing relationship instance in the iModel.
378
+ * @param props the properties of the relationship instance to update. Any properties that are not present will be left unchanged.
379
+ */
380
+ updateInstance(props: RelationshipProps): void;
381
+ /** Delete an Relationship instance from this iModel. */
382
+ deleteInstance(props: RelationshipProps): void;
383
+ /** Get the props of a Relationship instance
384
+ * @param relClassFullName The full class name of the relationship in the form of "schema:class"
385
+ * @param criteria Either the relationship instanceId or the source and target Ids
386
+ * @throws [IModelError]($common) if the relationship is not found or cannot be loaded.
387
+ * @see tryGetInstanceProps
388
+ */
389
+ getInstanceProps<T extends RelationshipProps>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T;
390
+ /** Get the props of a Relationship instance
391
+ * @param relClassFullName The full class name of the relationship in the form of "schema:class"
392
+ * @param criteria Either the relationship instanceId or the source and target Ids
393
+ * @returns The RelationshipProps or `undefined` if the relationship is not found.
394
+ * @note Useful for cases when a relationship may or may not exist and throwing an `Error` would be overkill.
395
+ * @see getInstanceProps
396
+ */
397
+ tryGetInstanceProps<T extends RelationshipProps>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T | undefined;
398
+ /** Get a Relationship instance
399
+ * @param relClassFullName The full class name of the relationship in the form of "schema:class"
400
+ * @param criteria Either the relationship instanceId or the source and target Ids
401
+ * @throws [IModelError]($common) if the relationship is not found or cannot be loaded.
402
+ * @see tryGetInstance
403
+ */
404
+ getInstance<T extends Relationship>(relClassSqlName: string, criteria: Id64String | SourceAndTarget): T;
405
+ /** Get a Relationship instance
406
+ * @param relClassFullName The full class name of the relationship in the form of "schema:class"
407
+ * @param criteria Either the relationship instanceId or the source and target Ids
408
+ * @returns The relationship or `undefined` if the relationship is not found.
409
+ * @note Useful for cases when a relationship may or may not exist and throwing an `Error` would be overkill.
410
+ * @see getInstance
411
+ */
412
+ tryGetInstance<T extends Relationship>(relClassFullName: string, criteria: Id64String | SourceAndTarget): T | undefined;
413
+ }
417
414
  //# sourceMappingURL=Relationship.d.ts.map