@itwin/core-backend 5.1.0-dev.9 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (671) hide show
  1. package/CHANGELOG.md +160 -1
  2. package/lib/cjs/BackendHubAccess.d.ts +1 -1
  3. package/lib/cjs/BackendHubAccess.js +1 -1
  4. package/lib/cjs/BackendHubAccess.js.map +1 -1
  5. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  6. package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
  7. package/lib/cjs/BisCoreSchema.js +4 -2
  8. package/lib/cjs/BisCoreSchema.js.map +1 -1
  9. package/lib/cjs/BlobContainerService.js.map +1 -1
  10. package/lib/cjs/BriefcaseManager.d.ts +10 -2
  11. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  12. package/lib/cjs/BriefcaseManager.js +16 -0
  13. package/lib/cjs/BriefcaseManager.js.map +1 -1
  14. package/lib/cjs/CatalogDb.js.map +1 -1
  15. package/lib/cjs/Category.d.ts +4 -4
  16. package/lib/cjs/Category.js +4 -4
  17. package/lib/cjs/Category.js.map +1 -1
  18. package/lib/cjs/ChangeSummaryManager.js +2 -2
  19. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  20. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  21. package/lib/cjs/ChangesetECAdaptor.d.ts +67 -8
  22. package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
  23. package/lib/cjs/ChangesetECAdaptor.js +490 -275
  24. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  25. package/lib/cjs/ChannelControl.js.map +1 -1
  26. package/lib/cjs/CheckpointManager.js.map +1 -1
  27. package/lib/cjs/ClassRegistry.d.ts +9 -1
  28. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  29. package/lib/cjs/ClassRegistry.js +14 -6
  30. package/lib/cjs/ClassRegistry.js.map +1 -1
  31. package/lib/cjs/CloudSqlite.js +1 -1
  32. package/lib/cjs/CloudSqlite.js.map +1 -1
  33. package/lib/cjs/CodeService.js.map +1 -1
  34. package/lib/cjs/CodeSpecs.d.ts +1 -1
  35. package/lib/cjs/CodeSpecs.js +1 -1
  36. package/lib/cjs/CodeSpecs.js.map +1 -1
  37. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  38. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  39. package/lib/cjs/DevTools.js.map +1 -1
  40. package/lib/cjs/DisplayStyle.d.ts +4 -4
  41. package/lib/cjs/DisplayStyle.js +3 -3
  42. package/lib/cjs/DisplayStyle.js.map +1 -1
  43. package/lib/cjs/ECDb.d.ts +4 -4
  44. package/lib/cjs/ECDb.d.ts.map +1 -1
  45. package/lib/cjs/ECDb.js +4 -4
  46. package/lib/cjs/ECDb.js.map +1 -1
  47. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  48. package/lib/cjs/ECSqlStatement.d.ts +15 -6
  49. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  50. package/lib/cjs/ECSqlStatement.js +19 -4
  51. package/lib/cjs/ECSqlStatement.js.map +1 -1
  52. package/lib/cjs/Element.d.ts +54 -51
  53. package/lib/cjs/Element.d.ts.map +1 -1
  54. package/lib/cjs/Element.js +67 -52
  55. package/lib/cjs/Element.js.map +1 -1
  56. package/lib/cjs/ElementAspect.d.ts +8 -8
  57. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  58. package/lib/cjs/ElementAspect.js +8 -8
  59. package/lib/cjs/ElementAspect.js.map +1 -1
  60. package/lib/cjs/ElementGraphics.js.map +1 -1
  61. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  62. package/lib/cjs/Entity.d.ts +10 -7
  63. package/lib/cjs/Entity.d.ts.map +1 -1
  64. package/lib/cjs/Entity.js +35 -13
  65. package/lib/cjs/Entity.js.map +1 -1
  66. package/lib/cjs/EntityReferences.js.map +1 -1
  67. package/lib/cjs/ExportGraphics.d.ts +54 -8
  68. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  69. package/lib/cjs/ExportGraphics.js +158 -59
  70. package/lib/cjs/ExportGraphics.js.map +1 -1
  71. package/lib/cjs/ExternalSource.js.map +1 -1
  72. package/lib/cjs/FontFile.js.map +1 -1
  73. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  74. package/lib/cjs/GeographicCRSServices.d.ts +6 -2
  75. package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
  76. package/lib/cjs/GeographicCRSServices.js +1 -1
  77. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  78. package/lib/cjs/GeometrySummary.js +47 -47
  79. package/lib/cjs/GeometrySummary.js.map +1 -1
  80. package/lib/cjs/IModelDb.d.ts +37 -26
  81. package/lib/cjs/IModelDb.d.ts.map +1 -1
  82. package/lib/cjs/IModelDb.js +132 -55
  83. package/lib/cjs/IModelDb.js.map +1 -1
  84. package/lib/cjs/IModelDbFonts.js.map +1 -1
  85. package/lib/cjs/IModelElementCloneContext.d.ts +1 -1
  86. package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
  87. package/lib/cjs/IModelElementCloneContext.js +1 -1
  88. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  89. package/lib/cjs/IModelHost.d.ts +2 -3
  90. package/lib/cjs/IModelHost.d.ts.map +1 -1
  91. package/lib/cjs/IModelHost.js +2 -3
  92. package/lib/cjs/IModelHost.js.map +1 -1
  93. package/lib/cjs/IModelIncrementalSchemaLocater.d.ts +36 -0
  94. package/lib/cjs/IModelIncrementalSchemaLocater.d.ts.map +1 -0
  95. package/lib/cjs/IModelIncrementalSchemaLocater.js +69 -0
  96. package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -0
  97. package/lib/cjs/IModelJsFs.js.map +1 -1
  98. package/lib/cjs/ImageSourceConversion.js.map +1 -1
  99. package/lib/cjs/IpcHost.js.map +1 -1
  100. package/lib/cjs/LineStyle.js.map +1 -1
  101. package/lib/cjs/LocalHub.d.ts.map +1 -1
  102. package/lib/cjs/LocalHub.js +6 -4
  103. package/lib/cjs/LocalHub.js.map +1 -1
  104. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  105. package/lib/cjs/LockControl.js.map +1 -1
  106. package/lib/cjs/Material.d.ts +4 -3
  107. package/lib/cjs/Material.d.ts.map +1 -1
  108. package/lib/cjs/Material.js +5 -5
  109. package/lib/cjs/Material.js.map +1 -1
  110. package/lib/cjs/Model.d.ts +22 -22
  111. package/lib/cjs/Model.js +22 -22
  112. package/lib/cjs/Model.js.map +1 -1
  113. package/lib/cjs/NativeAppStorage.js.map +1 -1
  114. package/lib/cjs/NativeHost.js.map +1 -1
  115. package/lib/cjs/NavigationRelationship.js.map +1 -1
  116. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  117. package/lib/cjs/PropertyStore.js.map +1 -1
  118. package/lib/cjs/Relationship.d.ts +3 -0
  119. package/lib/cjs/Relationship.d.ts.map +1 -1
  120. package/lib/cjs/Relationship.js +15 -0
  121. package/lib/cjs/Relationship.js.map +1 -1
  122. package/lib/cjs/RpcBackend.js.map +1 -1
  123. package/lib/cjs/SQLiteDb.d.ts +1 -1
  124. package/lib/cjs/SQLiteDb.js +1 -1
  125. package/lib/cjs/SQLiteDb.js.map +1 -1
  126. package/lib/cjs/Schema.d.ts +25 -0
  127. package/lib/cjs/Schema.d.ts.map +1 -1
  128. package/lib/cjs/Schema.js +25 -0
  129. package/lib/cjs/Schema.js.map +1 -1
  130. package/lib/cjs/SchemaSync.js.map +1 -1
  131. package/lib/cjs/SchemaUtils.js.map +1 -1
  132. package/lib/cjs/SheetIndex.js.map +1 -1
  133. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  134. package/lib/cjs/SqliteStatement.d.ts +1 -1
  135. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  136. package/lib/cjs/SqliteStatement.js +1 -1
  137. package/lib/cjs/SqliteStatement.js.map +1 -1
  138. package/lib/cjs/Texture.d.ts +1 -1
  139. package/lib/cjs/Texture.js +1 -1
  140. package/lib/cjs/Texture.js.map +1 -1
  141. package/lib/cjs/TileStorage.js.map +1 -1
  142. package/lib/cjs/TxnManager.d.ts +4 -4
  143. package/lib/cjs/TxnManager.js +1 -1
  144. package/lib/cjs/TxnManager.js.map +1 -1
  145. package/lib/cjs/ViewDefinition.d.ts +40 -14
  146. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  147. package/lib/cjs/ViewDefinition.js +42 -14
  148. package/lib/cjs/ViewDefinition.js.map +1 -1
  149. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  150. package/lib/cjs/ViewStore.js.map +1 -1
  151. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +61 -0
  152. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
  153. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +110 -0
  154. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -0
  155. package/lib/cjs/annotations/FrameGeometry.d.ts +51 -0
  156. package/lib/cjs/annotations/FrameGeometry.d.ts.map +1 -0
  157. package/lib/cjs/annotations/FrameGeometry.js +249 -0
  158. package/lib/cjs/annotations/FrameGeometry.js.map +1 -0
  159. package/lib/cjs/annotations/LeaderGeometry.d.ts +53 -0
  160. package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -0
  161. package/lib/cjs/annotations/LeaderGeometry.js +184 -0
  162. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -0
  163. package/lib/cjs/annotations/TextAnnotationElement.d.ts +204 -0
  164. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -0
  165. package/lib/cjs/annotations/TextAnnotationElement.js +411 -0
  166. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -0
  167. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +33 -0
  168. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -0
  169. package/lib/cjs/annotations/TextAnnotationGeometry.js +137 -0
  170. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -0
  171. package/lib/cjs/annotations/TextBlockGeometry.d.ts +16 -0
  172. package/lib/cjs/annotations/TextBlockGeometry.d.ts.map +1 -0
  173. package/lib/cjs/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +28 -70
  174. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -0
  175. package/lib/cjs/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +69 -22
  176. package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -0
  177. package/lib/cjs/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +174 -49
  178. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -0
  179. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  180. package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
  181. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
  182. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
  183. package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
  184. package/lib/cjs/core-backend.d.ts +7 -3
  185. package/lib/cjs/core-backend.d.ts.map +1 -1
  186. package/lib/cjs/core-backend.js +27 -6
  187. package/lib/cjs/core-backend.js.map +1 -1
  188. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  189. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  190. package/lib/cjs/domains/GenericElements.js.map +1 -1
  191. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  192. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
  193. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  194. package/lib/cjs/internal/ElementLRUCache.d.ts +23 -0
  195. package/lib/cjs/internal/ElementLRUCache.d.ts.map +1 -1
  196. package/lib/cjs/internal/ElementLRUCache.js +167 -3
  197. package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
  198. package/lib/cjs/internal/FontFileImpl.js.map +1 -1
  199. package/lib/cjs/internal/HubMock.js.map +1 -1
  200. package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
  201. package/lib/cjs/internal/NativePlatform.js.map +1 -1
  202. package/lib/cjs/internal/NoLocks.js.map +1 -1
  203. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
  204. package/lib/cjs/internal/Symbols.d.ts +1 -0
  205. package/lib/cjs/internal/Symbols.d.ts.map +1 -1
  206. package/lib/cjs/internal/Symbols.js +2 -1
  207. package/lib/cjs/internal/Symbols.js.map +1 -1
  208. package/lib/cjs/internal/annotations/fields.d.ts +22 -0
  209. package/lib/cjs/internal/annotations/fields.d.ts.map +1 -0
  210. package/lib/cjs/internal/annotations/fields.js +237 -0
  211. package/lib/cjs/internal/annotations/fields.js.map +1 -0
  212. package/lib/cjs/internal/cross-package.js.map +1 -1
  213. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  214. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  215. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  216. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  217. package/lib/cjs/rpc/multipart.js.map +1 -1
  218. package/lib/cjs/rpc/tracing.js.map +1 -1
  219. package/lib/cjs/rpc/web/logging.js.map +1 -1
  220. package/lib/cjs/rpc/web/request.js.map +1 -1
  221. package/lib/cjs/rpc/web/response.js.map +1 -1
  222. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  223. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
  224. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +1 -1
  225. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  226. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  227. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
  228. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  229. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
  230. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
  231. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  232. package/lib/cjs/workspace/Settings.js.map +1 -1
  233. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  234. package/lib/cjs/workspace/Workspace.d.ts +0 -1
  235. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  236. package/lib/cjs/workspace/Workspace.js.map +1 -1
  237. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
  238. package/lib/esm/BackendHubAccess.d.ts +1 -1
  239. package/lib/esm/BackendHubAccess.js +1 -1
  240. package/lib/esm/BackendHubAccess.js.map +1 -1
  241. package/lib/esm/BackendLoggerCategory.js.map +1 -1
  242. package/lib/esm/BisCoreSchema.d.ts.map +1 -1
  243. package/lib/esm/BisCoreSchema.js +4 -2
  244. package/lib/esm/BisCoreSchema.js.map +1 -1
  245. package/lib/esm/BlobContainerService.js.map +1 -1
  246. package/lib/esm/BriefcaseManager.d.ts +10 -2
  247. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  248. package/lib/esm/BriefcaseManager.js +17 -1
  249. package/lib/esm/BriefcaseManager.js.map +1 -1
  250. package/lib/esm/CatalogDb.js.map +1 -1
  251. package/lib/esm/Category.d.ts +4 -4
  252. package/lib/esm/Category.js +4 -4
  253. package/lib/esm/Category.js.map +1 -1
  254. package/lib/esm/ChangeSummaryManager.js +2 -2
  255. package/lib/esm/ChangeSummaryManager.js.map +1 -1
  256. package/lib/esm/ChangedElementsDb.js.map +1 -1
  257. package/lib/esm/ChangesetECAdaptor.d.ts +67 -8
  258. package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
  259. package/lib/esm/ChangesetECAdaptor.js +490 -275
  260. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  261. package/lib/esm/ChannelControl.js.map +1 -1
  262. package/lib/esm/CheckpointManager.js.map +1 -1
  263. package/lib/esm/ClassRegistry.d.ts +9 -1
  264. package/lib/esm/ClassRegistry.d.ts.map +1 -1
  265. package/lib/esm/ClassRegistry.js +14 -6
  266. package/lib/esm/ClassRegistry.js.map +1 -1
  267. package/lib/esm/CloudSqlite.js +1 -1
  268. package/lib/esm/CloudSqlite.js.map +1 -1
  269. package/lib/esm/CodeService.js.map +1 -1
  270. package/lib/esm/CodeSpecs.d.ts +1 -1
  271. package/lib/esm/CodeSpecs.js +1 -1
  272. package/lib/esm/CodeSpecs.js.map +1 -1
  273. package/lib/esm/ConcurrentQuery.js.map +1 -1
  274. package/lib/esm/CustomViewState3dCreator.js.map +1 -1
  275. package/lib/esm/DevTools.js.map +1 -1
  276. package/lib/esm/DisplayStyle.d.ts +4 -4
  277. package/lib/esm/DisplayStyle.js +3 -3
  278. package/lib/esm/DisplayStyle.js.map +1 -1
  279. package/lib/esm/ECDb.d.ts +4 -4
  280. package/lib/esm/ECDb.d.ts.map +1 -1
  281. package/lib/esm/ECDb.js +4 -4
  282. package/lib/esm/ECDb.js.map +1 -1
  283. package/lib/esm/ECSchemaXmlContext.js.map +1 -1
  284. package/lib/esm/ECSqlStatement.d.ts +15 -6
  285. package/lib/esm/ECSqlStatement.d.ts.map +1 -1
  286. package/lib/esm/ECSqlStatement.js +19 -4
  287. package/lib/esm/ECSqlStatement.js.map +1 -1
  288. package/lib/esm/Element.d.ts +54 -51
  289. package/lib/esm/Element.d.ts.map +1 -1
  290. package/lib/esm/Element.js +67 -52
  291. package/lib/esm/Element.js.map +1 -1
  292. package/lib/esm/ElementAspect.d.ts +8 -8
  293. package/lib/esm/ElementAspect.d.ts.map +1 -1
  294. package/lib/esm/ElementAspect.js +8 -8
  295. package/lib/esm/ElementAspect.js.map +1 -1
  296. package/lib/esm/ElementGraphics.js.map +1 -1
  297. package/lib/esm/ElementTreeWalker.js.map +1 -1
  298. package/lib/esm/Entity.d.ts +10 -7
  299. package/lib/esm/Entity.d.ts.map +1 -1
  300. package/lib/esm/Entity.js +36 -14
  301. package/lib/esm/Entity.js.map +1 -1
  302. package/lib/esm/EntityReferences.js.map +1 -1
  303. package/lib/esm/ExportGraphics.d.ts +54 -8
  304. package/lib/esm/ExportGraphics.d.ts.map +1 -1
  305. package/lib/esm/ExportGraphics.js +156 -58
  306. package/lib/esm/ExportGraphics.js.map +1 -1
  307. package/lib/esm/ExternalSource.js.map +1 -1
  308. package/lib/esm/FontFile.js.map +1 -1
  309. package/lib/esm/GeoCoordConfig.js.map +1 -1
  310. package/lib/esm/GeographicCRSServices.d.ts +6 -2
  311. package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
  312. package/lib/esm/GeographicCRSServices.js +1 -1
  313. package/lib/esm/GeographicCRSServices.js.map +1 -1
  314. package/lib/esm/GeometrySummary.js +47 -47
  315. package/lib/esm/GeometrySummary.js.map +1 -1
  316. package/lib/esm/IModelDb.d.ts +37 -26
  317. package/lib/esm/IModelDb.d.ts.map +1 -1
  318. package/lib/esm/IModelDb.js +136 -59
  319. package/lib/esm/IModelDb.js.map +1 -1
  320. package/lib/esm/IModelDbFonts.js.map +1 -1
  321. package/lib/esm/IModelElementCloneContext.d.ts +1 -1
  322. package/lib/esm/IModelElementCloneContext.d.ts.map +1 -1
  323. package/lib/esm/IModelElementCloneContext.js +1 -1
  324. package/lib/esm/IModelElementCloneContext.js.map +1 -1
  325. package/lib/esm/IModelHost.d.ts +2 -3
  326. package/lib/esm/IModelHost.d.ts.map +1 -1
  327. package/lib/esm/IModelHost.js +2 -3
  328. package/lib/esm/IModelHost.js.map +1 -1
  329. package/lib/esm/IModelIncrementalSchemaLocater.d.ts +36 -0
  330. package/lib/esm/IModelIncrementalSchemaLocater.d.ts.map +1 -0
  331. package/lib/esm/IModelIncrementalSchemaLocater.js +65 -0
  332. package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -0
  333. package/lib/esm/IModelJsFs.js.map +1 -1
  334. package/lib/esm/ImageSourceConversion.js.map +1 -1
  335. package/lib/esm/IpcHost.js.map +1 -1
  336. package/lib/esm/LineStyle.js.map +1 -1
  337. package/lib/esm/LocalHub.d.ts.map +1 -1
  338. package/lib/esm/LocalHub.js +6 -4
  339. package/lib/esm/LocalHub.js.map +1 -1
  340. package/lib/esm/LocalhostIpcHost.js.map +1 -1
  341. package/lib/esm/LockControl.js.map +1 -1
  342. package/lib/esm/Material.d.ts +4 -3
  343. package/lib/esm/Material.d.ts.map +1 -1
  344. package/lib/esm/Material.js +5 -5
  345. package/lib/esm/Material.js.map +1 -1
  346. package/lib/esm/Model.d.ts +22 -22
  347. package/lib/esm/Model.js +22 -22
  348. package/lib/esm/Model.js.map +1 -1
  349. package/lib/esm/NativeAppStorage.js.map +1 -1
  350. package/lib/esm/NativeHost.js.map +1 -1
  351. package/lib/esm/NavigationRelationship.js.map +1 -1
  352. package/lib/esm/PromiseMemoizer.js.map +1 -1
  353. package/lib/esm/PropertyStore.js.map +1 -1
  354. package/lib/esm/Relationship.d.ts +3 -0
  355. package/lib/esm/Relationship.d.ts.map +1 -1
  356. package/lib/esm/Relationship.js +15 -0
  357. package/lib/esm/Relationship.js.map +1 -1
  358. package/lib/esm/RpcBackend.js.map +1 -1
  359. package/lib/esm/SQLiteDb.d.ts +1 -1
  360. package/lib/esm/SQLiteDb.js +1 -1
  361. package/lib/esm/SQLiteDb.js.map +1 -1
  362. package/lib/esm/Schema.d.ts +25 -0
  363. package/lib/esm/Schema.d.ts.map +1 -1
  364. package/lib/esm/Schema.js +25 -0
  365. package/lib/esm/Schema.js.map +1 -1
  366. package/lib/esm/SchemaSync.js.map +1 -1
  367. package/lib/esm/SchemaUtils.js.map +1 -1
  368. package/lib/esm/SheetIndex.js.map +1 -1
  369. package/lib/esm/SqliteChangesetReader.js.map +1 -1
  370. package/lib/esm/SqliteStatement.d.ts +1 -1
  371. package/lib/esm/SqliteStatement.d.ts.map +1 -1
  372. package/lib/esm/SqliteStatement.js +1 -1
  373. package/lib/esm/SqliteStatement.js.map +1 -1
  374. package/lib/esm/Texture.d.ts +1 -1
  375. package/lib/esm/Texture.js +1 -1
  376. package/lib/esm/Texture.js.map +1 -1
  377. package/lib/esm/TileStorage.js.map +1 -1
  378. package/lib/esm/TxnManager.d.ts +4 -4
  379. package/lib/esm/TxnManager.js +1 -1
  380. package/lib/esm/TxnManager.js.map +1 -1
  381. package/lib/esm/ViewDefinition.d.ts +40 -14
  382. package/lib/esm/ViewDefinition.d.ts.map +1 -1
  383. package/lib/esm/ViewDefinition.js +42 -14
  384. package/lib/esm/ViewDefinition.js.map +1 -1
  385. package/lib/esm/ViewStateHydrator.js.map +1 -1
  386. package/lib/esm/ViewStore.js.map +1 -1
  387. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +61 -0
  388. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
  389. package/lib/esm/annotations/ElementDrivesTextAnnotation.js +105 -0
  390. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -0
  391. package/lib/esm/annotations/FrameGeometry.d.ts +51 -0
  392. package/lib/esm/annotations/FrameGeometry.d.ts.map +1 -0
  393. package/lib/esm/annotations/FrameGeometry.js +244 -0
  394. package/lib/esm/annotations/FrameGeometry.js.map +1 -0
  395. package/lib/esm/annotations/LeaderGeometry.d.ts +53 -0
  396. package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -0
  397. package/lib/esm/annotations/LeaderGeometry.js +179 -0
  398. package/lib/esm/annotations/LeaderGeometry.js.map +1 -0
  399. package/lib/esm/annotations/TextAnnotationElement.d.ts +204 -0
  400. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -0
  401. package/lib/esm/annotations/TextAnnotationElement.js +405 -0
  402. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -0
  403. package/lib/esm/annotations/TextAnnotationGeometry.d.ts +33 -0
  404. package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -0
  405. package/lib/esm/annotations/TextAnnotationGeometry.js +134 -0
  406. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -0
  407. package/lib/esm/annotations/TextBlockGeometry.d.ts +16 -0
  408. package/lib/esm/annotations/TextBlockGeometry.d.ts.map +1 -0
  409. package/lib/esm/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +28 -70
  410. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -0
  411. package/lib/esm/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +69 -22
  412. package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -0
  413. package/lib/esm/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +172 -48
  414. package/lib/esm/annotations/TextBlockLayout.js.map +1 -0
  415. package/lib/esm/core-backend.d.ts +7 -3
  416. package/lib/esm/core-backend.d.ts.map +1 -1
  417. package/lib/esm/core-backend.js +27 -3
  418. package/lib/esm/core-backend.js.map +1 -1
  419. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  420. package/lib/esm/domains/FunctionalSchema.js.map +1 -1
  421. package/lib/esm/domains/GenericElements.js.map +1 -1
  422. package/lib/esm/domains/GenericSchema.js.map +1 -1
  423. package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
  424. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  425. package/lib/esm/internal/ElementLRUCache.d.ts +23 -0
  426. package/lib/esm/internal/ElementLRUCache.d.ts.map +1 -1
  427. package/lib/esm/internal/ElementLRUCache.js +165 -2
  428. package/lib/esm/internal/ElementLRUCache.js.map +1 -1
  429. package/lib/esm/internal/FontFileImpl.js.map +1 -1
  430. package/lib/esm/internal/HubMock.js.map +1 -1
  431. package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
  432. package/lib/esm/internal/NativePlatform.js.map +1 -1
  433. package/lib/esm/internal/NoLocks.js.map +1 -1
  434. package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
  435. package/lib/esm/internal/Symbols.d.ts +1 -0
  436. package/lib/esm/internal/Symbols.d.ts.map +1 -1
  437. package/lib/esm/internal/Symbols.js +1 -0
  438. package/lib/esm/internal/Symbols.js.map +1 -1
  439. package/lib/esm/internal/annotations/fields.d.ts +22 -0
  440. package/lib/esm/internal/annotations/fields.d.ts.map +1 -0
  441. package/lib/esm/internal/annotations/fields.js +231 -0
  442. package/lib/esm/internal/annotations/fields.js.map +1 -0
  443. package/lib/esm/internal/cross-package.js.map +1 -1
  444. package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
  445. package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  446. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  447. package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  448. package/lib/esm/rpc/multipart.js.map +1 -1
  449. package/lib/esm/rpc/tracing.js.map +1 -1
  450. package/lib/esm/rpc/web/logging.js.map +1 -1
  451. package/lib/esm/rpc/web/request.js.map +1 -1
  452. package/lib/esm/rpc/web/response.js.map +1 -1
  453. package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  454. package/lib/esm/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
  455. package/lib/esm/rpc-impl/IModelReadRpcImpl.js +1 -1
  456. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  457. package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  458. package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
  459. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  460. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
  461. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
  462. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  463. package/lib/esm/test/AdvancedEqual.js.map +1 -1
  464. package/lib/esm/test/AnnotationTestUtils.d.ts +15 -0
  465. package/lib/esm/test/AnnotationTestUtils.d.ts.map +1 -0
  466. package/lib/esm/test/AnnotationTestUtils.js +41 -0
  467. package/lib/esm/test/AnnotationTestUtils.js.map +1 -0
  468. package/lib/esm/test/AttachDb.test.js +11 -11
  469. package/lib/esm/test/AttachDb.test.js.map +1 -1
  470. package/lib/esm/test/ElementLRUCache.test.js +224 -1
  471. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  472. package/lib/esm/test/GeometryTestUtil.js.map +1 -1
  473. package/lib/esm/test/IModelHost.test.js.map +1 -1
  474. package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
  475. package/lib/esm/test/IModelTestUtils.js +1 -0
  476. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  477. package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
  478. package/lib/esm/test/IpcHost.test.js.map +1 -1
  479. package/lib/esm/test/KnownTestLocations.js.map +1 -1
  480. package/lib/esm/test/PrintElementTree.js.map +1 -1
  481. package/lib/esm/test/PropertyDb.test.js.map +1 -1
  482. package/lib/esm/test/RevisionUtility.js.map +1 -1
  483. package/lib/esm/test/SchemaUtils.test.js +25 -25
  484. package/lib/esm/test/SchemaUtils.test.js.map +1 -1
  485. package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
  486. package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
  487. package/lib/esm/test/TestUtils.d.ts +1 -1
  488. package/lib/esm/test/TestUtils.d.ts.map +1 -1
  489. package/lib/esm/test/TestUtils.js +1 -1
  490. package/lib/esm/test/TestUtils.js.map +1 -1
  491. package/lib/esm/test/annotations/Fields.test.d.ts +2 -0
  492. package/lib/esm/test/annotations/Fields.test.d.ts.map +1 -0
  493. package/lib/esm/test/annotations/Fields.test.js +576 -0
  494. package/lib/esm/test/annotations/Fields.test.js.map +1 -0
  495. package/lib/esm/test/annotations/FrameGeometry.test.d.ts +2 -0
  496. package/lib/esm/test/annotations/FrameGeometry.test.d.ts.map +1 -0
  497. package/lib/esm/test/annotations/FrameGeometry.test.js +86 -0
  498. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -0
  499. package/lib/esm/test/annotations/LeaderGeometry.test.d.ts +2 -0
  500. package/lib/esm/test/annotations/LeaderGeometry.test.d.ts.map +1 -0
  501. package/lib/esm/test/annotations/LeaderGeometry.test.js +256 -0
  502. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -0
  503. package/lib/esm/test/annotations/TextAnnotation.test.js +269 -1047
  504. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  505. package/lib/esm/test/annotations/TextBlock.test.d.ts +2 -0
  506. package/lib/esm/test/annotations/TextBlock.test.d.ts.map +1 -0
  507. package/lib/esm/test/annotations/TextBlock.test.js +1199 -0
  508. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -0
  509. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.d.ts +60 -0
  510. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.d.ts.map +1 -0
  511. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js +69 -0
  512. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -0
  513. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts +1442 -0
  514. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts.map +1 -0
  515. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js +817 -0
  516. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -0
  517. package/lib/esm/test/categories/Category.test.js.map +1 -1
  518. package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
  519. package/lib/esm/test/ecdb/CTE.test.js +88 -88
  520. package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
  521. package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts +2 -0
  522. package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts.map +1 -0
  523. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +164 -0
  524. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -0
  525. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +35 -45
  526. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
  527. package/lib/esm/test/ecdb/ECDb.test.js +86 -65
  528. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  529. package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
  530. package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
  531. package/lib/esm/test/ecdb/ECSqlAst.test.js +65 -65
  532. package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
  533. package/lib/esm/test/ecdb/ECSqlQuery.test.js +0 -55
  534. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  535. package/lib/esm/test/ecdb/ECSqlReader.test.js +16 -16
  536. package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
  537. package/lib/esm/test/ecdb/ECSqlStatement.test.js +484 -292
  538. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  539. package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
  540. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
  541. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
  542. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
  543. package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
  544. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  545. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  546. package/lib/esm/test/element/ElementAspect.test.js +22 -22
  547. package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
  548. package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
  549. package/lib/esm/test/element/ElementRoundTrip.test.js +139 -139
  550. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  551. package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
  552. package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
  553. package/lib/esm/test/element/NullStructArray.test.js +13 -13
  554. package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
  555. package/lib/esm/test/element/UrlLink.test.js.map +1 -1
  556. package/lib/esm/test/font/FontFile.test.js.map +1 -1
  557. package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
  558. package/lib/esm/test/hubaccess/ApplyChangeset.test.d.ts +2 -0
  559. package/lib/esm/test/hubaccess/ApplyChangeset.test.d.ts.map +1 -0
  560. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +86 -0
  561. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -0
  562. package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
  563. package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
  564. package/lib/esm/test/imageData.js.map +1 -1
  565. package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
  566. package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
  567. package/lib/esm/test/imodel/IModel.test.js +313 -5
  568. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  569. package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
  570. package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
  571. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.d.ts +2 -0
  572. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.d.ts.map +1 -0
  573. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js +343 -0
  574. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -0
  575. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.d.ts +2 -0
  576. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.d.ts.map +1 -0
  577. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +207 -0
  578. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -0
  579. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts +11 -0
  580. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts.map +1 -0
  581. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js +36 -0
  582. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +1 -0
  583. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts +17 -0
  584. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts.map +1 -0
  585. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js +116 -0
  586. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +1 -0
  587. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts +9 -0
  588. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts.map +1 -0
  589. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js +20 -0
  590. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +1 -0
  591. package/lib/esm/test/index.js.map +1 -1
  592. package/lib/esm/test/misc/DevTools.test.js.map +1 -1
  593. package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
  594. package/lib/esm/test/misc/GeoServices.test.js +36 -10
  595. package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
  596. package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
  597. package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
  598. package/lib/esm/test/rpc/response.test.js.map +1 -1
  599. package/lib/esm/test/schema/ClassRegistry.test.js +175 -73
  600. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  601. package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
  602. package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
  603. package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
  604. package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
  605. package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
  606. package/lib/esm/test/standalone/ChangesetReader.test.js +575 -164
  607. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  608. package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
  609. package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
  610. package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
  611. package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
  612. package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
  613. package/lib/esm/test/standalone/ExportGraphics.test.js +67 -15
  614. package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
  615. package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
  616. package/lib/esm/test/standalone/GeometryStream.test.js +49 -1
  617. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  618. package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
  619. package/lib/esm/test/standalone/IModelLimits.test.d.ts +2 -0
  620. package/lib/esm/test/standalone/IModelLimits.test.d.ts.map +1 -0
  621. package/lib/esm/test/standalone/IModelLimits.test.js +103 -0
  622. package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -0
  623. package/lib/esm/test/standalone/IModelWrite.test.js +27 -27
  624. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  625. package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
  626. package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
  627. package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
  628. package/lib/esm/test/standalone/RenderMaterialElement.test.js +24 -1
  629. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  630. package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
  631. package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
  632. package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
  633. package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
  634. package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
  635. package/lib/esm/test/standalone/Setting.test.js.map +1 -1
  636. package/lib/esm/test/standalone/Settings.test.js.map +1 -1
  637. package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
  638. package/lib/esm/test/standalone/SnapshotDb.test.js +19 -1
  639. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  640. package/lib/esm/test/standalone/Texture.test.js.map +1 -1
  641. package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
  642. package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
  643. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  644. package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
  645. package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
  646. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  647. package/lib/esm/workspace/Settings.js.map +1 -1
  648. package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
  649. package/lib/esm/workspace/Workspace.d.ts +0 -1
  650. package/lib/esm/workspace/Workspace.d.ts.map +1 -1
  651. package/lib/esm/workspace/Workspace.js.map +1 -1
  652. package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
  653. package/package.json +22 -16
  654. package/lib/cjs/TextAnnotationElement.d.ts +0 -54
  655. package/lib/cjs/TextAnnotationElement.d.ts.map +0 -1
  656. package/lib/cjs/TextAnnotationElement.js +0 -94
  657. package/lib/cjs/TextAnnotationElement.js.map +0 -1
  658. package/lib/cjs/TextAnnotationGeometry.d.ts +0 -32
  659. package/lib/cjs/TextAnnotationGeometry.d.ts.map +0 -1
  660. package/lib/cjs/TextAnnotationGeometry.js.map +0 -1
  661. package/lib/cjs/TextAnnotationLayout.d.ts.map +0 -1
  662. package/lib/cjs/TextAnnotationLayout.js.map +0 -1
  663. package/lib/esm/TextAnnotationElement.d.ts +0 -54
  664. package/lib/esm/TextAnnotationElement.d.ts.map +0 -1
  665. package/lib/esm/TextAnnotationElement.js +0 -89
  666. package/lib/esm/TextAnnotationElement.js.map +0 -1
  667. package/lib/esm/TextAnnotationGeometry.d.ts +0 -32
  668. package/lib/esm/TextAnnotationGeometry.d.ts.map +0 -1
  669. package/lib/esm/TextAnnotationGeometry.js.map +0 -1
  670. package/lib/esm/TextAnnotationLayout.d.ts.map +0 -1
  671. package/lib/esm/TextAnnotationLayout.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAmC,kBAAkB,EAAsC,MAAM,oBAAoB,CAAC;AAG7H,OAAO,EAAE,WAAW,EAAY,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAgC/C;;;;GAIG;AACH,MAAM,OAAO,MAAM;IACjB;;OAEG;IACa,kBAAkB,GAAG,IAAa,CAAC;IACnD,0CAA0C;IACnC,MAAM,CAAC,MAAM,CAAgB,CAAC,mGAAmG;IAExI,IAAY,KAAK,KAAoB,OAAO,IAAI,CAAC,WAA4B,CAAC,CAAC,CAAC;IAEhF;;;;OAIG;IACI,MAAM,KAAK,SAAS,KAAa,OAAO,QAAQ,CAAC,CAAC,CAAC;IAE1D;;OAEG;IACI,MAAM,KAAK,aAAa;QAC7B,gFAAgF;QAChF,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClE,CAAC;IAEO,SAAS,CAAe;IAEhC;;;OAGG;IACH,IAAW,KAAK,KAAU,OAAO,IAAI,CAAC,CAAC,CAAC;IAExC,yDAAyD;IACzD,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAExE,4DAA4D;IAC5D,IAAW,SAAS,KAAa,OAAO,IA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IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD,gBAAgB;IACT,MAAM,KAAK,mBAAmB,KAAe,OAAO,EAAE,CAAC,CAAC,CAAC;IAEhE;;;;;OAKG;IACI,MAAM,CAAC,EAAE,CAAC,UAAyB;QACxC,6EAA6E;QAC7E,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,SAAS,YAAY,UAAU,CAAC;IACrE,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,gBAAgB,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC;IAEtD;;;;;OAKG;IACI,eAAe;QACpB,MAAM,YAAY,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAC9C,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACvC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;;;;OAOG;IACO,mBAAmB,CAAC,aAAiC;QAC7D,OAAO,CAAC,2BAA2B;IACrC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Schema\n */\n\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\nimport { ElementLoadOptions, EntityProps, EntityReferenceSet, PropertyCallback, PropertyMetaData } from \"@itwin/core-common\";\nimport type { IModelDb } from \"./IModelDb\";\nimport { Schema } from \"./Schema\";\nimport { EntityClass, Property, SchemaItemKey } from \"@itwin/ecschema-metadata\";\nimport { _nativeDb } from \"./internal/Symbols\";\n\n/** Represents a row returned by an ECSql query. The row is returned as a map of property names to values.\n * ECSqlRow has same schema as declared in ECSchema for the class and similar to if ECSQL SELECT * FROM <schema>:<class> were executed.\n * @beta */\nexport interface ECSqlRow {\n [key: string]: any\n}\n\n/** Set of properties that are used to deserialize an [[EntityProps]] from an ECSqlRow.\n * @beta */\nexport interface DeserializeEntityArgs {\n /** Row to deserialize */\n row: ECSqlRow;\n /** The IModel that contains this Entity */\n iModel: IModelDb;\n /** The options used when loading */\n options?: {\n /** Options used when loading an element */\n element?: ElementLoadOptions;\n }\n}\n\n/** A property of an [[Entity]] that needs to be custom handled during deserialization and serialization.\n * @beta */\nexport interface CustomHandledProperty {\n /** The name of the property as it appears in the ECSqlRow */\n readonly propertyName: string;\n /** Where the property is defined */\n readonly source: \"Class\" | \"Computed\";\n}\n\n/** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].\n * Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).\n * An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].\n * @public\n */\nexport class Entity {\n /** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types\n * are never substitutable for one another. To obtain an EntityProps from an Entity, use [[Entity.toJSON]].\n */\n public readonly isInstanceOfEntity = true as const;\n /** The Schema that defines this class. */\n public static schema: typeof Schema; // TODO: Schema key on the static level, but it requires a version which may differ between imodels\n\n private get _ctor(): typeof Entity { return this.constructor as typeof Entity; }\n\n /** The name of the BIS class associated with this class.\n * @note Every subclass of Entity **MUST** override this method to identify its BIS class.\n * Failure to do so will ordinarily result in an error when the class is registered, since there may only\n * be one JavaScript class for a given BIS class (usually the errant class will collide with its superclass.)\n */\n public static get className(): string { return \"Entity\"; }\n\n /** Serves as a unique identifier for this class. Typed variant of [[classFullName]].\n * @public @preview\n */\n public static get schemaItemKey(): SchemaItemKey {\n // We cannot cache this here because the className gets overridden in subclasses\n return new SchemaItemKey(this.className, this.schema.schemaKey);\n }\n\n private _metadata?: EntityClass;\n\n /** When working with an Entity it can be useful to set property values directly, bypassing the compiler's type checking.\n * This property makes such code slightly less tedious to read and write.\n * @internal\n */\n public get asAny(): any { return this; }\n\n /** The name of the BIS Schema that defines this class */\n public get schemaName(): string { return this._ctor.schema.schemaName; }\n\n /** The name of the BIS class associated with this class. */\n public get className(): string { return this._ctor.className; }\n\n /** The [[IModelDb]] that contains this Entity */\n public iModel: IModelDb;\n\n /** The Id of this Entity. May be invalid if the Entity has not yet been saved in the database. */\n public id: Id64String;\n\n\n protected constructor(props: EntityProps, iModel: IModelDb) {\n this.iModel = iModel;\n this.id = Id64.fromJSON(props.id);\n // copy all auto-handled properties from input to the object being constructed\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.forEachProperty((propName: string, meta: PropertyMetaData) => (this as any)[propName] = meta.createProperty((props as any)[propName]), false);\n }\n\n /** Invoke the constructor of the specified `Entity` subclass.\n * @internal\n */\n public static instantiate(subclass: typeof Entity, props: EntityProps, iModel: IModelDb): Entity {\n return new subclass(props, iModel);\n }\n\n /** List of properties that are need to be custom handled during deserialization and serialization.\n * These properties differ between the ECSql instance of an Entity and the Entity itself.\n * @beta */\n protected static readonly _customHandledProps: CustomHandledProperty[] = [\n { propertyName: \"id\", source: \"Class\" },\n { propertyName: \"className\", source: \"Class\" },\n { propertyName: \"jsonProperties\", source: \"Class\" }\n ];\n\n /** Get the list of properties that are custom handled by this class and its superclasses.\n * @internal */\n private static getCustomHandledProperties(): readonly CustomHandledProperty[] {\n if (this.name === \"Entity\") {\n return this._customHandledProps;\n }\n\n const superClass = Object.getPrototypeOf(this) as typeof Entity;\n return [\n ...superClass.getCustomHandledProperties(),\n ...this._customHandledProps,\n ];\n }\n\n /** Converts an ECSqlRow of an Entity to an EntityProps. This is used to deserialize an Entity from the database.\n * @beta */\n public static deserialize(props: DeserializeEntityArgs): EntityProps {\n const enProps: EntityProps = {\n classFullName: props.row.classFullName,\n id: props.row.id,\n }\n\n // Handles cases where id64 ints are stored in the jsonProperties and converts them to hex before parsing as a json object in js\n if (props.row.jsonProperties) {\n enProps.jsonProperties = JSON.parse(props.iModel[_nativeDb].patchJsonProperties(props.row.jsonProperties));\n }\n // Auto handles all properties that are not in the 'customHandledProperties' list\n const customHandledProperties = this.getCustomHandledProperties();\n Object.keys(props.row)\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\n .forEach((propertyName) => (enProps as ECSqlRow)[propertyName] = props.row[propertyName]\n );\n // Handles custom relClassNames to use '.' instead of ':'\n Object.keys(enProps).forEach((propertyName) => {\n if ((enProps as ECSqlRow)[propertyName].relClassName !== undefined && propertyName !== \"modeledElement\" && propertyName !== \"parentModel\") {\n (enProps as ECSqlRow)[propertyName].relClassName = (enProps as ECSqlRow)[propertyName].relClassName.replace(':', '.');\n }\n });\n return enProps;\n }\n\n /** Converts an EntityProps to an ECSqlRow. This is used to serialize an Entity to prepare to write it to the database.\n * @beta */\n public static serialize(props: EntityProps, _iModel: IModelDb): ECSqlRow {\n const inst: ECSqlRow = {\n classFullName: props.classFullName,\n id: props.id,\n }\n\n const customHandledProperties = this.getCustomHandledProperties();\n Object.keys(props)\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\n .forEach((propertyName) => inst[propertyName] = (props as ECSqlRow)[propertyName]\n );\n return inst;\n }\n\n /** Obtain the JSON representation of this Entity. Subclasses of [[Entity]] typically override this method to return their corresponding sub-type of [EntityProps]($common) -\n * for example, [[GeometricElement.toJSON]] returns a [GeometricElementProps]($common).\n */\n public toJSON(): EntityProps {\n const val: any = {};\n val.classFullName = this.classFullName;\n if (Id64.isValid(this.id))\n val.id = this.id;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.forEachProperty((propName: string) => val[propName] = (this as any)[propName], false);\n return val;\n }\n\n /** Call a function for each property of this Entity.\n * @param func The callback to be invoked on each property\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\n * @deprecated in 5.0. Please use `forEach` to get the metadata and iterate over the properties instead.\n *\n * @example\n * ```typescript\n * // Deprecated method\n * entity.forEachProperty((name, propMetaData) => {\n * console.log(`Property name: ${name}, Property type: ${propMetaData.primitiveType}`);\n * });\n *\n * // New method\n * entity.forEach((name, property) => {\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public forEachProperty(func: PropertyCallback, includeCustom: boolean = true) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.iModel.forEachMetaData(this.classFullName, true, func, includeCustom);\n }\n\n /**\n * Call a function for each property of this Entity.\n * @param func The callback to be invoked on each property.\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\n * @throws Error if metadata for the class cannot be retrieved.\n *\n * @example\n * ```typescript\n * entity.forEach((name, property) => {\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\n * });\n * ```\n */\n public forEach(func: PropertyHandler, includeCustom: boolean = true) {\n const metaData = this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey, EntityClass);\n if (!metaData)\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\n\n for (const property of metaData.getPropertiesSync()) {\n if (includeCustom || !property.customAttributes?.has(`BisCore.CustomHandledProperty`))\n func(property.name, property);\n }\n }\n\n /** Get the full BIS class name of this Entity in the form \"schema:class\" */\n public static get classFullName(): string { return `${this.schema.schemaName}:${this.className}`; }\n\n /** Get the full BIS class name of this Entity in the form \"schema:class\". */\n public get classFullName(): string { return this._ctor.classFullName; }\n /**\n * Get the item key used by the ecschema-metadata package to identify this entity class\n * @public @preview\n */\n public get schemaItemKey(): SchemaItemKey { return this._ctor.schemaItemKey; }\n\n /** query metadata for this entity class from the iModel's schema\n * @throws [[IModelError]] if there is a problem querying the schema\n * @returns The metadata for the current entity\n * @public @preview\n */\n public async getMetaData(): Promise<EntityClass> {\n if (!this._metadata) {\n this._metadata = await this.iModel.schemaContext.getSchemaItem(this.schemaItemKey, EntityClass);\n }\n\n if (!this._metadata) {\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\n }\n\n return this._metadata;\n }\n\n\n /** @internal */\n public static get protectedOperations(): string[] { return []; }\n\n /** return whether this Entity class is a subclass of another Entity class\n * @note the subclass-ness is checked according to JavaScript inheritance, to check the underlying raw EC class's\n * inheritance, you can use [ECClass.is]($ecschema-metadata)\n * @note this should have a type of `is<T extends typeof Entity>(otherClass: T): this is T` but can't because of\n * typescript's restriction on the `this` type in static methods\n */\n public static is(otherClass: typeof Entity): boolean {\n // inline of @itwin/core-bentley's isSubclassOf due to protected constructor.\n return this === otherClass || this.prototype instanceof otherClass;\n }\n\n /** whether this JavaScript class was generated for this ECClass because there was no registered custom implementation\n * ClassRegistry overrides this when generating a class\n * @internal\n */\n public static get isGeneratedClass() { return false; }\n\n /** Get the set of this entity's *entity references*, [EntityReferenceSet]($backend). An *entity reference* is any id\n * stored on the entity, in its EC properties or json fields.\n * This is important for cloning operations but can be useful in other situations as well.\n * @see this.collectReferenceIds\n * @beta\n */\n public getReferenceIds(): EntityReferenceSet {\n const referenceIds = new EntityReferenceSet();\n this.collectReferenceIds(referenceIds);\n return referenceIds;\n }\n\n /** Collect the Ids of this entity's *references* at this level of the class hierarchy.\n * A *reference* is any entity referenced by this entity's EC Data, including json fields.\n * This is important for cloning operations but can be useful in other situations as well.\n * @param _referenceIds The Id64Set to populate with reference Ids.\n * @note This should be overridden (with `super` called) at each level the class hierarchy that introduces references.\n * @see getReferenceIds\n * @beta\n */\n protected collectReferenceIds(_referenceIds: EntityReferenceSet): void {\n return; // no references by default\n }\n}\n\n/** A callback function to process properties of an Entity\n * @public @preview\n */\nexport type PropertyHandler = (name: string, property: Property) => void;\n\n/** Parameter type that can accept both abstract constructor types and non-abstract constructor types for `instanceof` to test.\n * @public\n */\nexport type EntityClassType<T> = Function & { prototype: T }; // eslint-disable-line @typescript-eslint/no-unsafe-function-type\n"]}
