@itwin/core-common 5.0.0-dev.8 → 5.0.0-dev.82

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 (724) hide show
  1. package/CHANGELOG.md +50 -1
  2. package/lib/cjs/AmbientOcclusion.js +17 -9
  3. package/lib/cjs/AmbientOcclusion.js.map +1 -1
  4. package/lib/cjs/AnalysisStyle.d.ts +0 -3
  5. package/lib/cjs/AnalysisStyle.d.ts.map +1 -1
  6. package/lib/cjs/AnalysisStyle.js +20 -4
  7. package/lib/cjs/AnalysisStyle.js.map +1 -1
  8. package/lib/cjs/Atmosphere.js +39 -21
  9. package/lib/cjs/Atmosphere.js.map +1 -1
  10. package/lib/cjs/BackgroundMapProvider.js +4 -0
  11. package/lib/cjs/BackgroundMapProvider.js.map +1 -1
  12. package/lib/cjs/BackgroundMapSettings.js +19 -0
  13. package/lib/cjs/BackgroundMapSettings.js.map +1 -1
  14. package/lib/cjs/BlobReader.js +8 -6
  15. package/lib/cjs/BlobReader.js.map +1 -1
  16. package/lib/cjs/BriefcaseTypes.d.ts +2 -2
  17. package/lib/cjs/BriefcaseTypes.d.ts.map +1 -1
  18. package/lib/cjs/BriefcaseTypes.js.map +1 -1
  19. package/lib/cjs/Camera.js +3 -0
  20. package/lib/cjs/Camera.js.map +1 -1
  21. package/lib/cjs/ChangesetProps.d.ts +1 -1
  22. package/lib/cjs/ChangesetProps.js.map +1 -1
  23. package/lib/cjs/ClipStyle.js +31 -5
  24. package/lib/cjs/ClipStyle.js.map +1 -1
  25. package/lib/cjs/Code.d.ts +0 -5
  26. package/lib/cjs/Code.d.ts.map +1 -1
  27. package/lib/cjs/Code.js +16 -11
  28. package/lib/cjs/Code.js.map +1 -1
  29. package/lib/cjs/ColorDef.js +11 -10
  30. package/lib/cjs/ColorDef.js.map +1 -1
  31. package/lib/cjs/ConcurrentQuery.d.ts +37 -1
  32. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  33. package/lib/cjs/ConcurrentQuery.js +16 -3
  34. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  35. package/lib/cjs/ContextRealityModel.js +53 -27
  36. package/lib/cjs/ContextRealityModel.js.map +1 -1
  37. package/lib/cjs/ContourDisplay.js +40 -5
  38. package/lib/cjs/ContourDisplay.js.map +1 -1
  39. package/lib/cjs/DisplayStyleSettings.js +95 -63
  40. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  41. package/lib/cjs/ECSqlReader.d.ts +2 -0
  42. package/lib/cjs/ECSqlReader.d.ts.map +1 -1
  43. package/lib/cjs/ECSqlReader.js +56 -50
  44. package/lib/cjs/ECSqlReader.js.map +1 -1
  45. package/lib/cjs/ElementProps.d.ts.map +1 -1
  46. package/lib/cjs/ElementProps.js +7 -3
  47. package/lib/cjs/ElementProps.js.map +1 -1
  48. package/lib/cjs/EntityProps.js +31 -0
  49. package/lib/cjs/EntityProps.js.map +1 -1
  50. package/lib/cjs/Environment.js +25 -2
  51. package/lib/cjs/Environment.js.map +1 -1
  52. package/lib/cjs/FeatureIndex.js +15 -6
  53. package/lib/cjs/FeatureIndex.js.map +1 -1
  54. package/lib/cjs/FeatureSymbology.d.ts +25 -73
  55. package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
  56. package/lib/cjs/FeatureSymbology.js +88 -103
  57. package/lib/cjs/FeatureSymbology.js.map +1 -1
  58. package/lib/cjs/FeatureTable.d.ts +6 -108
  59. package/lib/cjs/FeatureTable.d.ts.map +1 -1
  60. package/lib/cjs/FeatureTable.js +13 -329
  61. package/lib/cjs/FeatureTable.js.map +1 -1
  62. package/lib/cjs/Fonts.d.ts +68 -10
  63. package/lib/cjs/Fonts.d.ts.map +1 -1
  64. package/lib/cjs/Fonts.js +19 -4
  65. package/lib/cjs/Fonts.js.map +1 -1
  66. package/lib/cjs/Frustum.js +2 -2
  67. package/lib/cjs/Frustum.js.map +1 -1
  68. package/lib/cjs/GeoCoordinateServices.d.ts +1 -0
  69. package/lib/cjs/GeoCoordinateServices.d.ts.map +1 -1
  70. package/lib/cjs/GeoCoordinateServices.js +2 -1
  71. package/lib/cjs/GeoCoordinateServices.js.map +1 -1
  72. package/lib/cjs/GeometryParams.js +58 -0
  73. package/lib/cjs/GeometryParams.js.map +1 -1
  74. package/lib/cjs/Gradient.d.ts +3 -4
  75. package/lib/cjs/Gradient.d.ts.map +1 -1
  76. package/lib/cjs/Gradient.js +21 -19
  77. package/lib/cjs/Gradient.js.map +1 -1
  78. package/lib/cjs/GraphicParams.js +14 -12
  79. package/lib/cjs/GraphicParams.js.map +1 -1
  80. package/lib/cjs/GroundPlane.js +8 -2
  81. package/lib/cjs/GroundPlane.js.map +1 -1
  82. package/lib/cjs/HSLColor.js +6 -0
  83. package/lib/cjs/HSLColor.js.map +1 -1
  84. package/lib/cjs/HSVColor.js +6 -0
  85. package/lib/cjs/HSVColor.js.map +1 -1
  86. package/lib/cjs/HiddenLine.d.ts +17 -18
  87. package/lib/cjs/HiddenLine.d.ts.map +1 -1
  88. package/lib/cjs/HiddenLine.js +24 -5
  89. package/lib/cjs/HiddenLine.js.map +1 -1
  90. package/lib/cjs/Hilite.js +10 -0
  91. package/lib/cjs/Hilite.js.map +1 -1
  92. package/lib/cjs/IModel.d.ts +3 -12
  93. package/lib/cjs/IModel.d.ts.map +1 -1
  94. package/lib/cjs/IModel.js +47 -23
  95. package/lib/cjs/IModel.js.map +1 -1
  96. package/lib/cjs/IModelError.d.ts +0 -2
  97. package/lib/cjs/IModelError.d.ts.map +1 -1
  98. package/lib/cjs/IModelError.js +3 -8
  99. package/lib/cjs/IModelError.js.map +1 -1
  100. package/lib/cjs/IModelVersion.js +4 -0
  101. package/lib/cjs/IModelVersion.js.map +1 -1
  102. package/lib/cjs/ITwinError.d.ts +1 -1
  103. package/lib/cjs/ITwinError.d.ts.map +1 -1
  104. package/lib/cjs/ITwinError.js +1 -1
  105. package/lib/cjs/ITwinError.js.map +1 -1
  106. package/lib/cjs/Image.d.ts +22 -8
  107. package/lib/cjs/Image.d.ts.map +1 -1
  108. package/lib/cjs/Image.js +20 -4
  109. package/lib/cjs/Image.js.map +1 -1
  110. package/lib/cjs/IpcAppProps.d.ts +2 -0
  111. package/lib/cjs/IpcAppProps.d.ts.map +1 -1
  112. package/lib/cjs/IpcAppProps.js.map +1 -1
  113. package/lib/cjs/LightSettings.js +39 -1
  114. package/lib/cjs/LightSettings.js.map +1 -1
  115. package/lib/cjs/Localization.d.ts +0 -10
  116. package/lib/cjs/Localization.d.ts.map +1 -1
  117. package/lib/cjs/Localization.js +0 -1
  118. package/lib/cjs/Localization.js.map +1 -1
  119. package/lib/cjs/MapImagerySettings.js +3 -2
  120. package/lib/cjs/MapImagerySettings.js.map +1 -1
  121. package/lib/cjs/MapLayerSettings.d.ts +20 -0
  122. package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
  123. package/lib/cjs/MapLayerSettings.js +50 -1
  124. package/lib/cjs/MapLayerSettings.js.map +1 -1
  125. package/lib/cjs/MassProperties.d.ts +2 -0
  126. package/lib/cjs/MassProperties.d.ts.map +1 -1
  127. package/lib/cjs/MassProperties.js.map +1 -1
  128. package/lib/cjs/ModelClipGroup.js +6 -0
  129. package/lib/cjs/ModelClipGroup.js.map +1 -1
  130. package/lib/cjs/OctEncodedNormal.js +4 -0
  131. package/lib/cjs/OctEncodedNormal.js.map +1 -1
  132. package/lib/cjs/PlanProjectionSettings.d.ts +1 -2
  133. package/lib/cjs/PlanProjectionSettings.d.ts.map +1 -1
  134. package/lib/cjs/PlanProjectionSettings.js +8 -1
  135. package/lib/cjs/PlanProjectionSettings.js.map +1 -1
  136. package/lib/cjs/PlanarClipMask.d.ts +0 -12
  137. package/lib/cjs/PlanarClipMask.d.ts.map +1 -1
  138. package/lib/cjs/PlanarClipMask.js +24 -2
  139. package/lib/cjs/PlanarClipMask.js.map +1 -1
  140. package/lib/cjs/QPoint.d.ts +5 -5
  141. package/lib/cjs/QPoint.d.ts.map +1 -1
  142. package/lib/cjs/QPoint.js +37 -29
  143. package/lib/cjs/QPoint.js.map +1 -1
  144. package/lib/cjs/RealityModelDisplaySettings.js +81 -4
  145. package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
  146. package/lib/cjs/RenderMaterial.d.ts +0 -43
  147. package/lib/cjs/RenderMaterial.d.ts.map +1 -1
  148. package/lib/cjs/RenderMaterial.js +6 -51
  149. package/lib/cjs/RenderMaterial.js.map +1 -1
  150. package/lib/cjs/RenderPolyline.d.ts +36 -0
  151. package/lib/cjs/RenderPolyline.d.ts.map +1 -0
  152. package/lib/cjs/RenderPolyline.js +26 -0
  153. package/lib/cjs/RenderPolyline.js.map +1 -0
  154. package/lib/cjs/RenderSchedule.d.ts +1 -2
  155. package/lib/cjs/RenderSchedule.d.ts.map +1 -1
  156. package/lib/cjs/RenderSchedule.js +138 -11
  157. package/lib/cjs/RenderSchedule.js.map +1 -1
  158. package/lib/cjs/RenderTexture.d.ts +5 -23
  159. package/lib/cjs/RenderTexture.d.ts.map +1 -1
  160. package/lib/cjs/RenderTexture.js +13 -16
  161. package/lib/cjs/RenderTexture.js.map +1 -1
  162. package/lib/cjs/RgbColor.js +3 -0
  163. package/lib/cjs/RgbColor.js.map +1 -1
  164. package/lib/cjs/RpcInterface.d.ts.map +1 -1
  165. package/lib/cjs/RpcInterface.js +7 -1
  166. package/lib/cjs/RpcInterface.js.map +1 -1
  167. package/lib/cjs/SkyBox.js +17 -4
  168. package/lib/cjs/SkyBox.js.map +1 -1
  169. package/lib/cjs/SolarShadows.js +5 -1
  170. package/lib/cjs/SolarShadows.js.map +1 -1
  171. package/lib/cjs/SpatialClassification.js +19 -1
  172. package/lib/cjs/SpatialClassification.js.map +1 -1
  173. package/lib/cjs/SubCategoryAppearance.js +35 -1
  174. package/lib/cjs/SubCategoryAppearance.js.map +1 -1
  175. package/lib/cjs/SubCategoryOverride.js +16 -2
  176. package/lib/cjs/SubCategoryOverride.js.map +1 -1
  177. package/lib/cjs/TerrainSettings.d.ts +0 -7
  178. package/lib/cjs/TerrainSettings.d.ts.map +1 -1
  179. package/lib/cjs/TerrainSettings.js +19 -0
  180. package/lib/cjs/TerrainSettings.js.map +1 -1
  181. package/lib/cjs/TextureMapping.d.ts +17 -14
  182. package/lib/cjs/TextureMapping.d.ts.map +1 -1
  183. package/lib/cjs/TextureMapping.js +47 -19
  184. package/lib/cjs/TextureMapping.js.map +1 -1
  185. package/lib/cjs/ThematicDisplay.js +53 -2
  186. package/lib/cjs/ThematicDisplay.js.map +1 -1
  187. package/lib/cjs/Thumbnail.d.ts +1 -1
  188. package/lib/cjs/Thumbnail.js.map +1 -1
  189. package/lib/cjs/Tween.js +28 -19
  190. package/lib/cjs/Tween.js.map +1 -1
  191. package/lib/cjs/ViewDetails.js +10 -6
  192. package/lib/cjs/ViewDetails.js.map +1 -1
  193. package/lib/cjs/ViewFlags.d.ts +1 -3
  194. package/lib/cjs/ViewFlags.d.ts.map +1 -1
  195. package/lib/cjs/ViewFlags.js +86 -5
  196. package/lib/cjs/ViewFlags.js.map +1 -1
  197. package/lib/cjs/ViewProps.d.ts +0 -4
  198. package/lib/cjs/ViewProps.d.ts.map +1 -1
  199. package/lib/cjs/ViewProps.js.map +1 -1
  200. package/lib/cjs/WhiteOnWhiteReversalSettings.js +7 -2
  201. package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
  202. package/lib/cjs/annotation/TextAnnotation.js +10 -0
  203. package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
  204. package/lib/cjs/annotation/TextBlock.js +27 -6
  205. package/lib/cjs/annotation/TextBlock.js.map +1 -1
  206. package/lib/cjs/annotation/TextStyle.js +65 -19
  207. package/lib/cjs/annotation/TextStyle.js.map +1 -1
  208. package/lib/cjs/core-common.d.ts +1 -2
  209. package/lib/cjs/core-common.d.ts.map +1 -1
  210. package/lib/cjs/core-common.js +1 -2
  211. package/lib/cjs/core-common.js.map +1 -1
  212. package/lib/cjs/geometry/AdditionalTransform.js +12 -0
  213. package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
  214. package/lib/cjs/geometry/AreaPattern.js +17 -0
  215. package/lib/cjs/geometry/AreaPattern.js.map +1 -1
  216. package/lib/cjs/geometry/BoundingSphere.js +4 -0
  217. package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
  218. package/lib/cjs/geometry/Cartographic.js +23 -20
  219. package/lib/cjs/geometry/Cartographic.js.map +1 -1
  220. package/lib/cjs/geometry/CoordinateReferenceSystem.js +62 -0
  221. package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
  222. package/lib/cjs/geometry/ElementGeometry.js +26 -8
  223. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  224. package/lib/cjs/geometry/ElementGeometryFB.js +54 -108
  225. package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
  226. package/lib/cjs/geometry/FrustumPlanes.js +1 -0
  227. package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
  228. package/lib/cjs/geometry/GeodeticDatum.js +100 -0
  229. package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
  230. package/lib/cjs/geometry/GeodeticEllipsoid.js +16 -0
  231. package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
  232. package/lib/cjs/geometry/GeometryStream.js +19 -6
  233. package/lib/cjs/geometry/GeometryStream.js.map +1 -1
  234. package/lib/cjs/geometry/ImageGraphic.js +10 -0
  235. package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
  236. package/lib/cjs/geometry/LineStyle.js +14 -0
  237. package/lib/cjs/geometry/LineStyle.js.map +1 -1
  238. package/lib/cjs/geometry/Placement.js +6 -0
  239. package/lib/cjs/geometry/Placement.js.map +1 -1
  240. package/lib/cjs/geometry/Projection.js +75 -0
  241. package/lib/cjs/geometry/Projection.js.map +1 -1
  242. package/lib/cjs/geometry/TextString.js +18 -0
  243. package/lib/cjs/geometry/TextString.js.map +1 -1
  244. package/lib/cjs/{BackendTypes.d.ts → internal/BackendTypes.d.ts} +1 -0
  245. package/lib/cjs/internal/BackendTypes.d.ts.map +1 -0
  246. package/lib/cjs/internal/BackendTypes.js.map +1 -0
  247. package/lib/cjs/internal/PackedFeatureTable.d.ts +111 -0
  248. package/lib/cjs/internal/PackedFeatureTable.d.ts.map +1 -0
  249. package/lib/cjs/internal/PackedFeatureTable.js +359 -0
  250. package/lib/cjs/internal/PackedFeatureTable.js.map +1 -0
  251. package/lib/cjs/internal/RenderMaterialParams.d.ts +47 -0
  252. package/lib/cjs/internal/RenderMaterialParams.d.ts.map +1 -0
  253. package/lib/cjs/internal/RenderMaterialParams.js +68 -0
  254. package/lib/cjs/internal/RenderMaterialParams.js.map +1 -0
  255. package/lib/cjs/internal/RenderMesh.d.ts +52 -0
  256. package/lib/cjs/internal/RenderMesh.d.ts.map +1 -0
  257. package/lib/cjs/{Render.js → internal/RenderMesh.js} +12 -31
  258. package/lib/cjs/internal/RenderMesh.js.map +1 -0
  259. package/lib/cjs/internal/RenderTextureParams.d.ts +25 -0
  260. package/lib/cjs/internal/RenderTextureParams.d.ts.map +1 -0
  261. package/lib/cjs/internal/RenderTextureParams.js +37 -0
  262. package/lib/cjs/internal/RenderTextureParams.js.map +1 -0
  263. package/lib/cjs/internal/cross-package.d.ts +5 -0
  264. package/lib/cjs/internal/cross-package.d.ts.map +1 -1
  265. package/lib/cjs/internal/cross-package.js +16 -0
  266. package/lib/cjs/internal/cross-package.js.map +1 -1
  267. package/lib/cjs/ipc/IpcSession.js +1 -0
  268. package/lib/cjs/ipc/IpcSession.js.map +1 -1
  269. package/lib/cjs/ipc/IpcSocket.d.ts +2 -0
  270. package/lib/cjs/ipc/IpcSocket.d.ts.map +1 -1
  271. package/lib/cjs/ipc/IpcSocket.js.map +1 -1
  272. package/lib/cjs/ipc/IpcWebSocket.js +7 -6
  273. package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
  274. package/lib/cjs/ipc/IpcWebSocketTransport.js +8 -7
  275. package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
  276. package/lib/cjs/rpc/DevToolsRpcInterface.js +6 -6
  277. package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
  278. package/lib/cjs/rpc/IModelReadRpcInterface.js +8 -11
  279. package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
  280. package/lib/cjs/rpc/IModelTileRpcInterface.js +4 -4
  281. package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
  282. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +4 -4
  283. package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  284. package/lib/cjs/rpc/TestRpcManager.js +1 -4
  285. package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
  286. package/lib/cjs/rpc/core/RpcConfiguration.js +51 -64
  287. package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
  288. package/lib/cjs/rpc/core/RpcControl.js +29 -38
  289. package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
  290. package/lib/cjs/rpc/core/RpcInvocation.js +19 -13
  291. package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
  292. package/lib/cjs/rpc/core/RpcMarshaling.d.ts +1 -4
  293. package/lib/cjs/rpc/core/RpcMarshaling.d.ts.map +1 -1
  294. package/lib/cjs/rpc/core/RpcMarshaling.js +5 -4
  295. package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
  296. package/lib/cjs/rpc/core/RpcOperation.js +29 -31
  297. package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
  298. package/lib/cjs/rpc/core/RpcPendingQueue.js +17 -16
  299. package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
  300. package/lib/cjs/rpc/core/RpcProtocol.js +32 -30
  301. package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
  302. package/lib/cjs/rpc/core/RpcPush.js +15 -8
  303. package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
  304. package/lib/cjs/rpc/core/RpcRegistry.d.ts.map +1 -1
  305. package/lib/cjs/rpc/core/RpcRegistry.js +10 -9
  306. package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
  307. package/lib/cjs/rpc/core/RpcRequest.d.ts +2 -2
  308. package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
  309. package/lib/cjs/rpc/core/RpcRequest.js +51 -29
  310. package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
  311. package/lib/cjs/rpc/core/RpcRoutingToken.js +4 -2
  312. package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
  313. package/lib/cjs/rpc/core/RpcSessionInvocation.js +5 -10
  314. package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
  315. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js +11 -17
  316. package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  317. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +16 -19
  318. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  319. package/lib/cjs/rpc/web/OpenAPI.js +2 -0
  320. package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
  321. package/lib/cjs/rpc/web/RpcMultipart.d.ts +1 -1
  322. package/lib/cjs/rpc/web/RpcMultipart.d.ts.map +1 -1
  323. package/lib/cjs/rpc/web/RpcMultipart.js +13 -12
  324. package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
  325. package/lib/cjs/rpc/web/WebAppRpcLogging.d.ts +3 -0
  326. package/lib/cjs/rpc/web/WebAppRpcLogging.d.ts.map +1 -1
  327. package/lib/cjs/rpc/web/WebAppRpcLogging.js +1 -6
  328. package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
  329. package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +1 -1
  330. package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
  331. package/lib/cjs/rpc/web/WebAppRpcProtocol.js +6 -6
  332. package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
  333. package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
  334. package/lib/cjs/rpc/web/WebAppRpcRequest.js +27 -27
  335. package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
  336. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.d.ts +0 -2
  337. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
  338. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js +14 -8
  339. package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  340. package/lib/cjs/tile/B3dmTileIO.js +7 -0
  341. package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
  342. package/lib/cjs/tile/CompositeTileIO.js +3 -0
  343. package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
  344. package/lib/cjs/tile/GltfTileIO.js +4 -3
  345. package/lib/cjs/tile/GltfTileIO.js.map +1 -1
  346. package/lib/cjs/tile/I3dmTileIO.js +8 -0
  347. package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
  348. package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
  349. package/lib/cjs/tile/IModelTileIO.js +26 -3
  350. package/lib/cjs/tile/IModelTileIO.js.map +1 -1
  351. package/lib/cjs/tile/PntsTileIO.js +5 -0
  352. package/lib/cjs/tile/PntsTileIO.js.map +1 -1
  353. package/lib/cjs/tile/TileIO.js +2 -0
  354. package/lib/cjs/tile/TileIO.js.map +1 -1
  355. package/lib/cjs/tile/TileMetadata.js +9 -1
  356. package/lib/cjs/tile/TileMetadata.js.map +1 -1
  357. package/lib/esm/AmbientOcclusion.js +17 -9
  358. package/lib/esm/AmbientOcclusion.js.map +1 -1
  359. package/lib/esm/AnalysisStyle.d.ts +0 -3
  360. package/lib/esm/AnalysisStyle.d.ts.map +1 -1
  361. package/lib/esm/AnalysisStyle.js +20 -4
  362. package/lib/esm/AnalysisStyle.js.map +1 -1
  363. package/lib/esm/Atmosphere.js +39 -21
  364. package/lib/esm/Atmosphere.js.map +1 -1
  365. package/lib/esm/BackgroundMapProvider.js +4 -0
  366. package/lib/esm/BackgroundMapProvider.js.map +1 -1
  367. package/lib/esm/BackgroundMapSettings.js +19 -0
  368. package/lib/esm/BackgroundMapSettings.js.map +1 -1
  369. package/lib/esm/BlobReader.js +8 -6
  370. package/lib/esm/BlobReader.js.map +1 -1
  371. package/lib/esm/BriefcaseTypes.d.ts +2 -2
  372. package/lib/esm/BriefcaseTypes.d.ts.map +1 -1
  373. package/lib/esm/BriefcaseTypes.js.map +1 -1
  374. package/lib/esm/Camera.js +3 -0
  375. package/lib/esm/Camera.js.map +1 -1
  376. package/lib/esm/ChangesetProps.d.ts +1 -1
  377. package/lib/esm/ChangesetProps.js.map +1 -1
  378. package/lib/esm/ClipStyle.js +31 -5
  379. package/lib/esm/ClipStyle.js.map +1 -1
  380. package/lib/esm/Code.d.ts +0 -5
  381. package/lib/esm/Code.d.ts.map +1 -1
  382. package/lib/esm/Code.js +16 -11
  383. package/lib/esm/Code.js.map +1 -1
  384. package/lib/esm/ColorDef.js +11 -10
  385. package/lib/esm/ColorDef.js.map +1 -1
  386. package/lib/esm/ConcurrentQuery.d.ts +37 -1
  387. package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
  388. package/lib/esm/ConcurrentQuery.js +16 -3
  389. package/lib/esm/ConcurrentQuery.js.map +1 -1
  390. package/lib/esm/ContextRealityModel.js +53 -27
  391. package/lib/esm/ContextRealityModel.js.map +1 -1
  392. package/lib/esm/ContourDisplay.js +40 -5
  393. package/lib/esm/ContourDisplay.js.map +1 -1
  394. package/lib/esm/DisplayStyleSettings.js +95 -63
  395. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  396. package/lib/esm/ECSqlReader.d.ts +2 -0
  397. package/lib/esm/ECSqlReader.d.ts.map +1 -1
  398. package/lib/esm/ECSqlReader.js +56 -50
  399. package/lib/esm/ECSqlReader.js.map +1 -1
  400. package/lib/esm/ElementProps.d.ts.map +1 -1
  401. package/lib/esm/ElementProps.js +8 -4
  402. package/lib/esm/ElementProps.js.map +1 -1
  403. package/lib/esm/EntityProps.js +31 -0
  404. package/lib/esm/EntityProps.js.map +1 -1
  405. package/lib/esm/Environment.js +25 -2
  406. package/lib/esm/Environment.js.map +1 -1
  407. package/lib/esm/FeatureIndex.js +15 -6
  408. package/lib/esm/FeatureIndex.js.map +1 -1
  409. package/lib/esm/FeatureSymbology.d.ts +25 -73
  410. package/lib/esm/FeatureSymbology.d.ts.map +1 -1
  411. package/lib/esm/FeatureSymbology.js +88 -103
  412. package/lib/esm/FeatureSymbology.js.map +1 -1
  413. package/lib/esm/FeatureTable.d.ts +6 -108
  414. package/lib/esm/FeatureTable.d.ts.map +1 -1
  415. package/lib/esm/FeatureTable.js +11 -324
  416. package/lib/esm/FeatureTable.js.map +1 -1
  417. package/lib/esm/Fonts.d.ts +68 -10
  418. package/lib/esm/Fonts.d.ts.map +1 -1
  419. package/lib/esm/Fonts.js +19 -4
  420. package/lib/esm/Fonts.js.map +1 -1
  421. package/lib/esm/Frustum.js +2 -2
  422. package/lib/esm/Frustum.js.map +1 -1
  423. package/lib/esm/GeoCoordinateServices.d.ts +1 -0
  424. package/lib/esm/GeoCoordinateServices.d.ts.map +1 -1
  425. package/lib/esm/GeoCoordinateServices.js +2 -1
  426. package/lib/esm/GeoCoordinateServices.js.map +1 -1
  427. package/lib/esm/GeometryParams.js +58 -0
  428. package/lib/esm/GeometryParams.js.map +1 -1
  429. package/lib/esm/Gradient.d.ts +3 -4
  430. package/lib/esm/Gradient.d.ts.map +1 -1
  431. package/lib/esm/Gradient.js +21 -19
  432. package/lib/esm/Gradient.js.map +1 -1
  433. package/lib/esm/GraphicParams.js +14 -12
  434. package/lib/esm/GraphicParams.js.map +1 -1
  435. package/lib/esm/GroundPlane.js +8 -2
  436. package/lib/esm/GroundPlane.js.map +1 -1
  437. package/lib/esm/HSLColor.js +6 -0
  438. package/lib/esm/HSLColor.js.map +1 -1
  439. package/lib/esm/HSVColor.js +6 -0
  440. package/lib/esm/HSVColor.js.map +1 -1
  441. package/lib/esm/HiddenLine.d.ts +17 -18
  442. package/lib/esm/HiddenLine.d.ts.map +1 -1
  443. package/lib/esm/HiddenLine.js +24 -5
  444. package/lib/esm/HiddenLine.js.map +1 -1
  445. package/lib/esm/Hilite.js +10 -0
  446. package/lib/esm/Hilite.js.map +1 -1
  447. package/lib/esm/IModel.d.ts +3 -12
  448. package/lib/esm/IModel.d.ts.map +1 -1
  449. package/lib/esm/IModel.js +47 -23
  450. package/lib/esm/IModel.js.map +1 -1
  451. package/lib/esm/IModelError.d.ts +0 -2
  452. package/lib/esm/IModelError.d.ts.map +1 -1
  453. package/lib/esm/IModelError.js +2 -1
  454. package/lib/esm/IModelError.js.map +1 -1
  455. package/lib/esm/IModelVersion.js +4 -0
  456. package/lib/esm/IModelVersion.js.map +1 -1
  457. package/lib/esm/ITwinError.d.ts +1 -1
  458. package/lib/esm/ITwinError.d.ts.map +1 -1
  459. package/lib/esm/ITwinError.js +1 -1
  460. package/lib/esm/ITwinError.js.map +1 -1
  461. package/lib/esm/Image.d.ts +22 -8
  462. package/lib/esm/Image.d.ts.map +1 -1
  463. package/lib/esm/Image.js +19 -4
  464. package/lib/esm/Image.js.map +1 -1
  465. package/lib/esm/IpcAppProps.d.ts +2 -0
  466. package/lib/esm/IpcAppProps.d.ts.map +1 -1
  467. package/lib/esm/IpcAppProps.js.map +1 -1
  468. package/lib/esm/LightSettings.js +39 -1
  469. package/lib/esm/LightSettings.js.map +1 -1
  470. package/lib/esm/Localization.d.ts +0 -10
  471. package/lib/esm/Localization.d.ts.map +1 -1
  472. package/lib/esm/Localization.js +0 -1
  473. package/lib/esm/Localization.js.map +1 -1
  474. package/lib/esm/MapImagerySettings.js +3 -2
  475. package/lib/esm/MapImagerySettings.js.map +1 -1
  476. package/lib/esm/MapLayerSettings.d.ts +20 -0
  477. package/lib/esm/MapLayerSettings.d.ts.map +1 -1
  478. package/lib/esm/MapLayerSettings.js +50 -1
  479. package/lib/esm/MapLayerSettings.js.map +1 -1
  480. package/lib/esm/MassProperties.d.ts +2 -0
  481. package/lib/esm/MassProperties.d.ts.map +1 -1
  482. package/lib/esm/MassProperties.js.map +1 -1
  483. package/lib/esm/ModelClipGroup.js +6 -0
  484. package/lib/esm/ModelClipGroup.js.map +1 -1
  485. package/lib/esm/OctEncodedNormal.js +4 -0
  486. package/lib/esm/OctEncodedNormal.js.map +1 -1
  487. package/lib/esm/PlanProjectionSettings.d.ts +1 -2
  488. package/lib/esm/PlanProjectionSettings.d.ts.map +1 -1
  489. package/lib/esm/PlanProjectionSettings.js +8 -1
  490. package/lib/esm/PlanProjectionSettings.js.map +1 -1
  491. package/lib/esm/PlanarClipMask.d.ts +0 -12
  492. package/lib/esm/PlanarClipMask.d.ts.map +1 -1
  493. package/lib/esm/PlanarClipMask.js +24 -2
  494. package/lib/esm/PlanarClipMask.js.map +1 -1
  495. package/lib/esm/QPoint.d.ts +5 -5
  496. package/lib/esm/QPoint.d.ts.map +1 -1
  497. package/lib/esm/QPoint.js +37 -29
  498. package/lib/esm/QPoint.js.map +1 -1
  499. package/lib/esm/RealityModelDisplaySettings.js +81 -4
  500. package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
  501. package/lib/esm/RenderMaterial.d.ts +0 -43
  502. package/lib/esm/RenderMaterial.d.ts.map +1 -1
  503. package/lib/esm/RenderMaterial.js +6 -51
  504. package/lib/esm/RenderMaterial.js.map +1 -1
  505. package/lib/esm/RenderPolyline.d.ts +36 -0
  506. package/lib/esm/RenderPolyline.d.ts.map +1 -0
  507. package/lib/esm/RenderPolyline.js +23 -0
  508. package/lib/esm/RenderPolyline.js.map +1 -0
  509. package/lib/esm/RenderSchedule.d.ts +1 -2
  510. package/lib/esm/RenderSchedule.d.ts.map +1 -1
  511. package/lib/esm/RenderSchedule.js +138 -11
  512. package/lib/esm/RenderSchedule.js.map +1 -1
  513. package/lib/esm/RenderTexture.d.ts +5 -23
  514. package/lib/esm/RenderTexture.d.ts.map +1 -1
  515. package/lib/esm/RenderTexture.js +13 -16
  516. package/lib/esm/RenderTexture.js.map +1 -1
  517. package/lib/esm/RgbColor.js +3 -0
  518. package/lib/esm/RgbColor.js.map +1 -1
  519. package/lib/esm/RpcInterface.d.ts.map +1 -1
  520. package/lib/esm/RpcInterface.js +8 -2
  521. package/lib/esm/RpcInterface.js.map +1 -1
  522. package/lib/esm/SkyBox.js +17 -4
  523. package/lib/esm/SkyBox.js.map +1 -1
  524. package/lib/esm/SolarShadows.js +5 -1
  525. package/lib/esm/SolarShadows.js.map +1 -1
  526. package/lib/esm/SpatialClassification.js +19 -1
  527. package/lib/esm/SpatialClassification.js.map +1 -1
  528. package/lib/esm/SubCategoryAppearance.js +35 -1
  529. package/lib/esm/SubCategoryAppearance.js.map +1 -1
  530. package/lib/esm/SubCategoryOverride.js +16 -2
  531. package/lib/esm/SubCategoryOverride.js.map +1 -1
  532. package/lib/esm/TerrainSettings.d.ts +0 -7
  533. package/lib/esm/TerrainSettings.d.ts.map +1 -1
  534. package/lib/esm/TerrainSettings.js +19 -0
  535. package/lib/esm/TerrainSettings.js.map +1 -1
  536. package/lib/esm/TextureMapping.d.ts +17 -14
  537. package/lib/esm/TextureMapping.d.ts.map +1 -1
  538. package/lib/esm/TextureMapping.js +47 -19
  539. package/lib/esm/TextureMapping.js.map +1 -1
  540. package/lib/esm/ThematicDisplay.js +53 -2
  541. package/lib/esm/ThematicDisplay.js.map +1 -1
  542. package/lib/esm/Thumbnail.d.ts +1 -1
  543. package/lib/esm/Thumbnail.js.map +1 -1
  544. package/lib/esm/Tween.js +28 -19
  545. package/lib/esm/Tween.js.map +1 -1
  546. package/lib/esm/ViewDetails.js +10 -6
  547. package/lib/esm/ViewDetails.js.map +1 -1
  548. package/lib/esm/ViewFlags.d.ts +1 -3
  549. package/lib/esm/ViewFlags.d.ts.map +1 -1
  550. package/lib/esm/ViewFlags.js +86 -5
  551. package/lib/esm/ViewFlags.js.map +1 -1
  552. package/lib/esm/ViewProps.d.ts +0 -4
  553. package/lib/esm/ViewProps.d.ts.map +1 -1
  554. package/lib/esm/ViewProps.js.map +1 -1
  555. package/lib/esm/WhiteOnWhiteReversalSettings.js +7 -2
  556. package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
  557. package/lib/esm/annotation/TextAnnotation.js +10 -0
  558. package/lib/esm/annotation/TextAnnotation.js.map +1 -1
  559. package/lib/esm/annotation/TextBlock.js +27 -6
  560. package/lib/esm/annotation/TextBlock.js.map +1 -1
  561. package/lib/esm/annotation/TextStyle.js +65 -19
  562. package/lib/esm/annotation/TextStyle.js.map +1 -1
  563. package/lib/esm/core-common.d.ts +1 -2
  564. package/lib/esm/core-common.d.ts.map +1 -1
  565. package/lib/esm/core-common.js +1 -2
  566. package/lib/esm/core-common.js.map +1 -1
  567. package/lib/esm/geometry/AdditionalTransform.js +12 -0
  568. package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
  569. package/lib/esm/geometry/AreaPattern.js +17 -0
  570. package/lib/esm/geometry/AreaPattern.js.map +1 -1
  571. package/lib/esm/geometry/BoundingSphere.js +4 -0
  572. package/lib/esm/geometry/BoundingSphere.js.map +1 -1
  573. package/lib/esm/geometry/Cartographic.js +23 -20
  574. package/lib/esm/geometry/Cartographic.js.map +1 -1
  575. package/lib/esm/geometry/CoordinateReferenceSystem.js +62 -0
  576. package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
  577. package/lib/esm/geometry/ElementGeometry.js +26 -8
  578. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  579. package/lib/esm/geometry/ElementGeometryFB.js +54 -108
  580. package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
  581. package/lib/esm/geometry/FrustumPlanes.js +1 -0
  582. package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
  583. package/lib/esm/geometry/GeodeticDatum.js +100 -0
  584. package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
  585. package/lib/esm/geometry/GeodeticEllipsoid.js +16 -0
  586. package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
  587. package/lib/esm/geometry/GeometryStream.js +19 -6
  588. package/lib/esm/geometry/GeometryStream.js.map +1 -1
  589. package/lib/esm/geometry/ImageGraphic.js +10 -0
  590. package/lib/esm/geometry/ImageGraphic.js.map +1 -1
  591. package/lib/esm/geometry/LineStyle.js +14 -0
  592. package/lib/esm/geometry/LineStyle.js.map +1 -1
  593. package/lib/esm/geometry/Placement.js +6 -0
  594. package/lib/esm/geometry/Placement.js.map +1 -1
  595. package/lib/esm/geometry/Projection.js +75 -0
  596. package/lib/esm/geometry/Projection.js.map +1 -1
  597. package/lib/esm/geometry/TextString.js +18 -0
  598. package/lib/esm/geometry/TextString.js.map +1 -1
  599. package/lib/esm/{BackendTypes.d.ts → internal/BackendTypes.d.ts} +1 -0
  600. package/lib/esm/internal/BackendTypes.d.ts.map +1 -0
  601. package/lib/esm/internal/BackendTypes.js.map +1 -0
  602. package/lib/esm/internal/PackedFeatureTable.d.ts +111 -0
  603. package/lib/esm/internal/PackedFeatureTable.d.ts.map +1 -0
  604. package/lib/esm/internal/PackedFeatureTable.js +352 -0
  605. package/lib/esm/internal/PackedFeatureTable.js.map +1 -0
  606. package/lib/esm/internal/RenderMaterialParams.d.ts +47 -0
  607. package/lib/esm/internal/RenderMaterialParams.d.ts.map +1 -0
  608. package/lib/esm/internal/RenderMaterialParams.js +64 -0
  609. package/lib/esm/internal/RenderMaterialParams.js.map +1 -0
  610. package/lib/esm/internal/RenderMesh.d.ts +52 -0
  611. package/lib/esm/internal/RenderMesh.d.ts.map +1 -0
  612. package/lib/esm/{Render.js → internal/RenderMesh.js} +11 -29
  613. package/lib/esm/internal/RenderMesh.js.map +1 -0
  614. package/lib/esm/internal/RenderTextureParams.d.ts +25 -0
  615. package/lib/esm/internal/RenderTextureParams.d.ts.map +1 -0
  616. package/lib/esm/internal/RenderTextureParams.js +33 -0
  617. package/lib/esm/internal/RenderTextureParams.js.map +1 -0
  618. package/lib/esm/internal/cross-package.d.ts +5 -0
  619. package/lib/esm/internal/cross-package.d.ts.map +1 -1
  620. package/lib/esm/internal/cross-package.js +4 -1
  621. package/lib/esm/internal/cross-package.js.map +1 -1
  622. package/lib/esm/ipc/IpcSession.js +1 -0
  623. package/lib/esm/ipc/IpcSession.js.map +1 -1
  624. package/lib/esm/ipc/IpcSocket.d.ts +2 -0
  625. package/lib/esm/ipc/IpcSocket.d.ts.map +1 -1
  626. package/lib/esm/ipc/IpcSocket.js.map +1 -1
  627. package/lib/esm/ipc/IpcWebSocket.js +7 -6
  628. package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
  629. package/lib/esm/ipc/IpcWebSocketTransport.js +8 -7
  630. package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
  631. package/lib/esm/rpc/DevToolsRpcInterface.js +6 -6
  632. package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
  633. package/lib/esm/rpc/IModelReadRpcInterface.js +8 -11
  634. package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
  635. package/lib/esm/rpc/IModelTileRpcInterface.js +4 -4
  636. package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
  637. package/lib/esm/rpc/SnapshotIModelRpcInterface.js +4 -4
  638. package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
  639. package/lib/esm/rpc/TestRpcManager.js +1 -4
  640. package/lib/esm/rpc/TestRpcManager.js.map +1 -1
  641. package/lib/esm/rpc/core/RpcConfiguration.js +51 -64
  642. package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
  643. package/lib/esm/rpc/core/RpcControl.js +29 -38
  644. package/lib/esm/rpc/core/RpcControl.js.map +1 -1
  645. package/lib/esm/rpc/core/RpcInvocation.js +19 -13
  646. package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
  647. package/lib/esm/rpc/core/RpcMarshaling.d.ts +1 -4
  648. package/lib/esm/rpc/core/RpcMarshaling.d.ts.map +1 -1
  649. package/lib/esm/rpc/core/RpcMarshaling.js +2 -1
  650. package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
  651. package/lib/esm/rpc/core/RpcOperation.js +29 -31
  652. package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
  653. package/lib/esm/rpc/core/RpcPendingQueue.js +17 -16
  654. package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
  655. package/lib/esm/rpc/core/RpcProtocol.js +32 -30
  656. package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
  657. package/lib/esm/rpc/core/RpcPush.js +15 -8
  658. package/lib/esm/rpc/core/RpcPush.js.map +1 -1
  659. package/lib/esm/rpc/core/RpcRegistry.d.ts.map +1 -1
  660. package/lib/esm/rpc/core/RpcRegistry.js +10 -9
  661. package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
  662. package/lib/esm/rpc/core/RpcRequest.d.ts +2 -2
  663. package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
  664. package/lib/esm/rpc/core/RpcRequest.js +51 -29
  665. package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
  666. package/lib/esm/rpc/core/RpcRoutingToken.js +4 -2
  667. package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
  668. package/lib/esm/rpc/core/RpcSessionInvocation.js +5 -10
  669. package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
  670. package/lib/esm/rpc/web/BentleyCloudRpcManager.js +11 -17
  671. package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
  672. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +16 -19
  673. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  674. package/lib/esm/rpc/web/OpenAPI.js +2 -0
  675. package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
  676. package/lib/esm/rpc/web/RpcMultipart.d.ts +1 -1
  677. package/lib/esm/rpc/web/RpcMultipart.d.ts.map +1 -1
  678. package/lib/esm/rpc/web/RpcMultipart.js +14 -13
  679. package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
  680. package/lib/esm/rpc/web/WebAppRpcLogging.d.ts +3 -0
  681. package/lib/esm/rpc/web/WebAppRpcLogging.d.ts.map +1 -1
  682. package/lib/esm/rpc/web/WebAppRpcLogging.js +1 -6
  683. package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
  684. package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +1 -1
  685. package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
  686. package/lib/esm/rpc/web/WebAppRpcProtocol.js +6 -6
  687. package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
  688. package/lib/esm/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
  689. package/lib/esm/rpc/web/WebAppRpcRequest.js +27 -27
  690. package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
  691. package/lib/esm/rpc/web/multipart/RpcMultipartParser.d.ts +0 -2
  692. package/lib/esm/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
  693. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js +14 -8
  694. package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
  695. package/lib/esm/tile/B3dmTileIO.js +7 -0
  696. package/lib/esm/tile/B3dmTileIO.js.map +1 -1
  697. package/lib/esm/tile/CompositeTileIO.js +3 -0
  698. package/lib/esm/tile/CompositeTileIO.js.map +1 -1
  699. package/lib/esm/tile/GltfTileIO.js +4 -3
  700. package/lib/esm/tile/GltfTileIO.js.map +1 -1
  701. package/lib/esm/tile/I3dmTileIO.js +8 -0
  702. package/lib/esm/tile/I3dmTileIO.js.map +1 -1
  703. package/lib/esm/tile/IModelTileIO.d.ts +2 -2
  704. package/lib/esm/tile/IModelTileIO.js +26 -3
  705. package/lib/esm/tile/IModelTileIO.js.map +1 -1
  706. package/lib/esm/tile/PntsTileIO.js +5 -0
  707. package/lib/esm/tile/PntsTileIO.js.map +1 -1
  708. package/lib/esm/tile/TileIO.js +2 -0
  709. package/lib/esm/tile/TileIO.js.map +1 -1
  710. package/lib/esm/tile/TileMetadata.js +9 -1
  711. package/lib/esm/tile/TileMetadata.js.map +1 -1
  712. package/package.json +14 -14
  713. package/lib/cjs/BackendTypes.d.ts.map +0 -1
  714. package/lib/cjs/BackendTypes.js.map +0 -1
  715. package/lib/cjs/Render.d.ts +0 -85
  716. package/lib/cjs/Render.d.ts.map +0 -1
  717. package/lib/cjs/Render.js.map +0 -1
  718. package/lib/esm/BackendTypes.d.ts.map +0 -1
  719. package/lib/esm/BackendTypes.js.map +0 -1
  720. package/lib/esm/Render.d.ts +0 -85
  721. package/lib/esm/Render.d.ts.map +0 -1
  722. package/lib/esm/Render.js.map +0 -1
  723. /package/lib/cjs/{BackendTypes.js → internal/BackendTypes.js} +0 -0
  724. /package/lib/esm/{BackendTypes.js → internal/BackendTypes.js} +0 -0
