@itwin/core-backend 3.6.0-dev.11 → 3.6.0-dev.21

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 (245) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/AliCloudStorageService.d.ts +23 -23
  3. package/lib/cjs/AliCloudStorageService.js +71 -71
  4. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  5. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  6. package/lib/cjs/BackendHubAccess.js +41 -41
  7. package/lib/cjs/BackendHubAccess.js.map +1 -1
  8. package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
  9. package/lib/cjs/BackendLoggerCategory.js +99 -99
  10. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  11. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  12. package/lib/cjs/BisCoreSchema.js +60 -60
  13. package/lib/cjs/BisCoreSchema.js.map +1 -1
  14. package/lib/cjs/BriefcaseManager.d.ts +170 -170
  15. package/lib/cjs/BriefcaseManager.js +413 -413
  16. package/lib/cjs/BriefcaseManager.js.map +1 -1
  17. package/lib/cjs/Category.d.ts +153 -153
  18. package/lib/cjs/Category.js +243 -243
  19. package/lib/cjs/Category.js.map +1 -1
  20. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  21. package/lib/cjs/ChangeSummaryManager.js +447 -447
  22. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  23. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  24. package/lib/cjs/ChangedElementsDb.js +165 -165
  25. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  26. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  27. package/lib/cjs/ChangedElementsManager.js +88 -88
  28. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  29. package/lib/cjs/CheckpointManager.d.ts +122 -120
  30. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  31. package/lib/cjs/CheckpointManager.js +343 -343
  32. package/lib/cjs/CheckpointManager.js.map +1 -1
  33. package/lib/cjs/ClassRegistry.d.ts +79 -79
  34. package/lib/cjs/ClassRegistry.js +249 -249
  35. package/lib/cjs/ClassRegistry.js.map +1 -1
  36. package/lib/cjs/CloudSqlite.d.ts +350 -350
  37. package/lib/cjs/CloudSqlite.js +152 -152
  38. package/lib/cjs/CloudSqlite.js.map +1 -1
  39. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  40. package/lib/cjs/CloudStorageBackend.js +173 -173
  41. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  42. package/lib/cjs/CodeService.d.ts +396 -396
  43. package/lib/cjs/CodeService.js +63 -63
  44. package/lib/cjs/CodeService.js.map +1 -1
  45. package/lib/cjs/CodeSpecs.d.ts +50 -50
  46. package/lib/cjs/CodeSpecs.js +112 -112
  47. package/lib/cjs/CodeSpecs.js.map +1 -1
  48. package/lib/cjs/ConcurrentQuery.d.ts +13 -13
  49. package/lib/cjs/ConcurrentQuery.js +36 -36
  50. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  51. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
  52. package/lib/cjs/CustomViewState3dCreator.js +81 -81
  53. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  54. package/lib/cjs/DevTools.d.ts +71 -71
  55. package/lib/cjs/DevTools.js +154 -154
  56. package/lib/cjs/DevTools.js.map +1 -1
  57. package/lib/cjs/DisplayStyle.d.ts +106 -106
  58. package/lib/cjs/DisplayStyle.js +256 -256
  59. package/lib/cjs/DisplayStyle.js.map +1 -1
  60. package/lib/cjs/ECDb.d.ts +191 -191
  61. package/lib/cjs/ECDb.js +350 -350
  62. package/lib/cjs/ECDb.js.map +1 -1
  63. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  64. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  65. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  66. package/lib/cjs/ECSqlStatement.d.ts +466 -466
  67. package/lib/cjs/ECSqlStatement.js +791 -791
  68. package/lib/cjs/ECSqlStatement.js.map +1 -1
  69. package/lib/cjs/Element.d.ts +1102 -1102
  70. package/lib/cjs/Element.js +1416 -1416
  71. package/lib/cjs/Element.js.map +1 -1
  72. package/lib/cjs/ElementAspect.d.ts +176 -176
  73. package/lib/cjs/ElementAspect.js +211 -211
  74. package/lib/cjs/ElementAspect.js.map +1 -1
  75. package/lib/cjs/ElementGraphics.d.ts +9 -9
  76. package/lib/cjs/ElementGraphics.js +41 -41
  77. package/lib/cjs/ElementGraphics.js.map +1 -1
  78. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  79. package/lib/cjs/ElementTreeWalker.js +409 -409
  80. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  81. package/lib/cjs/Entity.d.ts +106 -106
  82. package/lib/cjs/Entity.js +134 -134
  83. package/lib/cjs/Entity.js.map +1 -1
  84. package/lib/cjs/EntityReferences.d.ts +49 -49
  85. package/lib/cjs/EntityReferences.js +95 -95
  86. package/lib/cjs/EntityReferences.js.map +1 -1
  87. package/lib/cjs/ExportGraphics.d.ts +317 -317
  88. package/lib/cjs/ExportGraphics.js +208 -208
  89. package/lib/cjs/ExportGraphics.js.map +1 -1
  90. package/lib/cjs/ExternalSource.d.ts +96 -96
  91. package/lib/cjs/ExternalSource.js +131 -131
  92. package/lib/cjs/ExternalSource.js.map +1 -1
  93. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  94. package/lib/cjs/GeoCoordConfig.js +85 -85
  95. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  96. package/lib/cjs/GeometrySummary.d.ts +4 -4
  97. package/lib/cjs/GeometrySummary.js +380 -380
  98. package/lib/cjs/GeometrySummary.js.map +1 -1
  99. package/lib/cjs/HubMock.d.ts +94 -94
  100. package/lib/cjs/HubMock.js +222 -222
  101. package/lib/cjs/HubMock.js.map +1 -1
  102. package/lib/cjs/IModelCloneContext.d.ts +8 -8
  103. package/lib/cjs/IModelCloneContext.js +15 -15
  104. package/lib/cjs/IModelCloneContext.js.map +1 -1
  105. package/lib/cjs/IModelDb.d.ts +1183 -1183
  106. package/lib/cjs/IModelDb.js +2374 -2374
  107. package/lib/cjs/IModelDb.js.map +1 -1
  108. package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
  109. package/lib/cjs/IModelElementCloneContext.js +159 -159
  110. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  111. package/lib/cjs/IModelHost.d.ts +370 -370
  112. package/lib/cjs/IModelHost.js +496 -496
  113. package/lib/cjs/IModelHost.js.map +1 -1
  114. package/lib/cjs/IModelJsFs.d.ts +62 -62
  115. package/lib/cjs/IModelJsFs.js +140 -140
  116. package/lib/cjs/IModelJsFs.js.map +1 -1
  117. package/lib/cjs/IpcHost.d.ts +104 -104
  118. package/lib/cjs/IpcHost.js +278 -278
  119. package/lib/cjs/IpcHost.js.map +1 -1
  120. package/lib/cjs/LineStyle.d.ts +311 -311
  121. package/lib/cjs/LineStyle.js +295 -295
  122. package/lib/cjs/LineStyle.js.map +1 -1
  123. package/lib/cjs/LocalHub.d.ts +162 -162
  124. package/lib/cjs/LocalHub.js +587 -587
  125. package/lib/cjs/LocalHub.js.map +1 -1
  126. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  127. package/lib/cjs/LocalhostIpcHost.js +81 -81
  128. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  129. package/lib/cjs/Material.d.ts +103 -103
  130. package/lib/cjs/Material.js +147 -147
  131. package/lib/cjs/Material.js.map +1 -1
  132. package/lib/cjs/Model.d.ts +392 -392
  133. package/lib/cjs/Model.js +485 -485
  134. package/lib/cjs/Model.js.map +1 -1
  135. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  136. package/lib/cjs/NativeAppStorage.js +202 -202
  137. package/lib/cjs/NativeAppStorage.js.map +1 -1
  138. package/lib/cjs/NativeHost.d.ts +52 -52
  139. package/lib/cjs/NativeHost.js +163 -163
  140. package/lib/cjs/NativeHost.js.map +1 -1
  141. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  142. package/lib/cjs/NavigationRelationship.js +225 -225
  143. package/lib/cjs/NavigationRelationship.js.map +1 -1
  144. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  145. package/lib/cjs/PromiseMemoizer.js +101 -101
  146. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  147. package/lib/cjs/PropertyStore.d.ts +132 -132
  148. package/lib/cjs/PropertyStore.js +11 -11
  149. package/lib/cjs/PropertyStore.js.map +1 -1
  150. package/lib/cjs/Relationship.d.ts +416 -416
  151. package/lib/cjs/Relationship.js +494 -494
  152. package/lib/cjs/Relationship.js.map +1 -1
  153. package/lib/cjs/RpcBackend.d.ts +5 -5
  154. package/lib/cjs/RpcBackend.js +31 -31
  155. package/lib/cjs/RpcBackend.js.map +1 -1
  156. package/lib/cjs/SQLiteDb.d.ts +219 -219
  157. package/lib/cjs/SQLiteDb.js +214 -214
  158. package/lib/cjs/SQLiteDb.js.map +1 -1
  159. package/lib/cjs/Schema.d.ts +55 -55
  160. package/lib/cjs/Schema.js +83 -83
  161. package/lib/cjs/Schema.js.map +1 -1
  162. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  163. package/lib/cjs/ServerBasedLocks.js +168 -168
  164. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  165. package/lib/cjs/SqliteStatement.d.ts +360 -360
  166. package/lib/cjs/SqliteStatement.js +586 -586
  167. package/lib/cjs/SqliteStatement.js.map +1 -1
  168. package/lib/cjs/Texture.d.ts +58 -58
  169. package/lib/cjs/Texture.js +82 -82
  170. package/lib/cjs/Texture.js.map +1 -1
  171. package/lib/cjs/TileStorage.d.ts +18 -18
  172. package/lib/cjs/TileStorage.js +90 -90
  173. package/lib/cjs/TileStorage.js.map +1 -1
  174. package/lib/cjs/TxnManager.d.ts +202 -202
  175. package/lib/cjs/TxnManager.js +356 -356
  176. package/lib/cjs/TxnManager.js.map +1 -1
  177. package/lib/cjs/ViewDefinition.d.ts +439 -439
  178. package/lib/cjs/ViewDefinition.js +646 -646
  179. package/lib/cjs/ViewDefinition.js.map +1 -1
  180. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  181. package/lib/cjs/ViewStateHydrator.js +103 -103
  182. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  183. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  184. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  185. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  186. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  187. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  188. package/lib/cjs/core-backend.d.ts +184 -184
  189. package/lib/cjs/core-backend.js +204 -204
  190. package/lib/cjs/core-backend.js.map +1 -1
  191. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  192. package/lib/cjs/domains/FunctionalElements.js +145 -145
  193. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  194. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  195. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  196. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  197. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  198. package/lib/cjs/domains/GenericElements.js +263 -263
  199. package/lib/cjs/domains/GenericElements.js.map +1 -1
  200. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  201. package/lib/cjs/domains/GenericSchema.js +28 -28
  202. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  203. package/lib/cjs/rpc/multipart.d.ts +11 -11
  204. package/lib/cjs/rpc/multipart.js +70 -70
  205. package/lib/cjs/rpc/multipart.js.map +1 -1
  206. package/lib/cjs/rpc/tracing.d.ts +28 -28
  207. package/lib/cjs/rpc/tracing.js +73 -73
  208. package/lib/cjs/rpc/tracing.js.map +1 -1
  209. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  210. package/lib/cjs/rpc/web/logging.js +42 -42
  211. package/lib/cjs/rpc/web/logging.js.map +1 -1
  212. package/lib/cjs/rpc/web/request.d.ts +6 -6
  213. package/lib/cjs/rpc/web/request.js +73 -73
  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 -105
  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/DevToolsRpcImpl.js.map +1 -1
  221. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  222. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +291 -291
  223. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  224. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  225. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +202 -202
  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 +168 -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 +43 -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/rpc-impl/WipRpcImpl.js.map +1 -1
  236. package/lib/cjs/workspace/Settings.d.ts +186 -186
  237. package/lib/cjs/workspace/Settings.js +155 -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 +191 -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 +543 -543
  244. package/lib/cjs/workspace/Workspace.js.map +1 -1
  245. package/package.json +12 -12
@@ -1,417 +1,417 @@
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
+ /** @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
+ }
417
417
  //# sourceMappingURL=Relationship.d.ts.map