1
+ {"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AACvD,OAA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;QACpB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACzF,IAAI,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,iBAAiB,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;YACzF,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;YACzB,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,gBAAgB;IACT,MAAM,KAAK,mBAAmB,KAAe,OAAO,EAAE,CAAC,CAAC,CAAC;IAEhE;;;;;OAKG;IACI,MAAM,CAAC,EAAE,CAAC,UAAyB;QACxC,6EAA6E;QAC7E,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,SAAS,YAAY,UAAU,CAAC;IACrE,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,gBAAgB,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC;IAEtD;;;;;OAKG;IACI,eAAe;QACpB,MAAM,YAAY,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAC9C,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACvC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;;;;OAOG;IACO,mBAAmB,CAAC,aAAiC;QAC7D,OAAO,CAAC,2BAA2B;IACrC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Schema\r\n */\r\n\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { ElementLoadOptions, EntityProps, EntityReferenceSet, PropertyCallback, PropertyMetaData } from \"@itwin/core-common\";\r\nimport type { IModelDb } from \"./IModelDb\";\r\nimport { Schema } from \"./Schema\";\r\nimport { ECClass, EntityClass, Property, RelationshipClass, SchemaItemKey } from \"@itwin/ecschema-metadata\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\n\r\n/** Represents a row returned by an ECSql query. The row is returned as a map of property names to values.\r\n * ECSqlRow has same schema as declared in ECSchema for the class and similar to if ECSQL SELECT * FROM <schema>:<class> were executed.\r\n * @beta */\r\nexport interface ECSqlRow {\r\n [key: string]: any\r\n}\r\n\r\n/** Set of properties that are used to deserialize an [[EntityProps]] from an ECSqlRow.\r\n * @beta */\r\nexport interface DeserializeEntityArgs {\r\n /** Row to deserialize */\r\n row: ECSqlRow;\r\n /** The IModel that contains this Entity */\r\n iModel: IModelDb;\r\n /** The options used when loading */\r\n options?: {\r\n /** Options used when loading an element */\r\n element?: ElementLoadOptions;\r\n }\r\n}\r\n\r\n/** A property of an [[Entity]] that needs to be custom handled during deserialization and serialization.\r\n * @beta */\r\nexport interface CustomHandledProperty {\r\n /** The name of the property as it appears in the ECSqlRow */\r\n readonly propertyName: string;\r\n /** Where the property is defined */\r\n readonly source: \"Class\" | \"Computed\";\r\n}\r\n\r\n/** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].\r\n * Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).\r\n * An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].\r\n * @public @preview\r\n */\r\nexport class Entity {\r\n /** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types\r\n * are never substitutable for one another. To obtain an EntityProps from an Entity, use [[Entity.toJSON]].\r\n */\r\n public readonly isInstanceOfEntity = true as const;\r\n /** The Schema that defines this class. */\r\n public static schema: typeof Schema; // TODO: Schema key on the static level, but it requires a version which may differ between imodels\r\n\r\n private get _ctor(): typeof Entity { return this.constructor as typeof Entity; }\r\n\r\n /** The name of the BIS class associated with this class.\r\n * @note Every subclass of Entity **MUST** override this method to identify its BIS class.\r\n * Failure to do so will ordinarily result in an error when the class is registered, since there may only\r\n * be one JavaScript class for a given BIS class (usually the errant class will collide with its superclass.)\r\n */\r\n public static get className(): string { return \"Entity\"; }\r\n\r\n /** Serves as a unique identifier for this class. Typed variant of [[classFullName]].\r\n * @public @preview\r\n */\r\n public static get schemaItemKey(): SchemaItemKey {\r\n // We cannot cache this here because the className gets overridden in subclasses\r\n return new SchemaItemKey(this.className, this.schema.schemaKey);\r\n }\r\n\r\n /** Cached Metadata for the ECClass */\r\n protected _metadata?: EntityClass | RelationshipClass;\r\n\r\n /** When working with an Entity it can be useful to set property values directly, bypassing the compiler's type checking.\r\n * This property makes such code slightly less tedious to read and write.\r\n * @internal\r\n */\r\n public get asAny(): any { return this; }\r\n\r\n /** The name of the BIS Schema that defines this class */\r\n public get schemaName(): string { return this._ctor.schema.schemaName; }\r\n\r\n /** The name of the BIS class associated with this class. */\r\n public get className(): string { return this._ctor.className; }\r\n\r\n /** The [[IModelDb]] that contains this Entity */\r\n public iModel: IModelDb;\r\n\r\n /** The Id of this Entity. May be invalid if the Entity has not yet been saved in the database. */\r\n public id: Id64String;\r\n\r\n\r\n protected constructor(props: EntityProps, iModel: IModelDb) {\r\n this.iModel = iModel;\r\n this.id = Id64.fromJSON(props.id);\r\n // copy all auto-handled properties from input to the object being constructed\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this.forEachProperty((propName: string, meta: PropertyMetaData) => (this as any)[propName] = meta.createProperty((props as any)[propName]), false);\r\n }\r\n\r\n /** Invoke the constructor of the specified `Entity` subclass.\r\n * @internal\r\n */\r\n public static instantiate(subclass: typeof Entity, props: EntityProps, iModel: IModelDb): Entity {\r\n return new subclass(props, iModel);\r\n }\r\n\r\n /** List of properties that are need to be custom handled during deserialization and serialization.\r\n * These properties differ between the ECSql instance of an Entity and the Entity itself.\r\n * @beta */\r\n protected static readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"id\", source: \"Class\" },\r\n { propertyName: \"className\", source: \"Class\" },\r\n { propertyName: \"jsonProperties\", source: \"Class\" }\r\n ];\r\n\r\n /** Get the list of properties that are custom handled by this class and its superclasses.\r\n * @internal */\r\n private static getCustomHandledProperties(): readonly CustomHandledProperty[] {\r\n if (this.name === \"Entity\") {\r\n return this._customHandledProps;\r\n }\r\n\r\n const superClass = Object.getPrototypeOf(this) as typeof Entity;\r\n return [\r\n ...superClass.getCustomHandledProperties(),\r\n ...this._customHandledProps,\r\n ];\r\n }\r\n\r\n /** Converts an ECSqlRow of an Entity to an EntityProps. This is used to deserialize an Entity from the database.\r\n * @beta */\r\n public static deserialize(props: DeserializeEntityArgs): EntityProps {\r\n const enProps: EntityProps = {\r\n classFullName: props.row.classFullName,\r\n id: props.row.id,\r\n }\r\n\r\n // Handles cases where id64 ints are stored in the jsonProperties and converts them to hex before parsing as a json object in js\r\n if (props.row.jsonProperties) {\r\n enProps.jsonProperties = JSON.parse(props.iModel[_nativeDb].patchJsonProperties(props.row.jsonProperties));\r\n }\r\n // Auto handles all properties that are not in the 'customHandledProperties' list\r\n const customHandledProperties = this.getCustomHandledProperties();\r\n Object.keys(props.row)\r\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\r\n .forEach((propertyName) => (enProps as ECSqlRow)[propertyName] = props.row[propertyName]\r\n );\r\n // Handles custom relClassNames to use '.' instead of ':'\r\n Object.keys(enProps).forEach((propertyName) => {\r\n if ((enProps as ECSqlRow)[propertyName].relClassName !== undefined && propertyName !== \"modeledElement\" && propertyName !== \"parentModel\") {\r\n (enProps as ECSqlRow)[propertyName].relClassName = (enProps as ECSqlRow)[propertyName].relClassName.replace(':', '.');\r\n }\r\n });\r\n return enProps;\r\n }\r\n\r\n /** Converts an EntityProps to an ECSqlRow. This is used to serialize an Entity to prepare to write it to the database.\r\n * @beta */\r\n public static serialize(props: EntityProps, _iModel: IModelDb): ECSqlRow {\r\n const inst: ECSqlRow = {\r\n classFullName: props.classFullName,\r\n id: props.id,\r\n }\r\n\r\n const customHandledProperties = this.getCustomHandledProperties();\r\n Object.keys(props)\r\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\r\n .forEach((propertyName) => inst[propertyName] = (props as ECSqlRow)[propertyName]\r\n );\r\n return inst;\r\n }\r\n\r\n /** Obtain the JSON representation of this Entity. Subclasses of [[Entity]] typically override this method to return their corresponding sub-type of [EntityProps]($common) -\r\n * for example, [[GeometricElement.toJSON]] returns a [GeometricElementProps]($common).\r\n */\r\n public toJSON(): EntityProps {\r\n const val: any = {};\r\n val.classFullName = this.classFullName;\r\n if (Id64.isValid(this.id))\r\n val.id = this.id;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this.forEachProperty((propName: string) => val[propName] = (this as any)[propName], false);\r\n return val;\r\n }\r\n\r\n /** Call a function for each property of this Entity.\r\n * @param func The callback to be invoked on each property\r\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\r\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `forEach` to get the metadata and iterate over the properties instead.\r\n *\r\n * @example\r\n * ```typescript\r\n * // Deprecated method\r\n * entity.forEachProperty((name, propMetaData) => {\r\n * console.log(`Property name: ${name}, Property type: ${propMetaData.primitiveType}`);\r\n * });\r\n *\r\n * // New method\r\n * entity.forEach((name, property) => {\r\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\r\n * });\r\n * ```\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n public forEachProperty(func: PropertyCallback, includeCustom: boolean = true) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this.iModel.forEachMetaData(this.classFullName, true, func, includeCustom);\r\n }\r\n\r\n /**\r\n * Call a function for each property of this Entity.\r\n * @param func The callback to be invoked on each property.\r\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\r\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\r\n * @throws Error if metadata for the class cannot be retrieved.\r\n *\r\n * @example\r\n * ```typescript\r\n * entity.forEach((name, property) => {\r\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\r\n * });\r\n * ```\r\n */\r\n public forEach(func: PropertyHandler, includeCustom: boolean = true) {\r\n const item = this._metadata ?? this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey);\r\n\r\n if (EntityClass.isEntityClass(item) || RelationshipClass.isRelationshipClass(item)) {\r\n for (const property of item.getPropertiesSync()) {\r\n if (includeCustom || !property.customAttributes?.has(`BisCore.CustomHandledProperty`))\r\n func(property.name, property);\r\n }\r\n } else {\r\n throw new Error(`Cannot get metadata for ${this.classFullName}. Class is not an EntityClass or RelationshipClass.`);\r\n }\r\n }\r\n\r\n /** Get the full BIS class name of this Entity in the form \"schema:class\" */\r\n public static get classFullName(): string { return `${this.schema.schemaName}:${this.className}`; }\r\n\r\n /** Get the full BIS class name of this Entity in the form \"schema:class\". */\r\n public get classFullName(): string { return this._ctor.classFullName; }\r\n /**\r\n * Get the item key used by the ecschema-metadata package to identify this entity class\r\n * @public @preview\r\n */\r\n public get schemaItemKey(): SchemaItemKey { return this._ctor.schemaItemKey; }\r\n\r\n /** Query metadata for this entity class from the iModel's schema. Returns cached metadata if available.\r\n * @throws [[IModelError]] if there is a problem querying the schema\r\n * @returns The metadata for the current entity\r\n * @public @preview\r\n */\r\n public async getMetaData(): Promise<EntityClass | RelationshipClass> {\r\n if (this._metadata) {\r\n return this._metadata;\r\n }\r\n\r\n const ecClass = await this.iModel.schemaContext.getSchemaItem(this.schemaItemKey, ECClass);\r\n if (EntityClass.isEntityClass(ecClass) || RelationshipClass.isRelationshipClass(ecClass)) {\r\n this._metadata = ecClass;\r\n return this._metadata;\r\n } else {\r\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public getMetaDataSync(): EntityClass | RelationshipClass {\r\n if (this._metadata) {\r\n return this._metadata;\r\n }\r\n\r\n const ecClass = this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey, ECClass);\r\n if (EntityClass.isEntityClass(ecClass) || RelationshipClass.isRelationshipClass(ecClass)) {\r\n this._metadata = ecClass;\r\n return this._metadata;\r\n } else {\r\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\r\n }\r\n }\r\n \r\n /** @internal */\r\n public static get protectedOperations(): string[] { return []; }\r\n\r\n /** return whether this Entity class is a subclass of another Entity class\r\n * @note the subclass-ness is checked according to JavaScript inheritance, to check the underlying raw EC class's\r\n * inheritance, you can use [ECClass.is]($ecschema-metadata)\r\n * @note this should have a type of `is<T extends typeof Entity>(otherClass: T): this is T` but can't because of\r\n * typescript's restriction on the `this` type in static methods\r\n */\r\n public static is(otherClass: typeof Entity): boolean {\r\n // inline of @itwin/core-bentley's isSubclassOf due to protected constructor.\r\n return this === otherClass || this.prototype instanceof otherClass;\r\n }\r\n\r\n /** whether this JavaScript class was generated for this ECClass because there was no registered custom implementation\r\n * ClassRegistry overrides this when generating a class\r\n * @internal\r\n */\r\n public static get isGeneratedClass() { return false; }\r\n\r\n /** Get the set of this entity's *entity references*, [EntityReferenceSet]($backend). An *entity reference* is any id\r\n * stored on the entity, in its EC properties or json fields.\r\n * This is important for cloning operations but can be useful in other situations as well.\r\n * @see this.collectReferenceIds\r\n * @beta\r\n */\r\n public getReferenceIds(): EntityReferenceSet {\r\n const referenceIds = new EntityReferenceSet();\r\n this.collectReferenceIds(referenceIds);\r\n return referenceIds;\r\n }\r\n\r\n /** Collect the Ids of this entity's *references* at this level of the class hierarchy.\r\n * A *reference* is any entity referenced by this entity's EC Data, including json fields.\r\n * This is important for cloning operations but can be useful in other situations as well.\r\n * @param _referenceIds The Id64Set to populate with reference Ids.\r\n * @note This should be overridden (with `super` called) at each level the class hierarchy that introduces references.\r\n * @see getReferenceIds\r\n * @beta\r\n */\r\n protected collectReferenceIds(_referenceIds: EntityReferenceSet): void {\r\n return; // no references by default\r\n }\r\n}\r\n\r\n/** A callback function to process properties of an Entity\r\n * @public @preview\r\n */\r\nexport type PropertyHandler = (name: string, property: Property) => void;\r\n\r\n/** Parameter type that can accept both abstract constructor types and non-abstract constructor types for `instanceof` to test.\r\n * @public @preview\r\n */\r\nexport type EntityClassType<T> = Function & { prototype: T }; // eslint-disable-line @typescript-eslint/no-unsafe-function-type\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityReferences.js","sourceRoot":"","sources":["../../src/EntityReferences.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAiE,MAAM,oBAAoB,CAAC;AACxH,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAcjC;;;GAGG;AACH,MAAM,KAAW,gBAAgB,CAkEhC;AAlED,WAAiB,gBAAgB;IAC/B,SAAgB,OAAO,CAAC,EAAmB;QACzC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,mBAAmB,CAAC,KAAK,CAAC;IAC7C,CAAC;IAFe,wBAAO,UAEtB,CAAA;IACD,SAAgB,SAAS,CAAC,EAAmB;QAC3C,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,mBAAmB,CAAC,OAAO,CAAC;IAC/C,CAAC;IAFe,0BAAS,YAExB,CAAA;IACD,SAA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,EAAE,CAAC;IACxB,CAAC;IAHe,0BAAS,YAGxB,CAAA;IAED,4EAA4E;IAC5E,SAAgB,cAAc,CAAC,EAAc,EAAE,IAAyB;QACtE,OAAO,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC;IACxB,CAAC;IAFe,+BAAc,iBAE7B,CAAA;IAED,+FAA+F;IAC/F,SAAgB,aAAa,CAAC,WAA0B;QACtD,IAAI,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC;YACzB,OAAO,mBAAmB,CAAC,OAAO,CAAC;aAChC,IAAI,WAAW,CAAC,EAAE,CAAC,aAAa,CAAC;YACpC,OAAO,mBAAmB,CAAC,aAAa,CAAC;aACtC,IAAI,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC;YAC5B,OAAO,mBAAmB,CAAC,KAAK,CAAC;aAC9B,IAAI,WAAW,CAAC,EAAE,CAAC,YAAY,CAAC;YACnC,OAAO,mBAAmB,CAAC,YAAY,CAAC;;YAExC,MAAM,CAAC,KAAK,EAAE,iEAAiE,CAAC,CAAC;IACrF,CAAC;IAXe,8BAAa,gBAW5B,CAAA;AACH,CAAC,EAlEgB,gBAAgB,KAAhB,gBAAgB,QAkEhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Schema\n */\n\nimport { ConcreteEntityTypes, ElementAspectProps, ElementProps, EntityReference, ModelProps } from \"@itwin/core-common\";\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\nimport type { Entity } from \"./Entity\";\nimport { Model } from \"./Model\";\nimport { Element } from \"./Element\";\nimport { ElementAspect } from \"./ElementAspect\";\nimport { Relationship, RelationshipProps } from \"./Relationship\";\nimport * as assert from \"assert\";\n\n/** Concrete classes that can be created, with the notable exception of CodeSpecs since it is does not derive from Entity\n * other entity classes. In the future if there is a need\n * to manage them this way, it can be added\n * @alpha\n */\nexport type ConcreteEntity = Element | Model | ElementAspect | Relationship;\n\n/** Props for a [[ConcreteEntity]]\n * @alpha\n */\nexport type ConcreteEntityProps = ElementProps | ModelProps | ElementAspectProps | RelationshipProps;\n\n/**\n * Utilities for the [EntityReference]($common) type which is a kind of strings\n * @alpha\n */\nexport namespace EntityReferences {\n export function isModel(id: EntityReference) {\n return id[0] === ConcreteEntityTypes.Model;\n }\n export function isElement(id: EntityReference) {\n return id[0] === ConcreteEntityTypes.Element;\n }\n export function isElementAspect(id: EntityReference) {\n return id[0] === ConcreteEntityTypes.ElementAspect;\n }\n export function isRelationship(id: EntityReference) {\n return id[0] === ConcreteEntityTypes.Relationship;\n }\n export function toId64(id: EntityReference) {\n return id.slice(1);\n }\n\n /** split a concrete entity id into its type and raw id */\n export function split(id: EntityReference): [ConcreteEntityTypes, Id64String] {\n return [id[0] as ConcreteEntityTypes, id.slice(1)];\n }\n\n /** used by the transformer to figure out where to check for the existence in a db of a concrete element id\n * @internal\n */\n export function isValid(id: EntityReference): boolean {\n return Id64.isValid(toId64(id));\n }\n\n /** create the invalid id for a concrete entity type\n * @internal\n */\n export function makeInvalid(type: ConcreteEntityTypes): EntityReference {\n return `${type}${Id64.invalid}`;\n }\n\n /** create an EntityReference given an entity */\n export function from(entity: ConcreteEntity): EntityReference {\n const type = typeFromClass(entity.constructor as typeof Entity);\n return `${type}${entity.id}`;\n }\n\n /** create an EntityReference given an id and a JavaScript class */\n export function fromClass(id: Id64String, entityClass: typeof Entity): EntityReference {\n const type = typeFromClass(entityClass);\n return `${type}${id}`;\n }\n\n /** Create an EntityReference quickly from an exact reference type and id */\n export function fromEntityType(id: Id64String, type: ConcreteEntityTypes): EntityReference {\n return `${type}${id}`;\n }\n\n /** @internal the argument entityClass be concrete (i.e. not the Entity abstract base class) */\n export function typeFromClass(entityClass: typeof Entity): ConcreteEntityTypes {\n if (entityClass.is(Element))\n return ConcreteEntityTypes.Element;\n else if (entityClass.is(ElementAspect))\n return ConcreteEntityTypes.ElementAspect;\n else if (entityClass.is(Model))\n return ConcreteEntityTypes.Model;\n else if (entityClass.is(Relationship))\n return ConcreteEntityTypes.Relationship;\n else\n assert(false, \"unknown or abstract entity type passed to EntityReferences.from\");\n }\n}\n"]}
1
+ {"version":3,"file":"EntityReferences.js","sourceRoot":"","sources":["../../src/EntityReferences.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAiE,MAAM,oBAAoB,CAAC;AACxH,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAcjC;;;GAGG;AACH,MAAM,KAAW,gBAAgB,CAkEhC;AAlED,WAAiB,gBAAgB;IAC/B,SAAgB,OAAO,CAAC,EAAmB;QACzC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,mBAAmB,CAAC,KAAK,CAAC;IAC7C,CAAC;IAFe,wBAAO,UAEtB,CAAA;IACD,SAAgB,SAAS,CAAC,EAAmB;QAC3C,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,mBAAmB,CAAC,OAAO,CAAC;IAC/C,CAAC;IAFe,0BAAS,YAExB,CAAA;IACD,SAAgB,eAAe,CAAC,EAAmB;QACjD,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,mBAAmB,CAAC,aAAa,CAAC;IACrD,CAAC;IAFe,gCAAe,kBAE9B,CAAA;IACD,SAAgB,cAAc,CAAC,EAAmB;QAChD,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,mBAAmB,CAAC,YAAY,CAAC;IACpD,CAAC;IAFe,+BAAc,iBA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AW,CAAC,EAAE,CAAC,OAAO,CAAC;YACzB,OAAO,mBAAmB,CAAC,OAAO,CAAC;aAChC,IAAI,WAAW,CAAC,EAAE,CAAC,aAAa,CAAC;YACpC,OAAO,mBAAmB,CAAC,aAAa,CAAC;aACtC,IAAI,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC;YAC5B,OAAO,mBAAmB,CAAC,KAAK,CAAC;aAC9B,IAAI,WAAW,CAAC,EAAE,CAAC,YAAY,CAAC;YACnC,OAAO,mBAAmB,CAAC,YAAY,CAAC;;YAExC,MAAM,CAAC,KAAK,EAAE,iEAAiE,CAAC,CAAC;IACrF,CAAC;IAXe,8BAAa,gBAW5B,CAAA;AACH,CAAC,EAlEgB,gBAAgB,KAAhB,gBAAgB,QAkEhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Schema\r\n */\r\n\r\nimport { ConcreteEntityTypes, ElementAspectProps, ElementProps, EntityReference, ModelProps } from \"@itwin/core-common\";\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport type { Entity } from \"./Entity\";\r\nimport { Model } from \"./Model\";\r\nimport { Element } from \"./Element\";\r\nimport { ElementAspect } from \"./ElementAspect\";\r\nimport { Relationship, RelationshipProps } from \"./Relationship\";\r\nimport * as assert from \"assert\";\r\n\r\n/** Concrete classes that can be created, with the notable exception of CodeSpecs since it is does not derive from Entity\r\n * other entity classes. In the future if there is a need\r\n * to manage them this way, it can be added\r\n * @alpha\r\n */\r\nexport type ConcreteEntity = Element | Model | ElementAspect | Relationship;\r\n\r\n/** Props for a [[ConcreteEntity]]\r\n * @alpha\r\n */\r\nexport type ConcreteEntityProps = ElementProps | ModelProps | ElementAspectProps | RelationshipProps;\r\n\r\n/**\r\n * Utilities for the [EntityReference]($common) type which is a kind of strings\r\n * @alpha\r\n */\r\nexport namespace EntityReferences {\r\n export function isModel(id: EntityReference) {\r\n return id[0] === ConcreteEntityTypes.Model;\r\n }\r\n export function isElement(id: EntityReference) {\r\n return id[0] === ConcreteEntityTypes.Element;\r\n }\r\n export function isElementAspect(id: EntityReference) {\r\n return id[0] === ConcreteEntityTypes.ElementAspect;\r\n }\r\n export function isRelationship(id: EntityReference) {\r\n return id[0] === ConcreteEntityTypes.Relationship;\r\n }\r\n export function toId64(id: EntityReference) {\r\n return id.slice(1);\r\n }\r\n\r\n /** split a concrete entity id into its type and raw id */\r\n export function split(id: EntityReference): [ConcreteEntityTypes, Id64String] {\r\n return [id[0] as ConcreteEntityTypes, id.slice(1)];\r\n }\r\n\r\n /** used by the transformer to figure out where to check for the existence in a db of a concrete element id\r\n * @internal\r\n */\r\n export function isValid(id: EntityReference): boolean {\r\n return Id64.isValid(toId64(id));\r\n }\r\n\r\n /** create the invalid id for a concrete entity type\r\n * @internal\r\n */\r\n export function makeInvalid(type: ConcreteEntityTypes): EntityReference {\r\n return `${type}${Id64.invalid}`;\r\n }\r\n\r\n /** create an EntityReference given an entity */\r\n export function from(entity: ConcreteEntity): EntityReference {\r\n const type = typeFromClass(entity.constructor as typeof Entity);\r\n return `${type}${entity.id}`;\r\n }\r\n\r\n /** create an EntityReference given an id and a JavaScript class */\r\n export function fromClass(id: Id64String, entityClass: typeof Entity): EntityReference {\r\n const type = typeFromClass(entityClass);\r\n return `${type}${id}`;\r\n }\r\n\r\n /** Create an EntityReference quickly from an exact reference type and id */\r\n export function fromEntityType(id: Id64String, type: ConcreteEntityTypes): EntityReference {\r\n return `${type}${id}`;\r\n }\r\n\r\n /** @internal the argument entityClass be concrete (i.e. not the Entity abstract base class) */\r\n export function typeFromClass(entityClass: typeof Entity): ConcreteEntityTypes {\r\n if (entityClass.is(Element))\r\n return ConcreteEntityTypes.Element;\r\n else if (entityClass.is(ElementAspect))\r\n return ConcreteEntityTypes.ElementAspect;\r\n else if (entityClass.is(Model))\r\n return ConcreteEntityTypes.Model;\r\n else if (entityClass.is(Relationship))\r\n return ConcreteEntityTypes.Relationship;\r\n else\r\n assert(false, \"unknown or abstract entity type passed to EntityReferences.from\");\r\n }\r\n}\r\n"]}
@@ -49,7 +49,7 @@ export interface ExportGraphicsMesh {
49
49
  normals: Float32Array;
50
50
  /** Parameters (uvs) for this mesh, laid out in the pattern XYXY */
51
51
  params: Float32Array;
52
- /** If true, clients should assume both sides of the mesh are visible and not cull backfaces. */
52
+ /** If true, clients should assume both sides of the mesh are visible and not cull back faces. */
53
53
  isTwoSided: boolean;
54
54
  }