@@ -8,11 +8,15 @@
8
8
  import { compareStrings, Guid } from "@itwin/core-bentley";
9
9
  /** Represents a texture image applied to a surface during rendering.
10
10
  * A RenderTexture is typically - but not always - associated with a [[RenderMaterial]].
11
- * @see [RenderSystem.createTextureFromImage]($frontend) to obtain a texture from an HTML image.
11
+ * @see [RenderSystem.createTexture]($frontend) to obtain a texture.
12
12
  * @see [RenderSystem.createTextureFromElement]($frontend) to obtain a texture from a [Texture]($backend) element.
13
13
  * @public
14
14
  */
15
15
  export class RenderTexture {
16
+ /** Indicates the type of texture. */
17
+ type;
18
+ /** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */
19
+ _guid;
16
20
  get isTileSection() { return RenderTexture.Type.TileSection === this.type; }
17
21
  get isGlyph() { return RenderTexture.Type.Glyph === this.type; }
18
22
  get isSkyBox() { return RenderTexture.Type.SkyBox === this.type; }
@@ -20,6 +24,14 @@ export class RenderTexture {
20
24
  this.type = type;
21
25
  this._guid = Guid.createValue();
22
26
  }
27
+ /** Releases any WebGL resources owned by this texture.
28
+ * For a texture created by a [RenderSystem]($frontend) for which [CreateTextureArgs.ownership]($frontend) was specified as "external",
29
+ * the caller is responsible for invoking this method when it is finished using the texture; otherwise, the [RenderSystem]($frontend) will handle
30
+ * its disposal.
31
+ */
32
+ [Symbol.dispose]() {
33
+ this.dispose(); // eslint-disable-line @typescript-eslint/no-deprecated
34
+ }
23
35
  /** An [OrderedComparator]($bentley) that compares this texture against `other`. */
24
36
  compare(other) {
25
37
  return compareStrings(this._guid, other._guid);
@@ -43,20 +55,5 @@ export class RenderTexture {
43
55
  /** A gradient image used for thematic display. */
44
56
  Type[Type["ThematicGradient"] = 5] = "ThematicGradient";
45
57
  })(Type = RenderTexture.Type || (RenderTexture.Type = {}));
46
- /** Parameters used to construct a [[RenderTexture]].
47
- * @deprecated in 3.x. use RenderSystem.createTexture and CreateTextureArgs.
48
- * @public
49
- */
50
- class Params {
51
- constructor(key, type = RenderTexture.Type.Normal, isOwned = false) {
52
- this.key = key;
53
- this.type = type;
54
- this.isOwned = isOwned;
55
- }
56
- get isTileSection() { return RenderTexture.Type.TileSection === this.type; }
57
- get isGlyph() { return RenderTexture.Type.Glyph === this.type; }
58
- get isSkyBox() { return RenderTexture.Type.SkyBox === this.type; }
59
- }
60
- RenderTexture.Params = Params;
61
58
  })(RenderTexture || (RenderTexture = {}));
