@itwin/core-common 5.4.0-dev.5 → 5.4.0-dev.6
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.
- package/lib/cjs/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/Atmosphere.js.map +1 -1
- package/lib/cjs/AuthorizationClient.js.map +1 -1
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/Base64EncodedString.js.map +1 -1
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/CatalogIModel.js.map +1 -1
- package/lib/cjs/CesiumIonAssets.js.map +1 -1
- package/lib/cjs/ChangedElements.js.map +1 -1
- package/lib/cjs/ChangedEntities.js.map +1 -1
- package/lib/cjs/ChangesetProps.js.map +1 -1
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorByName.js.map +1 -1
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/ContourDisplay.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSchemaProps.js.map +1 -1
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementMesh.js.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/EntityReference.js.map +1 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GenericInstanceFilter.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/GeometryContainment.js.map +1 -1
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSLColor.js.map +1 -1
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/ITwinCoreErrors.js.map +1 -1
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/IpcAppProps.js.map +1 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/LinePixels.js.map +1 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/ModelClipGroup.js.map +1 -1
- package/lib/cjs/ModelGeometryChanges.js.map +1 -1
- package/lib/cjs/ModelProps.js.map +1 -1
- package/lib/cjs/NativeAppProps.js.map +1 -1
- package/lib/cjs/OctEncodedNormal.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityDataAccessProps.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderPolyline.js.map +1 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/RpcManager.js.map +1 -1
- package/lib/cjs/SessionProps.js.map +1 -1
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarCalculate.js.map +1 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/TextureProps.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Thumbnail.js.map +1 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/TxnAction.js.map +1 -1
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/cjs/annotation/TextField.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/domains/FunctionalElementProps.js.map +1 -1
- package/lib/cjs/domains/GenericElementProps.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/internal/BackendTypes.js.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
- package/lib/cjs/internal/RenderMaterialParams.js.map +1 -1
- package/lib/cjs/internal/RenderMesh.js.map +1 -1
- package/lib/cjs/internal/RenderTextureParams.js.map +1 -1
- package/lib/cjs/internal/Snapping.js.map +1 -1
- package/lib/cjs/internal/annotations/FieldFormatter.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.js.map +1 -1
- package/lib/cjs/ipc/IpcSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/AuthorizationClient.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/Base64EncodedString.js.map +1 -1
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/CatalogIModel.js.map +1 -1
- package/lib/esm/CesiumIonAssets.js.map +1 -1
- package/lib/esm/ChangedElements.js.map +1 -1
- package/lib/esm/ChangedEntities.js.map +1 -1
- package/lib/esm/ChangesetProps.js.map +1 -1
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorByName.js.map +1 -1
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/ContourDisplay.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSchemaProps.js.map +1 -1
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementMesh.js.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EmphasizeElementsProps.js.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/EntityReference.js.map +1 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GenericInstanceFilter.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/GeometryContainment.js.map +1 -1
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSLColor.js.map +1 -1
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Hilite.js.map +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/ITwinCoreErrors.js.map +1 -1
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/IpcAppProps.js.map +1 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/LinePixels.js.map +1 -1
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/MassProperties.js.map +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/ModelClipGroup.js.map +1 -1
- package/lib/esm/ModelGeometryChanges.js.map +1 -1
- package/lib/esm/ModelProps.js.map +1 -1
- package/lib/esm/NativeAppProps.js.map +1 -1
- package/lib/esm/OctEncodedNormal.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityDataAccessProps.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderPolyline.js.map +1 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/RpcManager.js.map +1 -1
- package/lib/esm/SessionProps.js.map +1 -1
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarCalculate.js.map +1 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/TextureProps.js.map +1 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Thumbnail.js.map +1 -1
- package/lib/esm/TileProps.js.map +1 -1
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/TxnAction.js.map +1 -1
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/ViewProps.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/esm/annotation/TextField.js.map +1 -1
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/domains/FunctionalElementProps.js.map +1 -1
- package/lib/esm/domains/GenericElementProps.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/ImageGraphic.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/internal/BackendTypes.js.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
- package/lib/esm/internal/RenderMaterialParams.js.map +1 -1
- package/lib/esm/internal/RenderMesh.js.map +1 -1
- package/lib/esm/internal/RenderTextureParams.js.map +1 -1
- package/lib/esm/internal/Snapping.js.map +1 -1
- package/lib/esm/internal/annotations/FieldFormatter.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/ipc/IpcSession.js.map +1 -1
- package/lib/esm/ipc/IpcSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECSqlReader.js","sourceRoot":"","sources":["../../src/ECSqlReader.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,+DAA4D;AAC5D,uDAG2B;AAE3B,cAAc;AACd,MAAa,mBAAmB;IAKK;IAJ3B,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE9C,YAAmC,UAAmC;QAAnC,eAAU,GAAV,UAAU,CAAyB;QACpE,KAAK,MAAM,QAAQ,IA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;IACd,CAAC;IAED;;;;OAIG;IACI,CAAC,MAAM,CAAC,aAAa,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,IAAI;QACf,IAAI,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YACtB,OAAO;gBACL,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,IAAI,CAAC,OAAO;aACpB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO;gBACL,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,IAAI,CAAC,OAAO;aACpB,CAAC;QACJ,CAAC;IACH,CAAC;;AAxVH,kCAyVC","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 iModels\n */\nimport { Base64EncodedString } from \"./Base64EncodedString\";\nimport {\n DbQueryError, DbQueryRequest, DbQueryResponse, DbRequestExecutor, DbRequestKind, DbResponseStatus, DbValueFormat, QueryBinder, QueryOptions, QueryOptionsBuilder,\n QueryPropertyMetaData, QueryRowFormat,\n} from \"./ConcurrentQuery\";\n\n/** @public */\nexport class PropertyMetaDataMap implements Iterable<QueryPropertyMetaData> {\n private _byPropName = new Map<string, number>();\n private _byJsonName = new Map<string, number>();\n private _byNoCase = new Map<string, number>();\n\n public constructor(public readonly properties: QueryPropertyMetaData[]) {\n for (const property of this.properties) {\n property.extendType = property.extendedType !== undefined ? property.extendedType : \"\"; // eslint-disable-line @typescript-eslint/no-deprecated\n property.extendedType = property.extendedType === \"\" ? undefined : property.extendedType;\n this._byPropName.set(property.name, property.index);\n this._byJsonName.set(property.jsonName, property.index);\n this._byNoCase.set(property.name.toLowerCase(), property.index);\n this._byNoCase.set(property.jsonName.toLowerCase(), property.index);\n }\n }\n\n public get length(): number {\n return this.properties.length;\n }\n\n public [Symbol.iterator](): Iterator<QueryPropertyMetaData, any, undefined> {\n return this.properties[Symbol.iterator]();\n }\n\n public findByName(name: string): QueryPropertyMetaData | undefined {\n const index = this._byPropName.get(name);\n if (typeof index === \"number\") {\n return this.properties[index];\n }\n return undefined;\n }\n\n public findByJsonName(name: string): QueryPropertyMetaData | undefined {\n const index = this._byJsonName.get(name);\n if (typeof index === \"number\") {\n return this.properties[index];\n }\n return undefined;\n }\n\n public findByNoCase(name: string): QueryPropertyMetaData | undefined {\n const index = this._byNoCase.get(name.toLowerCase());\n if (typeof index === \"number\") {\n return this.properties[index];\n }\n return undefined;\n }\n}\n\n/**\n * The format for rows returned by [[ECSqlReader]].\n * @public\n */\nexport type QueryValueType = any;\n\n/**\n * Methods and ways of accessing values from rows returned by [[ECSqlReader]].\n * @public\n */\nexport interface QueryRowProxy {\n /**\n * Get the current row as a JavaScript `object`.\n *\n * @returns The current row as a JavaScript `object`.\n */\n toRow(): any;\n\n /**\n * Get all remaining rows from the query result.\n * If called on the current row ([[ECSqlReader.current]]), only that row is returned.\n *\n * @returns All remaining rows from the query result.\n */\n toArray(): QueryValueType[];\n\n /**\n * Get the metadata for each column in the query result.\n *\n * @returns The metadata for each column in the query result.\n */\n getMetaData(): QueryPropertyMetaData[];\n\n /**\n * Access a property using its name.\n *\n * @returns The value from the row whose key (ECSQL column name) is `propertyName`.\n *\n * @example\n * The following lines will all return the same result:\n * ```ts\n * reader.current.ECInstanceId;\n * reader.current.ecinstanceid;\n * reader.current.[\"ECInstanceId\"];\n * ```\n */\n [propertyName: string]: QueryValueType;\n\n /**\n * Access a property using its index.\n * The index is relative to the order of the columns returned by the query that produced the row.\n *\n * @returns The value from the column at `propertyIndex`.\n *\n * @example reader.current[0]\n */\n [propertyIndex: number]: QueryValueType;\n}\n\n/**\n * Performance-related statistics for [[ECSqlReader]].\n * @public\n */\nexport interface QueryStats {\n /** Time spent running the query; not including time spent queued. Time is in microseconds */\n backendCpuTime: number;\n /** Total time it took the backend to run the query. Time is in milliseconds. */\n backendTotalTime: number;\n /** Estimated memory used for the query. */\n backendMemUsed: number;\n /** Total number of rows returned by the backend. */\n backendRowsReturned: number;\n /** The total round trip time from the client's perspective. Time is in milliseconds. */\n totalTime: number;\n /** The number of retries attempted to execute the query. */\n retryCount: number;\n /** Total time in millisecond to prepare ECSQL or grabing it from cache and binding parameters */\n prepareTime: number;\n}\n\n/**\n * Execute ECSQL statements and read the results.\n *\n * The query results are returned one row at a time. The format of the row is dictated by the\n * [[QueryOptions.rowFormat]] specified in the `options` parameter of the constructed ECSqlReader object. Defaults to\n * [[QueryRowFormat.UseECSqlPropertyIndexes]] when no `rowFormat` is defined.\n *\n * There are three primary ways to interact with and read the results:\n * - Stream them using ECSqlReader as an asynchronous iterator.\n * - Iterator over them manually using [[ECSqlReader.step]].\n * - Capture all of the results at once in an array using [[QueryRowProxy.toArray]].\n *\n * @see\n * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)\n * - [ECSQL Row Formats]($docs/learning/ECSQLRowFormat) for more details on how rows are formatted.\n * - [ECSQL Code Examples]($docs/learning/ECSQLCodeExamples#iterating-over-query-results) for examples of each\n * of the above ways of interacting with ECSqlReader.\n *\n * @note When iterating over the results, the current row will be a [[QueryRowProxy]] object. To get the row as a basic\n * JavaScript object, call [[QueryRowProxy.toRow]] on it.\n * @public\n */\nexport class ECSqlReader implements AsyncIterableIterator<QueryRowProxy> {\n private static readonly _maxRetryCount = 10;\n\n private _localRows: any[] = [];\n private _localOffset: number = 0;\n private _globalOffset: number = -1;\n private _globalCount: number = -1;\n private _done: boolean = false;\n private _globalDone: boolean = false;\n private _props = new PropertyMetaDataMap([]);\n private _param = new QueryBinder().serialize();\n private _lockArgs: boolean = false;\n private _stats = { backendCpuTime: 0, backendTotalTime: 0, backendMemUsed: 0, backendRowsReturned: 0, totalTime: 0, retryCount: 0, prepareTime: 0 };\n private _options: QueryOptions = new QueryOptionsBuilder().getOptions();\n\n private _rowProxy = new Proxy<ECSqlReader>(this, {\n get: (target: ECSqlReader, key: string | symbol) => {\n if (typeof key === \"string\") {\n const idx = Number.parseInt(key, 10);\n if (!Number.isNaN(idx)) {\n return target.getRowInternal()[idx];\n }\n const prop = target._props.findByNoCase(key);\n if (prop) {\n return target.getRowInternal()[prop.index];\n }\n if (key === \"getMetaData\") {\n return () => target._props.properties;\n }\n if (key === \"toRow\") {\n return () => target.formatCurrentRow(true);\n }\n if (key === \"toArray\") {\n return () => this.getRowInternal();\n }\n }\n return undefined;\n },\n has: (target: ECSqlReader, p: string | symbol) => {\n return !target._props.findByNoCase(p as string);\n },\n ownKeys: (target: ECSqlReader) => {\n const keys = [];\n for (const prop of target._props) {\n keys.push(prop.name);\n }\n return keys;\n },\n });\n\n /**\n * @internal\n */\n public constructor(private _executor: DbRequestExecutor<DbQueryRequest, DbQueryResponse>, public readonly query: string, param?: QueryBinder, options?: QueryOptions) {\n if (query.trim().length === 0) {\n throw new Error(\"expecting non-empty ecsql statement\");\n }\n if (param) {\n this._param = param.serialize();\n }\n this.reset(options);\n }\n\n private static replaceBase64WithUint8Array(row: any) {\n for (const key of Object.keys(row)) {\n const val = row[key];\n if (typeof val === \"string\") {\n if (Base64EncodedString.hasPrefix(val)) {\n row[key] = Base64EncodedString.toUint8Array(val);\n }\n } else if (typeof val === \"object\" && val !== null) {\n this.replaceBase64WithUint8Array(val);\n }\n }\n }\n\n public setParams(param: QueryBinder) {\n if (this._lockArgs) {\n throw new Error(\"call resetBindings() before setting or changing parameters\");\n }\n this._param = param.serialize();\n }\n\n public reset(options?: QueryOptions) {\n if (options) {\n this._options = options;\n }\n this._props = new PropertyMetaDataMap([]);\n this._localRows = [];\n this._globalDone = false;\n this._globalOffset = 0;\n this._globalCount = -1;\n if (typeof this._options.rowFormat === \"undefined\")\n this._options.rowFormat = QueryRowFormat.UseECSqlPropertyIndexes;\n if (this._options.limit) {\n if (typeof this._options.limit.offset === \"number\" && this._options.limit.offset > 0)\n this._globalOffset = this._options.limit.offset;\n if (typeof this._options.limit.count === \"number\" && this._options.limit.count > 0)\n this._globalCount = this._options.limit.count;\n }\n this._done = false;\n }\n\n /**\n * Get the current row from the query result. The current row is the one most recently stepped-to\n * (by step() or during iteration).\n *\n * Each value from the row can be accessed by index or by name.\n *\n * The format of the row is dictated by the [[QueryOptions.rowFormat]] specified in the `options` parameter of the\n * constructed ECSqlReader object.\n *\n * @see\n * - [[QueryRowFormat]]\n * - [ECSQL Row Formats]($docs/learning/ECSQLRowFormat)\n *\n * @note The current row is be a [[QueryRowProxy]] object. To get the row as a basic JavaScript object, call\n * [[QueryRowProxy.toRow]] on it.\n *\n * @example\n * ```ts\n * const reader = iModel.createQueryReader(\"SELECT ECInstanceId FROM bis.Element\");\n * while (await reader.step()) {\n * // Both lines below print the same value\n * console.log(reader.current[0]);\n * console.log(reader.current.ecinstanceid);\n * }\n * ```\n *\n * @return The current row as a [[QueryRowProxy]].\n */\n public get current(): QueryRowProxy {\n return this._rowProxy as any;\n }\n\n /**\n * Clear all bindings.\n */\n public resetBindings() {\n this._param = new QueryBinder().serialize();\n this._lockArgs = false;\n }\n\n /**\n * Returns if there are more rows available.\n *\n * @returns `true` if all rows have been stepped through already.<br/>\n * `false` if there are any yet unaccessed rows.\n */\n public get done(): boolean {\n return this._done;\n }\n\n /**\n * @internal\n */\n public getRowInternal(): any[] {\n if (this._localRows.length <= this._localOffset)\n throw new Error(\"no current row\");\n return this._localRows[this._localOffset] as any[];\n }\n\n /**\n * Get performance-related statistics for the current query.\n */\n public get stats(): QueryStats {\n return this._stats;\n }\n\n /**\n *\n */\n private async readRows(): Promise<any[]> {\n if (this._globalDone) {\n return [];\n }\n this._lockArgs = true;\n this._globalOffset += this._localRows.length;\n this._globalCount -= this._localRows.length;\n if (this._globalCount === 0) {\n return [];\n }\n const valueFormat = this._options.rowFormat === QueryRowFormat.UseJsPropertyNames ? DbValueFormat.JsNames : DbValueFormat.ECSqlNames;\n const request: DbQueryRequest = {\n ... this._options,\n kind: DbRequestKind.ECSql,\n valueFormat,\n query: this.query,\n args: this._param,\n };\n request.includeMetaData = this._props.length > 0 ? false : true;\n request.limit = { offset: this._globalOffset, count: this._globalCount < 1 ? -1 : this._globalCount };\n const resp = await this.runWithRetry(request);\n this._globalDone = resp.status === DbResponseStatus.Done;\n if (this._props.length === 0 && resp.meta.length > 0) {\n this._props = new PropertyMetaDataMap(resp.meta);\n }\n for (const row of resp.data) {\n ECSqlReader.replaceBase64WithUint8Array(row);\n }\n return resp.data;\n }\n\n /**\n * @internal\n */\n protected async runWithRetry(request: DbQueryRequest) {\n const needRetry = (rs: DbQueryResponse) => (rs.status === DbResponseStatus.Partial || rs.status === DbResponseStatus.QueueFull || rs.status === DbResponseStatus.Timeout || rs.status === DbResponseStatus.ShuttingDown) && (rs.data === undefined || rs.data.length === 0);\n const updateStats = (rs: DbQueryResponse) => {\n this._stats.backendCpuTime += rs.stats.cpuTime;\n this._stats.backendTotalTime += rs.stats.totalTime;\n this._stats.backendMemUsed += rs.stats.memUsed;\n this._stats.prepareTime += rs.stats.prepareTime;\n this._stats.backendRowsReturned += (rs.data === undefined) ? 0 : rs.data.length;\n };\n const execQuery = async (req: DbQueryRequest) => {\n const startTime = Date.now();\n const rs = await this._executor.execute(req);\n this.stats.totalTime += (Date.now() - startTime);\n return rs;\n };\n let retry = ECSqlReader._maxRetryCount;\n let resp = await execQuery(request);\n DbQueryError.throwIfError(resp, request);\n while (--retry > 0 && needRetry(resp)) {\n resp = await execQuery(request);\n this._stats.retryCount += 1;\n if (needRetry(resp)) {\n updateStats(resp);\n }\n }\n if (retry === 0 && needRetry(resp)) {\n throw new Error(\"query too long to execute or server is too busy\");\n }\n updateStats(resp);\n return resp;\n }\n\n /**\n * @internal\n */\n public formatCurrentRow(onlyReturnObject: boolean = false): any[] | object {\n if (!onlyReturnObject && this._options.rowFormat === QueryRowFormat.UseECSqlPropertyIndexes) {\n return this.getRowInternal();\n }\n const formattedRow = {};\n for (const prop of this._props) {\n const propName = this._options.rowFormat === QueryRowFormat.UseJsPropertyNames ? prop.jsonName : prop.name;\n const val = this.getRowInternal()[prop.index];\n if (typeof val !== \"undefined\" && val !== null) {\n Object.defineProperty(formattedRow, propName, {\n value: val,\n enumerable: true,\n });\n }\n }\n return formattedRow;\n }\n\n /**\n * Get the metadata for each column in the query result.\n *\n * @returns An array of [[QueryPropertyMetaData]].\n */\n public async getMetaData(): Promise<QueryPropertyMetaData[]> {\n if (this._props.length === 0) {\n await this.fetchRows();\n }\n return this._props.properties;\n }\n\n /**\n *\n */\n private async fetchRows() {\n this._localOffset = -1;\n this._localRows = await this.readRows();\n if (this._localRows.length === 0) {\n this._done = true;\n }\n }\n\n /**\n * Step to the next row of the query result.\n *\n * @returns `true` if a row can be read from `current`.<br/>\n * `false` if there are no more rows; i.e., all rows have been stepped through already.\n */\n public async step(): Promise<boolean> {\n if (this._done) {\n return false;\n }\n const cachedRows = this._localRows.length;\n if (this._localOffset < cachedRows - 1) {\n ++this._localOffset;\n } else {\n await this.fetchRows();\n this._localOffset = 0;\n return !this._done;\n }\n return true;\n }\n\n /**\n * Get all remaining rows from the query result.\n *\n * @returns An array of all remaining rows from the query result.\n */\n public async toArray(): Promise<any[]> {\n const rows = [];\n while (await this.step()) {\n rows.push(this.formatCurrentRow());\n }\n return rows;\n }\n\n /**\n * Accessor for using ECSqlReader as an asynchronous iterator.\n *\n * @returns An asynchronous iterator over the rows returned by the executed ECSQL query.\n */\n public [Symbol.asyncIterator](): AsyncIterableIterator<QueryRowProxy> {\n return this;\n }\n\n /**\n * Calls step when called as an iterator.\n *\n * Returns the row alongside a `done` boolean to indicate if there are any more rows for an iterator to step to.\n *\n * @returns An object with the keys: `value` which contains the row and `done` which contains a boolean.\n */\n public async next(): Promise<IteratorResult<QueryRowProxy, any>> {\n if (await this.step()) {\n return {\n done: false,\n value: this.current,\n };\n } else {\n return {\n done: true,\n value: this.current,\n };\n }\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"ECSqlReader.js","sourceRoot":"","sources":["../../src/ECSqlReader.ts"],"names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C,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QACrB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO;QAClB,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,OAAO,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACI,CAAC,MAAM,CAAC,aAAa,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,IAAI;QACf,IAAI,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YACtB,OAAO;gBACL,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,IAAI,CAAC,OAAO;aACpB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO;gBACL,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,IAAI,CAAC,OAAO;aACpB,CAAC;QACJ,CAAC;IACH,CAAC;;AAxVH,kCAyVC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\nimport { Base64EncodedString } from \"./Base64EncodedString\";\r\nimport {\r\n DbQueryError, DbQueryRequest, DbQueryResponse, DbRequestExecutor, DbRequestKind, DbResponseStatus, DbValueFormat, QueryBinder, QueryOptions, QueryOptionsBuilder,\r\n QueryPropertyMetaData, QueryRowFormat,\r\n} from \"./ConcurrentQuery\";\r\n\r\n/** @public */\r\nexport class PropertyMetaDataMap implements Iterable<QueryPropertyMetaData> {\r\n private _byPropName = new Map<string, number>();\r\n private _byJsonName = new Map<string, number>();\r\n private _byNoCase = new Map<string, number>();\r\n\r\n public constructor(public readonly properties: QueryPropertyMetaData[]) {\r\n for (const property of this.properties) {\r\n property.extendType = property.extendedType !== undefined ? property.extendedType : \"\"; // eslint-disable-line @typescript-eslint/no-deprecated\r\n property.extendedType = property.extendedType === \"\" ? undefined : property.extendedType;\r\n this._byPropName.set(property.name, property.index);\r\n this._byJsonName.set(property.jsonName, property.index);\r\n this._byNoCase.set(property.name.toLowerCase(), property.index);\r\n this._byNoCase.set(property.jsonName.toLowerCase(), property.index);\r\n }\r\n }\r\n\r\n public get length(): number {\r\n return this.properties.length;\r\n }\r\n\r\n public [Symbol.iterator](): Iterator<QueryPropertyMetaData, any, undefined> {\r\n return this.properties[Symbol.iterator]();\r\n }\r\n\r\n public findByName(name: string): QueryPropertyMetaData | undefined {\r\n const index = this._byPropName.get(name);\r\n if (typeof index === \"number\") {\r\n return this.properties[index];\r\n }\r\n return undefined;\r\n }\r\n\r\n public findByJsonName(name: string): QueryPropertyMetaData | undefined {\r\n const index = this._byJsonName.get(name);\r\n if (typeof index === \"number\") {\r\n return this.properties[index];\r\n }\r\n return undefined;\r\n }\r\n\r\n public findByNoCase(name: string): QueryPropertyMetaData | undefined {\r\n const index = this._byNoCase.get(name.toLowerCase());\r\n if (typeof index === \"number\") {\r\n return this.properties[index];\r\n }\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * The format for rows returned by [[ECSqlReader]].\r\n * @public\r\n */\r\nexport type QueryValueType = any;\r\n\r\n/**\r\n * Methods and ways of accessing values from rows returned by [[ECSqlReader]].\r\n * @public\r\n */\r\nexport interface QueryRowProxy {\r\n /**\r\n * Get the current row as a JavaScript `object`.\r\n *\r\n * @returns The current row as a JavaScript `object`.\r\n */\r\n toRow(): any;\r\n\r\n /**\r\n * Get all remaining rows from the query result.\r\n * If called on the current row ([[ECSqlReader.current]]), only that row is returned.\r\n *\r\n * @returns All remaining rows from the query result.\r\n */\r\n toArray(): QueryValueType[];\r\n\r\n /**\r\n * Get the metadata for each column in the query result.\r\n *\r\n * @returns The metadata for each column in the query result.\r\n */\r\n getMetaData(): QueryPropertyMetaData[];\r\n\r\n /**\r\n * Access a property using its name.\r\n *\r\n * @returns The value from the row whose key (ECSQL column name) is `propertyName`.\r\n *\r\n * @example\r\n * The following lines will all return the same result:\r\n * ```ts\r\n * reader.current.ECInstanceId;\r\n * reader.current.ecinstanceid;\r\n * reader.current.[\"ECInstanceId\"];\r\n * ```\r\n */\r\n [propertyName: string]: QueryValueType;\r\n\r\n /**\r\n * Access a property using its index.\r\n * The index is relative to the order of the columns returned by the query that produced the row.\r\n *\r\n * @returns The value from the column at `propertyIndex`.\r\n *\r\n * @example reader.current[0]\r\n */\r\n [propertyIndex: number]: QueryValueType;\r\n}\r\n\r\n/**\r\n * Performance-related statistics for [[ECSqlReader]].\r\n * @public\r\n */\r\nexport interface QueryStats {\r\n /** Time spent running the query; not including time spent queued. Time is in microseconds */\r\n backendCpuTime: number;\r\n /** Total time it took the backend to run the query. Time is in milliseconds. */\r\n backendTotalTime: number;\r\n /** Estimated memory used for the query. */\r\n backendMemUsed: number;\r\n /** Total number of rows returned by the backend. */\r\n backendRowsReturned: number;\r\n /** The total round trip time from the client's perspective. Time is in milliseconds. */\r\n totalTime: number;\r\n /** The number of retries attempted to execute the query. */\r\n retryCount: number;\r\n /** Total time in millisecond to prepare ECSQL or grabing it from cache and binding parameters */\r\n prepareTime: number;\r\n}\r\n\r\n/**\r\n * Execute ECSQL statements and read the results.\r\n *\r\n * The query results are returned one row at a time. The format of the row is dictated by the\r\n * [[QueryOptions.rowFormat]] specified in the `options` parameter of the constructed ECSqlReader object. Defaults to\r\n * [[QueryRowFormat.UseECSqlPropertyIndexes]] when no `rowFormat` is defined.\r\n *\r\n * There are three primary ways to interact with and read the results:\r\n * - Stream them using ECSqlReader as an asynchronous iterator.\r\n * - Iterator over them manually using [[ECSqlReader.step]].\r\n * - Capture all of the results at once in an array using [[QueryRowProxy.toArray]].\r\n *\r\n * @see\r\n * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)\r\n * - [ECSQL Row Formats]($docs/learning/ECSQLRowFormat) for more details on how rows are formatted.\r\n * - [ECSQL Code Examples]($docs/learning/ECSQLCodeExamples#iterating-over-query-results) for examples of each\r\n * of the above ways of interacting with ECSqlReader.\r\n *\r\n * @note When iterating over the results, the current row will be a [[QueryRowProxy]] object. To get the row as a basic\r\n * JavaScript object, call [[QueryRowProxy.toRow]] on it.\r\n * @public\r\n */\r\nexport class ECSqlReader implements AsyncIterableIterator<QueryRowProxy> {\r\n private static readonly _maxRetryCount = 10;\r\n\r\n private _localRows: any[] = [];\r\n private _localOffset: number = 0;\r\n private _globalOffset: number = -1;\r\n private _globalCount: number = -1;\r\n private _done: boolean = false;\r\n private _globalDone: boolean = false;\r\n private _props = new PropertyMetaDataMap([]);\r\n private _param = new QueryBinder().serialize();\r\n private _lockArgs: boolean = false;\r\n private _stats = { backendCpuTime: 0, backendTotalTime: 0, backendMemUsed: 0, backendRowsReturned: 0, totalTime: 0, retryCount: 0, prepareTime: 0 };\r\n private _options: QueryOptions = new QueryOptionsBuilder().getOptions();\r\n\r\n private _rowProxy = new Proxy<ECSqlReader>(this, {\r\n get: (target: ECSqlReader, key: string | symbol) => {\r\n if (typeof key === \"string\") {\r\n const idx = Number.parseInt(key, 10);\r\n if (!Number.isNaN(idx)) {\r\n return target.getRowInternal()[idx];\r\n }\r\n const prop = target._props.findByNoCase(key);\r\n if (prop) {\r\n return target.getRowInternal()[prop.index];\r\n }\r\n if (key === \"getMetaData\") {\r\n return () => target._props.properties;\r\n }\r\n if (key === \"toRow\") {\r\n return () => target.formatCurrentRow(true);\r\n }\r\n if (key === \"toArray\") {\r\n return () => this.getRowInternal();\r\n }\r\n }\r\n return undefined;\r\n },\r\n has: (target: ECSqlReader, p: string | symbol) => {\r\n return !target._props.findByNoCase(p as string);\r\n },\r\n ownKeys: (target: ECSqlReader) => {\r\n const keys = [];\r\n for (const prop of target._props) {\r\n keys.push(prop.name);\r\n }\r\n return keys;\r\n },\r\n });\r\n\r\n /**\r\n * @internal\r\n */\r\n public constructor(private _executor: DbRequestExecutor<DbQueryRequest, DbQueryResponse>, public readonly query: string, param?: QueryBinder, options?: QueryOptions) {\r\n if (query.trim().length === 0) {\r\n throw new Error(\"expecting non-empty ecsql statement\");\r\n }\r\n if (param) {\r\n this._param = param.serialize();\r\n }\r\n this.reset(options);\r\n }\r\n\r\n private static replaceBase64WithUint8Array(row: any) {\r\n for (const key of Object.keys(row)) {\r\n const val = row[key];\r\n if (typeof val === \"string\") {\r\n if (Base64EncodedString.hasPrefix(val)) {\r\n row[key] = Base64EncodedString.toUint8Array(val);\r\n }\r\n } else if (typeof val === \"object\" && val !== null) {\r\n this.replaceBase64WithUint8Array(val);\r\n }\r\n }\r\n }\r\n\r\n public setParams(param: QueryBinder) {\r\n if (this._lockArgs) {\r\n throw new Error(\"call resetBindings() before setting or changing parameters\");\r\n }\r\n this._param = param.serialize();\r\n }\r\n\r\n public reset(options?: QueryOptions) {\r\n if (options) {\r\n this._options = options;\r\n }\r\n this._props = new PropertyMetaDataMap([]);\r\n this._localRows = [];\r\n this._globalDone = false;\r\n this._globalOffset = 0;\r\n this._globalCount = -1;\r\n if (typeof this._options.rowFormat === \"undefined\")\r\n this._options.rowFormat = QueryRowFormat.UseECSqlPropertyIndexes;\r\n if (this._options.limit) {\r\n if (typeof this._options.limit.offset === \"number\" && this._options.limit.offset > 0)\r\n this._globalOffset = this._options.limit.offset;\r\n if (typeof this._options.limit.count === \"number\" && this._options.limit.count > 0)\r\n this._globalCount = this._options.limit.count;\r\n }\r\n this._done = false;\r\n }\r\n\r\n /**\r\n * Get the current row from the query result. The current row is the one most recently stepped-to\r\n * (by step() or during iteration).\r\n *\r\n * Each value from the row can be accessed by index or by name.\r\n *\r\n * The format of the row is dictated by the [[QueryOptions.rowFormat]] specified in the `options` parameter of the\r\n * constructed ECSqlReader object.\r\n *\r\n * @see\r\n * - [[QueryRowFormat]]\r\n * - [ECSQL Row Formats]($docs/learning/ECSQLRowFormat)\r\n *\r\n * @note The current row is be a [[QueryRowProxy]] object. To get the row as a basic JavaScript object, call\r\n * [[QueryRowProxy.toRow]] on it.\r\n *\r\n * @example\r\n * ```ts\r\n * const reader = iModel.createQueryReader(\"SELECT ECInstanceId FROM bis.Element\");\r\n * while (await reader.step()) {\r\n * // Both lines below print the same value\r\n * console.log(reader.current[0]);\r\n * console.log(reader.current.ecinstanceid);\r\n * }\r\n * ```\r\n *\r\n * @return The current row as a [[QueryRowProxy]].\r\n */\r\n public get current(): QueryRowProxy {\r\n return this._rowProxy as any;\r\n }\r\n\r\n /**\r\n * Clear all bindings.\r\n */\r\n public resetBindings() {\r\n this._param = new QueryBinder().serialize();\r\n this._lockArgs = false;\r\n }\r\n\r\n /**\r\n * Returns if there are more rows available.\r\n *\r\n * @returns `true` if all rows have been stepped through already.<br/>\r\n * `false` if there are any yet unaccessed rows.\r\n */\r\n public get done(): boolean {\r\n return this._done;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public getRowInternal(): any[] {\r\n if (this._localRows.length <= this._localOffset)\r\n throw new Error(\"no current row\");\r\n return this._localRows[this._localOffset] as any[];\r\n }\r\n\r\n /**\r\n * Get performance-related statistics for the current query.\r\n */\r\n public get stats(): QueryStats {\r\n return this._stats;\r\n }\r\n\r\n /**\r\n *\r\n */\r\n private async readRows(): Promise<any[]> {\r\n if (this._globalDone) {\r\n return [];\r\n }\r\n this._lockArgs = true;\r\n this._globalOffset += this._localRows.length;\r\n this._globalCount -= this._localRows.length;\r\n if (this._globalCount === 0) {\r\n return [];\r\n }\r\n const valueFormat = this._options.rowFormat === QueryRowFormat.UseJsPropertyNames ? DbValueFormat.JsNames : DbValueFormat.ECSqlNames;\r\n const request: DbQueryRequest = {\r\n ... this._options,\r\n kind: DbRequestKind.ECSql,\r\n valueFormat,\r\n query: this.query,\r\n args: this._param,\r\n };\r\n request.includeMetaData = this._props.length > 0 ? false : true;\r\n request.limit = { offset: this._globalOffset, count: this._globalCount < 1 ? -1 : this._globalCount };\r\n const resp = await this.runWithRetry(request);\r\n this._globalDone = resp.status === DbResponseStatus.Done;\r\n if (this._props.length === 0 && resp.meta.length > 0) {\r\n this._props = new PropertyMetaDataMap(resp.meta);\r\n }\r\n for (const row of resp.data) {\r\n ECSqlReader.replaceBase64WithUint8Array(row);\r\n }\r\n return resp.data;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected async runWithRetry(request: DbQueryRequest) {\r\n const needRetry = (rs: DbQueryResponse) => (rs.status === DbResponseStatus.Partial || rs.status === DbResponseStatus.QueueFull || rs.status === DbResponseStatus.Timeout || rs.status === DbResponseStatus.ShuttingDown) && (rs.data === undefined || rs.data.length === 0);\r\n const updateStats = (rs: DbQueryResponse) => {\r\n this._stats.backendCpuTime += rs.stats.cpuTime;\r\n this._stats.backendTotalTime += rs.stats.totalTime;\r\n this._stats.backendMemUsed += rs.stats.memUsed;\r\n this._stats.prepareTime += rs.stats.prepareTime;\r\n this._stats.backendRowsReturned += (rs.data === undefined) ? 0 : rs.data.length;\r\n };\r\n const execQuery = async (req: DbQueryRequest) => {\r\n const startTime = Date.now();\r\n const rs = await this._executor.execute(req);\r\n this.stats.totalTime += (Date.now() - startTime);\r\n return rs;\r\n };\r\n let retry = ECSqlReader._maxRetryCount;\r\n let resp = await execQuery(request);\r\n DbQueryError.throwIfError(resp, request);\r\n while (--retry > 0 && needRetry(resp)) {\r\n resp = await execQuery(request);\r\n this._stats.retryCount += 1;\r\n if (needRetry(resp)) {\r\n updateStats(resp);\r\n }\r\n }\r\n if (retry === 0 && needRetry(resp)) {\r\n throw new Error(\"query too long to execute or server is too busy\");\r\n }\r\n updateStats(resp);\r\n return resp;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public formatCurrentRow(onlyReturnObject: boolean = false): any[] | object {\r\n if (!onlyReturnObject && this._options.rowFormat === QueryRowFormat.UseECSqlPropertyIndexes) {\r\n return this.getRowInternal();\r\n }\r\n const formattedRow = {};\r\n for (const prop of this._props) {\r\n const propName = this._options.rowFormat === QueryRowFormat.UseJsPropertyNames ? prop.jsonName : prop.name;\r\n const val = this.getRowInternal()[prop.index];\r\n if (typeof val !== \"undefined\" && val !== null) {\r\n Object.defineProperty(formattedRow, propName, {\r\n value: val,\r\n enumerable: true,\r\n });\r\n }\r\n }\r\n return formattedRow;\r\n }\r\n\r\n /**\r\n * Get the metadata for each column in the query result.\r\n *\r\n * @returns An array of [[QueryPropertyMetaData]].\r\n */\r\n public async getMetaData(): Promise<QueryPropertyMetaData[]> {\r\n if (this._props.length === 0) {\r\n await this.fetchRows();\r\n }\r\n return this._props.properties;\r\n }\r\n\r\n /**\r\n *\r\n */\r\n private async fetchRows() {\r\n this._localOffset = -1;\r\n this._localRows = await this.readRows();\r\n if (this._localRows.length === 0) {\r\n this._done = true;\r\n }\r\n }\r\n\r\n /**\r\n * Step to the next row of the query result.\r\n *\r\n * @returns `true` if a row can be read from `current`.<br/>\r\n * `false` if there are no more rows; i.e., all rows have been stepped through already.\r\n */\r\n public async step(): Promise<boolean> {\r\n if (this._done) {\r\n return false;\r\n }\r\n const cachedRows = this._localRows.length;\r\n if (this._localOffset < cachedRows - 1) {\r\n ++this._localOffset;\r\n } else {\r\n await this.fetchRows();\r\n this._localOffset = 0;\r\n return !this._done;\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Get all remaining rows from the query result.\r\n *\r\n * @returns An array of all remaining rows from the query result.\r\n */\r\n public async toArray(): Promise<any[]> {\r\n const rows = [];\r\n while (await this.step()) {\r\n rows.push(this.formatCurrentRow());\r\n }\r\n return rows;\r\n }\r\n\r\n /**\r\n * Accessor for using ECSqlReader as an asynchronous iterator.\r\n *\r\n * @returns An asynchronous iterator over the rows returned by the executed ECSQL query.\r\n */\r\n public [Symbol.asyncIterator](): AsyncIterableIterator<QueryRowProxy> {\r\n return this;\r\n }\r\n\r\n /**\r\n * Calls step when called as an iterator.\r\n *\r\n * Returns the row alongside a `done` boolean to indicate if there are any more rows for an iterator to step to.\r\n *\r\n * @returns An object with the keys: `value` which contains the row and `done` which contains a boolean.\r\n */\r\n public async next(): Promise<IteratorResult<QueryRowProxy, any>> {\r\n if (await this.step()) {\r\n return {\r\n done: false,\r\n value: this.current,\r\n };\r\n } else {\r\n return {\r\n done: true,\r\n value: this.current,\r\n };\r\n }\r\n }\r\n}\r\n\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECSqlTypes.js","sourceRoot":"","sources":["../../src/ECSqlTypes.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AAEzD;;;;GAIG;AACH,IAAY,cAkBX;AAlBD,WAAY,cAAc;IACxB,qFAAqF;IACrF,mDAAQ,CAAA;IACR,yDAAW,CAAA;IACX,2DAAY,CAAA;IACZ,uDAAU,CAAA;IACV,2DAAY,CAAA;IACZ,+CAAM,CAAA;IACN,iDAAO,CAAA;IACP,qDAAS,CAAA;IACT,yDAAW,CAAA;IACX,0DAAY,CAAA;IACZ,wDAAW,CAAA;IACX,gEAAe,CAAA;IACf,wDAAW,CAAA;IACX,wEAAmB,CAAA;IACnB,kEAAgB,CAAA;IAChB,oDAAS,CAAA;AACX,CAAC,EAlBW,cAAc,8BAAd,cAAc,QAkBzB;AAgCD;;;;;;;;GAQG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mDAAU,CAAA;IACV,mDAAU,CAAA;IACV,mDAAU,CAAA;AACZ,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED;;;;;;;;GAQG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,uEAAe,CAAA;IACf,yEAAgB,CAAA;IAChB,uEAAe,CAAA;IACf,yEAAgB,CAAA;AAClB,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B;AAED;;;;GAIG;AACH,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,6EAAY,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AI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1G;AAjHD,8BAiHC","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 ECSQL\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\n\n/** Describes the different data types an ECSQL value can be of.\n * See also [ECSQL]($docs/learning/ECSQL).\n * @public\n * @extensions\n */\nexport enum ECSqlValueType {\n // do not change the values of the enum as it must match its counterpart in the addon\n Blob = 1,\n Boolean = 2,\n DateTime = 3,\n Double = 4,\n Geometry = 5,\n Id = 6,\n Int = 7,\n Int64 = 8,\n Point2d = 9,\n Point3d = 10,\n String = 11,\n Navigation = 12,\n Struct = 13,\n PrimitiveArray = 14,\n StructArray = 15,\n Guid = 16,\n}\n\n/** An ECSQL Navigation value.\n * It is returned from ECSQL SELECT statements for navigation properties.\n * See also [ECSQL]($docs/learning/ECSQL).\n * @public\n * @extensions\n */\nexport interface NavigationValue {\n /** ECInstanceId of the related instance */\n id: Id64String;\n /** Fully qualified class name of the relationship backing the Navigation property */\n relClassName?: string;\n}\n\n/** An ECSQL Navigation value which can be bound to a navigation property ECSQL parameter\n * See also [ECSQL]($docs/learning/ECSQL).\n * @public\n * @extensions\n */\nexport interface NavigationBindingValue {\n /** ECInstanceId of the related instance */\n id: Id64String;\n /** Fully qualified class name of the relationship backing the Navigation property */\n relClassName?: string;\n /** Table space where the relationship's schema is persisted. This is only required\n * if other ECDb files are attached to the primary one. In case a schema exists in more than one of the files,\n * pass the table space to disambiguate.\n */\n relClassTableSpace?: string;\n}\n\n/** Equivalent of the ECEnumeration OpCode in the **ECDbChange** ECSchema.\n * The enum can be used when programmatically binding values to the InstanceChange.OpCode property of\n * the ECDbChange ECSchema.\n *\n * See also\n * - [ChangeSummary Overview]($docs/learning/ChangeSummaries)\n * @public\n * @extensions\n */\nexport enum ChangeOpCode {\n Insert = 1,\n Update = 2,\n Delete = 4,\n}\n\n/** The enum represents the values for the ChangedValueState argument of the ECSQL function **Changes**.\n * The enum can be used when programmatically binding values to the ChangedValueState argument\n * in an ECSQL using the **Changes** ECSQL function.\n *\n * See also\n * - [ChangeSummary Overview]($docs/learning/ChangeSummaries)\n * @public\n * @extensions\n */\nexport enum ChangedValueState {\n AfterInsert = 1,\n BeforeUpdate = 2,\n AfterUpdate = 3,\n BeforeDelete = 4,\n}\n\n/** Defines the ECSQL system properties.\n * See also [ECSQL]($docs/learning/ECSQL).\n * @public\n * @extensions\n */\nexport enum ECSqlSystemProperty {\n ECInstanceId,\n ECClassId,\n SourceECInstanceId,\n SourceECClassId,\n TargetECInstanceId,\n TargetECClassId,\n NavigationId,\n NavigationRelClassId,\n PointX,\n PointY,\n PointZ,\n}\n\n/** Utility to format ECProperty names according to the iTwin.js formatting rules.\n * See also [ECSQL Row Format]($docs/learning/ECSQLRowFormat).\n * @public\n */\nexport class ECJsNames {\n\n /** Formats the specified ECProperty name according to the iTwin.js formatting rules.\n *\n * See [ECSQL Row Format]($docs/learning/ECSQLRowFormat) which describes the formatting rules.\n *\n * @param ecProperty Property name as defined in the ECSchema for regular ECProperties\n * or the name of an ECSQL system properties\n * @param isSystemProperty if omitted, the method will try to find out whether the given property\n * is a system property or not. If true is specified, the method will throw if the property name\n * is not a known system property. If false is specified, the method will not attempt to recognize\n * the property name as system property.\n */\n public static toJsName(propName: string, isSystemProperty?: boolean) {\n assert(propName !== undefined, \"propName must not be undefined\");\n\n const propTypeUnknown: boolean = isSystemProperty === undefined || isSystemProperty === null;\n\n const accessStringTokens: string[] = propName.split(\".\");\n const tokenCount: number = accessStringTokens.length;\n assert(tokenCount > 0);\n\n if (tokenCount === 1) {\n if (propTypeUnknown || isSystemProperty) {\n if (propName === \"ECInstanceId\")\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.ECInstanceId);\n\n if (propName === \"ECClassId\")\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.ECClassId);\n\n if (propName === \"SourceECInstanceId\")\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.SourceECInstanceId);\n\n if (propName === \"TargetECInstanceId\")\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.TargetECInstanceId);\n\n if (propName === \"SourceECClassId\")\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.SourceECClassId);\n\n if (propName === \"TargetECClassId\")\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.TargetECClassId);\n\n return ECJsNames.lowerFirstChar(propName);\n }\n\n return ECJsNames.lowerFirstChar(propName);\n }\n\n // parse access string and convert the leaf tokens if they are system props\n // The first char of the access string is lowered.\n let jsName: string = ECJsNames.lowerFirstChar(`${accessStringTokens[0]}.`);\n for (let j = 1; j < tokenCount - 1; j++) {\n jsName += `${accessStringTokens[j]}.`;\n }\n\n const leafToken: string = accessStringTokens[tokenCount - 1];\n\n if (propTypeUnknown || isSystemProperty) {\n if (leafToken === \"Id\")\n jsName += ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.NavigationId);\n else if (leafToken === \"RelECClassId\")\n jsName += ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.NavigationRelClassId);\n else if (leafToken === \"X\")\n jsName += ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.PointX);\n else if (leafToken === \"Y\")\n jsName += ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.PointY);\n else if (leafToken === \"Z\")\n jsName += ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.PointZ);\n else if (propTypeUnknown)\n jsName += ECJsNames.lowerFirstChar(leafToken);\n else\n throw new Error(`Property ${leafToken} of access string ${propName} is no ECSQL system property.`);\n } else\n jsName += leafToken;\n\n return jsName;\n }\n\n /** Returns the name of the specified ECSQL system property according to the\n * iTwin.js formatting rules.\n *\n * See [ECSQL Row Format]($docs/learning/ECSQLRowFormat) which describes the formatting rules.\n * @param systemPropertyType System property type\n */\n public static systemPropertyToJsName(systemPropertyType: ECSqlSystemProperty): string {\n switch (systemPropertyType) {\n case ECSqlSystemProperty.ECInstanceId:\n case ECSqlSystemProperty.NavigationId:\n return \"id\";\n case ECSqlSystemProperty.ECClassId:\n return \"className\";\n case ECSqlSystemProperty.SourceECInstanceId:\n return \"sourceId\";\n case ECSqlSystemProperty.SourceECClassId:\n return \"sourceClassName\";\n case ECSqlSystemProperty.TargetECInstanceId:\n return \"targetId\";\n case ECSqlSystemProperty.TargetECClassId:\n return \"targetClassName\";\n case ECSqlSystemProperty.NavigationRelClassId:\n return \"relClassName\";\n case ECSqlSystemProperty.PointX:\n return \"x\";\n case ECSqlSystemProperty.PointY:\n return \"y\";\n case ECSqlSystemProperty.PointZ:\n return \"z\";\n default:\n throw new Error(`Unknown ECSqlSystemProperty enum value ${String(systemPropertyType)}.`);\n }\n }\n\n private static lowerFirstChar(name: string): string { return name[0].toLowerCase() + name.substring(1); }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ECSqlTypes.js","sourceRoot":"","sources":["../../src/ECSqlTypes.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AAEzD;;;;GAIG;AACH,IAAY,cAkBX;AAlBD,WAAY,cAAc;IACxB,qFAAqF;IACrF,mDAAQ,CAAA;IACR,yDAAW,CAAA;IACX,2DAAY,CAAA;IACZ,uDAAU,CAAA;IACV,2DAAY,CAAA;IACZ,+CAAM,CAAA;IACN,iDAAO,CAAA;IACP,qDAAS,CAAA;IACT,yDAAW,CAAA;IACX,0DAAY,CAAA;IACZ,wDAAW,CAAA;IACX,gEAAe,CAAA;IACf,wDAAW,CAAA;IACX,wEAAmB,CAAA;IACnB,kEAAgB,CAAA;IAChB,oDAAS,CAAA;AACX,CAAC,EAlBW,cAAc,8BAAd,cAAc,QAkBzB;AAgCD;;;;;;;;GAQG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mDAAU,CAAA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G,CAAC;YACb,KAAK,mBAAmB,CAAC,MAAM;gBAC7B,OAAO,GAAG,CAAC;YACb,KAAK,mBAAmB,CAAC,MAAM;gBAC7B,OAAO,GAAG,CAAC;YACb;gBACE,MAAM,IAAI,KAAK,CAAC,0CAA0C,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,cAAc,CAAC,IAAY,IAAY,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1G;AAjHD,8BAiHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ECSQL\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\n\r\n/** Describes the different data types an ECSQL value can be of.\r\n * See also [ECSQL]($docs/learning/ECSQL).\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ECSqlValueType {\r\n // do not change the values of the enum as it must match its counterpart in the addon\r\n Blob = 1,\r\n Boolean = 2,\r\n DateTime = 3,\r\n Double = 4,\r\n Geometry = 5,\r\n Id = 6,\r\n Int = 7,\r\n Int64 = 8,\r\n Point2d = 9,\r\n Point3d = 10,\r\n String = 11,\r\n Navigation = 12,\r\n Struct = 13,\r\n PrimitiveArray = 14,\r\n StructArray = 15,\r\n Guid = 16,\r\n}\r\n\r\n/** An ECSQL Navigation value.\r\n * It is returned from ECSQL SELECT statements for navigation properties.\r\n * See also [ECSQL]($docs/learning/ECSQL).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface NavigationValue {\r\n /** ECInstanceId of the related instance */\r\n id: Id64String;\r\n /** Fully qualified class name of the relationship backing the Navigation property */\r\n relClassName?: string;\r\n}\r\n\r\n/** An ECSQL Navigation value which can be bound to a navigation property ECSQL parameter\r\n * See also [ECSQL]($docs/learning/ECSQL).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface NavigationBindingValue {\r\n /** ECInstanceId of the related instance */\r\n id: Id64String;\r\n /** Fully qualified class name of the relationship backing the Navigation property */\r\n relClassName?: string;\r\n /** Table space where the relationship's schema is persisted. This is only required\r\n * if other ECDb files are attached to the primary one. In case a schema exists in more than one of the files,\r\n * pass the table space to disambiguate.\r\n */\r\n relClassTableSpace?: string;\r\n}\r\n\r\n/** Equivalent of the ECEnumeration OpCode in the **ECDbChange** ECSchema.\r\n * The enum can be used when programmatically binding values to the InstanceChange.OpCode property of\r\n * the ECDbChange ECSchema.\r\n *\r\n * See also\r\n * - [ChangeSummary Overview]($docs/learning/ChangeSummaries)\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ChangeOpCode {\r\n Insert = 1,\r\n Update = 2,\r\n Delete = 4,\r\n}\r\n\r\n/** The enum represents the values for the ChangedValueState argument of the ECSQL function **Changes**.\r\n * The enum can be used when programmatically binding values to the ChangedValueState argument\r\n * in an ECSQL using the **Changes** ECSQL function.\r\n *\r\n * See also\r\n * - [ChangeSummary Overview]($docs/learning/ChangeSummaries)\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ChangedValueState {\r\n AfterInsert = 1,\r\n BeforeUpdate = 2,\r\n AfterUpdate = 3,\r\n BeforeDelete = 4,\r\n}\r\n\r\n/** Defines the ECSQL system properties.\r\n * See also [ECSQL]($docs/learning/ECSQL).\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ECSqlSystemProperty {\r\n ECInstanceId,\r\n ECClassId,\r\n SourceECInstanceId,\r\n SourceECClassId,\r\n TargetECInstanceId,\r\n TargetECClassId,\r\n NavigationId,\r\n NavigationRelClassId,\r\n PointX,\r\n PointY,\r\n PointZ,\r\n}\r\n\r\n/** Utility to format ECProperty names according to the iTwin.js formatting rules.\r\n * See also [ECSQL Row Format]($docs/learning/ECSQLRowFormat).\r\n * @public\r\n */\r\nexport class ECJsNames {\r\n\r\n /** Formats the specified ECProperty name according to the iTwin.js formatting rules.\r\n *\r\n * See [ECSQL Row Format]($docs/learning/ECSQLRowFormat) which describes the formatting rules.\r\n *\r\n * @param ecProperty Property name as defined in the ECSchema for regular ECProperties\r\n * or the name of an ECSQL system properties\r\n * @param isSystemProperty if omitted, the method will try to find out whether the given property\r\n * is a system property or not. If true is specified, the method will throw if the property name\r\n * is not a known system property. If false is specified, the method will not attempt to recognize\r\n * the property name as system property.\r\n */\r\n public static toJsName(propName: string, isSystemProperty?: boolean) {\r\n assert(propName !== undefined, \"propName must not be undefined\");\r\n\r\n const propTypeUnknown: boolean = isSystemProperty === undefined || isSystemProperty === null;\r\n\r\n const accessStringTokens: string[] = propName.split(\".\");\r\n const tokenCount: number = accessStringTokens.length;\r\n assert(tokenCount > 0);\r\n\r\n if (tokenCount === 1) {\r\n if (propTypeUnknown || isSystemProperty) {\r\n if (propName === \"ECInstanceId\")\r\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.ECInstanceId);\r\n\r\n if (propName === \"ECClassId\")\r\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.ECClassId);\r\n\r\n if (propName === \"SourceECInstanceId\")\r\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.SourceECInstanceId);\r\n\r\n if (propName === \"TargetECInstanceId\")\r\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.TargetECInstanceId);\r\n\r\n if (propName === \"SourceECClassId\")\r\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.SourceECClassId);\r\n\r\n if (propName === \"TargetECClassId\")\r\n return ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.TargetECClassId);\r\n\r\n return ECJsNames.lowerFirstChar(propName);\r\n }\r\n\r\n return ECJsNames.lowerFirstChar(propName);\r\n }\r\n\r\n // parse access string and convert the leaf tokens if they are system props\r\n // The first char of the access string is lowered.\r\n let jsName: string = ECJsNames.lowerFirstChar(`${accessStringTokens[0]}.`);\r\n for (let j = 1; j < tokenCount - 1; j++) {\r\n jsName += `${accessStringTokens[j]}.`;\r\n }\r\n\r\n const leafToken: string = accessStringTokens[tokenCount - 1];\r\n\r\n if (propTypeUnknown || isSystemProperty) {\r\n if (leafToken === \"Id\")\r\n jsName += ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.NavigationId);\r\n else if (leafToken === \"RelECClassId\")\r\n jsName += ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.NavigationRelClassId);\r\n else if (leafToken === \"X\")\r\n jsName += ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.PointX);\r\n else if (leafToken === \"Y\")\r\n jsName += ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.PointY);\r\n else if (leafToken === \"Z\")\r\n jsName += ECJsNames.systemPropertyToJsName(ECSqlSystemProperty.PointZ);\r\n else if (propTypeUnknown)\r\n jsName += ECJsNames.lowerFirstChar(leafToken);\r\n else\r\n throw new Error(`Property ${leafToken} of access string ${propName} is no ECSQL system property.`);\r\n } else\r\n jsName += leafToken;\r\n\r\n return jsName;\r\n }\r\n\r\n /** Returns the name of the specified ECSQL system property according to the\r\n * iTwin.js formatting rules.\r\n *\r\n * See [ECSQL Row Format]($docs/learning/ECSQLRowFormat) which describes the formatting rules.\r\n * @param systemPropertyType System property type\r\n */\r\n public static systemPropertyToJsName(systemPropertyType: ECSqlSystemProperty): string {\r\n switch (systemPropertyType) {\r\n case ECSqlSystemProperty.ECInstanceId:\r\n case ECSqlSystemProperty.NavigationId:\r\n return \"id\";\r\n case ECSqlSystemProperty.ECClassId:\r\n return \"className\";\r\n case ECSqlSystemProperty.SourceECInstanceId:\r\n return \"sourceId\";\r\n case ECSqlSystemProperty.SourceECClassId:\r\n return \"sourceClassName\";\r\n case ECSqlSystemProperty.TargetECInstanceId:\r\n return \"targetId\";\r\n case ECSqlSystemProperty.TargetECClassId:\r\n return \"targetClassName\";\r\n case ECSqlSystemProperty.NavigationRelClassId:\r\n return \"relClassName\";\r\n case ECSqlSystemProperty.PointX:\r\n return \"x\";\r\n case ECSqlSystemProperty.PointY:\r\n return \"y\";\r\n case ECSqlSystemProperty.PointZ:\r\n return \"z\";\r\n default:\r\n throw new Error(`Unknown ECSqlSystemProperty enum value ${String(systemPropertyType)}.`);\r\n }\r\n }\r\n\r\n private static lowerFirstChar(name: string): string { return name[0].toLowerCase() + name.substring(1); }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementMesh.js","sourceRoot":"","sources":["../../src/ElementMesh.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAkEH,8CAuBC;AAvFD,sDAA6D;AAC7D,wDAAkF;AAsClF,SAAS,SAAS,CAAC,MAAkB;IACnC,IAAI,MAAM,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC;QAC/B,2BAA2B;QAC3B,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,6DAA6D;IAC7D,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;IAC/F,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;QACrC,OAAO,SAAS,CAAC;IAEnB,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACvC,MAAM,IAAI,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;QACnC,IAAI;KACL,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,IAAgB;IAChD,MAAM,SAAS,GAAsB,EAAE,CAAC;IAExC,MAAM,MAAM,GAAG,yBAAU,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,UAAU,IAAI,MAAM,KAAK,UAAU,CAAC,IAAI;QAC3C,OAAO,SAAS,CAAC;IAEnB,OAAO,MAAM,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI;YAChD,SAAS;QAEX,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,yCAAyB,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACzE,IAAI,IAAI,YAAY,+BAAe;gBACjC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,EAAE;QACJ,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,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 Geometry\n */\n\nimport { ByteStream, Id64String } from \"@itwin/core-bentley\";\nimport { BentleyGeometryFlatBuffer, IndexedPolyface } from \"@itwin/core-geometry\";\n\n/** Options used to control how [Polyface]($core-geometry)s are produced from elements by [IModelConnection.generateElementMeshes]($frontend).\n * @beta\n */\nexport interface ElementMeshOptions {\n /** Maximum distance from a face to the original geometry.\n * If not supplied, defaults to zero and [[angleTolerance]] will control the quality of the resulting mesh instead.\n * @see [StrokeOptions.chordTol]($core-geometry).\n */\n chordTolerance?: number;\n /** Maximum angle difference in radians for an approximated face.\n * If not supplied, defaults to PI/12 (15 degrees).\n * @see [StrokeOptions.angleTol]($core-geometry).\n */\n angleTolerance?: number;\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\n * like screws and screw holes.\n */\n minBRepFeatureSize?: number;\n // ###TODO? decimationTolerance?: number;\n}\n\n/** Describes a request to generate [Polyface]($core-geometry)s from an element.\n * @see [IModelConnection.generateElementMeshes]($frontend).\n * @beta\n */\nexport interface ElementMeshRequestProps extends ElementMeshOptions {\n /** The Id of the [GeometricElement]($backend) from which to obtain meshes. */\n source: Id64String;\n}\n\ninterface Chunk {\n type: string;\n data?: Uint8Array;\n}\n\nfunction nextChunk(stream: ByteStream): Chunk | undefined {\n if (stream.remainingLength < 8) {\n // Consume remaining bytes.\n stream.curPos = stream.length;\n return undefined;\n }\n\n // Type codes are a sequence of four uppercase ASCII letters.\n const chars = [stream.readUint8(), stream.readUint8(), stream.readUint8(), stream.readUint8()];\n if (chars.some((c) => c < 65 || c > 90))\n return undefined;\n\n const dataLength = stream.readUint32();\n const data = dataLength > 0 ? stream.nextBytes(dataLength) : undefined;\n return {\n type: String.fromCharCode(...chars),\n data,\n };\n}\n\n/** Convert the output of [IModelConnection.generateElementMeshes]($frontend) into an array of [Polyface]($core-geometry)s.\n * @param data Encoded polyfaces obtained from [IModelConnection.generateElementMeshes]($frontend).\n * @returns a list of decoded polyfaces.\n * @beta\n */\nexport function readElementMeshes(data: Uint8Array): IndexedPolyface[] {\n const polyfaces: IndexedPolyface[] = [];\n\n const stream = ByteStream.fromUint8Array(data);\n const firstChunk = nextChunk(stream);\n if (!firstChunk || \"LMSH\" !== firstChunk.type)\n return polyfaces;\n\n while (stream.remainingLength > 0) {\n const chunk = nextChunk(stream);\n if (!chunk || chunk.type !== \"PLFC\" || !chunk.data)\n continue;\n\n try {\n const geom = BentleyGeometryFlatBuffer.bytesToGeometry(chunk.data, true);\n if (geom instanceof IndexedPolyface)\n polyfaces.push(geom);\n } catch {\n //\n }\n }\n\n return polyfaces;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ElementMesh.js","sourceRoot":"","sources":["../../src/ElementMesh.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAkEH,8CAuBC;AAvFD,sDAA6D;AAC7D,wDAAkF;AAsClF,SAAS,SAAS,CAAC,MAAkB;IACnC,IAAI,MAAM,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC;QAC/B,2BAA2B;QAC3B,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,6DAA6D;IAC7D,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;IAC/F,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;QACrC,OAAO,SAAS,CAAC;IAEnB,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACvC,MAAM,IAAI,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;QACnC,IAAI;KACL,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,IAAgB;IAChD,MAAM,SAAS,GAAsB,EAAE,CAAC;IAExC,MAAM,MAAM,GAAG,yBAAU,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,UAAU,IAAI,MAAM,KAAK,UAAU,CAAC,IAAI;QAC3C,OAAO,SAAS,CAAC;IAEnB,OAAO,MAAM,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI;YAChD,SAAS;QAEX,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,yCAAyB,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACzE,IAAI,IAAI,YAAY,+BAAe;gBACjC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,EAAE;QACJ,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Geometry\r\n */\r\n\r\nimport { ByteStream, Id64String } from \"@itwin/core-bentley\";\r\nimport { BentleyGeometryFlatBuffer, IndexedPolyface } from \"@itwin/core-geometry\";\r\n\r\n/** Options used to control how [Polyface]($core-geometry)s are produced from elements by [IModelConnection.generateElementMeshes]($frontend).\r\n * @beta\r\n */\r\nexport interface ElementMeshOptions {\r\n /** Maximum distance from a face to the original geometry.\r\n * If not supplied, defaults to zero and [[angleTolerance]] will control the quality of the resulting mesh instead.\r\n * @see [StrokeOptions.chordTol]($core-geometry).\r\n */\r\n chordTolerance?: number;\r\n /** Maximum angle difference in radians for an approximated face.\r\n * If not supplied, defaults to PI/12 (15 degrees).\r\n * @see [StrokeOptions.angleTol]($core-geometry).\r\n */\r\n angleTolerance?: number;\r\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\r\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\r\n * like screws and screw holes.\r\n */\r\n minBRepFeatureSize?: number;\r\n // ###TODO? decimationTolerance?: number;\r\n}\r\n\r\n/** Describes a request to generate [Polyface]($core-geometry)s from an element.\r\n * @see [IModelConnection.generateElementMeshes]($frontend).\r\n * @beta\r\n */\r\nexport interface ElementMeshRequestProps extends ElementMeshOptions {\r\n /** The Id of the [GeometricElement]($backend) from which to obtain meshes. */\r\n source: Id64String;\r\n}\r\n\r\ninterface Chunk {\r\n type: string;\r\n data?: Uint8Array;\r\n}\r\n\r\nfunction nextChunk(stream: ByteStream): Chunk | undefined {\r\n if (stream.remainingLength < 8) {\r\n // Consume remaining bytes.\r\n stream.curPos = stream.length;\r\n return undefined;\r\n }\r\n\r\n // Type codes are a sequence of four uppercase ASCII letters.\r\n const chars = [stream.readUint8(), stream.readUint8(), stream.readUint8(), stream.readUint8()];\r\n if (chars.some((c) => c < 65 || c > 90))\r\n return undefined;\r\n\r\n const dataLength = stream.readUint32();\r\n const data = dataLength > 0 ? stream.nextBytes(dataLength) : undefined;\r\n return {\r\n type: String.fromCharCode(...chars),\r\n data,\r\n };\r\n}\r\n\r\n/** Convert the output of [IModelConnection.generateElementMeshes]($frontend) into an array of [Polyface]($core-geometry)s.\r\n * @param data Encoded polyfaces obtained from [IModelConnection.generateElementMeshes]($frontend).\r\n * @returns a list of decoded polyfaces.\r\n * @beta\r\n */\r\nexport function readElementMeshes(data: Uint8Array): IndexedPolyface[] {\r\n const polyfaces: IndexedPolyface[] = [];\r\n\r\n const stream = ByteStream.fromUint8Array(data);\r\n const firstChunk = nextChunk(stream);\r\n if (!firstChunk || \"LMSH\" !== firstChunk.type)\r\n return polyfaces;\r\n\r\n while (stream.remainingLength > 0) {\r\n const chunk = nextChunk(stream);\r\n if (!chunk || chunk.type !== \"PLFC\" || !chunk.data)\r\n continue;\r\n\r\n try {\r\n const geom = BentleyGeometryFlatBuffer.bytesToGeometry(chunk.data, true);\r\n if (geom instanceof IndexedPolyface)\r\n polyfaces.push(geom);\r\n } catch {\r\n //\r\n }\r\n }\r\n\r\n return polyfaces;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementProps.js","sourceRoot":"","sources":["../../src/ElementProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA2IH,gDAEC;AAKD,gDAEC;AAlJD,sDAAiF;AAQjF,+CAA4C;AAoC5C;;GAEG;AACH,MAAa,cAAc;IACzB,8DAA8D;IAC9C,EAAE,CAAa;IAE/B,oDAAoD;IACpC,YAAY,CAAU;IAEtC,YAAY,KAA0B;QACpC,IAAI,CAAC,EAAE,GAAG,mBAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IACzC,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAA0B;QAC/C,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrD,CAAC;IAED,8DAA8D;IACvD,MAAM,CAAU,IAAI,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,EAAE,mBAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAEvE,mJAAmJ;IAC5I,MAAM,CAAC,UAAU,CAAC,IAAS;QAChC,IAAI,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;YACjD,MAAM,CAAC,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACxC,IAAI,CAAC,KAAK,SAAS;gBACjB,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC;YAC/E,OAAO,CAAC,CAAC,EAAE,CAAC;QACd,CAAC;QACD,OAAO,mBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAEM,MAAM;QACX,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC;IACJ,CAAC;;AAnCH,wCAoCC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,cAAc;CACjD;AADD,wCACC;AA6CD;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAqB;IACtD,OAAQ,KAA0B,CAAC,KAAK,KAAK,SAAS,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAqB;IACtD,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AAoCD;;;GAGG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,mDAAW,CAAA;IACX,iDAAU,CAAA;IACV,uDAAa,CAAA;IACb,6CAAQ,CAAA;AACV,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAsSD;;GAEG;AACH,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACtC,gEAAgE;IAChE,mGAAkB,CAAA;IAClB,0EAA0E;IAC1E,6FAAe,CAAA;AACjB,CAAC,EALW,4BAA4B,4CAA5B,4BAA4B,QAKvC;AAyCD;;;GAGG;AACH,IAAY,IASX;AATD,WAAY,IAAI;IACd,gDAAgD;IAChD,mCAAU,CAAA;IACV,4GAA4G;IAC5G,mCAAU,CAAA;IACV,6HAA6H;IAC7H,6CAAe,CAAA;IACf,mIAAmI;IACnI,+BAAQ,CAAA;AACV,CAAC,EATW,IAAI,oBAAJ,IAAI,QASf","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 Entities\n */\n\nimport { GuidString, Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n AngleProps, ClipVectorProps, LowAndHighXYProps, LowAndHighXYZProps, TransformProps, XYProps, XYZProps, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { CodeProps } from \"./Code\";\nimport { EntityProps } from \"./EntityProps\";\nimport { ElementGeometryBuilderParams, ElementGeometryBuilderParamsForPart } from \"./geometry/ElementGeometry\";\nimport { GeometryStreamProps } from \"./geometry/GeometryStream\";\nimport { IModelError } from \"./IModelError\";\nimport { SubCategoryAppearance } from \"./SubCategoryAppearance\";\n\n/** Properties of a NavigationProperty.\n * @public @preview\n * @extensions\n */\nexport interface RelatedElementProps {\n /** The Id of the element to which this element is related. */\n id: Id64String;\n /** The full className of the relationship class. */\n relClassName?: string;\n}\n\n/** Properties of an [Element]($docs/bis/guide/fundamentals/element-fundamentals)\n * @public @preview\n * @extensions\n */\nexport interface ElementProps extends EntityProps {\n /** The Id of the [Model]($docs/bis/guide/fundamentals/model-fundamentals.md) containing this element */\n model: Id64String;\n /** The [Code]($docs/bis/guide/fundamentals/codes.md) for this element */\n code: CodeProps;\n /** The Parent of this element, if defined. */\n parent?: RelatedElementProps;\n /** A [FederationGuid]($docs/bis/guide/fundamentals/element-fundamentals.md#federationguid) assigned to this element.\n * @note On insert, if this is a valid Guid, the value is preserved. If it is `undefined`, a new Guid is created. If it is an invalid Guid (e.g. Guid.empty), the\n * resultant element will have a `null` federationGuid. For update, `undefined` means \"don't change.\"\n */\n federationGuid?: GuidString;\n /** A [user-assigned label]($docs/bis/guide/fundamentals/element-fundamentals.md#userlabel) for this element. */\n userLabel?: string;\n /** Optional [json properties]($docs/bis/guide/fundamentals/element-fundamentals.md#jsonproperties) of this element. */\n jsonProperties?: any;\n}\n\n/** The Id and relationship class of an Element that is somehow related to another Element\n * @public @preview\n */\nexport class RelatedElement implements RelatedElementProps {\n /** The Id of the element to which this element is related. */\n public readonly id: Id64String;\n\n /** The full className of the relationship class. */\n public readonly relClassName?: string;\n\n constructor(props: RelatedElementProps) {\n this.id = Id64.fromJSON(props.id);\n this.relClassName = props.relClassName;\n }\n\n public static fromJSON(json?: RelatedElementProps): RelatedElement | undefined {\n return json ? new RelatedElement(json) : undefined;\n }\n\n /** Used to *null out* an existing navigation relationship. */\n public static readonly none = new RelatedElement({ id: Id64.invalid });\n\n /** Accept the value of a navigation property that might be in the shortened format of just an id or might be in the full RelatedElement format. */\n public static idFromJson(json: any): Id64String {\n if ((typeof json === \"object\") && (\"id\" in json)) {\n const r = RelatedElement.fromJSON(json);\n if (r === undefined)\n throw new IModelError(IModelStatus.BadArg, \"Problem parsing Id64 from json\");\n return r.id;\n }\n return Id64.fromJSON(json);\n }\n\n public toJSON(): RelatedElementProps {\n return {\n id: this.id,\n relClassName: this.relClassName,\n };\n }\n}\n\n/** A [RelatedElement]($common) relationship that describes the [TypeDefinitionElement]($backend) of an element.\n * @public @preview\n */\nexport class TypeDefinition extends RelatedElement {\n}\n\n/** Properties of a [GeometricElement]($backend)\n * @public @preview\n * @extensions\n */\nexport interface GeometricElementProps extends ElementProps {\n /** The id of the category for this geometric element. */\n category: Id64String;\n /** The geometry stream properties */\n geom?: GeometryStreamProps;\n /** Describes how to build the element's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent element.\n */\n elementGeometryBuilderParams?: ElementGeometryBuilderParams;\n /** The placement properties */\n placement?: PlacementProps;\n}\n\n/** Properties of a [[Placement3d]]\n * @public @preview\n * @extensions\n */\nexport interface Placement3dProps {\n origin: XYZProps;\n angles: YawPitchRollProps;\n bbox?: LowAndHighXYZProps;\n}\n\n/** Properties of a [[Placement2d]]\n * @public @preview\n * @extensions\n */\nexport interface Placement2dProps {\n origin: XYProps;\n angle: AngleProps;\n bbox?: LowAndHighXYProps;\n}\n\n/**\n * @public @preview\n * @extensions\n */\nexport type PlacementProps = Placement2dProps | Placement3dProps;\n\n/** determine if this is Placement2dProps\n * @public @preview\n */\nexport function isPlacement2dProps(props: PlacementProps): props is Placement2dProps {\n return (props as Placement2dProps).angle !== undefined;\n}\n\n/** determine if this is Placement3dProps\n * @public @preview\n */\nexport function isPlacement3dProps(props: PlacementProps): props is Placement3dProps {\n return !isPlacement2dProps(props);\n}\n\n/** Properties that define a [GeometricElement3d]($backend)\n * @public @preview\n * @extensions\n */\nexport interface GeometricElement3dProps extends GeometricElementProps {\n placement?: Placement3dProps;\n typeDefinition?: RelatedElementProps;\n}\n\n/** JSON representation of a [TextAnnotation3d]($backend).\n * @public @preview\n * @extensions\n */\nexport interface TextAnnotation3dProps extends GeometricElement3dProps {\n /** The stringified versioned JSON representation of the text annotation.\n * @see [[VersionedJSON]] for the JSON representation.\n * @see [[TextAnnotationProps]] for the data model.\n * @note Don't set this property directly - use [TextAnnotation3d.setAnnotation]($backend) instead.\n */\n textAnnotationData?: string;\n /** The default [AnnotationTextStyle]($backend) element used by the text annotation.\n * @beta\n */\n defaultTextStyle?: RelatedElementProps;\n}\n\n/** Properties that define a [PhysicalElement]($backend)\n * @public @preview\n * @extensions\n */\nexport interface PhysicalElementProps extends GeometricElement3dProps {\n physicalMaterial?: RelatedElementProps;\n}\n\n/** An enumeration of the different types of [SectionDrawing]($backend)s.\n * @public @preview\n * @extensions\n */\nexport enum SectionType {\n Section = 3,\n Detail = 4,\n Elevation = 5,\n Plan = 6,\n}\n\n/** Properties that define a [Drawing]($backend).\n * @public @preview\n * @extensions\n */\nexport interface DrawingProps extends ElementProps {\n /** A factor used by tools to adjust the size of text in [GeometricElement2d]($backend)s in the associated [DrawingModel]($backend) and to compute the\n * size of the [ViewAttachment]($backend) created when attaching the [Drawing]($backend) to a [Sheet]($backend).\n * Default: 1.\n * @note The scale factor **must** be greater than zero.\n * @public @preview\n */\n scaleFactor?: number;\n}\n\n/** Properties that define a [SectionDrawing]($backend).\n * @public @preview\n * @extensions\n */\nexport interface SectionDrawingProps extends DrawingProps {\n /** The type of section used to generate the drawing. Default: Section. */\n sectionType?: SectionType;\n /** The spatial view from which the section was generated. */\n spatialView?: RelatedElementProps;\n jsonProperties?: {\n /** A transform from the section drawing model's coordinates to spatial coordinates. */\n drawingToSpatialTransform?: TransformProps;\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), a transform from the sheet's coordinates to spatial coordinates. */\n sheetToSpatialTransform?: TransformProps;\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), JSON representation of a [ClipVector]($geometry) to apply to\n * the sheet graphics when drawn in the context of the spatial view.\n * The ClipVector is in spatial coordinates.\n */\n drawingBoundaryClip?: ClipVectorProps;\n /** If true, when displaying the section drawing as a [DrawingViewState]($frontend), the [[spatialView]] will also be displayed. */\n displaySpatialView?: true;\n };\n}\n\n/** Properties that define a [SectionDrawingLocation]($backend)\n * @public @preview\n * @extensions\n */\nexport interface SectionDrawingLocationProps extends GeometricElement3dProps {\n /** The [ViewDefinition]($backend) to which this location refers. */\n sectionView?: RelatedElementProps;\n}\n\n/** Properties that define a [GeometricElement2d]($backend)\n * @public @preview\n * @extensions\n */\nexport interface GeometricElement2dProps extends GeometricElementProps {\n placement?: Placement2dProps;\n typeDefinition?: RelatedElementProps;\n}\n\n/** Properties that define a [TextAnnotation2d]($backend).\n * @public @preview\n * @extensions\n */\nexport interface TextAnnotation2dProps extends GeometricElement2dProps {\n /** The stringified versioned JSON representation of the text annotation.\n * @see [[VersionedJSON]] for the JSON representation.\n * @see [[TextAnnotationProps]] for the data model.\n * @note Don't set this property directly - use [TextAnnotation2d.setAnnotation]($backend) instead.\n */\n textAnnotationData?: string;\n /** The default [AnnotationTextStyle]($backend) element used by the text annotation.\n * @beta\n */\n defaultTextStyle?: RelatedElementProps;\n}\n\n/** Properties of a [GeometryPart]($backend)\n * @public @preview\n * @extensions\n */\nexport interface GeometryPartProps extends ElementProps {\n geom?: GeometryStreamProps;\n /** Describes how to build the part's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent part.\n */\n elementGeometryBuilderParams?: ElementGeometryBuilderParamsForPart;\n bbox?: LowAndHighXYZProps;\n}\n\n/** Properties for a [ViewAttachment]($backend)\n * @public @preview\n * @extensions\n */\nexport interface ViewAttachmentProps extends GeometricElement2dProps {\n view: RelatedElementProps;\n jsonProperties?: {\n /** Integer priority in [-500,500]. Where two attachments overlap, the one with the higher priority draws in front of the other. Default: 0. */\n displayPriority?: number;\n /** JSON representation of a [ClipVector]($core-geometry] in sheet coordinate space, used to clip the attachment's graphics on the sheet. */\n clip?: ClipVectorProps;\n /** Options for customizing how the view attachment is displayed on the sheet. */\n displayOptions?: {\n /** If true, the view attachment is always drawn as a raster image. By default, only 3d perspective views are drawn this way (they always *must* be). Default: false. */\n drawAsRaster?: boolean;\n /** If true, and the view attachment is drawn as a raster image, the background color of the view will be preserved. By default the background color of the\n * sheet is used and any background pixels become transparent, allowing the contents of the sheet to show through. Default: false.\n */\n preserveBackground?: boolean;\n };\n };\n}\n\n/** Properties of a [Subject]($backend)\n * @public @preview\n * @extensions\n */\nexport interface SubjectProps extends ElementProps {\n description?: string;\n}\n\n/** Properties of a [SheetBorderTemplate]($backend)\n * @beta\n */\nexport interface SheetBorderTemplateProps extends ElementProps {\n height?: number;\n width?: number;\n}\n\n/** Properties of a [SheetTemplate]($backend)\n * @beta\n */\nexport interface SheetTemplateProps extends ElementProps {\n height?: number;\n width?: number;\n border?: Id64String;\n}\n\n/** Properties of a [Sheet]($backend).\n * @public @preview\n * @extensions\n */\nexport interface SheetProps extends ElementProps {\n width?: number;\n height?: number;\n scale?: number;\n sheetTemplate?: Id64String;\n attachments?: Id64String[];\n}\n\n/** Properties of a [DefinitionElement]($backend)\n * @public @preview\n * @extensions\n */\nexport interface DefinitionElementProps extends ElementProps {\n isPrivate?: boolean;\n}\n\n/** Properties of a [TypeDefinitionElement]($backend)\n * @public @preview\n * @extensions\n */\nexport interface TypeDefinitionElementProps extends DefinitionElementProps {\n recipe?: RelatedElementProps;\n}\n\n/** Properties of a [PhysicalType]($backend)\n * @public @preview\n * @extensions\n */\nexport interface PhysicalTypeProps extends TypeDefinitionElementProps {\n /** The [PhysicalMaterial]($backend) that makes up this physical type. */\n physicalMaterial?: RelatedElementProps;\n}\n\n/** Properties of a [InformationPartitionElement]($backend)\n * @public @preview\n * @extensions\n */\nexport interface InformationPartitionElementProps extends ElementProps {\n description?: string;\n}\n\n/** Options controlling which properties are included or excluded when querying [[DisplayStyleProps]].\n * @see [[ViewStateLoadProps]] and [[ElementLoadOptions]].\n * @public @preview\n * @extensions\n */\nexport interface DisplayStyleLoadProps {\n /** If true, the lists of element Ids in the display style's schedule script will be empty.\n * The element Ids are not required on the frontend for display and can be quite large.\n */\n omitScheduleScriptElementIds?: boolean;\n /** If true, [[DisplayStyleSettingsProps.excludedElements]] will be compressed into a single compact string; otherwise they will be expanded into an array of strings.\n * The number of Ids may be quite large, so the compressed format is preferred, especially when communicating between the backend and frontend.\n */\n compressExcludedElementIds?: boolean;\n}\n\n/** Options controlling which properties are included or excluded when querying [[RenderTimelineProps]].\n * @see [[ElementLoadOptions.renderTimeline]].\n * @public @preview\n * @extensions\n */\nexport interface RenderTimelineLoadProps {\n /** If true, the lists of element Ids in the schedule script will be empty.\n * The element Ids can be extremely numerous and are not required on the frontend for display, so they are omitted by default by [DisplayStyleState.load]($frontend).\n */\n omitScriptElementIds?: boolean;\n}\n\n/** Options used to specify properties to include or exclude when querying [[ElementProps]] with functions like\n * [IModelDb.Elements.getElementProps]($backend) and [IModelConnection.Elements.loadProps]($frontend).\n * @public @preview\n * @extensions\n */\nexport interface ElementLoadOptions {\n /** if true, only load the members of [[ElementProps]], and no members from subclasses */\n onlyBaseProperties?: boolean;\n /** If true, include the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\n * Geometry streams can consist of many megabytes worth of JSON, so they are omitted by default.\n */\n wantGeometry?: boolean;\n /** When including a geometry stream containing brep entries, whether to return the raw brep data or proxy geometry, false when undefined */\n /** If true, include [[BRepEntity.DataProps.data]] in the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\n * The data is a potentially large base-64-encoded opaque binary blob that cannot be directly inspected or manipulated on the frontend, so it is omitted by default.\n */\n wantBRepData?: boolean;\n /** Options controlling which properties of [[DisplayStyleProps]] to include or exclude. */\n displayStyle?: DisplayStyleLoadProps;\n /** Options controlling which properties of [[RenderTimelineProps]] to include or exclude. */\n renderTimeline?: RenderTimelineLoadProps;\n}\n\n/** Parameters to specify what element to load for functions like [IModelDb.Elements.getElementProps]($backend).\n * @public @preview\n * @extensions\n */\nexport interface ElementLoadProps extends ElementLoadOptions {\n id?: Id64String;\n /** The properties of the Code of the element to load.\n * @note the Value member is required even though it is not declared so here. If no value is supplied, no element will ever be loaded.\n * TODO: change to Required<CodeProps> in Version 4.0\n */\n code?: CodeProps;\n federationGuid?: GuidString;\n}\n\n/** Properties of an [ElementAspect]($backend)\n * @public @preview\n * @extensions\n */\nexport interface ElementAspectProps extends EntityProps {\n element: RelatedElementProps;\n}\n\n/** Properties of an [ExternalSourceAspect]($backend) that stores synchronization information for an element originating from an external source.\n * @public @preview\n * @extensions\n */\nexport interface ExternalSourceAspectProps extends ElementAspectProps {\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\n */\n scope: RelatedElementProps;\n /** The identifier of the object in the source repository. */\n identifier: string;\n /** The kind of object within the source repository. */\n kind: string;\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\n * If present, this value must be guaranteed to change when any of the source object's content changes.\n */\n version?: string;\n /** The optional cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\n checksum?: string;\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\n * @note Warning: if defined, jsonProperties must be a *string*, specifically a valid JSON string.\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\n */\n jsonProperties?: any;\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\n source?: RelatedElementProps;\n}\n\n/** Properties of an [ExternalSource]($backend)\n * @beta\n */\nexport interface ExternalSourceProps extends ElementProps {\n repository?: RelatedElementProps;\n connectorName?: string;\n connectorVersion?: string;\n}\n\n/** The role that an attached [ExternalSource]($backend) plays.\n * @beta\n */\nexport enum ExternalSourceAttachmentRole {\n /** The attached [ExternalSource]($backend) provides context. */\n SpecifyContext = 0,\n /** The attached [ExternalSource]($backend) models a part of the whole. */\n SpecifyPart = 1,\n}\n\n/** Properties of an [ExternalSourceAttachment]($backend)\n * @beta\n */\nexport interface ExternalSourceAttachmentProps extends ElementProps {\n attaches?: RelatedElementProps;\n role?: ExternalSourceAttachmentRole;\n translation?: XYZProps;\n yaw?: number;\n pitch?: number;\n roll?: number;\n scale?: XYZProps;\n}\n\n/** Properties of an [ChannelRootAspect]($backend) that identifies an Element as the root of a *channel* which is a subset of the overall iModel hierarchy that is independently maintained.\n * @public @preview\n * @extensions\n */\nexport interface ChannelRootAspectProps extends ElementAspectProps {\n /** The owner of the channel */\n owner: string;\n}\n\n/** Properties of a [LineStyle]($backend)\n * @public @preview\n * @extensions\n */\nexport interface LineStyleProps extends DefinitionElementProps {\n description?: string;\n /** The JSON string line style definition element data [LineStyleDefinition.StyleProps]($backend) */\n data: string;\n}\n\n/** Properties of a [LightLocation]($backend)\n * @internal\n */\nexport interface LightLocationProps extends GeometricElement3dProps {\n enabled?: boolean;\n}\n\n/** The *rank* for a Category\n * @public @preview\n * @extensions\n */\nexport enum Rank {\n /** This category is predefined by the system */\n System = 0,\n /** This category is defined by a schema. Elements in this category are not recognized by system classes. */\n Domain = 1,\n /** This category is defined by an application. Elements in this category are not recognized by system and schema classes. */\n Application = 2,\n /** This category is defined by a user. Elements in this category are not recognized by system, schema, and application classes. */\n User = 3,\n}\n\n/** Parameters of a [Category]($backend)\n * @public @preview\n * @extensions\n */\nexport interface CategoryProps extends DefinitionElementProps {\n rank?: Rank;\n description?: string;\n}\n\n/** Parameters of a [SubCategory]($backend)\n * @public @preview\n * @extensions\n */\nexport interface SubCategoryProps extends DefinitionElementProps {\n appearance?: SubCategoryAppearance.Props;\n description?: string;\n}\n\n/** Parameters of a [UrlLink]($backend)\n * @public @preview\n * @extensions\n */\nexport interface UrlLinkProps extends ElementProps {\n description?: string;\n url?: string;\n}\n\n/** Parameters of a [RepositoryLink]($backend)\n * @public @preview\n * @extensions\n */\nexport interface RepositoryLinkProps extends UrlLinkProps {\n repositoryGuid?: GuidString;\n format?: string;\n}\n\n/** The properties of a [SynchronizationConfigLink]($backend)\n * @beta\n */\nexport interface SynchronizationConfigLinkProps extends UrlLinkProps {\n lastSuccessfulRun?: string;\n}\n\n/** Wire format describing a [RenderTimeline]($backend).\n * @public @preview\n * @extensions\n */\nexport interface RenderTimelineProps extends ElementProps {\n /** An optional human-readable description of the timeline. */\n description?: string;\n /** The stringified JSON representation of the instructions for visualizing change over time.\n * @see [[RenderSchedule.ScriptProps]] for the JSON interface.\n */\n script: string;\n}\n\n/** Properties of a [SheetIndexEntry]($backend).\n * @beta\n*/\nexport interface SheetIndexEntryProps extends ElementProps {\n /** Can be used to prioritize or order members within a SheetIndex or SheetIndexFolder. */\n entryPriority: number;\n}\n\n/** Properties of a [SheetIndexFolder]($backend)\n * @beta\n */\nexport type SheetIndexFolderProps = SheetIndexEntryProps;\n\n/** Properties of a [SheetIndexReference]($backend)\n * @beta\n */\nexport interface SheetIndexReferenceProps extends SheetIndexEntryProps {\n /** The bis:SheetIndex that this bis:SheetIndexReference is pointing to. */\n sheetIndex?: RelatedElementProps;\n}\n\n/** Properties of a [SheetReference]($backend)\n * @beta\n */\nexport interface SheetReferenceProps extends SheetIndexEntryProps {\n /** The bis:Sheet that this bis:SheetReference is pointing to. */\n sheet?: RelatedElementProps;\n}\n\n/** Properties that define an [AnnotationTextStyle]($backend).\n * @beta\n */\nexport interface AnnotationTextStyleProps extends DefinitionElementProps {\n /** An optional human-readable description of the text style.*/\n description?: string;\n /** The stringified versioned JSON representation of the text style.\n * @see [[VersionedJSON]] for the JSON representation.\n * @see [[TextStyleSettingsProps]] for the data model.\n */\n settings?: string;\n}\n\n/** A string in the format `read.write.minor` where the semantics match those of [ECVersion]($ecschema-metadata).\n * @beta\n */\nexport type ECVersionString = `${string}.${string}.${string}`\n\n/** Wrapper for versioned JSON data.\n * @beta\n */\nexport interface VersionedJSON<T> {\n /** The semver version of the JSON data.\n * Uses the same semantics as [ECVersion]($ecschema-metadata).\n */\n version: ECVersionString;\n /** The JSON data. */\n data: T;\n}\n\n/** Project-level properties hosted by a [ProjectInformationRecord]($backend) element.\n * @beta\n */\nexport interface ProjectInformation {\n /** A name that uniquely identifies this project within an organization. */\n projectNumber?: string;\n /** A human-readable display label for the project. Unlike [[projectNumber]], this needn't be unique. */\n projectName?: string;\n /** A human-readable description of the geographic location of the project - often, the name of a city or a street address. */\n location?: string;\n}\n\n/** JSON representation of a [ProjectInformationRecord]($backend).\n * @beta\n */\nexport type ProjectInformationRecordProps = ElementProps & ProjectInformation;\n\n/** Captures basic metadata about a [Sheet]($backend). This information is typically included in the Sheet's graphical representation, often\n * as part of its title block.\n * This information is stored in a [SheetInformationAspect]($backend).\n * @beta\n */\nexport interface SheetInformation {\n /** A user-supplied string describing who designed the sheet contents. */\n designedBy?: string;\n /** A user-supplied date describing when the sheet contents were designed. */\n designedDate?: Date;\n /** A user-supplied string describing who drew the sheet contents. */\n drawnBy?: string;\n /** A user-supplied string describing who verified the sheet contents. */\n checkedBy?: string;\n}\n\n/** JSON representation of a [[SheetInformation]].\n * @beta\n */\nexport interface SheetInformationProps {\n /** A user-supplied string describing who designed the sheet contents. */\n designedBy?: string;\n /** The [ISO string representation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) of a user-supplied date describing when the sheet contents were designed. */\n designedDate?: string;\n /** A user-supplied string describing who drew the sheet contents. */\n drawnBy?: string;\n /** A user-supplied string describing who verified the sheet contents. */\n checkedBy?: string;\n}\n\n/** JSON representation of a [SheetInformationAspect]($backend).\n * @beta\n */\nexport type SheetInformationAspectProps = ElementAspectProps & SheetInformationProps;\n"]}
|
|
1
|
+
{"version":3,"file":"ElementProps.js","sourceRoot":"","sources":["../../src/ElementProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA2IH,gDAEC;AAKD,gDAEC;AAlJD,sDAAiF;AAQjF,+CAA4C;AAoC5C;;GAEG;AACH,MAAa,cAAc;IACzB,8DAA8D;IAC9C,EAAE,CAAa;IAE/B,oDAAoD;IACpC,YAAY,CAAU;IAEtC,YAAY,KAA0B;QACpC,IAAI,CAAC,EAAE,GAAG,mBAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IACzC,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAA0B;QAC/C,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrD,CAAC;IAED,8DAA8D;IACvD,MAAM,CAAU,IAAI,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,EAAE,mBAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAEvE,mJAAmJ;IAC5I,MAAM,CAAC,UAAU,CAAC,IAAS;QAChC,IAAI,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;YACjD,MAAM,CAAC,GAAG,cAAc,CAAC,QAAQ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*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Entities\r\n */\r\n\r\nimport { GuidString, Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n AngleProps, ClipVectorProps, LowAndHighXYProps, LowAndHighXYZProps, TransformProps, XYProps, XYZProps, YawPitchRollProps,\r\n} from \"@itwin/core-geometry\";\r\nimport { CodeProps } from \"./Code\";\r\nimport { EntityProps } from \"./EntityProps\";\r\nimport { ElementGeometryBuilderParams, ElementGeometryBuilderParamsForPart } from \"./geometry/ElementGeometry\";\r\nimport { GeometryStreamProps } from \"./geometry/GeometryStream\";\r\nimport { IModelError } from \"./IModelError\";\r\nimport { SubCategoryAppearance } from \"./SubCategoryAppearance\";\r\n\r\n/** Properties of a NavigationProperty.\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface RelatedElementProps {\r\n /** The Id of the element to which this element is related. */\r\n id: Id64String;\r\n /** The full className of the relationship class. */\r\n relClassName?: string;\r\n}\r\n\r\n/** Properties of an [Element]($docs/bis/guide/fundamentals/element-fundamentals)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface ElementProps extends EntityProps {\r\n /** The Id of the [Model]($docs/bis/guide/fundamentals/model-fundamentals.md) containing this element */\r\n model: Id64String;\r\n /** The [Code]($docs/bis/guide/fundamentals/codes.md) for this element */\r\n code: CodeProps;\r\n /** The Parent of this element, if defined. */\r\n parent?: RelatedElementProps;\r\n /** A [FederationGuid]($docs/bis/guide/fundamentals/element-fundamentals.md#federationguid) assigned to this element.\r\n * @note On insert, if this is a valid Guid, the value is preserved. If it is `undefined`, a new Guid is created. If it is an invalid Guid (e.g. Guid.empty), the\r\n * resultant element will have a `null` federationGuid. For update, `undefined` means \"don't change.\"\r\n */\r\n federationGuid?: GuidString;\r\n /** A [user-assigned label]($docs/bis/guide/fundamentals/element-fundamentals.md#userlabel) for this element. */\r\n userLabel?: string;\r\n /** Optional [json properties]($docs/bis/guide/fundamentals/element-fundamentals.md#jsonproperties) of this element. */\r\n jsonProperties?: any;\r\n}\r\n\r\n/** The Id and relationship class of an Element that is somehow related to another Element\r\n * @public @preview\r\n */\r\nexport class RelatedElement implements RelatedElementProps {\r\n /** The Id of the element to which this element is related. */\r\n public readonly id: Id64String;\r\n\r\n /** The full className of the relationship class. */\r\n public readonly relClassName?: string;\r\n\r\n constructor(props: RelatedElementProps) {\r\n this.id = Id64.fromJSON(props.id);\r\n this.relClassName = props.relClassName;\r\n }\r\n\r\n public static fromJSON(json?: RelatedElementProps): RelatedElement | undefined {\r\n return json ? new RelatedElement(json) : undefined;\r\n }\r\n\r\n /** Used to *null out* an existing navigation relationship. */\r\n public static readonly none = new RelatedElement({ id: Id64.invalid });\r\n\r\n /** Accept the value of a navigation property that might be in the shortened format of just an id or might be in the full RelatedElement format. */\r\n public static idFromJson(json: any): Id64String {\r\n if ((typeof json === \"object\") && (\"id\" in json)) {\r\n const r = RelatedElement.fromJSON(json);\r\n if (r === undefined)\r\n throw new IModelError(IModelStatus.BadArg, \"Problem parsing Id64 from json\");\r\n return r.id;\r\n }\r\n return Id64.fromJSON(json);\r\n }\r\n\r\n public toJSON(): RelatedElementProps {\r\n return {\r\n id: this.id,\r\n relClassName: this.relClassName,\r\n };\r\n }\r\n}\r\n\r\n/** A [RelatedElement]($common) relationship that describes the [TypeDefinitionElement]($backend) of an element.\r\n * @public @preview\r\n */\r\nexport class TypeDefinition extends RelatedElement {\r\n}\r\n\r\n/** Properties of a [GeometricElement]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface GeometricElementProps extends ElementProps {\r\n /** The id of the category for this geometric element. */\r\n category: Id64String;\r\n /** The geometry stream properties */\r\n geom?: GeometryStreamProps;\r\n /** Describes how to build the element's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\r\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent element.\r\n */\r\n elementGeometryBuilderParams?: ElementGeometryBuilderParams;\r\n /** The placement properties */\r\n placement?: PlacementProps;\r\n}\r\n\r\n/** Properties of a [[Placement3d]]\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface Placement3dProps {\r\n origin: XYZProps;\r\n angles: YawPitchRollProps;\r\n bbox?: LowAndHighXYZProps;\r\n}\r\n\r\n/** Properties of a [[Placement2d]]\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface Placement2dProps {\r\n origin: XYProps;\r\n angle: AngleProps;\r\n bbox?: LowAndHighXYProps;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport type PlacementProps = Placement2dProps | Placement3dProps;\r\n\r\n/** determine if this is Placement2dProps\r\n * @public @preview\r\n */\r\nexport function isPlacement2dProps(props: PlacementProps): props is Placement2dProps {\r\n return (props as Placement2dProps).angle !== undefined;\r\n}\r\n\r\n/** determine if this is Placement3dProps\r\n * @public @preview\r\n */\r\nexport function isPlacement3dProps(props: PlacementProps): props is Placement3dProps {\r\n return !isPlacement2dProps(props);\r\n}\r\n\r\n/** Properties that define a [GeometricElement3d]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface GeometricElement3dProps extends GeometricElementProps {\r\n placement?: Placement3dProps;\r\n typeDefinition?: RelatedElementProps;\r\n}\r\n\r\n/** JSON representation of a [TextAnnotation3d]($backend).\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface TextAnnotation3dProps extends GeometricElement3dProps {\r\n /** The stringified versioned JSON representation of the text annotation.\r\n * @see [[VersionedJSON]] for the JSON representation.\r\n * @see [[TextAnnotationProps]] for the data model.\r\n * @note Don't set this property directly - use [TextAnnotation3d.setAnnotation]($backend) instead.\r\n */\r\n textAnnotationData?: string;\r\n /** The default [AnnotationTextStyle]($backend) element used by the text annotation.\r\n * @beta\r\n */\r\n defaultTextStyle?: RelatedElementProps;\r\n}\r\n\r\n/** Properties that define a [PhysicalElement]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface PhysicalElementProps extends GeometricElement3dProps {\r\n physicalMaterial?: RelatedElementProps;\r\n}\r\n\r\n/** An enumeration of the different types of [SectionDrawing]($backend)s.\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport enum SectionType {\r\n Section = 3,\r\n Detail = 4,\r\n Elevation = 5,\r\n Plan = 6,\r\n}\r\n\r\n/** Properties that define a [Drawing]($backend).\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface DrawingProps extends ElementProps {\r\n /** A factor used by tools to adjust the size of text in [GeometricElement2d]($backend)s in the associated [DrawingModel]($backend) and to compute the\r\n * size of the [ViewAttachment]($backend) created when attaching the [Drawing]($backend) to a [Sheet]($backend).\r\n * Default: 1.\r\n * @note The scale factor **must** be greater than zero.\r\n * @public @preview\r\n */\r\n scaleFactor?: number;\r\n}\r\n\r\n/** Properties that define a [SectionDrawing]($backend).\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface SectionDrawingProps extends DrawingProps {\r\n /** The type of section used to generate the drawing. Default: Section. */\r\n sectionType?: SectionType;\r\n /** The spatial view from which the section was generated. */\r\n spatialView?: RelatedElementProps;\r\n jsonProperties?: {\r\n /** A transform from the section drawing model's coordinates to spatial coordinates. */\r\n drawingToSpatialTransform?: TransformProps;\r\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), a transform from the sheet's coordinates to spatial coordinates. */\r\n sheetToSpatialTransform?: TransformProps;\r\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), JSON representation of a [ClipVector]($geometry) to apply to\r\n * the sheet graphics when drawn in the context of the spatial view.\r\n * The ClipVector is in spatial coordinates.\r\n */\r\n drawingBoundaryClip?: ClipVectorProps;\r\n /** If true, when displaying the section drawing as a [DrawingViewState]($frontend), the [[spatialView]] will also be displayed. */\r\n displaySpatialView?: true;\r\n };\r\n}\r\n\r\n/** Properties that define a [SectionDrawingLocation]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface SectionDrawingLocationProps extends GeometricElement3dProps {\r\n /** The [ViewDefinition]($backend) to which this location refers. */\r\n sectionView?: RelatedElementProps;\r\n}\r\n\r\n/** Properties that define a [GeometricElement2d]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface GeometricElement2dProps extends GeometricElementProps {\r\n placement?: Placement2dProps;\r\n typeDefinition?: RelatedElementProps;\r\n}\r\n\r\n/** Properties that define a [TextAnnotation2d]($backend).\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface TextAnnotation2dProps extends GeometricElement2dProps {\r\n /** The stringified versioned JSON representation of the text annotation.\r\n * @see [[VersionedJSON]] for the JSON representation.\r\n * @see [[TextAnnotationProps]] for the data model.\r\n * @note Don't set this property directly - use [TextAnnotation2d.setAnnotation]($backend) instead.\r\n */\r\n textAnnotationData?: string;\r\n /** The default [AnnotationTextStyle]($backend) element used by the text annotation.\r\n * @beta\r\n */\r\n defaultTextStyle?: RelatedElementProps;\r\n}\r\n\r\n/** Properties of a [GeometryPart]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface GeometryPartProps extends ElementProps {\r\n geom?: GeometryStreamProps;\r\n /** Describes how to build the part's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\r\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent part.\r\n */\r\n elementGeometryBuilderParams?: ElementGeometryBuilderParamsForPart;\r\n bbox?: LowAndHighXYZProps;\r\n}\r\n\r\n/** Properties for a [ViewAttachment]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface ViewAttachmentProps extends GeometricElement2dProps {\r\n view: RelatedElementProps;\r\n jsonProperties?: {\r\n /** Integer priority in [-500,500]. Where two attachments overlap, the one with the higher priority draws in front of the other. Default: 0. */\r\n displayPriority?: number;\r\n /** JSON representation of a [ClipVector]($core-geometry] in sheet coordinate space, used to clip the attachment's graphics on the sheet. */\r\n clip?: ClipVectorProps;\r\n /** Options for customizing how the view attachment is displayed on the sheet. */\r\n displayOptions?: {\r\n /** If true, the view attachment is always drawn as a raster image. By default, only 3d perspective views are drawn this way (they always *must* be). Default: false. */\r\n drawAsRaster?: boolean;\r\n /** If true, and the view attachment is drawn as a raster image, the background color of the view will be preserved. By default the background color of the\r\n * sheet is used and any background pixels become transparent, allowing the contents of the sheet to show through. Default: false.\r\n */\r\n preserveBackground?: boolean;\r\n };\r\n };\r\n}\r\n\r\n/** Properties of a [Subject]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface SubjectProps extends ElementProps {\r\n description?: string;\r\n}\r\n\r\n/** Properties of a [SheetBorderTemplate]($backend)\r\n * @beta\r\n */\r\nexport interface SheetBorderTemplateProps extends ElementProps {\r\n height?: number;\r\n width?: number;\r\n}\r\n\r\n/** Properties of a [SheetTemplate]($backend)\r\n * @beta\r\n */\r\nexport interface SheetTemplateProps extends ElementProps {\r\n height?: number;\r\n width?: number;\r\n border?: Id64String;\r\n}\r\n\r\n/** Properties of a [Sheet]($backend).\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface SheetProps extends ElementProps {\r\n width?: number;\r\n height?: number;\r\n scale?: number;\r\n sheetTemplate?: Id64String;\r\n attachments?: Id64String[];\r\n}\r\n\r\n/** Properties of a [DefinitionElement]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface DefinitionElementProps extends ElementProps {\r\n isPrivate?: boolean;\r\n}\r\n\r\n/** Properties of a [TypeDefinitionElement]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface TypeDefinitionElementProps extends DefinitionElementProps {\r\n recipe?: RelatedElementProps;\r\n}\r\n\r\n/** Properties of a [PhysicalType]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface PhysicalTypeProps extends TypeDefinitionElementProps {\r\n /** The [PhysicalMaterial]($backend) that makes up this physical type. */\r\n physicalMaterial?: RelatedElementProps;\r\n}\r\n\r\n/** Properties of a [InformationPartitionElement]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface InformationPartitionElementProps extends ElementProps {\r\n description?: string;\r\n}\r\n\r\n/** Options controlling which properties are included or excluded when querying [[DisplayStyleProps]].\r\n * @see [[ViewStateLoadProps]] and [[ElementLoadOptions]].\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface DisplayStyleLoadProps {\r\n /** If true, the lists of element Ids in the display style's schedule script will be empty.\r\n * The element Ids are not required on the frontend for display and can be quite large.\r\n */\r\n omitScheduleScriptElementIds?: boolean;\r\n /** If true, [[DisplayStyleSettingsProps.excludedElements]] will be compressed into a single compact string; otherwise they will be expanded into an array of strings.\r\n * The number of Ids may be quite large, so the compressed format is preferred, especially when communicating between the backend and frontend.\r\n */\r\n compressExcludedElementIds?: boolean;\r\n}\r\n\r\n/** Options controlling which properties are included or excluded when querying [[RenderTimelineProps]].\r\n * @see [[ElementLoadOptions.renderTimeline]].\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface RenderTimelineLoadProps {\r\n /** If true, the lists of element Ids in the schedule script will be empty.\r\n * The element Ids can be extremely numerous and are not required on the frontend for display, so they are omitted by default by [DisplayStyleState.load]($frontend).\r\n */\r\n omitScriptElementIds?: boolean;\r\n}\r\n\r\n/** Options used to specify properties to include or exclude when querying [[ElementProps]] with functions like\r\n * [IModelDb.Elements.getElementProps]($backend) and [IModelConnection.Elements.loadProps]($frontend).\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface ElementLoadOptions {\r\n /** if true, only load the members of [[ElementProps]], and no members from subclasses */\r\n onlyBaseProperties?: boolean;\r\n /** If true, include the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\r\n * Geometry streams can consist of many megabytes worth of JSON, so they are omitted by default.\r\n */\r\n wantGeometry?: boolean;\r\n /** When including a geometry stream containing brep entries, whether to return the raw brep data or proxy geometry, false when undefined */\r\n /** If true, include [[BRepEntity.DataProps.data]] in the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\r\n * The data is a potentially large base-64-encoded opaque binary blob that cannot be directly inspected or manipulated on the frontend, so it is omitted by default.\r\n */\r\n wantBRepData?: boolean;\r\n /** Options controlling which properties of [[DisplayStyleProps]] to include or exclude. */\r\n displayStyle?: DisplayStyleLoadProps;\r\n /** Options controlling which properties of [[RenderTimelineProps]] to include or exclude. */\r\n renderTimeline?: RenderTimelineLoadProps;\r\n}\r\n\r\n/** Parameters to specify what element to load for functions like [IModelDb.Elements.getElementProps]($backend).\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface ElementLoadProps extends ElementLoadOptions {\r\n id?: Id64String;\r\n /** The properties of the Code of the element to load.\r\n * @note the Value member is required even though it is not declared so here. If no value is supplied, no element will ever be loaded.\r\n * TODO: change to Required<CodeProps> in Version 4.0\r\n */\r\n code?: CodeProps;\r\n federationGuid?: GuidString;\r\n}\r\n\r\n/** Properties of an [ElementAspect]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface ElementAspectProps extends EntityProps {\r\n element: RelatedElementProps;\r\n}\r\n\r\n/** Properties of an [ExternalSourceAspect]($backend) that stores synchronization information for an element originating from an external source.\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface ExternalSourceAspectProps extends ElementAspectProps {\r\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\r\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\r\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\r\n */\r\n scope: RelatedElementProps;\r\n /** The identifier of the object in the source repository. */\r\n identifier: string;\r\n /** The kind of object within the source repository. */\r\n kind: string;\r\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\r\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\r\n * If present, this value must be guaranteed to change when any of the source object's content changes.\r\n */\r\n version?: string;\r\n /** The optional cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\r\n checksum?: string;\r\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\r\n * @note Warning: if defined, jsonProperties must be a *string*, specifically a valid JSON string.\r\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\r\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\r\n */\r\n jsonProperties?: any;\r\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\r\n source?: RelatedElementProps;\r\n}\r\n\r\n/** Properties of an [ExternalSource]($backend)\r\n * @beta\r\n */\r\nexport interface ExternalSourceProps extends ElementProps {\r\n repository?: RelatedElementProps;\r\n connectorName?: string;\r\n connectorVersion?: string;\r\n}\r\n\r\n/** The role that an attached [ExternalSource]($backend) plays.\r\n * @beta\r\n */\r\nexport enum ExternalSourceAttachmentRole {\r\n /** The attached [ExternalSource]($backend) provides context. */\r\n SpecifyContext = 0,\r\n /** The attached [ExternalSource]($backend) models a part of the whole. */\r\n SpecifyPart = 1,\r\n}\r\n\r\n/** Properties of an [ExternalSourceAttachment]($backend)\r\n * @beta\r\n */\r\nexport interface ExternalSourceAttachmentProps extends ElementProps {\r\n attaches?: RelatedElementProps;\r\n role?: ExternalSourceAttachmentRole;\r\n translation?: XYZProps;\r\n yaw?: number;\r\n pitch?: number;\r\n roll?: number;\r\n scale?: XYZProps;\r\n}\r\n\r\n/** Properties of an [ChannelRootAspect]($backend) that identifies an Element as the root of a *channel* which is a subset of the overall iModel hierarchy that is independently maintained.\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface ChannelRootAspectProps extends ElementAspectProps {\r\n /** The owner of the channel */\r\n owner: string;\r\n}\r\n\r\n/** Properties of a [LineStyle]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface LineStyleProps extends DefinitionElementProps {\r\n description?: string;\r\n /** The JSON string line style definition element data [LineStyleDefinition.StyleProps]($backend) */\r\n data: string;\r\n}\r\n\r\n/** Properties of a [LightLocation]($backend)\r\n * @internal\r\n */\r\nexport interface LightLocationProps extends GeometricElement3dProps {\r\n enabled?: boolean;\r\n}\r\n\r\n/** The *rank* for a Category\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport enum Rank {\r\n /** This category is predefined by the system */\r\n System = 0,\r\n /** This category is defined by a schema. Elements in this category are not recognized by system classes. */\r\n Domain = 1,\r\n /** This category is defined by an application. Elements in this category are not recognized by system and schema classes. */\r\n Application = 2,\r\n /** This category is defined by a user. Elements in this category are not recognized by system, schema, and application classes. */\r\n User = 3,\r\n}\r\n\r\n/** Parameters of a [Category]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface CategoryProps extends DefinitionElementProps {\r\n rank?: Rank;\r\n description?: string;\r\n}\r\n\r\n/** Parameters of a [SubCategory]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface SubCategoryProps extends DefinitionElementProps {\r\n appearance?: SubCategoryAppearance.Props;\r\n description?: string;\r\n}\r\n\r\n/** Parameters of a [UrlLink]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface UrlLinkProps extends ElementProps {\r\n description?: string;\r\n url?: string;\r\n}\r\n\r\n/** Parameters of a [RepositoryLink]($backend)\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface RepositoryLinkProps extends UrlLinkProps {\r\n repositoryGuid?: GuidString;\r\n format?: string;\r\n}\r\n\r\n/** The properties of a [SynchronizationConfigLink]($backend)\r\n * @beta\r\n */\r\nexport interface SynchronizationConfigLinkProps extends UrlLinkProps {\r\n lastSuccessfulRun?: string;\r\n}\r\n\r\n/** Wire format describing a [RenderTimeline]($backend).\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface RenderTimelineProps extends ElementProps {\r\n /** An optional human-readable description of the timeline. */\r\n description?: string;\r\n /** The stringified JSON representation of the instructions for visualizing change over time.\r\n * @see [[RenderSchedule.ScriptProps]] for the JSON interface.\r\n */\r\n script: string;\r\n}\r\n\r\n/** Properties of a [SheetIndexEntry]($backend).\r\n * @beta\r\n*/\r\nexport interface SheetIndexEntryProps extends ElementProps {\r\n /** Can be used to prioritize or order members within a SheetIndex or SheetIndexFolder. */\r\n entryPriority: number;\r\n}\r\n\r\n/** Properties of a [SheetIndexFolder]($backend)\r\n * @beta\r\n */\r\nexport type SheetIndexFolderProps = SheetIndexEntryProps;\r\n\r\n/** Properties of a [SheetIndexReference]($backend)\r\n * @beta\r\n */\r\nexport interface SheetIndexReferenceProps extends SheetIndexEntryProps {\r\n /** The bis:SheetIndex that this bis:SheetIndexReference is pointing to. */\r\n sheetIndex?: RelatedElementProps;\r\n}\r\n\r\n/** Properties of a [SheetReference]($backend)\r\n * @beta\r\n */\r\nexport interface SheetReferenceProps extends SheetIndexEntryProps {\r\n /** The bis:Sheet that this bis:SheetReference is pointing to. */\r\n sheet?: RelatedElementProps;\r\n}\r\n\r\n/** Properties that define an [AnnotationTextStyle]($backend).\r\n * @beta\r\n */\r\nexport interface AnnotationTextStyleProps extends DefinitionElementProps {\r\n /** An optional human-readable description of the text style.*/\r\n description?: string;\r\n /** The stringified versioned JSON representation of the text style.\r\n * @see [[VersionedJSON]] for the JSON representation.\r\n * @see [[TextStyleSettingsProps]] for the data model.\r\n */\r\n settings?: string;\r\n}\r\n\r\n/** A string in the format `read.write.minor` where the semantics match those of [ECVersion]($ecschema-metadata).\r\n * @beta\r\n */\r\nexport type ECVersionString = `${string}.${string}.${string}`\r\n\r\n/** Wrapper for versioned JSON data.\r\n * @beta\r\n */\r\nexport interface VersionedJSON<T> {\r\n /** The semver version of the JSON data.\r\n * Uses the same semantics as [ECVersion]($ecschema-metadata).\r\n */\r\n version: ECVersionString;\r\n /** The JSON data. */\r\n data: T;\r\n}\r\n\r\n/** Project-level properties hosted by a [ProjectInformationRecord]($backend) element.\r\n * @beta\r\n */\r\nexport interface ProjectInformation {\r\n /** A name that uniquely identifies this project within an organization. */\r\n projectNumber?: string;\r\n /** A human-readable display label for the project. Unlike [[projectNumber]], this needn't be unique. */\r\n projectName?: string;\r\n /** A human-readable description of the geographic location of the project - often, the name of a city or a street address. */\r\n location?: string;\r\n}\r\n\r\n/** JSON representation of a [ProjectInformationRecord]($backend).\r\n * @beta\r\n */\r\nexport type ProjectInformationRecordProps = ElementProps & ProjectInformation;\r\n\r\n/** Captures basic metadata about a [Sheet]($backend). This information is typically included in the Sheet's graphical representation, often\r\n * as part of its title block.\r\n * This information is stored in a [SheetInformationAspect]($backend).\r\n * @beta\r\n */\r\nexport interface SheetInformation {\r\n /** A user-supplied string describing who designed the sheet contents. */\r\n designedBy?: string;\r\n /** A user-supplied date describing when the sheet contents were designed. */\r\n designedDate?: Date;\r\n /** A user-supplied string describing who drew the sheet contents. */\r\n drawnBy?: string;\r\n /** A user-supplied string describing who verified the sheet contents. */\r\n checkedBy?: string;\r\n}\r\n\r\n/** JSON representation of a [[SheetInformation]].\r\n * @beta\r\n */\r\nexport interface SheetInformationProps {\r\n /** A user-supplied string describing who designed the sheet contents. */\r\n designedBy?: string;\r\n /** The [ISO string representation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) of a user-supplied date describing when the sheet contents were designed. */\r\n designedDate?: string;\r\n /** A user-supplied string describing who drew the sheet contents. */\r\n drawnBy?: string;\r\n /** A user-supplied string describing who verified the sheet contents. */\r\n checkedBy?: string;\r\n}\r\n\r\n/** JSON representation of a [SheetInformationAspect]($backend).\r\n * @beta\r\n */\r\nexport type SheetInformationAspectProps = ElementAspectProps & SheetInformationProps;\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmphasizeElementsProps.js","sourceRoot":"","sources":["../../src/EmphasizeElementsProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAMH;;;;;GAKG;AACH,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,2BAA2B;IAC3B,uEAAS,CAAA;IACT,2BAA2B;IAC3B,uEAAS,CAAA;IACT,qCAAqC;IACrC,+EAAa,CAAA;AACf,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B","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 { Id64Array } from \"@itwin/core-bentley\";\nimport { ColorDefProps } from \"./ColorDef\";\nimport { FeatureAppearanceProps } from \"./FeatureSymbology\";\n\n/** Options for overriding element appearance.\n * @see [EmphasizeElements]($frontend)\n * @see [[AppearanceOverrideProps]]\n * @public\n * @extensions\n */\nexport enum FeatureOverrideType {\n /** Override color only. */\n ColorOnly,\n /** Override alpha only. */\n AlphaOnly,\n /** Override both color and alpha. */\n ColorAndAlpha,\n}\n\n/** JSON representation of an appearance override in an [[EmphasizeElementsProps]].\n * @see [EmphasizeElements]($frontend).\n * @public\n * @extensions\n */\nexport interface AppearanceOverrideProps {\n /** Whether to override color, transparency, or both. */\n overrideType?: FeatureOverrideType;\n /** The 0xTTBBGGRR format color/transparency value. */\n color?: ColorDefProps;\n /** The element IDs to display with the specified override. */\n ids?: Id64Array;\n}\n\n/** JSON representation of an [EmphasizeElements]($frontend).\n * @public\n * @extensions\n */\nexport interface EmphasizeElementsProps {\n /** See [EmphasizeElements.getNeverDrawnElements]($frontend) */\n neverDrawn?: Id64Array;\n /** See [EmphasizeElements.getAlwaysDrawnElements]($frontend) */\n alwaysDrawn?: Id64Array;\n /** See [EmphasizeElements.getIsolatedElements]($frontend) */\n isAlwaysDrawnExclusive?: boolean;\n /** See [EmphasizeElements.getEmphasizedIsolatedElements]($frontend) */\n alwaysDrawnExclusiveEmphasized?: Id64Array;\n /** See [EmphasizeElements.defaultAppearance]($frontend) */\n defaultAppearance?: FeatureAppearanceProps;\n /** See [EmphasizeElements.getOverriddenElementsByKey]($frontend) */\n appearanceOverride?: AppearanceOverrideProps[];\n /** See [EmphasizeElements.wantEmphasis]($frontend) */\n wantEmphasis?: boolean;\n /** See [EmphasizeElements.unanimatedAppearance]($frontend) */\n unanimatedAppearance?: FeatureAppearanceProps;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"EmphasizeElementsProps.js","sourceRoot":"","sources":["../../src/EmphasizeElementsProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAMH;;;;;GAKG;AACH,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,2BAA2B;IAC3B,uEAAS,CAAA;IACT,2BAA2B;IAC3B,uEAAS,CAAA;IACT,qCAAqC;IACrC,+EAAa,CAAA;AACf,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { Id64Array } from \"@itwin/core-bentley\";\r\nimport { ColorDefProps } from \"./ColorDef\";\r\nimport { FeatureAppearanceProps } from \"./FeatureSymbology\";\r\n\r\n/** Options for overriding element appearance.\r\n * @see [EmphasizeElements]($frontend)\r\n * @see [[AppearanceOverrideProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport enum FeatureOverrideType {\r\n /** Override color only. */\r\n ColorOnly,\r\n /** Override alpha only. */\r\n AlphaOnly,\r\n /** Override both color and alpha. */\r\n ColorAndAlpha,\r\n}\r\n\r\n/** JSON representation of an appearance override in an [[EmphasizeElementsProps]].\r\n * @see [EmphasizeElements]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AppearanceOverrideProps {\r\n /** Whether to override color, transparency, or both. */\r\n overrideType?: FeatureOverrideType;\r\n /** The 0xTTBBGGRR format color/transparency value. */\r\n color?: ColorDefProps;\r\n /** The element IDs to display with the specified override. */\r\n ids?: Id64Array;\r\n}\r\n\r\n/** JSON representation of an [EmphasizeElements]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface EmphasizeElementsProps {\r\n /** See [EmphasizeElements.getNeverDrawnElements]($frontend) */\r\n neverDrawn?: Id64Array;\r\n /** See [EmphasizeElements.getAlwaysDrawnElements]($frontend) */\r\n alwaysDrawn?: Id64Array;\r\n /** See [EmphasizeElements.getIsolatedElements]($frontend) */\r\n isAlwaysDrawnExclusive?: boolean;\r\n /** See [EmphasizeElements.getEmphasizedIsolatedElements]($frontend) */\r\n alwaysDrawnExclusiveEmphasized?: Id64Array;\r\n /** See [EmphasizeElements.defaultAppearance]($frontend) */\r\n defaultAppearance?: FeatureAppearanceProps;\r\n /** See [EmphasizeElements.getOverriddenElementsByKey]($frontend) */\r\n appearanceOverride?: AppearanceOverrideProps[];\r\n /** See [EmphasizeElements.wantEmphasis]($frontend) */\r\n wantEmphasis?: boolean;\r\n /** See [EmphasizeElements.unanimatedAppearance]($frontend) */\r\n unanimatedAppearance?: FeatureAppearanceProps;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityProps.js","sourceRoot":"","sources":["../../src/EntityProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AACvD,wDAAwD;AACxD,iDAAgD;AA6DhD;;GAEG;AACH,IAAY,iBAYX;AAZD,WAAY,iBAAiB;IAC3B,2EAAoB,CAAA;IACpB,+DAAc,CAAA;IACd,iEAAe,CAAA;IACf,mEAAgB,CAAA;IAChB,gEAAc,CAAA;IACd,kEAAe,CAAA;IACf,4DAAY,CAAA;IACZ,kEAAe,CAAA;IACf,kEAAe,CAAA;IACf,gEAAc,CAAA;IACd,sEAAiB,CAAA;AACnB,CAAC,EAZW,iBAAiB,iCAAjB,iBAAiB,QAY5B;AA4DD;;;GAGG;AACH,4DAA4D;AAC5D,MAAa,gBAAgB;IACpB,aAAa,CAAqB;IAClC,UAAU,CA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AG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QAErB,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,mCAAmC;YAC9E,4DAA4D;YAC5D,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjF,CAAC;IACH,CAAC;CACF;AAjCD,wCAiCC","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 Entities\n */\n\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\nimport { RelatedElement } from \"./ElementProps\";\n\n/** The persistent format of an [Entity]($backend), also used as the \"wire format\" when transmitting information about entities\n * between the backend and frontend.\n * EntityProps and all of its sub-types like [[ElementProps]] are \"plain old Javascript objects\" - that is, objects containing\n * no methods and no properties of `class` type.\n * @public @preview\n * @extensions\n */\nexport interface EntityProps {\n /** A non-existent property used to discriminate between [[EntityProps]] and [Entity]($backend).\n * @see [Entity.isInstanceOfEntity]($backend).\n */\n readonly isInstanceOfEntity?: never;\n /** The full name of the [ECClass]($docs/bis/guide/references/glossary/#ecclass) for this entity, in the form \"Schema:ClassName\" */\n classFullName: string;\n /** The Id of the entity. Must be present for SELECT, UPDATE, or DELETE, ignored for INSERT. */\n id?: Id64String;\n /** Optional [json properties]($docs/bis/guide/fundamentals/element-fundamentals.md#jsonproperties) of this Entity. */\n jsonProperties?: { [key: string]: any };\n}\n\n/** Specifies the source and target elements of a [[Relationship]] instance.\n * @public @preview\n * @extensions\n */\nexport interface SourceAndTarget {\n sourceId: Id64String;\n targetId: Id64String;\n}\n\n/** Properties that are common to all types of link table ECRelationships\n * @public @preview\n * @extensions\n */\nexport interface RelationshipProps extends EntityProps, SourceAndTarget {\n}\n\n/** Parameters for performing a query on [Entity]($backend) classes.\n * @public @preview\n * @extensions\n */\nexport interface EntityQueryParams {\n /** The sql className, in the form \"Schema.ClassName\", of the class to search. */\n from?: string;\n /** Set to true to limit results to *not* include sub-classes of \"from\" class */\n only?: boolean;\n /** Optional \"WHERE\" clause to filter entities. Note: do *not* include the \"WHERE\" keyword. */\n where?: string;\n /** Optional \"ORDERBY\" clause to sort results. Note: do *not* include the \"ORDERBY\" keyword. */\n orderBy?: string;\n /** Optional \"LIMIT\" clause to limit the number of rows returned. */\n limit?: number;\n /** Optional \"OFFSET\" clause. Only valid if Limit is also present. */\n offset?: number;\n /** Bindings for parameterized values.\n * @see [[ECSqlStatement.bindValues]]\n */\n bindings?: any[] | object;\n}\n\n/** The primitive types of an Entity property.\n * @beta\n */\nexport enum PrimitiveTypeCode {\n Uninitialized = 0x00,\n Binary = 0x101,\n Boolean = 0x201,\n DateTime = 0x301,\n Double = 0x401,\n Integer = 0x501,\n Long = 0x601,\n Point2d = 0x701, // eslint-disable-line @typescript-eslint/no-shadow\n Point3d = 0x801, // eslint-disable-line @typescript-eslint/no-shadow\n String = 0x901,\n IGeometry = 0xa01, // Used for Bentley.Geometry.Common.IGeometry types\n}\n\n/** A callback function to process properties of an Entity\n * @beta\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `PropertyHandler` from `@itwin/ecschema-metadata` instead.\n *\n * @example\n * ```typescript\n * // Current usage:\n * const callback: PropertyCallback = (name: string, propMetaData: PropertyMetaData) => {\n * console.log(`Property name: ${name}, Property type: ${propMetaData.primitiveType}`);\n * };\n *\n * // Replacement:\n * const callback: PropertyHandler = (propName: string, property: Property) => {\n * console.log(`Property name: ${propName}, Property type: ${property.propertyType}`);\n * };\n * ```\n */\nexport type PropertyCallback = (name: string, meta: PropertyMetaData) => void;\n\n/** A custom attribute instance\n * @beta\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `CustomAttribute` interface from `@itwin/ecschema-metadata` instead.\n */\nexport interface CustomAttribute {\n /** The class of the CustomAttribute */\n ecclass: string;\n /** An object whose properties correspond by name to the properties of this custom attribute instance. */\n properties: { [propName: string]: any };\n}\n\ntype FactoryFunc = (jsonObj: any) => any;\n\n/**\n * @beta\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `@itwin/ecschema-metadata` instead.\n */\nexport interface PropertyMetaDataProps {\n primitiveType?: number;\n structName?: string;\n extendedType?: string;\n description?: string;\n displayLabel?: string;\n minimumValue?: any;\n maximumValue?: any;\n minimumLength?: number;\n maximumLength?: number;\n readOnly?: boolean;\n kindOfQuantity?: string;\n isCustomHandled?: boolean;\n isCustomHandledOrphan?: boolean;\n minOccurs?: number;\n maxOccurs?: number;\n direction?: string;\n relationshipClass?: string;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n customAttributes?: CustomAttribute[];\n}\n\n/** Metadata for a property.\n * @beta\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the `Property` class from @itwin/ecschema-metadata` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class PropertyMetaData implements PropertyMetaDataProps {\n public primitiveType?: PrimitiveTypeCode;\n public structName?: string;\n public extendedType?: string;\n public description?: string;\n public displayLabel?: string;\n public minimumValue?: any;\n public maximumValue?: any;\n public minimumLength?: number;\n public maximumLength?: number;\n public readOnly?: boolean;\n public kindOfQuantity?: string;\n public isCustomHandled?: boolean;\n public isCustomHandledOrphan?: boolean;\n public minOccurs?: number;\n public maxOccurs?: number;\n public direction?: string;\n public relationshipClass?: string;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public customAttributes?: CustomAttribute[];\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public constructor(jsonObj: PropertyMetaDataProps) {\n this.primitiveType = jsonObj.primitiveType;\n if (jsonObj.structName)\n this.structName = jsonObj.structName;\n this.extendedType = jsonObj.extendedType;\n this.description = jsonObj.description;\n this.displayLabel = jsonObj.displayLabel;\n if (undefined !== jsonObj.minimumValue)\n this.minimumValue = jsonObj.minimumValue;\n if (undefined !== jsonObj.maximumValue)\n this.maximumValue = jsonObj.maximumValue;\n if (undefined !== jsonObj.minimumLength)\n this.minimumLength = jsonObj.minimumLength;\n if (undefined !== jsonObj.maximumLength)\n this.maximumLength = jsonObj.maximumLength;\n this.readOnly = jsonObj.readOnly;\n this.kindOfQuantity = jsonObj.kindOfQuantity;\n this.isCustomHandled = jsonObj.isCustomHandled;\n if (undefined !== jsonObj.minOccurs)\n this.minOccurs = jsonObj.minOccurs;\n if (undefined !== jsonObj.maxOccurs)\n this.maxOccurs = jsonObj.maxOccurs;\n this.direction = jsonObj.direction;\n this.relationshipClass = jsonObj.relationshipClass;\n this.customAttributes = jsonObj.customAttributes;\n }\n\n /** Create a typed value, or array of values, from a factory and an input object */\n private createValueOrArray(func: FactoryFunc, jsonObj: any) {\n if (undefined === this.minOccurs)\n return func(jsonObj); // not an array\n\n const val: any = [];\n jsonObj.forEach((element: any) => val.push(func(element)));\n return val;\n }\n\n /** construct a single property from an input object according to this metadata */\n public createProperty(jsonObj: any): any {\n if (jsonObj === undefined)\n return undefined;\n\n if (undefined !== this.primitiveType) {\n switch (this.primitiveType) {\n case PrimitiveTypeCode.Boolean:\n case PrimitiveTypeCode.Double:\n case PrimitiveTypeCode.Integer:\n case PrimitiveTypeCode.String:\n return jsonObj; // this works even for arrays or strings that are JSON because the parsed JSON is already the right type\n\n case PrimitiveTypeCode.Point2d:\n return this.createValueOrArray((obj) => Point2d.fromJSON(obj), jsonObj);\n\n case PrimitiveTypeCode.Point3d:\n return this.createValueOrArray((obj) => Point3d.fromJSON(obj), jsonObj);\n }\n }\n if (this.isNavigation)\n return jsonObj.id !== undefined ? new RelatedElement(jsonObj) : Id64.fromJSON(jsonObj);\n\n return jsonObj;\n }\n\n /** Return `true` if this property is a NavigationProperty. */\n public get isNavigation(): boolean {\n return (this.direction !== undefined); // the presence of `direction` means it is a navigation property\n }\n}\n\n/**\n * @beta\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `@itwin/ecschema-metadata` instead.\n */\nexport interface EntityMetaDataProps {\n classId: Id64String;\n ecclass: string;\n description?: string;\n modifier?: string;\n displayLabel?: string;\n /** The base classes from which this class derives. If more than one, the first is the super class and the others are [mixins]($docs/bis/ec/ec-mixin-class). */\n baseClasses: string[];\n /** The Custom Attributes for this class */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n customAttributes?: CustomAttribute[];\n /** An object whose properties correspond by name to the properties of this class. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n properties: { [propName: string]: PropertyMetaData };\n}\n\n/** Metadata for an Entity.\n * @beta\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `EntityClass` class from `@itwin/ecschema-metadata` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class EntityMetaData implements EntityMetaDataProps {\n /** The Id of the class in the [[IModelDb]] from which the metadata was obtained. */\n public readonly classId: Id64String;\n /** The Entity name */\n public readonly ecclass: string;\n public readonly description?: string;\n public readonly modifier?: string;\n public readonly displayLabel?: string;\n /** The base class that this class is derives from. If more than one, the first is the actual base class and the others are mixins. */\n public readonly baseClasses: string[];\n /** The Custom Attributes for this class */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public readonly customAttributes?: CustomAttribute[];\n /** An object whose properties correspond by name to the properties of this class. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public readonly properties: { [propName: string]: PropertyMetaData };\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public constructor(jsonObj: EntityMetaDataProps) {\n this.classId = jsonObj.classId;\n this.ecclass = jsonObj.ecclass;\n this.description = jsonObj.description;\n this.modifier = jsonObj.modifier;\n this.displayLabel = jsonObj.displayLabel;\n this.baseClasses = jsonObj.baseClasses;\n this.customAttributes = jsonObj.customAttributes;\n this.properties = {};\n\n for (const propName in jsonObj.properties) { // eslint-disable-line guard-for-in\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.properties[propName] = new PropertyMetaData(jsonObj.properties[propName]);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"EntityProps.js","sourceRoot":"","sources":["../../src/EntityProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AACvD,wDAAwD;AACxD,iDAAgD;AA6DhD;;GAEG;AACH,IAAY,iBAYX;AAZD,WAAY,iBAAiB;IAC3B,2EAAoB,CAAA;IACpB,+DAAc,CAAA;IACd,iEAAe,CAAA;IACf,mEAAgB,CAAA;IAChB,gEAAc,CAAA;IACd,kEAAe,CAAA;IACf,4DAAY,CAAA;IACZ,kEAAe,CAAA;IACf,kEAAe,CAAA;IACf,gEAAc,CAAA;IACd,sEAAiB,CAAA;AACnB,CAAC,EAZW,iBAAiB,iCAAjB,iBAAiB,QAY5B;AA4DD;;;GAGG;AACH,4DAA4D;AAC5D,MAAa,gBAAgB;IACpB,aAAa,CAAqB;IAClC,UAAU,CAAU;IACpB,YAAY,CAAU;IACtB,WAAW,CAAU;IACrB,YAAY,CAAU;IACtB,YAAY,CAAO;IACnB,YAAY,CAAO;IACnB,aAAa,CAAU;IACvB,aAAa,CAAU;IACvB,QAAQ,CAAW;IACnB,cAAc,CAAU;IACxB,eAAe,CAAW;IAC1B,qBAAqB,CAAW;IAChC,SAAS,CAAU;IACnB,SAAS,CAAU;IACnB,SAAS,CAAU;IACnB,iBAAiB,CAAU;IAClC,4DAA4D;IACrD,gBAAgB,CAAqB;IAE5C,4DAA4D;IAC5D,YAAmB,OAA8B;QAC/C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,OAAO,CAAC,UAAU;YACpB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,OAAO,C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AAC,CAAC,CAAC,gEAAgE;IACzG,CAAC;CACF;AAzFD,4CAyFC;AAsBD;;;GAGG;AACH,4DAA4D;AAC5D,MAAa,cAAc;IACzB,oFAAoF;IACpE,OAAO,CAAa;IACpC,sBAAsB;IACN,OAAO,CAAS;IAChB,WAAW,CAAU;IACrB,QAAQ,CAAU;IAClB,YAAY,CAAU;IACtC,uIAAuI;IACvH,WAAW,CAAW;IACtC,2CAA2C;IAC3C,4DAA4D;IAC5C,gBAAgB,CAAqB;IACrD,qFAAqF;IACrF,4DAA4D;IAC5C,UAAU,CAA2C;IAErE,4DAA4D;IAC5D,YAAmB,OAA4B;QAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QAErB,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,mCAAmC;YAC9E,4DAA4D;YAC5D,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjF,CAAC;IACH,CAAC;CACF;AAjCD,wCAiCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Entities\r\n */\r\n\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\r\nimport { RelatedElement } from \"./ElementProps\";\r\n\r\n/** The persistent format of an [Entity]($backend), also used as the \"wire format\" when transmitting information about entities\r\n * between the backend and frontend.\r\n * EntityProps and all of its sub-types like [[ElementProps]] are \"plain old Javascript objects\" - that is, objects containing\r\n * no methods and no properties of `class` type.\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface EntityProps {\r\n /** A non-existent property used to discriminate between [[EntityProps]] and [Entity]($backend).\r\n * @see [Entity.isInstanceOfEntity]($backend).\r\n */\r\n readonly isInstanceOfEntity?: never;\r\n /** The full name of the [ECClass]($docs/bis/guide/references/glossary/#ecclass) for this entity, in the form \"Schema:ClassName\" */\r\n classFullName: string;\r\n /** The Id of the entity. Must be present for SELECT, UPDATE, or DELETE, ignored for INSERT. */\r\n id?: Id64String;\r\n /** Optional [json properties]($docs/bis/guide/fundamentals/element-fundamentals.md#jsonproperties) of this Entity. */\r\n jsonProperties?: { [key: string]: any };\r\n}\r\n\r\n/** Specifies the source and target elements of a [[Relationship]] instance.\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface SourceAndTarget {\r\n sourceId: Id64String;\r\n targetId: Id64String;\r\n}\r\n\r\n/** Properties that are common to all types of link table ECRelationships\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface RelationshipProps extends EntityProps, SourceAndTarget {\r\n}\r\n\r\n/** Parameters for performing a query on [Entity]($backend) classes.\r\n * @public @preview\r\n * @extensions\r\n */\r\nexport interface EntityQueryParams {\r\n /** The sql className, in the form \"Schema.ClassName\", of the class to search. */\r\n from?: string;\r\n /** Set to true to limit results to *not* include sub-classes of \"from\" class */\r\n only?: boolean;\r\n /** Optional \"WHERE\" clause to filter entities. Note: do *not* include the \"WHERE\" keyword. */\r\n where?: string;\r\n /** Optional \"ORDERBY\" clause to sort results. Note: do *not* include the \"ORDERBY\" keyword. */\r\n orderBy?: string;\r\n /** Optional \"LIMIT\" clause to limit the number of rows returned. */\r\n limit?: number;\r\n /** Optional \"OFFSET\" clause. Only valid if Limit is also present. */\r\n offset?: number;\r\n /** Bindings for parameterized values.\r\n * @see [[ECSqlStatement.bindValues]]\r\n */\r\n bindings?: any[] | object;\r\n}\r\n\r\n/** The primitive types of an Entity property.\r\n * @beta\r\n */\r\nexport enum PrimitiveTypeCode {\r\n Uninitialized = 0x00,\r\n Binary = 0x101,\r\n Boolean = 0x201,\r\n DateTime = 0x301,\r\n Double = 0x401,\r\n Integer = 0x501,\r\n Long = 0x601,\r\n Point2d = 0x701, // eslint-disable-line @typescript-eslint/no-shadow\r\n Point3d = 0x801, // eslint-disable-line @typescript-eslint/no-shadow\r\n String = 0x901,\r\n IGeometry = 0xa01, // Used for Bentley.Geometry.Common.IGeometry types\r\n}\r\n\r\n/** A callback function to process properties of an Entity\r\n * @beta\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `PropertyHandler` from `@itwin/ecschema-metadata` instead.\r\n *\r\n * @example\r\n * ```typescript\r\n * // Current usage:\r\n * const callback: PropertyCallback = (name: string, propMetaData: PropertyMetaData) => {\r\n * console.log(`Property name: ${name}, Property type: ${propMetaData.primitiveType}`);\r\n * };\r\n *\r\n * // Replacement:\r\n * const callback: PropertyHandler = (propName: string, property: Property) => {\r\n * console.log(`Property name: ${propName}, Property type: ${property.propertyType}`);\r\n * };\r\n * ```\r\n */\r\nexport type PropertyCallback = (name: string, meta: PropertyMetaData) => void;\r\n\r\n/** A custom attribute instance\r\n * @beta\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `CustomAttribute` interface from `@itwin/ecschema-metadata` instead.\r\n */\r\nexport interface CustomAttribute {\r\n /** The class of the CustomAttribute */\r\n ecclass: string;\r\n /** An object whose properties correspond by name to the properties of this custom attribute instance. */\r\n properties: { [propName: string]: any };\r\n}\r\n\r\ntype FactoryFunc = (jsonObj: any) => any;\r\n\r\n/**\r\n * @beta\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `@itwin/ecschema-metadata` instead.\r\n */\r\nexport interface PropertyMetaDataProps {\r\n primitiveType?: number;\r\n structName?: string;\r\n extendedType?: string;\r\n description?: string;\r\n displayLabel?: string;\r\n minimumValue?: any;\r\n maximumValue?: any;\r\n minimumLength?: number;\r\n maximumLength?: number;\r\n readOnly?: boolean;\r\n kindOfQuantity?: string;\r\n isCustomHandled?: boolean;\r\n isCustomHandledOrphan?: boolean;\r\n minOccurs?: number;\r\n maxOccurs?: number;\r\n direction?: string;\r\n relationshipClass?: string;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n customAttributes?: CustomAttribute[];\r\n}\r\n\r\n/** Metadata for a property.\r\n * @beta\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the `Property` class from @itwin/ecschema-metadata` instead.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport class PropertyMetaData implements PropertyMetaDataProps {\r\n public primitiveType?: PrimitiveTypeCode;\r\n public structName?: string;\r\n public extendedType?: string;\r\n public description?: string;\r\n public displayLabel?: string;\r\n public minimumValue?: any;\r\n public maximumValue?: any;\r\n public minimumLength?: number;\r\n public maximumLength?: number;\r\n public readOnly?: boolean;\r\n public kindOfQuantity?: string;\r\n public isCustomHandled?: boolean;\r\n public isCustomHandledOrphan?: boolean;\r\n public minOccurs?: number;\r\n public maxOccurs?: number;\r\n public direction?: string;\r\n public relationshipClass?: string;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n public customAttributes?: CustomAttribute[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n public constructor(jsonObj: PropertyMetaDataProps) {\r\n this.primitiveType = jsonObj.primitiveType;\r\n if (jsonObj.structName)\r\n this.structName = jsonObj.structName;\r\n this.extendedType = jsonObj.extendedType;\r\n this.description = jsonObj.description;\r\n this.displayLabel = jsonObj.displayLabel;\r\n if (undefined !== jsonObj.minimumValue)\r\n this.minimumValue = jsonObj.minimumValue;\r\n if (undefined !== jsonObj.maximumValue)\r\n this.maximumValue = jsonObj.maximumValue;\r\n if (undefined !== jsonObj.minimumLength)\r\n this.minimumLength = jsonObj.minimumLength;\r\n if (undefined !== jsonObj.maximumLength)\r\n this.maximumLength = jsonObj.maximumLength;\r\n this.readOnly = jsonObj.readOnly;\r\n this.kindOfQuantity = jsonObj.kindOfQuantity;\r\n this.isCustomHandled = jsonObj.isCustomHandled;\r\n if (undefined !== jsonObj.minOccurs)\r\n this.minOccurs = jsonObj.minOccurs;\r\n if (undefined !== jsonObj.maxOccurs)\r\n this.maxOccurs = jsonObj.maxOccurs;\r\n this.direction = jsonObj.direction;\r\n this.relationshipClass = jsonObj.relationshipClass;\r\n this.customAttributes = jsonObj.customAttributes;\r\n }\r\n\r\n /** Create a typed value, or array of values, from a factory and an input object */\r\n private createValueOrArray(func: FactoryFunc, jsonObj: any) {\r\n if (undefined === this.minOccurs)\r\n return func(jsonObj); // not an array\r\n\r\n const val: any = [];\r\n jsonObj.forEach((element: any) => val.push(func(element)));\r\n return val;\r\n }\r\n\r\n /** construct a single property from an input object according to this metadata */\r\n public createProperty(jsonObj: any): any {\r\n if (jsonObj === undefined)\r\n return undefined;\r\n\r\n if (undefined !== this.primitiveType) {\r\n switch (this.primitiveType) {\r\n case PrimitiveTypeCode.Boolean:\r\n case PrimitiveTypeCode.Double:\r\n case PrimitiveTypeCode.Integer:\r\n case PrimitiveTypeCode.String:\r\n return jsonObj; // this works even for arrays or strings that are JSON because the parsed JSON is already the right type\r\n\r\n case PrimitiveTypeCode.Point2d:\r\n return this.createValueOrArray((obj) => Point2d.fromJSON(obj), jsonObj);\r\n\r\n case PrimitiveTypeCode.Point3d:\r\n return this.createValueOrArray((obj) => Point3d.fromJSON(obj), jsonObj);\r\n }\r\n }\r\n if (this.isNavigation)\r\n return jsonObj.id !== undefined ? new RelatedElement(jsonObj) : Id64.fromJSON(jsonObj);\r\n\r\n return jsonObj;\r\n }\r\n\r\n /** Return `true` if this property is a NavigationProperty. */\r\n public get isNavigation(): boolean {\r\n return (this.direction !== undefined); // the presence of `direction` means it is a navigation property\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `@itwin/ecschema-metadata` instead.\r\n */\r\nexport interface EntityMetaDataProps {\r\n classId: Id64String;\r\n ecclass: string;\r\n description?: string;\r\n modifier?: string;\r\n displayLabel?: string;\r\n /** The base classes from which this class derives. If more than one, the first is the super class and the others are [mixins]($docs/bis/ec/ec-mixin-class). */\r\n baseClasses: string[];\r\n /** The Custom Attributes for this class */\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n customAttributes?: CustomAttribute[];\r\n /** An object whose properties correspond by name to the properties of this class. */\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n properties: { [propName: string]: PropertyMetaData };\r\n}\r\n\r\n/** Metadata for an Entity.\r\n * @beta\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `EntityClass` class from `@itwin/ecschema-metadata` instead.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport class EntityMetaData implements EntityMetaDataProps {\r\n /** The Id of the class in the [[IModelDb]] from which the metadata was obtained. */\r\n public readonly classId: Id64String;\r\n /** The Entity name */\r\n public readonly ecclass: string;\r\n public readonly description?: string;\r\n public readonly modifier?: string;\r\n public readonly displayLabel?: string;\r\n /** The base class that this class is derives from. If more than one, the first is the actual base class and the others are mixins. */\r\n public readonly baseClasses: string[];\r\n /** The Custom Attributes for this class */\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n public readonly customAttributes?: CustomAttribute[];\r\n /** An object whose properties correspond by name to the properties of this class. */\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n public readonly properties: { [propName: string]: PropertyMetaData };\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n public constructor(jsonObj: EntityMetaDataProps) {\r\n this.classId = jsonObj.classId;\r\n this.ecclass = jsonObj.ecclass;\r\n this.description = jsonObj.description;\r\n this.modifier = jsonObj.modifier;\r\n this.displayLabel = jsonObj.displayLabel;\r\n this.baseClasses = jsonObj.baseClasses;\r\n this.customAttributes = jsonObj.customAttributes;\r\n this.properties = {};\r\n\r\n for (const propName in jsonObj.properties) { // eslint-disable-line guard-for-in\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this.properties[propName] = new PropertyMetaData(jsonObj.properties[propName]);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityReference.js","sourceRoot":"","sources":["../../src/EntityReference.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;;;;;;;;GASG;AACH,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,kCAAW,CAAA;IACX,oCAAa,CAAA;IACb,0CAAmB,CAAA;IACnB,yCAAkB,CAAA;AACpB,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAED;;;GAGG;AACH,WAAiB,mBAAmB;IAClC,MAAM,6BAA6B,GAAG;QACpC,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,eAAe;QAC5C,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,iBAAiB;QAChD,CAAC,mBAAmB,CAAC,aAAa,CAAC,EAAE,uBAAuB;QAC5D,CAAC,mBAAmB,CAAC,YAAY,CAAC,EAAE,sBAAsB;KAClD,CAAC;IAEX;;OAEG;IACH,SAAgB,0BAA0B,CAAC,IAAyB;QAClE,OAAO,6BAA6B,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAFe,8CAA0B,6BAEzC,CAAA;AACH,CAAC,EAdgB,mBAAmB,mCAAnB,mBAAmB,QAcnC;AAUD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,GAAoB;IACnD,UAAU,CAAC,EAAc,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,EAAc,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAc,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACjD,eAAe,CAAC,EAAc,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;CAC/D;AALD,gDAKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Schema\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\n\n/**\n * Types of concrete entities. Used for storing strings in JavaScript reference-equality containers which encode\n * low-level entity information.\n * @note the values of this enum are unstable, do not depend upon their values between versions of iTwin.js\n * (e.g. do not serialize them and load them in another version of iTwin.js and expect them to work)\n * CodeSpecs are excepted since their JavaScript representation does not derive from [Entity]($backend)\n * @note the string value of each variant is required/guaranteed to be 1 character\n * @see EntityReference\n * @alpha\n */\nexport enum ConcreteEntityTypes {\n Model = \"m\",\n Element = \"e\",\n ElementAspect = \"a\",\n Relationship = \"r\",\n}\n\n/**\n * Adds some utilities to the [[ConcreteEntityTypes]] enum\n * @alpha\n */\nexport namespace ConcreteEntityTypes {\n const toBisCoreRootClassFullNameMap = {\n [ConcreteEntityTypes.Model]: \"BisCore:Model\",\n [ConcreteEntityTypes.Element]: \"BisCore:Element\",\n [ConcreteEntityTypes.ElementAspect]: \"BisCore:ElementAspect\",\n [ConcreteEntityTypes.Relationship]: \"BisCore:Relationship\",\n } as const;\n\n /** used by the transformer to figure out where to check for the existence in a db of a concrete element id\n * @internal\n */\n export function toBisCoreRootClassFullName(type: ConcreteEntityTypes): string {\n return toBisCoreRootClassFullNameMap[type];\n }\n}\n\n/**\n * This id format can be used for storing a unique key for an entity in containers like `Map`.\n * Elements and non-element entities have different id sequences, they can collide with each other, but not within themselves.\n * @note for utilities that require runtime backend classes, see [EntityReferences]($backend)\n * @alpha\n */\nexport type EntityReference = `${ConcreteEntityTypes}${Id64String}`;\n\n/** A set of concrete entity ids, with additional functions to more literately add ids where you have the raw id and know what type it is\n * @alpha\n */\nexport class EntityReferenceSet extends Set<EntityReference> {\n public addElement(id: Id64String) { this.add(`e${id}`); }\n public addModel(id: Id64String) { this.add(`m${id}`); }\n public addAspect(id: Id64String) { this.add(`a${id}`); }\n public addRelationship(id: Id64String) { this.add(`r${id}`); }\n}\n\n/** @internal entity reference type information of a relationship */\nexport interface RelTypeInfo {\n source: ConcreteEntityTypes;\n target: ConcreteEntityTypes;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"EntityReference.js","sourceRoot":"","sources":["../../src/EntityReference.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;;;;;;;;GASG;AACH,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,kCAAW,CAAA;IACX,oCAAa,CAAA;IACb,0CAAmB,CAAA;IACnB,yCAAkB,CAAA;AACpB,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAED;;;GAGG;AACH,WAAiB,mBAAmB;IAClC,MAAM,6BAA6B,GAAG;QACpC,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,eAAe;QAC5C,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,iBAAiB;QAChD,CAAC,mBAAmB,CAAC,aAAa,CAAC,EAAE,uBAAuB;QAC5D,CAAC,mBAAmB,CAAC,YAAY,CAAC,EAAE,sBAAsB;KAClD,CAAC;IAEX;;OAEG;IACH,SAAgB,0BAA0B,CAAC,IAAyB;QAClE,OAAO,6BAA6B,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAFe,8CAA0B,6BAEzC,CAAA;AACH,CAAC,EAdgB,mBAAmB,mCAAnB,mBAAmB,QAcnC;AAUD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,GAAoB;IACnD,UAAU,CAAC,EAAc,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,EAAc,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAc,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACjD,eAAe,CAAC,EAAc,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;CAC/D;AALD,gDAKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Schema\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\n\r\n/**\r\n * Types of concrete entities. Used for storing strings in JavaScript reference-equality containers which encode\r\n * low-level entity information.\r\n * @note the values of this enum are unstable, do not depend upon their values between versions of iTwin.js\r\n * (e.g. do not serialize them and load them in another version of iTwin.js and expect them to work)\r\n * CodeSpecs are excepted since their JavaScript representation does not derive from [Entity]($backend)\r\n * @note the string value of each variant is required/guaranteed to be 1 character\r\n * @see EntityReference\r\n * @alpha\r\n */\r\nexport enum ConcreteEntityTypes {\r\n Model = \"m\",\r\n Element = \"e\",\r\n ElementAspect = \"a\",\r\n Relationship = \"r\",\r\n}\r\n\r\n/**\r\n * Adds some utilities to the [[ConcreteEntityTypes]] enum\r\n * @alpha\r\n */\r\nexport namespace ConcreteEntityTypes {\r\n const toBisCoreRootClassFullNameMap = {\r\n [ConcreteEntityTypes.Model]: \"BisCore:Model\",\r\n [ConcreteEntityTypes.Element]: \"BisCore:Element\",\r\n [ConcreteEntityTypes.ElementAspect]: \"BisCore:ElementAspect\",\r\n [ConcreteEntityTypes.Relationship]: \"BisCore:Relationship\",\r\n } as const;\r\n\r\n /** used by the transformer to figure out where to check for the existence in a db of a concrete element id\r\n * @internal\r\n */\r\n export function toBisCoreRootClassFullName(type: ConcreteEntityTypes): string {\r\n return toBisCoreRootClassFullNameMap[type];\r\n }\r\n}\r\n\r\n/**\r\n * This id format can be used for storing a unique key for an entity in containers like `Map`.\r\n * Elements and non-element entities have different id sequences, they can collide with each other, but not within themselves.\r\n * @note for utilities that require runtime backend classes, see [EntityReferences]($backend)\r\n * @alpha\r\n */\r\nexport type EntityReference = `${ConcreteEntityTypes}${Id64String}`;\r\n\r\n/** A set of concrete entity ids, with additional functions to more literately add ids where you have the raw id and know what type it is\r\n * @alpha\r\n */\r\nexport class EntityReferenceSet extends Set<EntityReference> {\r\n public addElement(id: Id64String) { this.add(`e${id}`); }\r\n public addModel(id: Id64String) { this.add(`m${id}`); }\r\n public addAspect(id: Id64String) { this.add(`a${id}`); }\r\n public addRelationship(id: Id64String) { this.add(`r${id}`); }\r\n}\r\n\r\n/** @internal entity reference type information of a relationship */\r\nexport interface RelTypeInfo {\r\n source: ConcreteEntityTypes;\r\n target: ConcreteEntityTypes;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Environment.js","sourceRoot":"","sources":["../../src/Environment.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,6CAA0C;AAC1C,+CAA8D;AAC9D,qCAA+C;AAsB/C;;;;GAIG;AACH,MAAa,WAAW;IACtB;;;OAGG;IACa,UAAU,CAAU;IACpC;;;OAGG;IACa,aAAa,CAAU;IACvC;;;;;OAKG;IACa,iBAAiB,CAAU;IAE3C,iDAAiD;IACjC,GAAG,CAAS;IAC5B,sDAAsD;IACtC,MAAM,CAAc;IACpC,yDAAyD;IACz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CAAC,YAAY;YACf,OAAO,IAAI,CAAC;QAEd,OAAO,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;IAC1D,CAAC;;AA3FH,kCA4FC","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 { NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\nimport { Atmosphere } from \"./Atmosphere\";\nimport { GroundPlane, GroundPlaneProps } from \"./GroundPlane\";\nimport { SkyBox, SkyBoxProps } from \"./SkyBox\";\n\n/** JSON representation of an [[Environment]].\n * @see [[DisplayStyle3dSettingsProps.environment]].\n * @public\n * @extensions\n */\nexport interface EnvironmentProps {\n /** See [[Environment.ground]] and [[Environment.displayGround]]. */\n ground?: GroundPlaneProps;\n /** See [[Environment.sky]] and [[Environment.displaySky]]. */\n sky?: SkyBoxProps;\n /** @beta See [[Environment.atmosphere]] and [[Environment.displayAtmosphere]]. */\n atmosphere?: Atmosphere.Props;\n}\n\n/** A type containing all of the properties of [[Environment]] with none of the methods and with the `readonly` modifiers removed.\n * @see [[Environment.create]] and [[Environment.clone]].\n * @public\n */\nexport type EnvironmentProperties = NonFunctionPropertiesOf<Environment>;\n\n/** As part of a [[DisplayStyle3dSettings]], controls the display of a [[SkyBox]] and [[GroundPlane]] to simulate the\n * outdoor environment.\n * @see [[DisplayStyle3dSettings.environment]].\n * @public\n */\nexport class Environment {\n /** If true, the sky box will be displayed.\n * Default: false.\n * @see [[withDisplay]] or [[DisplayStyle3dSettings.toggleSkyBox]] to change this.\n */\n public readonly displaySky: boolean;\n /** If true, the ground plane will be displayed.\n * Default: false.\n * @see [[withDisplay]] or [[DisplayStyle3dSettings.toggleGroundPlane]] to change this.\n */\n public readonly displayGround: boolean;\n /**\n * @beta\n * If true, the atmosphere will be displayed. Enabling this will override any color information provided to the sky box.\n * Default: false.\n * @see [[withDisplay]] or [[DisplayStyle3dSettings.toggleAtmosphere]] to change this.\n */\n public readonly displayAtmosphere: boolean;\n\n /** Describes how the sky box should be drawn. */\n public readonly sky: SkyBox;\n /** Describes how the ground plane should be drawn. */\n public readonly ground: GroundPlane;\n /** @beta Describes how the atmosphere should be drawn */\n public readonly atmosphere: Atmosphere.Settings;\n\n protected constructor(props?: Partial<EnvironmentProperties>) {\n this.displaySky = props?.displaySky ?? false;\n this.displayGround = props?.displayGround ?? false;\n this.displayAtmosphere = props?.displayAtmosphere ?? false;\n this.sky = props?.sky ?? SkyBox.defaults;\n this.ground = props?.ground ?? GroundPlane.defaults;\n this.atmosphere = props?.atmosphere ?? Atmosphere.Settings.defaults;\n }\n\n /** Default settings without a ground plane, sky box, or atmosphere displayed. */\n public static readonly defaults = new Environment();\n\n /** Create a new Environment. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<EnvironmentProperties>): Environment {\n return props ? new this(props) : this.defaults;\n }\n\n /** Create a copy of this environment, changing the `displayGround`, `displaySky` and/or `displayAtmosphere` flags. */\n public withDisplay(display: { sky?: boolean, ground?: boolean, atmosphere?: boolean }): Environment {\n const displaySky = display.sky ?? this.displaySky;\n const displayGround = display.ground ?? this.displayGround;\n const displayAtmosphere = display.atmosphere ?? this.displayAtmosphere;\n if (displaySky === this.displaySky && displayGround === this.displayGround && displayAtmosphere === this.displayAtmosphere)\n return this;\n\n return Environment.create({\n ...this,\n displaySky: displaySky ?? this.displaySky,\n displayGround: displayGround ?? this.displayGround,\n displayAtmosphere: displayAtmosphere ?? this.displayAtmosphere,\n });\n }\n\n /** Convert to JSON representation. */\n public toJSON(): EnvironmentProps {\n return {\n sky: this.sky.toJSON(this.displaySky),\n ground: this.ground.toJSON(this.displayGround),\n atmosphere: this.atmosphere.toJSON(this.displayAtmosphere),\n };\n }\n\n /** Create from JSON representation. */\n public static fromJSON(props?: EnvironmentProps): Environment {\n if (!props)\n return this.defaults;\n\n return new this({\n displaySky: props?.sky?.display,\n displayGround: props?.ground?.display,\n displayAtmosphere: props?.atmosphere?.display,\n sky: props?.sky ? SkyBox.fromJSON(props.sky) : undefined,\n ground: props?.ground ? GroundPlane.fromJSON(props.ground) : undefined,\n atmosphere: props?.atmosphere ? Atmosphere.Settings.fromJSON(props.atmosphere) : undefined,\n });\n }\n\n /** Create a copy of this environment, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<EnvironmentProperties>): Environment {\n if (!changedProps)\n return this;\n\n return Environment.create({ ...this, ...changedProps });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Environment.js","sourceRoot":"","sources":["../../src/Environment.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,6CAA0C;AAC1C,+CAA8D;AAC9D,qCAA+C;AAsB/C;;;;GAIG;AACH,MAAa,WAAW;IACtB;;;OAGG;IACa,UAAU,CAAU;IACpC;;;OAGG;IACa,aAAa,CAAU;IACvC;;;;;OAKG;IACa,iBAAiB,CAAU;IAE3C,iDAAiD;IACjC,GAAG,CAAS;IAC5B,sDAAsD;IACtC,MAAM,CAAc;IACpC,yDAAyD;IACzC,UAAU,CAAsB;IAEhD,YAAsB,KAAsC;QAC1D,IAAI,CAAC,UAAU,GAAG,KAAK,EAAE,UAAU,IAAI,KAAK,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,KAAK,EAAE,aAAa,IAAI,KAAK,CAAC;QACnD,IAAI,CAAC,iBAAiB,GAAG,KAAK,EAAE,iBAAiB,IAAI,KAAK,CAAC;QAC3D,IAAI,CAAC,GAAG,GAAG,KAAK,EAAE,GAAG,IAAI,eAAM,CAAC,QAAQ,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,KAAK,EAAE,MAAM,IAAI,yBAAW,CAAC,QAAQ,CAAC;QACpD,IAAI,CAAC,U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iBAAiB,CAAC;SAC3D,CAAC;IACJ,CAAC;IAED,uCAAuC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAwB;QAC7C,IAAI,CAAC,KAAK;YACR,OAAO,IAAI,CAAC,QAAQ,CAAC;QAEvB,OAAO,IAAI,IAAI,CAAC;YACd,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO;YAC/B,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO;YACrC,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO;YAC7C,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,eAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;YACxD,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,yBAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;YACtE,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,uBAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;SAC3F,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,YAA6C;QACxD,IAAI,CAAC,YAAY;YACf,OAAO,IAAI,CAAC;QAEd,OAAO,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;IAC1D,CAAC;;AA3FH,kCA4FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\r\nimport { Atmosphere } from \"./Atmosphere\";\r\nimport { GroundPlane, GroundPlaneProps } from \"./GroundPlane\";\r\nimport { SkyBox, SkyBoxProps } from \"./SkyBox\";\r\n\r\n/** JSON representation of an [[Environment]].\r\n * @see [[DisplayStyle3dSettingsProps.environment]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface EnvironmentProps {\r\n /** See [[Environment.ground]] and [[Environment.displayGround]]. */\r\n ground?: GroundPlaneProps;\r\n /** See [[Environment.sky]] and [[Environment.displaySky]]. */\r\n sky?: SkyBoxProps;\r\n /** @beta See [[Environment.atmosphere]] and [[Environment.displayAtmosphere]]. */\r\n atmosphere?: Atmosphere.Props;\r\n}\r\n\r\n/** A type containing all of the properties of [[Environment]] with none of the methods and with the `readonly` modifiers removed.\r\n * @see [[Environment.create]] and [[Environment.clone]].\r\n * @public\r\n */\r\nexport type EnvironmentProperties = NonFunctionPropertiesOf<Environment>;\r\n\r\n/** As part of a [[DisplayStyle3dSettings]], controls the display of a [[SkyBox]] and [[GroundPlane]] to simulate the\r\n * outdoor environment.\r\n * @see [[DisplayStyle3dSettings.environment]].\r\n * @public\r\n */\r\nexport class Environment {\r\n /** If true, the sky box will be displayed.\r\n * Default: false.\r\n * @see [[withDisplay]] or [[DisplayStyle3dSettings.toggleSkyBox]] to change this.\r\n */\r\n public readonly displaySky: boolean;\r\n /** If true, the ground plane will be displayed.\r\n * Default: false.\r\n * @see [[withDisplay]] or [[DisplayStyle3dSettings.toggleGroundPlane]] to change this.\r\n */\r\n public readonly displayGround: boolean;\r\n /**\r\n * @beta\r\n * If true, the atmosphere will be displayed. Enabling this will override any color information provided to the sky box.\r\n * Default: false.\r\n * @see [[withDisplay]] or [[DisplayStyle3dSettings.toggleAtmosphere]] to change this.\r\n */\r\n public readonly displayAtmosphere: boolean;\r\n\r\n /** Describes how the sky box should be drawn. */\r\n public readonly sky: SkyBox;\r\n /** Describes how the ground plane should be drawn. */\r\n public readonly ground: GroundPlane;\r\n /** @beta Describes how the atmosphere should be drawn */\r\n public readonly atmosphere: Atmosphere.Settings;\r\n\r\n protected constructor(props?: Partial<EnvironmentProperties>) {\r\n this.displaySky = props?.displaySky ?? false;\r\n this.displayGround = props?.displayGround ?? false;\r\n this.displayAtmosphere = props?.displayAtmosphere ?? false;\r\n this.sky = props?.sky ?? SkyBox.defaults;\r\n this.ground = props?.ground ?? GroundPlane.defaults;\r\n this.atmosphere = props?.atmosphere ?? Atmosphere.Settings.defaults;\r\n }\r\n\r\n /** Default settings without a ground plane, sky box, or atmosphere displayed. */\r\n public static readonly defaults = new Environment();\r\n\r\n /** Create a new Environment. Any properties not specified by `props` will be initialized to their default values. */\r\n public static create(props?: Partial<EnvironmentProperties>): Environment {\r\n return props ? new this(props) : this.defaults;\r\n }\r\n\r\n /** Create a copy of this environment, changing the `displayGround`, `displaySky` and/or `displayAtmosphere` flags. */\r\n public withDisplay(display: { sky?: boolean, ground?: boolean, atmosphere?: boolean }): Environment {\r\n const displaySky = display.sky ?? this.displaySky;\r\n const displayGround = display.ground ?? this.displayGround;\r\n const displayAtmosphere = display.atmosphere ?? this.displayAtmosphere;\r\n if (displaySky === this.displaySky && displayGround === this.displayGround && displayAtmosphere === this.displayAtmosphere)\r\n return this;\r\n\r\n return Environment.create({\r\n ...this,\r\n displaySky: displaySky ?? this.displaySky,\r\n displayGround: displayGround ?? this.displayGround,\r\n displayAtmosphere: displayAtmosphere ?? this.displayAtmosphere,\r\n });\r\n }\r\n\r\n /** Convert to JSON representation. */\r\n public toJSON(): EnvironmentProps {\r\n return {\r\n sky: this.sky.toJSON(this.displaySky),\r\n ground: this.ground.toJSON(this.displayGround),\r\n atmosphere: this.atmosphere.toJSON(this.displayAtmosphere),\r\n };\r\n }\r\n\r\n /** Create from JSON representation. */\r\n public static fromJSON(props?: EnvironmentProps): Environment {\r\n if (!props)\r\n return this.defaults;\r\n\r\n return new this({\r\n displaySky: props?.sky?.display,\r\n displayGround: props?.ground?.display,\r\n displayAtmosphere: props?.atmosphere?.display,\r\n sky: props?.sky ? SkyBox.fromJSON(props.sky) : undefined,\r\n ground: props?.ground ? GroundPlane.fromJSON(props.ground) : undefined,\r\n atmosphere: props?.atmosphere ? Atmosphere.Settings.fromJSON(props.atmosphere) : undefined,\r\n });\r\n }\r\n\r\n /** Create a copy of this environment, identical except for any properties specified by `changedProps`.\r\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\r\n */\r\n public clone(changedProps?: Partial<EnvironmentProperties>): Environment {\r\n if (!changedProps)\r\n return this;\r\n\r\n return Environment.create({ ...this, ...changedProps });\r\n }\r\n}\r\n"]}
|