55
55
  /** Info provided to ExportGraphicsFunction about graphics.
@@ -273,18 +273,19 @@ export declare class ExportGraphicsMeshVisitor extends PolyfaceData implements P
273
273
  private _nextFacetIndex;
274
274
  private _numWrap;
275
275
  private _polyface;
276
- private constructor();
276
+ protected constructor(facets: ExportGraphicsMesh, numWrap: number);
277
277
  /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays
278
278
  * Typical wrap counts are:
279
- * * 0 -- leave the point arrays with "missing final edge"
279
+ * * 0 -- leave the point arrays with "missing final edge" (default)
280
280
  * * 1 -- add point 0 as closure point
281
281
  * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.
282
282
  */
283
- static create(polyface: ExportGraphicsMesh, numWrap: number): ExportGraphicsMeshVisitor;
284
- /** Reset the iterator to start at the first facet of the polyface. */
283
+ static create(polyface: ExportGraphicsMesh, numWrap?: number): ExportGraphicsMeshVisitor;
284
+ /** Restart the visitor at the first facet. */
285
285
  reset(): void;
286
286
  /** Select a facet by simple index. */
287
287
  moveToReadIndex(facetIndex: number): boolean;
288
+ /** Load data for the next facet. */
288
289
  moveToNextFacet(): boolean;