62
59
  //# sourceMappingURL=RenderTexture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderTexture.js","sourceRoot":"","sources":["../../src/RenderTexture.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,IAAI,EAAuC,MAAM,qBAAqB,CAAC;AAUhG;;;;;GAKG;AACH,MAAM,OAAgB,aAAa;IAMjC,IAAW,aAAa,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5F,IAAW,OAAO,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChF,IAAW,QAAQ,KAAc,OAAO,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CAAC,CAAC;KACnF;IArBY,oBAAM,SAqBlB,CAAA;AACH,CAAC,EA3CgB,aAAa,KAAb,aAAa,QA2C7B","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 Rendering\n */\n\nimport { compareStrings, Guid, GuidString, Id64String, IDisposable } from \"@itwin/core-bentley\";\n\n/** Identifies an image to be used to produce a [[RenderTexture]] for a given purpose - for example,\n * as part of a [[SkyBox]]. If the string is a valid `Id64String`, it refers to a persistent [Texture]($backend) element stored in an iModel.\n * Otherwise, it is interpreted as a Url resolving to an HTMLImageElement.\n * @see [[SkySphereImageProps.texture]] and [[SkyCubeImageProps]].\n * @public\n */\nexport type TextureImageSpec = Id64String | string;\n\n/** Represents a texture image applied to a surface during rendering.\n * A RenderTexture is typically - but not always - associated with a [[RenderMaterial]].\n * @see [RenderSystem.createTextureFromImage]($frontend) to obtain a texture from an HTML image.\n * @see [RenderSystem.createTextureFromElement]($frontend) to obtain a texture from a [Texture]($backend) element.\n * @public\n */\nexport abstract class RenderTexture implements IDisposable {\n /** Indicates the type of texture. */\n public readonly type: RenderTexture.Type;\n /** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */\n private readonly _guid: GuidString;\n\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\n public abstract get bytesUsed(): number;\n\n protected constructor(type: RenderTexture.Type) {\n this.type = type;\n this._guid = Guid.createValue();\n }\n\n /** Releases any WebGL resources owned by this texture.\n * For a texture created by a [RenderSystem]($frontend) for which [CreateTextureArgs.ownership]($frontend) was specified as \"external\",\n * the caller is responsible for invoking this method when it is finished using the texture; otherwise, the [RenderSystem]($frontend) will handle\n * its disposal.\n */\n public abstract dispose(): void;\n\n /** An [OrderedComparator]($bentley) that compares this texture against `other`. */\n public compare(other: RenderTexture): number {\n return compareStrings(this._guid, other._guid);\n }\n}\n\n/** @public */\nexport namespace RenderTexture {\n /** The types of [[RenderTexture]]s that can be created by a [RenderSystem]($frontend). */\n export enum Type {\n /** An image applied to a surface, with support for mip-mapping and repetition. */\n Normal,\n /** An image containing any number of text glyphs, used for efficiently rendering readable small text. */\n Glyph,\n /** A non-repeating image with no mip-maps, used for example for reality models. */\n TileSection,\n /** A three-dimensional texture used for rendering a skybox. */\n SkyBox,\n /** A non-repeating image with mip-maps and and anisotropic filtering, used for map tiles when draped on terrain. */\n FilteredTileSection,\n /** A gradient image used for thematic display. */\n ThematicGradient,\n }\n\n /** Parameters used to construct a [[RenderTexture]].\n * @deprecated in 3.x. use RenderSystem.createTexture and CreateTextureArgs.\n * @public\n */\n export class Params {\n /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.\n * Textures created on the front-end generally have no key.\n */\n public readonly key?: string;\n /** Indicates the type of texture. */\n public readonly type: RenderTexture.Type;\n /** Indicates that some object is managing the lifetime of this texture and will take care of calling its dispose function appropriately.\n * An unowned texture associated with a [RenderGraphic]($frontend) will be disposed when the RenderGraphic is disposed.\n */\n public readonly isOwned: boolean;\n\n public constructor(key?: string, type: RenderTexture.Type = RenderTexture.Type.Normal, isOwned: boolean = false) {\n this.key = key;\n this.type = type;\n this.isOwned = isOwned;\n }\n\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\n }\n}\n"]}