289
290
  /** Set the number of vertices to replicate in visitor arrays. */
290
291
  setNumWrap(numWrap: number): void;
@@ -300,12 +301,12 @@ export declare class ExportGraphicsMeshVisitor extends PolyfaceData implements P
300
301
  * Use the artificial paramIndex, which matches pointIndex.
301
302
  */
302
303
  clientNormalIndex(i: number): number;
303
- /** Return the color index of vertex i within the currently loaded facet */
304
+ /** Always returns -1 since we never have colors. */
304
305
  clientColorIndex(_i: number): number;
305
- /** Return the aux data index of vertex i within the currently loaded facet */
306
+ /** Always returns -1 since we never have auxiliary data. */
306
307
  clientAuxIndex(_i: number): number;
307
308
  /** return the client polyface */
308
- clientPolyface(): Polyface;
309
+ clientPolyface(): Polyface | undefined;
309
310
  /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */
310
311
  clearArrays(): void;
311
312
  /** transfer interpolated data from the other visitor.
@@ -314,5 +315,50 @@ export declare class ExportGraphicsMeshVisitor extends PolyfaceData implements P
314
315
  pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void;
315
316
  /** transfer data from a specified index of the other visitor as new data in this visitor. */
316
317
  pushDataFrom(other: PolyfaceVisitor, index: number): void;
318
+ /** Return the number of facets this visitor is able to visit */
319
+ getVisitableFacetCount(): number;
320
+ /** Create a visitor for a subset of the facets visitable by the instance. */
321
+ createSubsetVisitor(facetIndices: number[], numWrap?: number): ExportGraphicsMeshSubsetVisitor;
322
+ }
323
+ /**
324
+ * An `ExportGraphicsMeshSubsetVisitor` is an `ExportGraphicsMeshVisitor` which only visits a subset of the facets.
325
+ * * The subset is defined by an array of facet indices provided when this visitor is created.
326
+ * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.
327
+ * @public
328
+ */
329
+ export declare class ExportGraphicsMeshSubsetVisitor extends ExportGraphicsMeshVisitor {
330
+ private _facetIndices;
331
+ private _currentSubsetIndex;
332
+ private _nextSubsetIndex;
333
+ private constructor();
334
+ private isValidSubsetIndex;
335
+ /**
336
+ * Create a visitor for iterating a subset of the facets of `polyface`.
337
+ * @param polyface reference to the client polyface, supplying facets
338
+ * @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.
339
+ * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.
340
+ */
341
+ static createSubsetVisitor(polyface: ExportGraphicsMesh, facetIndices: number[], numWrap?: number): ExportGraphicsMeshSubsetVisitor;
342
+ /**
343
+ * Advance the iterator to a particular facet in the subset of client polyface facets.
344
+ * @param subsetIndex index into the subset array, not to be confused with the client facet index.
345
+ * @return whether the iterator was successfully moved.
346
+ */
347
+ moveToReadIndex(subsetIndex: number): boolean;
348
+ /**
349
+ * Advance the iterator to the next facet in the subset of client polyface facets.
350
+ * @return whether the iterator was successfully moved.
351
+ */
352
+ moveToNextFacet(): boolean;
353
+ /** Restart the visitor at the first facet. */
354
+ reset(): void;
355
+ /**
356
+ * Return the client polyface facet index (aka "readIndex") for the given subset index.
357
+ * @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.
358
+ * @return valid client polyface facet index, or `undefined` if invalid subset index.
359
+ */
360
+ parentFacetIndex(subsetIndex?: number): number | undefined;
361
+ /** Return the number of facets this visitor is able to visit. */
362
+ getVisitableFacetCount(): number;
317
363
  }