1
+ {"version":3,"file":"RenderTexture.js","sourceRoot":"","sources":["../../src/RenderTexture.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,IAAI,EAA0B,MAAM,qBAAqB,CAAC;AAUnF;;;;;GAKG;AACH,MAAM,OAAgB,aAAa;IACjC,qCAAqC;IACrB,IAAI,CAAqB;IACzC,0EAA0E;IACzD,KAAK,CAAa;IAEnC,IAAW,aAAa,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5F,IAAW,OAAO,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChF,IAAW,QAAQ,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAGlF,YAAsB,IAAwB;QAC5C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,uDAAuD;IACzE,CAAC;IAKD,mFAAmF;IAC5E,OAAO,CAAC,KAAoB;QACjC,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;CACF;AAED,cAAc;AACd,WAAiB,aAAa;IAC5B,0FAA0F;IAC1F,IAAY,IAaX;IAbD,WAAY,IAAI;QACd,kFAAkF;QAClF,mCAAM,CAAA;QACN,yGAAyG;QACzG,iCAAK,CAAA;QACL,mFAAmF;QACnF,6CAAW,CAAA;QACX,+DAA+D;QAC/D,mCAAM,CAAA;QACN,oHAAoH;QACpH,6DAAmB,CAAA;QACnB,kDAAkD;QAClD,uDAAgB,CAAA;IAClB,CAAC,EAbW,IAAI,GAAJ,kBAAI,KAAJ,kBAAI,QAaf;AACH,CAAC,EAhBgB,aAAa,KAAb,aAAa,QAgB7B","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 Rendering\n */\n\nimport { compareStrings, Guid, GuidString, Id64String } from \"@itwin/core-bentley\";\n\n/** Identifies an image to be used to produce a [[RenderTexture]] for a given purpose - for example,\n * as part of a [[SkyBox]]. If the string is a valid `Id64String`, it refers to a persistent [Texture]($backend) element stored in an iModel.\n * Otherwise, it is interpreted as a Url resolving to an HTMLImageElement.\n * @see [[SkySphereImageProps.texture]] and [[SkyCubeImageProps]].\n * @public\n */\nexport type TextureImageSpec = Id64String | string;\n\n/** Represents a texture image applied to a surface during rendering.\n * A RenderTexture is typically - but not always - associated with a [[RenderMaterial]].\n * @see [RenderSystem.createTexture]($frontend) to obtain a texture.\n * @see [RenderSystem.createTextureFromElement]($frontend) to obtain a texture from a [Texture]($backend) element.\n * @public\n */\nexport abstract class RenderTexture implements Disposable {\n /** Indicates the type of texture. */\n public readonly type: RenderTexture.Type;\n /** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */\n private readonly _guid: GuidString;\n\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\n public abstract get bytesUsed(): number;\n\n protected constructor(type: RenderTexture.Type) {\n this.type = type;\n this._guid = Guid.createValue();\n }\n\n /** Releases any WebGL resources owned by this texture.\n * For a texture created by a [RenderSystem]($frontend) for which [CreateTextureArgs.ownership]($frontend) was specified as \"external\",\n * the caller is responsible for invoking this method when it is finished using the texture; otherwise, the [RenderSystem]($frontend) will handle\n * its disposal.\n */\n public [Symbol.dispose]() {\n this.dispose(); // eslint-disable-line @typescript-eslint/no-deprecated\n }\n\n /** @deprecated in 5.0 Will be made protected in a future release. Use [Symbol.dispose] instead. */\n public abstract dispose(): void; // eslint-disable-line @typescript-eslint/no-deprecated\n\n /** An [OrderedComparator]($bentley) that compares this texture against `other`. */\n public compare(other: RenderTexture): number {\n return compareStrings(this._guid, other._guid);\n }\n}\n\n/** @public */\nexport namespace RenderTexture {\n /** The types of [[RenderTexture]]s that can be created by a [RenderSystem]($frontend). */\n export enum Type {\n /** An image applied to a surface, with support for mip-mapping and repetition. */\n Normal,\n /** An image containing any number of text glyphs, used for efficiently rendering readable small text. */\n Glyph,\n /** A non-repeating image with no mip-maps, used for example for reality models. */\n TileSection,\n /** A three-dimensional texture used for rendering a skybox. */\n SkyBox,\n /** A non-repeating image with mip-maps and and anisotropic filtering, used for map tiles when draped on terrain. */\n FilteredTileSection,\n /** A gradient image used for thematic display. */\n ThematicGradient,\n }\n}\n"]}
@@ -11,6 +11,9 @@ import { ColorDef } from "./ColorDef";
11
11
  * @public
12
12
  */