318
364
  //# sourceMappingURL=ExportGraphics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExportGraphics.d.ts","sourceRoot":"","sources":["../../src/ExportGraphics.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAElE;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,OAAO,EAAE,UAAU,CAAC;IACpB,+DAA+D;IAC/D,MAAM,EAAE,YAAY,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,SAAS,EAAE,UAAU,CAAC;IACtB,kEAAkE;IAClE,WA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E;IACzD,sBAAsB,IAAI,MAAM;IAGvC,6EAA6E;IACtE,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAU,GAAG,+BAA+B;CAGzG;AAED;;;;;GAKG;AACH,qBAAa,+BAAgC,SAAQ,yBAAyB;IAC5E,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,mBAAmB,CAAS;IACpC,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAO;IAOP,OAAO,CAAC,kBAAkB;IAG1B;;;;;OAKG;WACW,mBAAmB,CAC/B,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAU,GACxE,+BAA+B;IAGlC;;;;OAIG;IACa,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAQ7D;;;OAGG;IACa,eAAe,IAAI,OAAO;IAM1C,8CAA8C;IAC9B,KAAK,IAAI,IAAI;IAM7B;;;;OAIG;IACI,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAKjE,iEAAiE;IACjD,sBAAsB,IAAI,MAAM;CAGjD"}
@@ -76,105 +76,122 @@ export class ExportGraphicsMeshVisitor extends PolyfaceData {
76
76
  _nextFacetIndex;
77
77
  _numWrap;
78
78
  _polyface;
79
- // to be called from static factory method that validates the polyface ...
80
79
  constructor(facets, numWrap) {
81
80
  super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);
82
81
  this._polyface = facets;
83
82
  this._numWrap = numWrap;
84
83
  this._nextFacetIndex = 0;
85
84
  this._currentFacetIndex = -1;
86
- this.twoSided = facets.isTwoSided;
87
85
  this.reset();
88
86
  }
89
87
  /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays
90
88
  * Typical wrap counts are:
91
- * * 0 -- leave the point arrays with "missing final edge"
89
+ * * 0 -- leave the point arrays with "missing final edge" (default)
92
90
  * * 1 -- add point 0 as closure point
93
91
  * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.
94
92
  */
95
- static create(polyface, numWrap) {
93
+ static create(polyface, numWrap = 0) {
96
94
  return new ExportGraphicsMeshVisitor(polyface, numWrap);
97
95
  }
98
- /** Reset the iterator to start at the first facet of the polyface. */
96
+ /** Restart the visitor at the first facet. */
99
97
  reset() {
100
98
  this.moveToReadIndex(0);
101
- this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.
99
+ this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here
102
100
  }
103
101
  /** Select a facet by simple index. */
104
102
  moveToReadIndex(facetIndex) {
105
103
  if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)
106
104
  return false;
107
- this._currentFacetIndex = facetIndex;
108
- this._nextFacetIndex = facetIndex + 1;
109
- this.point.length = 0;
110
- const points = this.point;
111
- points.length = 0;
112
- this.pointIndex.length = 0;
113
- this.point.length = 0;
114
- this.edgeVisible.length = 0;
115
- const sourcePoints = this._polyface.points;
116
- const indices = this._polyface.indices;
117
- const i0 = 3 * facetIndex;
118
- for (let i = i0; i < i0 + 3; i++) {
119
- const k = 3 * indices[i];
120
- this.pointIndex.push(indices[i]);
121
- this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);
122
- this.edgeVisible.push(true);
123
- }
124
- for (let i = 0; i < this._numWrap; i++) {
125
- this.point.pushFromGrowableXYZArray(this.point, i);
126
- }
127
- const sourceParams = this._polyface.params;
128
- if (sourceParams.length > 0 && this.paramIndex && this.param) {
129
- this.paramIndex.length = 0;
130
- this.param.length = 0;
105
+ if (this._currentFacetIndex !== facetIndex || 3 + this._numWrap !== this.point.length) {
106
+ this._currentFacetIndex = facetIndex;
107
+ this.point.length = 0;
108
+ this.pointIndex.length = 0;
109
+ this.edgeVisible.length = 0;
110
+ const sourcePoints = this._polyface.points;
111
+ const indices = this._polyface.indices;
112
+ const i0 = 3 * facetIndex;
131
113
  for (let i = i0; i < i0 + 3; i++) {
132
- const k = 2 * indices[i];
133
- this.paramIndex.push(indices[i]);
134
- this.param.pushXY(sourceParams[k], sourceParams[k + 1]);
114
+ const k = 3 * indices[i];
115
+ this.pointIndex.push(indices[i]);
116
+ this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);
117
+ this.edgeVisible.push(true);
135
118
  }
136
119
  for (let i = 0; i < this._numWrap; i++) {
137
- this.param.pushFromGrowableXYArray(this.param, i);
120
+ this.point.pushFromGrowableXYZArray(this.point, i);
138
121
  }
139
- }
140
- const sourceNormals = this._polyface.normals;
141
- if (sourceNormals.length > 0 && this.normalIndex && this.normal) {
142
- this.normalIndex.length = 0;
143
- this.normal.length = 0;
144
- for (let i = i0; i < i0 + 3; i++) {
145
- const k = 3 * indices[i];
146
- this.normalIndex.push(indices[i]);
147
- this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);
122
+ const sourceParams = this._polyface.params;
123
+ if (sourceParams.length > 0 && this.paramIndex && this.param) {
124
+ this.paramIndex.length = 0;
125
+ this.param.length = 0;
126
+ for (let i = i0; i < i0 + 3; i++) {
127
+ const k = 2 * indices[i];
128
+ this.paramIndex.push(indices[i]);
129
+ this.param.pushXY(sourceParams[k], sourceParams[k + 1]);
130
+ }
131
+ for (let i = 0; i < this._numWrap; i++) {
132
+ this.param.pushFromGrowableXYArray(this.param, i);
133
+ }
148
134
  }
149
- for (let i = 0; i < this._numWrap; i++) {
150
- this.normal.pushFromGrowableXYZArray(this.normal, i);
135
+ const sourceNormals = this._polyface.normals;
136
+ if (sourceNormals.length > 0 && this.normalIndex && this.normal) {
137
+ this.normalIndex.length = 0;
138
+ this.normal.length = 0;
139
+ for (let i = i0; i < i0 + 3; i++) {
140
+ const k = 3 * indices[i];
141
+ this.normalIndex.push(indices[i]);
142
+ this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);
143
+ }
144
+ for (let i = 0; i < this._numWrap; i++) {
145
+ this.normal.pushFromGrowableXYZArray(this.normal, i);
146
+ }
151
147
  }
152
148
  }