13
13
  export class RgbColor {
14
+ r;
15
+ g;
16
+ b;
14
17
  /** Constructs from red, green, and blue components.
15
18
  * @param r Red
16
19
  * @param g Green
@@ -1 +1 @@
1
- {"version":3,"file":"RgbColor.js","sourceRoot":"","sources":["../../src/RgbColor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAYtC;;GAEG;AACH,MAAM,OAAO,QAAQ;IACnB;;;;OAIG;IACH,YAAmC,CAAS,EAAkB,CAAS,EAAkB,CAAS;QAA/D,MAAC,GAAD,CAAC,CAAQ;QAAkB,MAAC,GAAD,CAAC,CAAQ;QAAkB,MAAC,GAAD,CAAC,CAAQ;QAChG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IA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AAQ;gBAC5B,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QACf,CAAC;QAED,OAAO,IAAI,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,sGAAsG;IAC/F,MAAM,CAAC,KAAe;QAC3B,OAAO,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,+FAA+F;IACxF,SAAS,CAAC,KAAe;QAC9B,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/G,CAAC;IAED,mIAAmI;IAC5H,WAAW;QAChB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;CACF","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 Symbology\n */\n\nimport { compareNumbers } from \"@itwin/core-bentley\";\nimport { ColorDef } from \"./ColorDef\";\n\n/** JSON representation of an [[RgbColor]], with each component an integer in the range [0, 255].\n * @public\n * @extensions\n */\nexport interface RgbColorProps {\n r: number;\n g: number;\n b: number;\n}\n\n/** An immutable representation of a color with red, green, and blue components each in the integer range [0, 255].\n * @public\n */\nexport class RgbColor {\n /** Constructs from red, green, and blue components.\n * @param r Red\n * @param g Green\n * @param b Blue\n */\n public constructor(public readonly r: number, public readonly g: number, public readonly b: number) {\n this.r = Math.max(0, Math.min(this.r, 0xff));\n this.g = Math.max(0, Math.min(this.g, 0xff));\n this.b = Math.max(0, Math.min(this.b, 0xff));\n }\n\n /** Constructs from the red, green, and blue components of a ColorDef. The transparency component is ignored. */\n public static fromColorDef(colorDef: ColorDef): RgbColor {\n const colors = colorDef.colors;\n return new RgbColor(colors.r, colors.g, colors.b);\n }\n\n /** Converts this RgbColor to a ColorDef.\n * @param transparency Value to use for the transparency component of the ColorDef.\n * @param out If defined, this ColorDef will be modified in-place and returned; otherwise a new ColorDef will be allocated.\n * @returns A ColorDef with RGB components equivalent to those of this RgbColor and transparency component as specified.\n */\n public toColorDef(transparency = 0): ColorDef {\n return ColorDef.from(this.r, this.g, this.b, transparency);\n }\n\n /** Convert this color to its JSON representation. */\n public toJSON(): RgbColorProps {\n return { r: this.r, g: this.g, b: this.b };\n }\n\n /** Create an RgbColor from its JSON representation.\n * If `json` is `undefined`, the result is pure white.\n */\n public static fromJSON(json: RgbColorProps | undefined): RgbColor {\n let r = 0xff;\n let g = 0xff;\n let b = 0xff;\n if (undefined !== json) {\n if (typeof json.r === \"number\")\n r = json.r;\n if (typeof json.g === \"number\")\n g = json.g;\n if (typeof json.b === \"number\")\n b = json.b;\n }\n\n return new RgbColor(r, g, b);\n }\n\n /** Returns true if this color's red, green, and blue components are identical to those of `other`. */\n public equals(other: RgbColor): boolean {\n return this.r === other.r && this.g === other.g && this.b === other.b;\n }\n\n /** Compare this color to another color using the rules of an [OrderedComparator]($bentley). */\n public compareTo(other: RgbColor): number {\n return compareNumbers(this.r, other.r) || compareNumbers(this.g, other.g) || compareNumbers(this.b, other.b);\n }\n\n /** Convert this color to a string in the form \"#rrggbb\" where the values are the hex digits of the respective color components. */\n public toHexString(): string {\n return this.toColorDef().toHexString();\n }\n}\n"]}
1
+ {"version":3,"file":"RgbColor.js","sourceRoot":"","sources":["../../src/RgbColor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,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------\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 Symbology\n */\n\nimport { compareNumbers } from \"@itwin/core-bentley\";\nimport { ColorDef } from \"./ColorDef\";\n\n/** JSON representation of an [[RgbColor]], with each component an integer in the range [0, 255].\n * @public\n * @extensions\n */\nexport interface RgbColorProps {\n r: number;\n g: number;\n b: number;\n}\n\n/** An immutable representation of a color with red, green, and blue components each in the integer range [0, 255].\n * @public\n */\nexport class RgbColor {\n /** Constructs from red, green, and blue components.\n * @param r Red\n * @param g Green\n * @param b Blue\n */\n public constructor(public readonly r: number, public readonly g: number, public readonly b: number) {\n this.r = Math.max(0, Math.min(this.r, 0xff));\n this.g = Math.max(0, Math.min(this.g, 0xff));\n this.b = Math.max(0, Math.min(this.b, 0xff));\n }\n\n /** Constructs from the red, green, and blue components of a ColorDef. The transparency component is ignored. */\n public static fromColorDef(colorDef: ColorDef): RgbColor {\n const colors = colorDef.colors;\n return new RgbColor(colors.r, colors.g, colors.b);\n }\n\n /** Converts this RgbColor to a ColorDef.\n * @param transparency Value to use for the transparency component of the ColorDef.\n * @param out If defined, this ColorDef will be modified in-place and returned; otherwise a new ColorDef will be allocated.\n * @returns A ColorDef with RGB components equivalent to those of this RgbColor and transparency component as specified.\n */\n public toColorDef(transparency = 0): ColorDef {\n return ColorDef.from(this.r, this.g, this.b, transparency);\n }\n\n /** Convert this color to its JSON representation. */\n public toJSON(): RgbColorProps {\n return { r: this.r, g: this.g, b: this.b };\n }\n\n /** Create an RgbColor from its JSON representation.\n * If `json` is `undefined`, the result is pure white.\n */\n public static fromJSON(json: RgbColorProps | undefined): RgbColor {\n let r = 0xff;\n let g = 0xff;\n let b = 0xff;\n if (undefined !== json) {\n if (typeof json.r === \"number\")\n r = json.r;\n if (typeof json.g === \"number\")\n g = json.g;\n if (typeof json.b === \"number\")\n b = json.b;\n }\n\n return new RgbColor(r, g, b);\n }\n\n /** Returns true if this color's red, green, and blue components are identical to those of `other`. */\n public equals(other: RgbColor): boolean {\n return this.r === other.r && this.g === other.g && this.b === other.b;\n }\n\n /** Compare this color to another color using the rules of an [OrderedComparator]($bentley). */\n public compareTo(other: RgbColor): number {\n return compareNumbers(this.r, other.r) || compareNumbers(this.g, other.g) || compareNumbers(this.b, other.b);\n }\n\n /** Convert this color to a string in the form \"#rrggbb\" where the values are the hex digits of the respective color components. */\n public toHexString(): string {\n return this.toColorDef().toHexString();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RpcInterface.d.ts","sourceRoot":"","sources":["../../src/RpcInterface.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGzF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAW7D;;;;GAIG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IAAI,SAAS,EAAE,CAAC,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE;AAEhJ;;;GAGG;AACH,MAAM,MAAM,0BAA0B,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,UAAU,CAAC,CAAC;AAS5F;;;GAGG;AACH,8BAAsB,YAAY;IAEhC,OAAO,CAAC,MAAM,CAAC,QAAQ;IAQvB,OAAO,CAAC,MAAM,CAAC,QAAQ;IAYvB,8JAA8J;WAChJ,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO;IAwB7E;;OAEG;IACH,SAAgB,aAAa,EAAE,gBAAgB,CAAC;IAEhD,gBAAgB;IAChB,SAAgB,OAAO,EAAE,eAAe,CAAC;IAEzC,YAAY;gBACO,OAAO,GAAE,eAAyC;IAKrE,8DAA8D;IACjD,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC;IAgBjE,gBAAgB;IACT,qBAAqB,EAAE,wBAAwB,GAAG,SAAS,CAAC;CACpE"}
1
+ {"version":3,"file":"RpcInterface.d.ts","sourceRoot":"","sources":["../../src/RpcInterface.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGzF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAW7D;;;;GAIG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IAAI,SAAS,EAAE,CAAC,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE;AAEhJ;;;GAGG;AACH,MAAM,MAAM,0BAA0B,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,UAAU,CAAC,CAAC;AAS5F;;;GAGG;AACH,8BAAsB,YAAY;IAEhC,OAAO,CAAC,MAAM,CAAC,QAAQ;IAQvB,OAAO,CAAC,MAAM,CAAC,QAAQ;IAYvB,8JAA8J;WAChJ,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO;IAwB7E;;OAEG;IACH,SAAgB,aAAa,EAAE,gBAAgB,CAAC;IAEhD,gBAAgB;IAChB,SAAgB,OAAO,EAAE,eAAe,CAAC;IAEzC,YAAY;gBACO,OAAO,GAAE,eAAyC;IAKrE,8DAA8D;IACjD,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC;IAgBjE,gBAAgB;IACD,qBAAqB,EAAE,wBAAwB,GAAG,SAAS,CAAC;CAC5E"}
@@ -10,9 +10,9 @@ import { CURRENT_REQUEST } from "./rpc/core/RpcRegistry";
10
10
  import { aggregateLoad, RpcRequest } from "./rpc/core/RpcRequest";
11
11
  import { RpcRoutingToken } from "./rpc/core/RpcRoutingToken";
12
12
  import { IpcSession } from "./ipc/IpcSession";
13
- import { BentleyStatus, IModelError, NoContentError } from "./IModelError";
13
+ import { IModelError, NoContentError } from "./IModelError";
14
14
  import { RpcRequestEvent, RpcRequestStatus } from "./rpc/core/RpcConstants";
15
- import { BeDuration } from "@itwin/core-bentley";
15
+ import { BeDuration, BentleyStatus } from "@itwin/core-bentley";
16
16
  /** An RPC interface is a set of operations exposed by a service that a client can call, using configurable protocols,
17
17
  * in a platform-independent way. TheRpcInterface class is the base class for RPC interface definitions and implementations.
18
18
  * @public
@@ -54,6 +54,12 @@ export class RpcInterface {
54
54
  // patch difference is fine. If minor versions differ, compatible as long as backend minor version is greater
55
55
  return difference === "patch" || (difference === "minor" && frontendSemver.minor < backendSemver.minor);
56
56
  }
57
+ /** The configuration for the RPC interface.
58
+ * @internal
59
+ */
60
+ configuration;
61
+ /** @internal */
62
+ routing;
57
63
  /** @beta */
58
64
  constructor(routing = RpcRoutingToken.default) {
59
65
  this.routing = routing;
@@ -1 +1 @@
1
- {"version":3,"file":"RpcInterface.js","sourceRoot":"","sources":["../../src/RpcInterface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAA4B,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAyB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAA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AsE;YACrF,CAAC;QACH,CAAC,EAAE,MAAM,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,eAAe;IAC5B,MAAM,IAAI,cAAc,EAAE,CAAC;AAC7B,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 RpcInterface\n */\nimport { RpcConfiguration, RpcConfigurationSupplier } from \"./rpc/core/RpcConfiguration\";\nimport { CURRENT_REQUEST } from \"./rpc/core/RpcRegistry\";\nimport { aggregateLoad, RpcRequest } from \"./rpc/core/RpcRequest\";\nimport { RpcRoutingToken } from \"./rpc/core/RpcRoutingToken\";\nimport { InterceptedRpcRequest, IpcSession } from \"./ipc/IpcSession\";\nimport { RpcSerializedValue } from \"./rpc/core/RpcMarshaling\";\nimport { RpcManagedStatus } from \"./rpc/core/RpcProtocol\";\nimport { BentleyStatus, IModelError, NoContentError } from \"./IModelError\";\nimport { RpcRequestEvent, RpcRequestStatus } from \"./rpc/core/RpcConstants\";\nimport { BeDuration } from \"@itwin/core-bentley\";\nimport { RpcNotFoundResponse } from \"./rpc/core/RpcControl\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/**\n * Specifies the required static properties of an RpcInterface class.\n * These properties are used to identify RPC requests and responses.\n * @beta\n */\nexport interface RpcInterfaceDefinition<T extends RpcInterface = RpcInterface> { prototype: T, interfaceName: string, interfaceVersion: string }\n\n/**\n * A class that implements the operations of an RPC interface.\n * @beta\n */\nexport type RpcInterfaceImplementation<T extends RpcInterface = RpcInterface> = new () => T;\n\ninterface SemverType {\n major: number;\n minor: number;\n patch: number;\n prerelease?: string;\n}\n\n/** An RPC interface is a set of operations exposed by a service that a client can call, using configurable protocols,\n * in a platform-independent way. TheRpcInterface class is the base class for RPC interface definitions and implementations.\n * @public\n */\nexport abstract class RpcInterface {\n\n private static findDiff(backend: SemverType, frontend: SemverType) {\n return backend.major !== frontend.major ? \"major\" :\n backend.minor !== frontend.minor ? \"minor\" :\n backend.patch !== frontend.patch ? \"patch\" :\n backend.prerelease !== frontend.prerelease ? \"prerelease\" :\n \"same\";\n }\n\n private static parseVer(version: string): SemverType {\n // separate the version from the prerelease tag\n const parts = version.split(/[:-]/);\n // Split the major.minor.path into separate components\n const prefix = parts[0].split(\".\");\n\n const ver: SemverType = { major: Number(prefix[0]), minor: Number(prefix[1]), patch: Number(prefix[2]) };\n if (parts.length > 1)\n ver.prerelease = parts[1];\n return ver;\n }\n\n /** Determines whether the backend version of an RPC interface is compatible (according to semantic versioning) with the frontend version of the interface. */\n public static isVersionCompatible(backend: string, frontend: string): boolean {\n if (backend === frontend)\n return true; // most common case, versions are identical\n\n const backendSemver = this.parseVer(backend);\n const frontendSemver = this.parseVer(frontend);\n\n // if either has a prerelease tag, they are not compatible unless version strings are identical\n if (backendSemver.prerelease || frontendSemver.prerelease)\n return false;\n\n const difference = this.findDiff(backendSemver, frontendSemver);\n // If the major versions are different, the versions are not compatible\n if (difference === \"major\")\n return false;\n\n // special case for major version 0. If patch difference, backend patch must be greater than frontend patch\n if (backendSemver.major === 0)\n return (difference === \"patch\" && frontendSemver.patch < backendSemver.patch);\n\n // patch difference is fine. If minor versions differ, compatible as long as backend minor version is greater\n return difference === \"patch\" || (difference === \"minor\" && frontendSemver.minor < backendSemver.minor);\n }\n\n /** The configuration for the RPC interface.\n * @internal\n */\n public readonly configuration: RpcConfiguration;\n\n /** @internal */\n public readonly routing: RpcRoutingToken;\n\n /** @beta */\n public constructor(routing: RpcRoutingToken = RpcRoutingToken.default) {\n this.routing = routing;\n this.configuration = RpcConfiguration.supply(this);\n }\n\n /** Obtains the implementation result for an RPC operation. */\n public async forward<T = any>(parameters: IArguments): Promise<T> {\n const parametersCompat = (arguments.length === 1 && typeof (parameters) === \"object\") ? parameters : arguments;\n const parametersArray = Array.isArray(parametersCompat) ? parametersCompat : Array.prototype.slice.call(parametersCompat);\n const operationName = parametersArray.pop();\n\n const session = IpcSession.active;\n if (session) {\n return intercept(session, this, operationName, parametersArray);\n } else {\n const request = new (this.configuration.protocol.requestType as any)(this, operationName, parametersArray) as RpcRequest;\n request.submit(); // eslint-disable-line @typescript-eslint/no-floating-promises\n (this as any)[CURRENT_REQUEST] = request;\n return request.response;\n }\n }\n\n /** @internal */\n public configurationSupplier: RpcConfigurationSupplier | undefined;\n}\n\nRpcInterface.prototype.configurationSupplier = undefined;\n\nclass InterceptedRequest extends RpcRequest {\n protected override async load(): Promise<RpcSerializedValue> { throw new Error(); }\n protected override async send(): Promise<number> { throw new Error(); }\n protected override setHeader(_name: string, _value: string): void { throw new Error(); }\n}\n\nasync function intercept(session: IpcSession, client: RpcInterface, operation: string, parameters: any[]) {\n const request = new InterceptedRequest(client, operation, []);\n (client as any)[CURRENT_REQUEST] = request;\n\n const context = await client.configuration.protocol.serialize(request);\n request.parameters = parameters;\n\n const info: InterceptedRpcRequest = {\n definition: {\n interfaceName: context.operation.interfaceDefinition,\n interfaceVersion: context.operation.interfaceVersion,\n },\n operation,\n parameters,\n context: {\n applicationId: context.applicationId,\n applicationVersion: context.applicationVersion,\n id: context.id,\n sessionId: context.sessionId,\n protocolVersion: (context.protocolVersion || 0).toString(),\n },\n };\n\n const dispatch = async () => {\n aggregateLoad.lastRequest = new Date().getTime();\n\n const response = await session.handleRpc(info);\n\n aggregateLoad.lastResponse = new Date().getTime();\n\n if (typeof (response) === \"object\" && response.hasOwnProperty(\"iTwinRpcCoreResponse\") && response.hasOwnProperty(\"managedStatus\")) {\n const status: RpcManagedStatus = response;\n\n if (status.managedStatus === \"pending\") {\n return handlePending(request, status, dispatch);\n } else if (status.managedStatus === \"notFound\") {\n return handleNotFound(request, status, dispatch);\n } else if (status.managedStatus === \"noContent\") {\n return handleNoContent();\n }\n } else {\n return response;\n }\n };\n\n return dispatch();\n}\n\nasync function handlePending(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n request._status = RpcRequestStatus.Pending;\n request._extendedStatus = (status.responseValue as { message: string }).message;\n RpcRequest.events.raiseEvent(RpcRequestEvent.PendingUpdateReceived, request);\n\n const delay = request.operation.policy.retryInterval(request.client.configuration);\n\n await BeDuration.wait(delay);\n return dispatch();\n}\n\nasync function handleNotFound(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n return new Promise((resolve, reject) => {\n let resubmitted = false;\n\n RpcRequest.notFoundHandlers.raiseEvent(request, status.responseValue as RpcNotFoundResponse, async () => {\n if (resubmitted) {\n throw new IModelError(BentleyStatus.ERROR, `Already resubmitted using this handler.`);\n }\n\n resubmitted = true;\n\n try {\n const response = await dispatch();\n resolve(response);\n } catch (err) {\n reject(err); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\n }\n }, reject);\n });\n}\n\nasync function handleNoContent() {\n throw new NoContentError();\n}\n"]}
1
+ {"version":3,"file":"RpcInterface.js","sourceRoot":"","sources":["../../src/RpcInterface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAA4B,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAyB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGrE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAyBhE;;;GAGG;AACH,MAAM,OAAgB,YAAY;IAExB,MAAM,CAAC,QAAQ,CAAC,OAAmB,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M,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,eAAe;IAC5B,MAAM,IAAI,cAAc,EAAE,CAAC;AAC7B,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 RpcInterface\n */\nimport { RpcConfiguration, RpcConfigurationSupplier } from \"./rpc/core/RpcConfiguration\";\nimport { CURRENT_REQUEST } from \"./rpc/core/RpcRegistry\";\nimport { aggregateLoad, RpcRequest } from \"./rpc/core/RpcRequest\";\nimport { RpcRoutingToken } from \"./rpc/core/RpcRoutingToken\";\nimport { InterceptedRpcRequest, IpcSession } from \"./ipc/IpcSession\";\nimport { RpcSerializedValue } from \"./rpc/core/RpcMarshaling\";\nimport { RpcManagedStatus } from \"./rpc/core/RpcProtocol\";\nimport { IModelError, NoContentError } from \"./IModelError\";\nimport { RpcRequestEvent, RpcRequestStatus } from \"./rpc/core/RpcConstants\";\nimport { BeDuration, BentleyStatus } from \"@itwin/core-bentley\";\nimport { RpcNotFoundResponse } from \"./rpc/core/RpcControl\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/**\n * Specifies the required static properties of an RpcInterface class.\n * These properties are used to identify RPC requests and responses.\n * @beta\n */\nexport interface RpcInterfaceDefinition<T extends RpcInterface = RpcInterface> { prototype: T, interfaceName: string, interfaceVersion: string }\n\n/**\n * A class that implements the operations of an RPC interface.\n * @beta\n */\nexport type RpcInterfaceImplementation<T extends RpcInterface = RpcInterface> = new () => T;\n\ninterface SemverType {\n major: number;\n minor: number;\n patch: number;\n prerelease?: string;\n}\n\n/** An RPC interface is a set of operations exposed by a service that a client can call, using configurable protocols,\n * in a platform-independent way. TheRpcInterface class is the base class for RPC interface definitions and implementations.\n * @public\n */\nexport abstract class RpcInterface {\n\n private static findDiff(backend: SemverType, frontend: SemverType) {\n return backend.major !== frontend.major ? \"major\" :\n backend.minor !== frontend.minor ? \"minor\" :\n backend.patch !== frontend.patch ? \"patch\" :\n backend.prerelease !== frontend.prerelease ? \"prerelease\" :\n \"same\";\n }\n\n private static parseVer(version: string): SemverType {\n // separate the version from the prerelease tag\n const parts = version.split(/[:-]/);\n // Split the major.minor.path into separate components\n const prefix = parts[0].split(\".\");\n\n const ver: SemverType = { major: Number(prefix[0]), minor: Number(prefix[1]), patch: Number(prefix[2]) };\n if (parts.length > 1)\n ver.prerelease = parts[1];\n return ver;\n }\n\n /** Determines whether the backend version of an RPC interface is compatible (according to semantic versioning) with the frontend version of the interface. */\n public static isVersionCompatible(backend: string, frontend: string): boolean {\n if (backend === frontend)\n return true; // most common case, versions are identical\n\n const backendSemver = this.parseVer(backend);\n const frontendSemver = this.parseVer(frontend);\n\n // if either has a prerelease tag, they are not compatible unless version strings are identical\n if (backendSemver.prerelease || frontendSemver.prerelease)\n return false;\n\n const difference = this.findDiff(backendSemver, frontendSemver);\n // If the major versions are different, the versions are not compatible\n if (difference === \"major\")\n return false;\n\n // special case for major version 0. If patch difference, backend patch must be greater than frontend patch\n if (backendSemver.major === 0)\n return (difference === \"patch\" && frontendSemver.patch < backendSemver.patch);\n\n // patch difference is fine. If minor versions differ, compatible as long as backend minor version is greater\n return difference === \"patch\" || (difference === \"minor\" && frontendSemver.minor < backendSemver.minor);\n }\n\n /** The configuration for the RPC interface.\n * @internal\n */\n public readonly configuration: RpcConfiguration;\n\n /** @internal */\n public readonly routing: RpcRoutingToken;\n\n /** @beta */\n public constructor(routing: RpcRoutingToken = RpcRoutingToken.default) {\n this.routing = routing;\n this.configuration = RpcConfiguration.supply(this);\n }\n\n /** Obtains the implementation result for an RPC operation. */\n public async forward<T = any>(parameters: IArguments): Promise<T> {\n const parametersCompat = (arguments.length === 1 && typeof (parameters) === \"object\") ? parameters : arguments;\n const parametersArray = Array.isArray(parametersCompat) ? parametersCompat : Array.prototype.slice.call(parametersCompat);\n const operationName = parametersArray.pop();\n\n const session = IpcSession.active;\n if (session) {\n return intercept(session, this, operationName, parametersArray);\n } else {\n const request = new (this.configuration.protocol.requestType as any)(this, operationName, parametersArray) as RpcRequest;\n request.submit(); // eslint-disable-line @typescript-eslint/no-floating-promises\n (this as any)[CURRENT_REQUEST] = request;\n return request.response;\n }\n }\n\n /** @internal */\n declare public configurationSupplier: RpcConfigurationSupplier | undefined;\n}\n\nRpcInterface.prototype.configurationSupplier = undefined;\n\nclass InterceptedRequest extends RpcRequest {\n protected override async load(): Promise<RpcSerializedValue> { throw new Error(); }\n protected override async send(): Promise<number> { throw new Error(); }\n protected override setHeader(_name: string, _value: string): void { throw new Error(); }\n}\n\nasync function intercept(session: IpcSession, client: RpcInterface, operation: string, parameters: any[]) {\n const request = new InterceptedRequest(client, operation, []);\n (client as any)[CURRENT_REQUEST] = request;\n\n const context = await client.configuration.protocol.serialize(request);\n request.parameters = parameters;\n\n const info: InterceptedRpcRequest = {\n definition: {\n interfaceName: context.operation.interfaceDefinition,\n interfaceVersion: context.operation.interfaceVersion,\n },\n operation,\n parameters,\n context: {\n applicationId: context.applicationId,\n applicationVersion: context.applicationVersion,\n id: context.id,\n sessionId: context.sessionId,\n protocolVersion: (context.protocolVersion || 0).toString(),\n },\n };\n\n const dispatch = async () => {\n aggregateLoad.lastRequest = new Date().getTime();\n\n const response = await session.handleRpc(info);\n\n aggregateLoad.lastResponse = new Date().getTime();\n\n if (typeof (response) === \"object\" && response.hasOwnProperty(\"iTwinRpcCoreResponse\") && response.hasOwnProperty(\"managedStatus\")) {\n const status: RpcManagedStatus = response;\n\n if (status.managedStatus === \"pending\") {\n return handlePending(request, status, dispatch);\n } else if (status.managedStatus === \"notFound\") {\n return handleNotFound(request, status, dispatch);\n } else if (status.managedStatus === \"noContent\") {\n return handleNoContent();\n }\n } else {\n return response;\n }\n };\n\n return dispatch();\n}\n\nasync function handlePending(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n request._status = RpcRequestStatus.Pending;\n request._extendedStatus = (status.responseValue as { message: string }).message;\n RpcRequest.events.raiseEvent(RpcRequestEvent.PendingUpdateReceived, request);\n\n const delay = request.operation.policy.retryInterval(request.client.configuration);\n\n await BeDuration.wait(delay);\n return dispatch();\n}\n\nasync function handleNotFound(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n return new Promise((resolve, reject) => {\n let resubmitted = false;\n\n RpcRequest.notFoundHandlers.raiseEvent(request, status.responseValue as RpcNotFoundResponse, async () => {\n if (resubmitted) {\n throw new IModelError(BentleyStatus.ERROR, `Already resubmitted using this handler.`);\n }\n\n resubmitted = true;\n\n try {\n const response = await dispatch();\n resolve(response);\n } catch (err) {\n reject(err); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\n }\n }, reject);\n });\n}\n\nasync function handleNoContent() {\n throw new NoContentError();\n}\n"]}
package/lib/esm/SkyBox.js CHANGED
@@ -40,6 +40,13 @@ function colorDefFromJson(props) {
40
40
  * @public
41
41
  */
42
42
  export class SkyGradient {
43
+ twoColor;
44
+ skyColor;
45
+ groundColor;
46
+ zenithColor;
47
+ nadirColor;
48
+ skyExponent;
49
+ groundExponent;
43
50
  constructor(args) {
44
51
  this.twoColor = args.twoColor ?? false;
45
52
  this.skyColor = args.skyColor ?? defaultSkyColor;
@@ -49,6 +56,8 @@ export class SkyGradient {
49
56
  this.skyExponent = args.skyExponent ?? defaultExponent;
50
57
  this.groundExponent = args.groundExponent ?? defaultExponent;
51
58
  }
59
+ /** Default settings for a four-color gradient. */
60
+ static defaults = new SkyGradient({});
52
61
  /** Create a new gradient. Any properties not specified by `props` are initialized to their default values. */
53
62
  static create(props) {
54
63
  return props ? new this(props) : this.defaults;
@@ -97,16 +106,18 @@ export class SkyGradient {
97
106
  this.zenithColor.equals(other.zenithColor) && this.nadirColor.equals(other.nadirColor);
98
107
  }
99
108
  }
100
- /** Default settings for a four-color gradient. */
101
- SkyGradient.defaults = new SkyGradient({});
102
109
  /** Describes how to draw a representation of a sky, as part of an [[Environment]].
103
110
  * @see [[SkyBoxProps]].
104
111
  * @public
105
112
  */
106
113
  export class SkyBox {
114
+ /** The gradient settings, used if no cube or sphere images are supplied, or if the images cannot be loaded. */
115
+ gradient;
107
116
  constructor(gradient) {
108
117
  this.gradient = gradient;
109
118
  }
119
+ /** Default settings for a four-color gradient. */
120
+ static defaults = new SkyBox(SkyGradient.defaults);
110
121
  /** Create a skybox that displays the specified gradient, or the default gradient if none is supplied. */
111
122
  static createGradient(gradient) {
112
123
  return gradient ? new this(gradient) : this.defaults;
@@ -144,12 +155,12 @@ export class SkyBox {
144
155
  return [];
145
156
  }
146
157
  }
147
- /** Default settings for a four-color gradient. */
148
- SkyBox.defaults = new SkyBox(SkyGradient.defaults);
149
158
  /** Describes how to draw a representation of a sky by mapping a single image to the interior of a sphere.
150
159
  * @public
151
160
  */
152
161
  export class SkySphere extends SkyBox {
162
+ /** The image to map to the interior of the sphere. */
163
+ image;
153
164
  /** Create a new sky sphere using the specified image.
154
165
  * @param image The image to map to the interior of the sphere.
155
166
  * @param gradient Optionally overrides the default gradient settings used if the image cannot be obtained.
@@ -177,6 +188,8 @@ export class SkySphere extends SkyBox {
177
188
  * @public
178
189
  */
179
190
  export class SkyCube extends SkyBox {
191
+ /** The images to map to each face of the cube. */
192
+ images;
180
193
  /** Create a new sky cube using the specified images.
181
194
  * @param images The images to map to each face of the cube.
182
195
  * @param gradient Optionally overrides the default gradient settings used if the images cannot be obtained.
@@ -1 +1 @@
1
- {"version":3,"file":"SkyBox.js","sourceRoot":"","sources":["../../src/SkyBox.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAuC,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAGrD;;;;GAIG;AACH,MAAM,CAAN,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,kEAAkE;IAClE,qDAAQ,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AAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAClH,CAAC;CACF","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 DisplayStyles\n */\n\nimport { Id64, Id64String, NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\nimport { TextureImageSpec } from \"./RenderTexture\";\n\n/** Supported types of [[SkyBox]] images.\n * @see [[SkyBoxImageProps]].\n * @public\n * @extensions\n */\nexport enum SkyBoxImageType {\n /** No image, indicating a [[SkyGradient]] should be displayed. */\n None = 0,\n /** A single image mapped to the surface of a sphere.\n * @see [[SkySphere]].\n */\n Spherical = 1,\n /** @internal not yet supported */\n Cylindrical = 2,\n /** Six images mapped to the faces of a cube.\n * @see [[SkyCube]].\n */\n Cube = 3,\n}\n\n/** JSON representation of the six images used by a [[SkyCube]].\n * Each property specifies the image for a face of the cube as either an image URL, or the Id of a [Texture]($backend) element.\n * Each image must be square and have the same dimensions as all the other images.\n * @public\n * @extensions\n */\nexport interface SkyCubeProps {\n front: TextureImageSpec;\n back: TextureImageSpec;\n top: TextureImageSpec;\n bottom: TextureImageSpec;\n right: TextureImageSpec;\n left: TextureImageSpec;\n}\n\n/** JSON representation of the image used for a [[SkySphere]].\n * @see [[SkyBoxProps.image]].\n * @public\n */\nexport interface SkySphereImageProps {\n type: SkyBoxImageType.Spherical;\n texture: TextureImageSpec;\n /** @internal */\n textures?: never;\n}\n\n/** JSON representation of the images used for a [[SkyCube]].\n * @see [[SkyBoxProps.image]].\n * @public\n */\nexport interface SkyCubeImageProps {\n type: SkyBoxImageType.Cube;\n textures: SkyCubeProps;\n /** @internal */\n texture?: never;\n}\n\n/** JSON representation of the image(s) to be mapped to the surfaces of a [[SkyBox]].\n * @see [[SkyBoxProps.image]].\n * @public\n * @extensions\n */\nexport type SkyBoxImageProps = SkySphereImageProps | SkyCubeImageProps | { type?: SkyBoxImageType, texture?: never, textures?: never };\n\n/** JSON representation of a [[SkyBox]] that can be drawn as the background of a [ViewState3d]($frontend).\n * An object of this type can describe one of several types of sky box:\n * - A cube with a texture image mapped to each face; or\n * - A sphere with a single texture image mapped to its surface; or\n * - A sphere with a two- or four-color vertical [[Gradient]] mapped to its surface.\n *\n * Whether cuboid or spherical, the skybox is drawn as if the viewer and the contents of the view are contained within its interior.\n *\n * For a two-color gradient, the gradient transitions smoothly from the nadir color at the bottom of the sphere to the zenith color at the top of the sphere.\n * The sky and ground colors are unused, as are the sky and ground exponents.\n *\n * For a four-color gradient, a \"horizon\" is produced on the equator of the sphere, where the ground color and sky color meet. The lower half of the sphere transitions\n * smoothly from the ground color at the equator to the nadir color at the bottom, and the upper half transitions from the sky color at the equator to the zenith color at\n * the top of the sphere.\n *\n * The color and exponent properties are unused if one or more texture images are supplied.\n *\n * The skybox is ignored entirely when an atmosphere is displayed.\n *\n * @see [[DisplayStyle3dSettings.environment]] to define the skybox for a display style.\n * @public\n * @extensions\n */\nexport interface SkyBoxProps {\n /** Whether or not the skybox should be displayed.\n * Default: false.\n */\n display?: boolean;\n /** For a [[SkyGradient]], if true, a 2-color gradient skybox is used instead of a 4-color.\n * Default: false.\n */\n twoColor?: boolean;\n /** The color of the sky at the horizon. Unused unless this is a four-color [[SkyGradient]].\n * Default: (143, 205, 255).\n */\n skyColor?: ColorDefProps;\n /** The color of the ground at the horizon. Unused unless this is a four-color [[SkyGradient]].\n * Default: (120, 143, 125).\n */\n groundColor?: ColorDefProps;\n /** The color of the top of the sphere.\n * Default: (54, 117, 255).\n */\n zenithColor?: ColorDefProps;\n /** The color of the bottom of the sphere.\n * Default: (40, 15, 0).\n */\n nadirColor?: ColorDefProps;\n /** For a 4-color [[SkyGradient]], controls speed of change from sky color to zenith color; otherwise unused.\n * Default: 4.0.\n */\n skyExponent?: number;\n /** For a 4-color [[SkyGradient]], controls speed of change from ground color to nadir color; otherwise unused.\n * Default: 4.0.\n */\n groundExponent?: number;\n /** The image(s), if any, to be mapped to the surfaces of the sphere or cube. If undefined, the skybox will be displayed as a gradient instead.\n * Default: undefined.\n */\n image?: SkyBoxImageProps;\n}\n\nconst defaultGroundColor = ColorDef.from(143, 205, 125);\nconst defaultZenithColor = ColorDef.from(54, 117, 255);\nconst defaultNadirColor = ColorDef.from(40, 125, 0);\nconst defaultSkyColor = ColorDef.from(142, 205, 255);\nconst defaultExponent = 4.0;\n\nfunction colorDefFromJson(props?: ColorDefProps): ColorDef | undefined {\n return undefined !== props ? ColorDef.fromJSON(props) : undefined;\n}\n\n/** A type containing all of the properties and none of the methods of [[SkyGradient]] with `readonly` modifiers removed.\n * @see [[SkyGradient.create]] and [[SkyGradient.clone]].\n * @public\n */\nexport type SkyGradientProperties = NonFunctionPropertiesOf<SkyGradient>;\n\n/** Describes how to map a two- or four-color [[Gradient]] to the interior of a sphere to produce a [[SkyBox]].\n * @see [[SkyBox.gradient]].\n * @public\n */\nexport class SkyGradient {\n public readonly twoColor: boolean;\n public readonly skyColor: ColorDef;\n public readonly groundColor: ColorDef;\n public readonly zenithColor: ColorDef;\n public readonly nadirColor: ColorDef;\n public readonly skyExponent: number;\n public readonly groundExponent: number;\n\n private constructor(args: Partial<SkyGradientProperties>) {\n this.twoColor = args.twoColor ?? false;\n this.skyColor = args.skyColor ?? defaultSkyColor;\n this.groundColor = args.groundColor ?? defaultGroundColor;\n this.nadirColor = args.nadirColor ?? defaultNadirColor;\n this.zenithColor = args.zenithColor ?? defaultZenithColor;\n this.skyExponent = args.skyExponent ?? defaultExponent;\n this.groundExponent = args.groundExponent ?? defaultExponent;\n }\n\n /** Default settings for a four-color gradient. */\n public static readonly defaults = new SkyGradient({});\n\n /** Create a new gradient. Any properties not specified by `props` are initialized to their default values. */\n public static create(props?: Partial<SkyGradientProperties>): SkyGradient {\n return props ? new this(props) : this.defaults;\n }\n\n /** Create from JSON representation. */\n public static fromJSON(props?: SkyBoxProps): SkyGradient {\n if (!props)\n return this.defaults;\n\n return new this({\n twoColor: props.twoColor,\n skyExponent: props.skyExponent,\n groundExponent: props.groundExponent,\n skyColor: colorDefFromJson(props.skyColor),\n groundColor: colorDefFromJson(props.groundColor),\n nadirColor: colorDefFromJson(props.nadirColor),\n zenithColor: colorDefFromJson(props.zenithColor),\n });\n }\n\n /** Create ea copy of this gradient, identical except for any properties explicitly specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps: SkyGradientProperties): SkyGradient {\n return new SkyGradient({ ...this, ...changedProps });\n }\n\n /** Convert to JSON representation. */\n public toJSON(): SkyBoxProps {\n const props: SkyBoxProps = {\n skyColor: this.skyColor.toJSON(),\n groundColor: this.groundColor.toJSON(),\n nadirColor: this.nadirColor.toJSON(),\n zenithColor: this.zenithColor.toJSON(),\n };\n\n if (this.groundExponent !== defaultExponent)\n props.groundExponent = this.groundExponent;\n\n if (this.skyExponent !== defaultExponent)\n props.skyExponent = this.skyExponent;\n\n if (this.twoColor)\n props.twoColor = this.twoColor;\n\n return props;\n }\n\n /** Returns true if this gradient is equivalent to the supplied gradient. */\n public equals(other: SkyGradient): boolean {\n if (this === other)\n return true;\n\n return this.twoColor === other.twoColor && this.skyColor.equals(other.skyColor) && this.groundColor.equals(other.groundColor) &&\n this.zenithColor.equals(other.zenithColor) && this.nadirColor.equals(other.nadirColor);\n }\n}\n\n/** Describes how to draw a representation of a sky, as part of an [[Environment]].\n * @see [[SkyBoxProps]].\n * @public\n */\nexport class SkyBox {\n /** The gradient settings, used if no cube or sphere images are supplied, or if the images cannot be loaded. */\n public readonly gradient: SkyGradient;\n\n protected constructor(gradient: SkyGradient) {\n this.gradient = gradient;\n }\n\n /** Default settings for a four-color gradient. */\n public static readonly defaults = new SkyBox(SkyGradient.defaults);\n\n /** Create a skybox that displays the specified gradient, or the default gradient if none is supplied. */\n public static createGradient(gradient?: SkyGradient): SkyBox {\n return gradient ? new this(gradient) : this.defaults;\n }\n\n /** Create from JSON representation. */\n public static fromJSON(props?: SkyBoxProps): SkyBox {\n const gradient = SkyGradient.fromJSON(props);\n\n if (props?.image) {\n switch (props.image.type) {\n case SkyBoxImageType.Spherical:\n if (undefined !== props.image.texture)\n return new SkySphere(props.image.texture, gradient);\n\n break;\n case SkyBoxImageType.Cube: {\n const tx = props.image.textures;\n if (tx && undefined !== tx.top && undefined !== tx.bottom && undefined !== tx.right && undefined !== tx.left && undefined !== tx.front && undefined !== tx.back)\n return new SkyCube(tx, gradient);\n\n break;\n }\n }\n }\n\n return this.createGradient(gradient);\n }\n\n /** Convert to JSON representation.\n * @param display If defined, the value to use for [[SkyBoxProps.display]]; otherwise, that property will be left undefined.\n */\n public toJSON(display?: boolean): SkyBoxProps {\n const props = this.gradient.toJSON();\n if (undefined !== display)\n props.display = display;\n\n return props;\n }\n\n /** @internal */\n public get textureIds(): Iterable<Id64String> {\n return [];\n }\n}\n\n/** Describes how to draw a representation of a sky by mapping a single image to the interior of a sphere.\n * @public\n */\nexport class SkySphere extends SkyBox {\n /** The image to map to the interior of the sphere. */\n public readonly image: TextureImageSpec;\n\n /** Create a new sky sphere using the specified image.\n * @param image The image to map to the interior of the sphere.\n * @param gradient Optionally overrides the default gradient settings used if the image cannot be obtained.\n */\n public constructor(image: TextureImageSpec, gradient?: SkyGradient) {\n super(gradient ?? SkyGradient.defaults);\n this.image = image;\n }\n\n /** See [[SkyBox.toJSON]]. */\n public override toJSON(display?: boolean): SkyBoxProps {\n const props = super.toJSON(display);\n props.image = {\n type: SkyBoxImageType.Spherical,\n texture: this.image,\n };\n\n return props;\n }\n\n /** @internal */\n public override get textureIds(): Iterable<Id64String> {\n return Id64.isValidId64(this.image) ? [this.image] : [];\n }\n}\n\n/** Describes how to draw a representation of a sky by mapping images to the interior faces of a cube.\n * The images are required to be *square*, and each image must have the same dimensions as the other images.\n * @public\n */\nexport class SkyCube extends SkyBox {\n /** The images to map to each face of the cube. */\n public readonly images: SkyCubeProps;\n\n /** Create a new sky cube using the specified images.\n * @param images The images to map to each face of the cube.\n * @param gradient Optionally overrides the default gradient settings used if the images cannot be obtained.\n */\n public constructor(images: SkyCubeProps, gradient?: SkyGradient) {\n super(gradient ?? SkyGradient.defaults);\n this.images = { ...images };\n }\n\n /** See [[SkyBox.toJSON]]. */\n public override toJSON(display?: boolean): SkyBoxProps {\n const props = super.toJSON(display);\n props.image = {\n type: SkyBoxImageType.Cube,\n textures: { ...this.images },\n };\n\n return props;\n }\n\n /** @internal */\n public override get textureIds(): Iterable<Id64String> {\n const imgs = this.images;\n return [imgs.front, imgs.back, imgs.top, imgs.bottom, imgs.left, imgs.right].filter((x) => Id64.isValidId64(x));\n }\n}\n"]}
1
+ {"version":3,"file":"SkyBox.js","sourceRoot":"","sources":["../../src/SkyBox.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAuC,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAGrD;;;;GAIG;AACH,MAAM,CAAN,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,kEAAkE;IAClE,qDAAQ,CAAA;IACR;;OAEG;IACH,+DAAa,CAAA;IACb,kCAAkC;IAClC,mEAAe,CAAA;IACf;;OAEG;IACH,qDAAQ,CAAA;AACV,CAAC,EAbW,eAAe,KAAf,eAAe,QAa1B;AA4GD,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACxD,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACvD,MAAM,iBAAiB,GAAG,QAAQ,CAAC,I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AC,CAAC,CAAC;IAClH,CAAC;CACF","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 DisplayStyles\n */\n\nimport { Id64, Id64String, NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\nimport { TextureImageSpec } from \"./RenderTexture\";\n\n/** Supported types of [[SkyBox]] images.\n * @see [[SkyBoxImageProps]].\n * @public\n * @extensions\n */\nexport enum SkyBoxImageType {\n /** No image, indicating a [[SkyGradient]] should be displayed. */\n None = 0,\n /** A single image mapped to the surface of a sphere.\n * @see [[SkySphere]].\n */\n Spherical = 1,\n /** @internal not yet supported */\n Cylindrical = 2,\n /** Six images mapped to the faces of a cube.\n * @see [[SkyCube]].\n */\n Cube = 3,\n}\n\n/** JSON representation of the six images used by a [[SkyCube]].\n * Each property specifies the image for a face of the cube as either an image URL, or the Id of a [Texture]($backend) element.\n * Each image must be square and have the same dimensions as all the other images.\n * @public\n * @extensions\n */\nexport interface SkyCubeProps {\n front: TextureImageSpec;\n back: TextureImageSpec;\n top: TextureImageSpec;\n bottom: TextureImageSpec;\n right: TextureImageSpec;\n left: TextureImageSpec;\n}\n\n/** JSON representation of the image used for a [[SkySphere]].\n * @see [[SkyBoxProps.image]].\n * @public\n */\nexport interface SkySphereImageProps {\n type: SkyBoxImageType.Spherical;\n texture: TextureImageSpec;\n /** @internal */\n textures?: never;\n}\n\n/** JSON representation of the images used for a [[SkyCube]].\n * @see [[SkyBoxProps.image]].\n * @public\n */\nexport interface SkyCubeImageProps {\n type: SkyBoxImageType.Cube;\n textures: SkyCubeProps;\n /** @internal */\n texture?: never;\n}\n\n/** JSON representation of the image(s) to be mapped to the surfaces of a [[SkyBox]].\n * @see [[SkyBoxProps.image]].\n * @public\n * @extensions\n */\nexport type SkyBoxImageProps = SkySphereImageProps | SkyCubeImageProps | { type?: SkyBoxImageType, texture?: never, textures?: never };\n\n/** JSON representation of a [[SkyBox]] that can be drawn as the background of a [ViewState3d]($frontend).\n * An object of this type can describe one of several types of sky box:\n * - A cube with a texture image mapped to each face; or\n * - A sphere with a single texture image mapped to its surface; or\n * - A sphere with a two- or four-color vertical [[Gradient]] mapped to its surface.\n *\n * Whether cuboid or spherical, the skybox is drawn as if the viewer and the contents of the view are contained within its interior.\n *\n * For a two-color gradient, the gradient transitions smoothly from the nadir color at the bottom of the sphere to the zenith color at the top of the sphere.\n * The sky and ground colors are unused, as are the sky and ground exponents.\n *\n * For a four-color gradient, a \"horizon\" is produced on the equator of the sphere, where the ground color and sky color meet. The lower half of the sphere transitions\n * smoothly from the ground color at the equator to the nadir color at the bottom, and the upper half transitions from the sky color at the equator to the zenith color at\n * the top of the sphere.\n *\n * The color and exponent properties are unused if one or more texture images are supplied.\n *\n * The skybox is ignored entirely when an atmosphere is displayed.\n *\n * @see [[DisplayStyle3dSettings.environment]] to define the skybox for a display style.\n * @public\n * @extensions\n */\nexport interface SkyBoxProps {\n /** Whether or not the skybox should be displayed.\n * Default: false.\n */\n display?: boolean;\n /** For a [[SkyGradient]], if true, a 2-color gradient skybox is used instead of a 4-color.\n * Default: false.\n */\n twoColor?: boolean;\n /** The color of the sky at the horizon. Unused unless this is a four-color [[SkyGradient]].\n * Default: (143, 205, 255).\n */\n skyColor?: ColorDefProps;\n /** The color of the ground at the horizon. Unused unless this is a four-color [[SkyGradient]].\n * Default: (120, 143, 125).\n */\n groundColor?: ColorDefProps;\n /** The color of the top of the sphere.\n * Default: (54, 117, 255).\n */\n zenithColor?: ColorDefProps;\n /** The color of the bottom of the sphere.\n * Default: (40, 15, 0).\n */\n nadirColor?: ColorDefProps;\n /** For a 4-color [[SkyGradient]], controls speed of change from sky color to zenith color; otherwise unused.\n * Default: 4.0.\n */\n skyExponent?: number;\n /** For a 4-color [[SkyGradient]], controls speed of change from ground color to nadir color; otherwise unused.\n * Default: 4.0.\n */\n groundExponent?: number;\n /** The image(s), if any, to be mapped to the surfaces of the sphere or cube. If undefined, the skybox will be displayed as a gradient instead.\n * Default: undefined.\n */\n image?: SkyBoxImageProps;\n}\n\nconst defaultGroundColor = ColorDef.from(143, 205, 125);\nconst defaultZenithColor = ColorDef.from(54, 117, 255);\nconst defaultNadirColor = ColorDef.from(40, 125, 0);\nconst defaultSkyColor = ColorDef.from(142, 205, 255);\nconst defaultExponent = 4.0;\n\nfunction colorDefFromJson(props?: ColorDefProps): ColorDef | undefined {\n return undefined !== props ? ColorDef.fromJSON(props) : undefined;\n}\n\n/** A type containing all of the properties and none of the methods of [[SkyGradient]] with `readonly` modifiers removed.\n * @see [[SkyGradient.create]] and [[SkyGradient.clone]].\n * @public\n */\nexport type SkyGradientProperties = NonFunctionPropertiesOf<SkyGradient>;\n\n/** Describes how to map a two- or four-color [[Gradient]] to the interior of a sphere to produce a [[SkyBox]].\n * @see [[SkyBox.gradient]].\n * @public\n */\nexport class SkyGradient {\n public readonly twoColor: boolean;\n public readonly skyColor: ColorDef;\n public readonly groundColor: ColorDef;\n public readonly zenithColor: ColorDef;\n public readonly nadirColor: ColorDef;\n public readonly skyExponent: number;\n public readonly groundExponent: number;\n\n private constructor(args: Partial<SkyGradientProperties>) {\n this.twoColor = args.twoColor ?? false;\n this.skyColor = args.skyColor ?? defaultSkyColor;\n this.groundColor = args.groundColor ?? defaultGroundColor;\n this.nadirColor = args.nadirColor ?? defaultNadirColor;\n this.zenithColor = args.zenithColor ?? defaultZenithColor;\n this.skyExponent = args.skyExponent ?? defaultExponent;\n this.groundExponent = args.groundExponent ?? defaultExponent;\n }\n\n /** Default settings for a four-color gradient. */\n public static readonly defaults = new SkyGradient({});\n\n /** Create a new gradient. Any properties not specified by `props` are initialized to their default values. */\n public static create(props?: Partial<SkyGradientProperties>): SkyGradient {\n return props ? new this(props) : this.defaults;\n }\n\n /** Create from JSON representation. */\n public static fromJSON(props?: SkyBoxProps): SkyGradient {\n if (!props)\n return this.defaults;\n\n return new this({\n twoColor: props.twoColor,\n skyExponent: props.skyExponent,\n groundExponent: props.groundExponent,\n skyColor: colorDefFromJson(props.skyColor),\n groundColor: colorDefFromJson(props.groundColor),\n nadirColor: colorDefFromJson(props.nadirColor),\n zenithColor: colorDefFromJson(props.zenithColor),\n });\n }\n\n /** Create ea copy of this gradient, identical except for any properties explicitly specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps: SkyGradientProperties): SkyGradient {\n return new SkyGradient({ ...this, ...changedProps });\n }\n\n /** Convert to JSON representation. */\n public toJSON(): SkyBoxProps {\n const props: SkyBoxProps = {\n skyColor: this.skyColor.toJSON(),\n groundColor: this.groundColor.toJSON(),\n nadirColor: this.nadirColor.toJSON(),\n zenithColor: this.zenithColor.toJSON(),\n };\n\n if (this.groundExponent !== defaultExponent)\n props.groundExponent = this.groundExponent;\n\n if (this.skyExponent !== defaultExponent)\n props.skyExponent = this.skyExponent;\n\n if (this.twoColor)\n props.twoColor = this.twoColor;\n\n return props;\n }\n\n /** Returns true if this gradient is equivalent to the supplied gradient. */\n public equals(other: SkyGradient): boolean {\n if (this === other)\n return true;\n\n return this.twoColor === other.twoColor && this.skyColor.equals(other.skyColor) && this.groundColor.equals(other.groundColor) &&\n this.zenithColor.equals(other.zenithColor) && this.nadirColor.equals(other.nadirColor);\n }\n}\n\n/** Describes how to draw a representation of a sky, as part of an [[Environment]].\n * @see [[SkyBoxProps]].\n * @public\n */\nexport class SkyBox {\n /** The gradient settings, used if no cube or sphere images are supplied, or if the images cannot be loaded. */\n public readonly gradient: SkyGradient;\n\n protected constructor(gradient: SkyGradient) {\n this.gradient = gradient;\n }\n\n /** Default settings for a four-color gradient. */\n public static readonly defaults = new SkyBox(SkyGradient.defaults);\n\n /** Create a skybox that displays the specified gradient, or the default gradient if none is supplied. */\n public static createGradient(gradient?: SkyGradient): SkyBox {\n return gradient ? new this(gradient) : this.defaults;\n }\n\n /** Create from JSON representation. */\n public static fromJSON(props?: SkyBoxProps): SkyBox {\n const gradient = SkyGradient.fromJSON(props);\n\n if (props?.image) {\n switch (props.image.type) {\n case SkyBoxImageType.Spherical:\n if (undefined !== props.image.texture)\n return new SkySphere(props.image.texture, gradient);\n\n break;\n case SkyBoxImageType.Cube: {\n const tx = props.image.textures;\n if (tx && undefined !== tx.top && undefined !== tx.bottom && undefined !== tx.right && undefined !== tx.left && undefined !== tx.front && undefined !== tx.back)\n return new SkyCube(tx, gradient);\n\n break;\n }\n }\n }\n\n return this.createGradient(gradient);\n }\n\n /** Convert to JSON representation.\n * @param display If defined, the value to use for [[SkyBoxProps.display]]; otherwise, that property will be left undefined.\n */\n public toJSON(display?: boolean): SkyBoxProps {\n const props = this.gradient.toJSON();\n if (undefined !== display)\n props.display = display;\n\n return props;\n }\n\n /** @internal */\n public get textureIds(): Iterable<Id64String> {\n return [];\n }\n}\n\n/** Describes how to draw a representation of a sky by mapping a single image to the interior of a sphere.\n * @public\n */\nexport class SkySphere extends SkyBox {\n /** The image to map to the interior of the sphere. */\n public readonly image: TextureImageSpec;\n\n /** Create a new sky sphere using the specified image.\n * @param image The image to map to the interior of the sphere.\n * @param gradient Optionally overrides the default gradient settings used if the image cannot be obtained.\n */\n public constructor(image: TextureImageSpec, gradient?: SkyGradient) {\n super(gradient ?? SkyGradient.defaults);\n this.image = image;\n }\n\n /** See [[SkyBox.toJSON]]. */\n public override toJSON(display?: boolean): SkyBoxProps {\n const props = super.toJSON(display);\n props.image = {\n type: SkyBoxImageType.Spherical,\n texture: this.image,\n };\n\n return props;\n }\n\n /** @internal */\n public override get textureIds(): Iterable<Id64String> {\n return Id64.isValidId64(this.image) ? [this.image] : [];\n }\n}\n\n/** Describes how to draw a representation of a sky by mapping images to the interior faces of a cube.\n * The images are required to be *square*, and each image must have the same dimensions as the other images.\n * @public\n */\nexport class SkyCube extends SkyBox {\n /** The images to map to each face of the cube. */\n public readonly images: SkyCubeProps;\n\n /** Create a new sky cube using the specified images.\n * @param images The images to map to each face of the cube.\n * @param gradient Optionally overrides the default gradient settings used if the images cannot be obtained.\n */\n public constructor(images: SkyCubeProps, gradient?: SkyGradient) {\n super(gradient ?? SkyGradient.defaults);\n this.images = { ...images };\n }\n\n /** See [[SkyBox.toJSON]]. */\n public override toJSON(display?: boolean): SkyBoxProps {\n const props = super.toJSON(display);\n props.image = {\n type: SkyBoxImageType.Cube,\n textures: { ...this.images },\n };\n\n return props;\n }\n\n /** @internal */\n public override get textureIds(): Iterable<Id64String> {\n const imgs = this.images;\n return [imgs.front, imgs.back, imgs.top, imgs.bottom, imgs.left, imgs.right].filter((x) => Id64.isValidId64(x));\n }\n}\n"]}
@@ -15,6 +15,10 @@ const defaultColor = RgbColor.fromColorDef(ColorDef.fromTbgr(ColorByName.grey));
15
15
  * @public
16
16
  */
17
17
  export class SolarShadowSettings {
18
+ /** Shadow color. */
19
+ color;
20
+ /** @internal */
21
+ bias;
18
22
  constructor(props) {
19
23
  this.bias = JsonUtils.asDouble(props.bias, 0.001);
20
24
  if (undefined === props.color || null === props.color)
@@ -22,6 +26,7 @@ export class SolarShadowSettings {
22
26
  else
23
27
  this.color = RgbColor.fromColorDef(ColorDef.fromJSON(props.color));
24
28
  }
29
+ static defaults = new SolarShadowSettings({});
25
30
  static fromJSON(props) {
26
31
  return props ? new SolarShadowSettings(props) : this.defaults;
27
32
  }
@@ -54,5 +59,4 @@ export class SolarShadowSettings {
54
59
  return SolarShadowSettings.fromJSON(props);
55
60
  }
56
61
  }
57
- SolarShadowSettings.defaults = new SolarShadowSettings({});
58
62
  //# sourceMappingURL=SolarShadows.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SolarShadows.js","sourceRoot":"","sources":["../../src/SolarShadows.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC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AAC,IAAI,CAAC;QAEzB,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,GAAwB;QACpC,OAAO,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,YAAuC;QAClD,IAAI,CAAC,YAAY;YACf,OAAO,IAAI,CAAC;QAEd,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;QAClC,IAAI,YAAY,CAAC,KAAK;YACpB,KAAK,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;QAEnC,IAAI,SAAS,KAAK,YAAY,CAAC,IAAI;YACjC,KAAK,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;QAEjC,OAAO,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;;AAzCa,4BAAQ,GAAG,IAAI,mBAAmB,CAAC,EAAE,CAAC,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 DisplayStyles\n */\n\nimport { JsonUtils } from \"@itwin/core-bentley\";\nimport { ColorByName } from \"./ColorByName\";\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\nimport { RgbColor } from \"./RgbColor\";\n\n/** JSON representation of [[SolarShadowSettings]].\n * @public\n * @extensions\n */\nexport interface SolarShadowSettingsProps {\n /** Shadow color. Default: [[ColorByName.grey]]. */\n color?: ColorDefProps;\n /** @internal */\n bias?: number;\n}\n\nconst defaultColor = RgbColor.fromColorDef(ColorDef.fromTbgr(ColorByName.grey));\n\n/** Settings controlling display of solar shadows for a [[DisplayStyle3dSettings]].\n * Solar shadows are imposed as a color scaling on geometry occluded from solar lighting.\n * @public\n */\nexport class SolarShadowSettings {\n /** Shadow color. */\n public readonly color: RgbColor;\n /** @internal */\n public readonly bias: number;\n\n private constructor(props: SolarShadowSettingsProps) {\n this.bias = JsonUtils.asDouble(props.bias, 0.001);\n if (undefined === props.color || null === props.color)\n this.color = defaultColor;\n else\n this.color = RgbColor.fromColorDef(ColorDef.fromJSON(props.color));\n }\n\n public static defaults = new SolarShadowSettings({});\n\n public static fromJSON(props?: SolarShadowSettingsProps): SolarShadowSettings {\n return props ? new SolarShadowSettings(props) : this.defaults;\n }\n\n public toJSON(): SolarShadowSettingsProps | undefined {\n const defaults = SolarShadowSettings.defaults;\n if (this.equals(defaults))\n return undefined;\n\n const props: SolarShadowSettingsProps = {};\n if (!this.color.equals(defaults.color))\n props.color = this.color.toColorDef().toJSON();\n\n if (this.bias !== defaults.bias)\n props.bias = this.bias;\n\n return props;\n }\n\n public equals(rhs: SolarShadowSettings): boolean {\n return this.bias === rhs.bias && this.color.equals(rhs.color);\n }\n\n /** Create a copy of these settings.\n * @param changedProps Any property explicitly defined will be overridden in the copy.\n * @returns A settings object equivalent to this one except for any properties explicitly overridden by `changedProps`.\n */\n public clone(changedProps?: SolarShadowSettingsProps): SolarShadowSettings {\n if (!changedProps)\n return this;\n\n const props = this.toJSON() ?? {};\n if (changedProps.color)\n props.color = changedProps.color;\n\n if (undefined !== changedProps.bias)\n props.bias = changedProps.bias;\n\n return SolarShadowSettings.fromJSON(props);\n }\n}\n"]}
1
+ {"version":3,"file":"SolarShadows.js","sourceRoot":"","sources":["../../src/SolarShadows.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AA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KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEzB,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,GAAwB;QACpC,OAAO,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,YAAuC;QAClD,IAAI,CAAC,YAAY;YACf,OAAO,IAAI,CAAC;QAEd,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;QAClC,IAAI,YAAY,CAAC,KAAK;YACpB,KAAK,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;QAEnC,IAAI,SAAS,KAAK,YAAY,CAAC,IAAI;YACjC,KAAK,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;QAEjC,OAAO,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7C,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 DisplayStyles\n */\n\nimport { JsonUtils } from \"@itwin/core-bentley\";\nimport { ColorByName } from \"./ColorByName\";\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\nimport { RgbColor } from \"./RgbColor\";\n\n/** JSON representation of [[SolarShadowSettings]].\n * @public\n * @extensions\n */\nexport interface SolarShadowSettingsProps {\n /** Shadow color. Default: [[ColorByName.grey]]. */\n color?: ColorDefProps;\n /** @internal */\n bias?: number;\n}\n\nconst defaultColor = RgbColor.fromColorDef(ColorDef.fromTbgr(ColorByName.grey));\n\n/** Settings controlling display of solar shadows for a [[DisplayStyle3dSettings]].\n * Solar shadows are imposed as a color scaling on geometry occluded from solar lighting.\n * @public\n */\nexport class SolarShadowSettings {\n /** Shadow color. */\n public readonly color: RgbColor;\n /** @internal */\n public readonly bias: number;\n\n private constructor(props: SolarShadowSettingsProps) {\n this.bias = JsonUtils.asDouble(props.bias, 0.001);\n if (undefined === props.color || null === props.color)\n this.color = defaultColor;\n else\n this.color = RgbColor.fromColorDef(ColorDef.fromJSON(props.color));\n }\n\n public static defaults = new SolarShadowSettings({});\n\n public static fromJSON(props?: SolarShadowSettingsProps): SolarShadowSettings {\n return props ? new SolarShadowSettings(props) : this.defaults;\n }\n\n public toJSON(): SolarShadowSettingsProps | undefined {\n const defaults = SolarShadowSettings.defaults;\n if (this.equals(defaults))\n return undefined;\n\n const props: SolarShadowSettingsProps = {};\n if (!this.color.equals(defaults.color))\n props.color = this.color.toColorDef().toJSON();\n\n if (this.bias !== defaults.bias)\n props.bias = this.bias;\n\n return props;\n }\n\n public equals(rhs: SolarShadowSettings): boolean {\n return this.bias === rhs.bias && this.color.equals(rhs.color);\n }\n\n /** Create a copy of these settings.\n * @param changedProps Any property explicitly defined will be overridden in the copy.\n * @returns A settings object equivalent to this one except for any properties explicitly overridden by `changedProps`.\n */\n public clone(changedProps?: SolarShadowSettingsProps): SolarShadowSettings {\n if (!changedProps)\n return this;\n\n const props = this.toJSON() ?? {};\n if (changedProps.color)\n props.color = changedProps.color;\n\n if (undefined !== changedProps.bias)\n props.bias = changedProps.bias;\n\n return SolarShadowSettings.fromJSON(props);\n }\n}\n"]}
@@ -42,6 +42,12 @@ export var SpatialClassifierOutsideDisplay;
42
42
  * @public
43
43
  */
44
44
  export class SpatialClassifierFlags {
45
+ /** How geometry intersecting the classifier should be displayed. */
46
+ inside;
47
+ /** How geometry not intersecting the classifier should be displayed. */
48
+ outside;
49
+ /** True for volume classification; false for planar classification. */
50
+ isVolumeClassifier;
45
51
  /** Construct new flags. */
46
52
  constructor(inside = SpatialClassifierInsideDisplay.ElementColor, outside = SpatialClassifierOutsideDisplay.Dimmed, isVolumeClassifier = false) {
47
53
  this.inside = insideDisplay(inside);
@@ -98,6 +104,16 @@ export class SpatialClassifierFlags {
98
104
  * @public
99
105
  */
100
106
  export class SpatialClassifier {
107
+ /** The Id of the [GeometricModel]($backend) whose geometry is used to produce the classifier. */
108
+ modelId;
109
+ /** A distance in meters by which to expand the classifier geometry. For example, if line strings are used to represent streets,
110
+ * you might expand them to the average width of a street.
111
+ */
112
+ expand;
113
+ /** Flags controlling how to apply the classifier. */
114
+ flags;
115
+ /** A user-friendly name, useful for identifying individual classifiers within a [[SpatialClassifiers]]. */
116
+ name;
101
117
  /** Construct a new classifier. */
102
118
  constructor(modelId, name, flags = new SpatialClassifierFlags(), expand = 0) {
103
119
  this.modelId = modelId;
@@ -155,13 +171,15 @@ export class SpatialClassifier {
155
171
  * @public
156
172
  */
157
173
  export class SpatialClassifiers {
174
+ _json;
175
+ _classifiers = [];
176
+ _active;
158
177
  /** Construct a new set of classifiers from the JSON representation. The set will be initialized from `container.classifiers` and that JSON representation
159
178
  * will be kept in sync with changes made to the set. The caller should not directly modify `container.classifiers` or its contents as that will cause the set to become out
160
179
  * of sync with the JSON representation.
161
180
  * The [[active]] classifier will be determined by the first [[SpatialClassifierProps]] whose `isActive` property is set to `true`, if any.
162
181
  */
163
182
  constructor(container) {
164
- this._classifiers = [];
165
183
  this._json = container;
166
184
  const json = this._array;
167
185
  if (!json)