149
+ this._nextFacetIndex = facetIndex + 1;
153
150
  return true;
154
151
  }
152
+ /** Load data for the next facet. */
155
153
  moveToNextFacet() {
156
- return this.moveToReadIndex(this._nextFacetIndex);
154
+ if (this._nextFacetIndex !== this._currentFacetIndex)
155
+ return this.moveToReadIndex(this._nextFacetIndex);
156
+ this._nextFacetIndex++;
157
+ return true;
157
158
  }
158
159
  /** Set the number of vertices to replicate in visitor arrays. */
159
- setNumWrap(numWrap) { this._numWrap = numWrap; }
160
+ setNumWrap(numWrap) {
161
+ this._numWrap = numWrap;
162
+ }
160
163
  /** Return the index (in the client polyface) of the current facet */
161
- currentReadIndex() { return this._currentFacetIndex; }
164
+ currentReadIndex() {
165
+ return this._currentFacetIndex;
166
+ }
162
167
  /** Return the point index of vertex i within the currently loaded facet */
163
- clientPointIndex(i) { return this.pointIndex[i]; }
168
+ clientPointIndex(i) {
169
+ return this.pointIndex[i];
170
+ }
164
171
  /** Return the param index of vertex i within the currently loaded facet.
165
172
  * Use the artificial paramIndex, which matches pointIndex.
166
173
  */
167
- clientParamIndex(i) { return this.paramIndex ? this.paramIndex[i] : -1; }
174
+ clientParamIndex(i) {
175
+ return this.paramIndex ? this.paramIndex[i] : -1;
176
+ }
168
177
  /** Return the normal index of vertex i within the currently loaded facet.
169
178
  * Use the artificial paramIndex, which matches pointIndex.
170
179
  */
171
- clientNormalIndex(i) { return this.normalIndex ? this.normalIndex[i] : -1; }
172
- /** Return the color index of vertex i within the currently loaded facet */
173
- clientColorIndex(_i) { return 1; }
174
- /** Return the aux data index of vertex i within the currently loaded facet */
175
- clientAuxIndex(_i) { return -1; }
180
+ clientNormalIndex(i) {
181
+ return this.normalIndex ? this.normalIndex[i] : -1;
182
+ }
183
+ /** Always returns -1 since we never have colors. */
184
+ clientColorIndex(_i) {
185
+ return -1;
186
+ }
187
+ /** Always returns -1 since we never have auxiliary data. */
188
+ clientAuxIndex(_i) {
189
+ return -1;
190
+ }
176
191
  /** return the client polyface */
177
- clientPolyface() { return undefined; }
192
+ clientPolyface() {
193
+ return undefined;
194
+ }
178
195
  /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */
179
196
  clearArrays() {
180
197
  if (this.point !== undefined)
@@ -198,12 +215,93 @@ export class ExportGraphicsMeshVisitor extends PolyfaceData {
198
215
  /** transfer data from a specified index of the other visitor as new data in this visitor. */
199
216
  pushDataFrom(other, index) {
200
217
  this.point.pushFromGrowableXYZArray(other.point, index);
201
- if (this.color && other.color && index < other.color.length)
202
- this.color.push(other.color[index]);
203
218
  if (this.param && other.param && index < other.param.length)
204
219
  this.param.pushFromGrowableXYArray(other.param, index);
205
220
  if (this.normal && other.normal && index < other.normal.length)
206
221
  this.normal.pushFromGrowableXYZArray(other.normal, index);
222
+ // ignore color and aux -- they never exist.
223
+ }
224
+ /** Return the number of facets this visitor is able to visit */
225
+ getVisitableFacetCount() {
226
+ return Math.floor(this._polyface.indices.length / 3);
227
+ }
228
+ /** Create a visitor for a subset of the facets visitable by the instance. */
229
+ createSubsetVisitor(facetIndices, numWrap = 0) {
230
+ return ExportGraphicsMeshSubsetVisitor.createSubsetVisitor(this._polyface, facetIndices, numWrap);
231
+ }
232
+ }
233
+ /**
234
+ * An `ExportGraphicsMeshSubsetVisitor` is an `ExportGraphicsMeshVisitor` which only visits a subset of the facets.
235
+ * * The subset is defined by an array of facet indices provided when this visitor is created.
236
+ * * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.
237
+ * @public
238
+ */
239
+ export class ExportGraphicsMeshSubsetVisitor extends ExportGraphicsMeshVisitor {
240
+ _facetIndices;
241
+ _currentSubsetIndex; // index within _facetIndices
242
+ _nextSubsetIndex; // index within _facetIndices
243
+ constructor(polyface, facetIndices, numWrap) {
244
+ super(polyface, numWrap);
245
+ this._facetIndices = facetIndices.slice();
246
+ this._currentSubsetIndex = -1;
247
+ this._nextSubsetIndex = 0;
248
+ this.reset();
249
+ }
250
+ isValidSubsetIndex(index) {
251
+ return index >= 0 && index < this._facetIndices.length;
252
+ }
253
+ /**
254
+ * Create a visitor for iterating a subset of the facets of `polyface`.
255
+ * @param polyface reference to the client polyface, supplying facets
256
+ * @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.
257
+ * @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.
258
+ */
259
+ static createSubsetVisitor(polyface, facetIndices, numWrap = 0) {
260
+ return new ExportGraphicsMeshSubsetVisitor(polyface, facetIndices, numWrap);
261
+ }
262
+ /**
263
+ * Advance the iterator to a particular facet in the subset of client polyface facets.
264
+ * @param subsetIndex index into the subset array, not to be confused with the client facet index.
265
+ * @return whether the iterator was successfully moved.
266
+ */
267
+ moveToReadIndex(subsetIndex) {
268
+ if (this.isValidSubsetIndex(subsetIndex)) {
269
+ this._currentSubsetIndex = subsetIndex;
270
+ this._nextSubsetIndex = subsetIndex + 1;
271
+ return super.moveToReadIndex(this._facetIndices[subsetIndex]);
272
+ }
273
+ return false;
274
+ }
275
+ /**
276
+ * Advance the iterator to the next facet in the subset of client polyface facets.
277
+ * @return whether the iterator was successfully moved.
278
+ */
279
+ moveToNextFacet() {
280
+ if (this._nextSubsetIndex !== this._currentSubsetIndex)
281
+ return this.moveToReadIndex(this._nextSubsetIndex);
282
+ this._nextSubsetIndex++;
283
+ return true;
284
+ }
285
+ /** Restart the visitor at the first facet. */
286
+ reset() {
287
+ if (this._facetIndices) { // avoid crash during super ctor when we aren't yet initialized
288
+ this.moveToReadIndex(0);
289
+ this._nextSubsetIndex = 0; // so immediate moveToNextFacet stays here
290
+ }
291
+ }
292
+ /**
293
+ * Return the client polyface facet index (aka "readIndex") for the given subset index.
294
+ * @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.
295
+ * @return valid client polyface facet index, or `undefined` if invalid subset index.
296
+ */
297
+ parentFacetIndex(subsetIndex) {
298
+ if (undefined === subsetIndex)
299
+ subsetIndex = this._currentSubsetIndex;
300
+ return this.isValidSubsetIndex(subsetIndex) ? this._facetIndices[subsetIndex] : undefined;
301
+ }
302
+ /** Return the number of facets this visitor is able to visit. */
303
+ getVisitableFacetCount() {
304
+ return this._facetIndices.length;
207
305
  }
208
306
  }
209
307
  //# sourceMappingURL=ExportGraphics.js.map