@itwin/core-common 5.4.0-dev.7 → 5.5.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -1
- 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
package/lib/cjs/ColorDef.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorDef.js","sourceRoot":"","sources":["../../src/ColorDef.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAgD;AAChD,+CAA4C;AAC5C,yCAAsC;AACtC,yCAAoD;AAEpD,+HAA+H;AAE/H,wEAAwE;AAExE,MAAM,YAAY,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AACvC,MAAM,aAAa,GAAG,IAAI,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AAQ3D;;;;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AC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5F,CAAC;IAED,0EAA0E;IACnE,MAAM,CAAC,KAAe;QAC3B,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC;IACpC,CAAC;IAED,iBAAiB;IACV,MAAM,CAAU,KAAK,GAAG,IAAI,QAAQ,CAAC,yBAAW,CAAC,KAAK,CAAC,CAAC;IAC/D,iBAAiB;IACV,MAAM,CAAU,KAAK,GAAG,IAAI,QAAQ,CAAC,yBAAW,CAAC,KAAK,CAAC,CAAC;IAC/D,eAAe;IACR,MAAM,CAAU,GAAG,GAAG,IAAI,QAAQ,CAAC,yBAAW,CAAC,GAAG,CAAC,CAAC;IAC3D,iBAAiB;IACV,MAAM,CAAU,KAAK,GAAG,IAAI,QAAQ,CAAC,yBAAW,CAAC,KAAK,CAAC,CAAC;IAC/D,gBAAgB;IACT,MAAM,CAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,yBAAW,CAAC,IAAI,CAAC,CAAC;;AAnmB/D,4BAomBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Symbology\n */\n\nimport { Geometry } from \"@itwin/core-geometry\";\nimport { ColorByName } from \"./ColorByName\";\nimport { HSLColor } from \"./HSLColor\";\nimport { HSVColor, HSVConstants } from \"./HSVColor\";\n\n// cspell: ignore ttbbggrr bbggrr rrggbb aabbggrr abgr rrggbb hsla lerp torgb dhue dsaturation dvalue intpart fractpart cyanish\n\n// portions adapted from Three.js Copyright © 2010-2024 three.js authors\n\nconst scratchBytes = new Uint8Array(4);\nconst scratchUInt32 = new Uint32Array(scratchBytes.buffer);\n\n/** The JSON representation of a [[ColorDef]] - an unsigned 32-bit integer in 0xTTBBGGRR format.\n * @public\n * @extensions\n */\nexport type ColorDefProps = number;\n\n/** An immutable integer representation of a color.\n *\n * A color consists of 4 components: Red, Blue, Green, and Transparency. Each component is an 8-bit unsigned integer in the range [0..255]. A value of zero means that component contributes nothing\n * to the color: e.g., a color with Red=0 contains no shade of red, and a color with Transparency=0 is fully opaque. A value of 255 means that component contributes its maximum\n * value to the color: e.g., a color with Red=255 is as red as it is possible to be, and a color with Transparency=255 is fully transparent.\n *\n * Internally, these 4 components are combined into a single 32-bit unsigned integer as represented by [[ColorDefProps]]. This representation can result in some confusion regarding:\n * 1. The ordering of the individual components; and\n * 2. Whether to specify transparency or opacity (sometimes referred to as \"alpha\").\n *\n * ColorDef uses `0xTTBBGGRR` internally, which uses Transparency and puts Red in the low byte and Transparency in the high byte. It can be converted to `0xRRGGBB` format (blue in the low byte)\n * using [[getRgb]] and `0xAABBGGRRx format (red in the low byte, using opacity instead of transparency) using [[getAbgr]].\n *\n * A ColorDef can be created from a numeric [[ColorDefProps]], from a string in one of the common HTML formats (e.g., [[fromString]]), or by specifying values for the individual components\n * (e.g., [[from]]).\n *\n * ColorDef is **immutable**. To obtain a modified copy of a ColorDef, use methods like [[adjustedForContrast]], [[inverse]], or [[withTransparency]]. For example:\n * ```ts\n * const semiTransparentBlue = ColorDef.blue.withTransparency(100);\n * ```\n * @public\n * @extensions\n */\nexport class ColorDef {\n private readonly _tbgr: number;\n\n private constructor(tbgr: number) {\n scratchUInt32[0] = tbgr; // Force to be a 32-bit unsigned integer\n this._tbgr = scratchUInt32[0];\n }\n\n /**\n * Create a new ColorDef.\n * @param val value to use.\n * If a number, it is interpreted as a 0xTTBBGGRR (Red in the low byte, high byte is transparency 0==fully opaque) value.\n * If a string, it must be in one of the forms supported by [[fromString]] - any unrecognized string will produce [[black]].\n */\n public static create(val?: string | ColorDefProps) {\n return this.fromTbgr(this.computeTbgr(val));\n }\n\n /** Compute the 0xTTBBGGRR value corresponding to the specified representation of a color.\n * @see [[fromString]] for a description of valid string representations.\n */\n public static computeTbgr(val?: string | ColorDefProps): ColorDefProps {\n switch (typeof val) {\n case \"number\":\n return val;\n case \"string\":\n return this.computeTbgrFromString(val);\n default:\n return 0;\n }\n }\n\n /** Convert this ColorDef to a 32 bit number representing the 0xTTBBGGRR value */\n public toJSON(): ColorDefProps { return this._tbgr; }\n\n /** Create a new ColorDef from a json object. If the json object is a number, it is assumed to be a 0xTTBBGGRR value. */\n public static fromJSON(json?: ColorDefProps): ColorDef {\n return this.create(json);\n }\n\n /** Create a ColorDef from Red, Green, Blue, Transparency values. All inputs should be integers between 0-255. */\n public static from(red: number, green: number, blue: number, transparency?: number): ColorDef {\n return this.fromTbgr(this.computeTbgrFromComponents(red, green, blue, transparency));\n }\n\n /** Compute the 0xTTBBGGRR value corresponding to the specified Red, Green, Blue, Transparency components. All inputs should be integers between 0-255. */\n public static computeTbgrFromComponents(red: number, green: number, blue: number, transparency?: number): ColorDefProps {\n scratchBytes[0] = red;\n scratchBytes[1] = green;\n scratchBytes[2] = blue;\n scratchBytes[3] = transparency || 0;\n return scratchUInt32[0];\n }\n\n /** Create a ColorDef from its 0xTTBBGGRR representation. */\n public static fromTbgr(tbgr: ColorDefProps): ColorDef {\n switch (tbgr) {\n case ColorByName.black:\n return this.black;\n case ColorByName.white:\n return this.white;\n case ColorByName.red:\n return this.red;\n case ColorByName.green:\n return this.green;\n case ColorByName.blue:\n return this.blue;\n default:\n return new ColorDef(tbgr);\n }\n }\n\n /** Create a ColorDef from its 0xAABBGGRR representation. */\n public static fromAbgr(abgr: number): ColorDef {\n return this.fromTbgr(this.getAbgr(abgr));\n }\n\n /** Create a ColorDef from a string representation. The following representations are supported:\n * *\"rgb(255,0,0)\"*\n * *\"rgba(255,0,0,.2)\"*\n * *\"rgb(100%,0%,0%)\"*\n * *\"hsl(120,50%,50%)\"*\n * *\"#rrbbgg\"*\n * *\"blanchedAlmond\"* (see possible values from [[ColorByName]]). Case-insensitive.\n *\n * If `val` is not a valid color string, this function returns [[black]].\n * @see [[isValidColor]] to determine if `val` is a valid color string.\n */\n public static fromString(val: string): ColorDef {\n return this.fromTbgr(this.computeTbgrFromString(val));\n }\n\n /** Determine whether the input is a valid representation of a ColorDef.\n * @see [[fromString]] for the definition of a valid string representation.\n * @see [[ColorDefProps]] for the definition of a valid numeric representation.\n */\n public static isValidColor(val: string | number): boolean {\n if (typeof val === \"number\")\n return val >= 0 && val <= 0xffffffff && Math.floor(val) === val;\n\n return undefined !== this.tryComputeTbgrFromString(val);\n }\n\n /** Compute the 0xTTBBGGRR value corresponding to a string representation of a color.\n * If `val` is not a valid color string, this function returns 0 (black).\n * @see [[fromString]] for the definition of a valid color string.\n * @see [[tryComputeTbgrFromString]] to determine if `val` is a valid color string.\n */\n public static computeTbgrFromString(val: string): ColorDefProps {\n return this.tryComputeTbgrFromString(val) ?? 0;\n }\n\n /** Try to compute the 0xTTBBGGRR value corresponding to a string representation of a ColorDef.\n * @returns the corresponding numeric representation, or `undefined` if the input does not represent a color.\n * @see [[fromString]] for the definition of a valid color string.\n */\n public static tryComputeTbgrFromString(val: string): ColorDefProps | undefined {\n if (typeof val !== \"string\")\n return undefined;\n\n val = val.toLowerCase();\n let m = /^((?:rgb|hsl)a?)\\(\\s*([^\\)]*)\\)/.exec(val);\n if (m) { // rgb / hsl\n let color;\n const name = m[1];\n const components = m[2];\n\n const hasPercent = (str: string) => str[str.length - 1] === \"%\";\n const floatOrPercent = (str: string) => {\n const v = parseFloat(str);\n return 255 * Geometry.clamp(hasPercent(str) ? v / 100 : v, 0, 1);\n };\n const intOrPercent = (str: string) => {\n const v = hasPercent(str) ? (parseFloat(str) / 100) * 255 : parseInt(str, 10);\n return Geometry.clamp(v, 0, 255);\n };\n\n switch (name) {\n case \"rgb\":\n case \"rgba\":\n color = /^(\\d+%*)\\s*[, ]\\s*(\\d+%*)\\s*[, ]\\s*(\\d+%*)\\s*([,\\/]\\s*([0-9]*\\.?[0-9]+%*)\\s*)?$/.exec(components);\n if (color) { // rgb(255,0,0) rgba(255,0,0,0.5)\n return this.computeTbgrFromComponents(\n intOrPercent(color[1]),\n intOrPercent(color[2]),\n intOrPercent(color[3]),\n typeof color[5] === \"string\" ? 255 - floatOrPercent(color[5]) : 0);\n }\n\n break;\n case \"hsl\":\n case \"hsla\":\n color = /^([0-9]*\\.?[0-9]+)\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(components);\n if (color) { // hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n const h = parseFloat(color[1]) / 360;\n const s = parseInt(color[2], 10) / 100;\n const l = parseInt(color[3], 10) / 100;\n const t = typeof color[5] === \"string\" ? 255 - floatOrPercent(color[5]) : 0;\n return this.computeTbgrFromHSL(h, s, l, t);\n }\n\n break;\n }\n } else if (m = /^\\#([a-f0-9]+)$/.exec(val)) { // hex color\n const hex = m[1];\n const size = hex.length;\n\n if (size === 3) { // #ff0\n return this.computeTbgrFromComponents(\n parseInt(hex.charAt(0) + hex.charAt(0), 16),\n parseInt(hex.charAt(1) + hex.charAt(1), 16),\n parseInt(hex.charAt(2) + hex.charAt(2), 16), 0);\n }\n if (size === 6) { // #ff0000\n return this.computeTbgrFromComponents(\n parseInt(hex.charAt(0) + hex.charAt(1), 16),\n parseInt(hex.charAt(2) + hex.charAt(3), 16),\n parseInt(hex.charAt(4) + hex.charAt(5), 16), 0);\n }\n }\n\n if (val && val.length > 0) { // ColorRgb value\n for (const [key, value] of Object.entries(ColorByName))\n if (key.toLowerCase() === val)\n return value;\n }\n\n return undefined;\n }\n\n /** Get the red, green, blue, and transparency values from this ColorDef. Values will be integers between 0-255. */\n public get colors(): { r: number, g: number, b: number, t: number } {\n return ColorDef.getColors(this._tbgr);\n }\n\n /** Get the r,g,b,t values encoded in an 0xTTBBGGRR value. Values will be integers between 0-255. */\n public static getColors(tbgr: ColorDefProps) {\n scratchUInt32[0] = tbgr;\n return {\n b: scratchBytes[2],\n g: scratchBytes[1],\n r: scratchBytes[0],\n t: scratchBytes[3],\n };\n }\n\n /** The color value of this ColorDef as an integer in the form 0xTTBBGGRR (red in the low byte) */\n public get tbgr(): ColorDefProps { return this._tbgr; }\n\n /** Get the value of the color as a number in 0xAABBGGRR format (i.e. red is in low byte). Transparency (0==fully opaque) converted to alpha (0==fully transparent). */\n public getAbgr(): number {\n return ColorDef.getAbgr(this._tbgr);\n }\n\n /** Get the value of a 0xTTBBGGRR color as a number in 0xAABBGGRR format (i.e. red is in low byte). Transparency (0==fully opaque) converted to alpha (0==fully transparent). */\n public static getAbgr(tbgr: ColorDefProps): number {\n scratchUInt32[0] = tbgr;\n scratchBytes[3] = 255 - scratchBytes[3];\n return scratchUInt32[0];\n }\n\n /** Get the RGB value of the color as a number in 0xRRGGBB format (i.e blue is in the low byte). Transparency is ignored. Value will be from 0 to 2^24 */\n public getRgb(): number {\n return ColorDef.getRgb(this._tbgr);\n }\n\n /** Get the RGB value of the 0xTTBBGGRR color as a number in 0xRRGGBB format (i.e blue is in the low byte). Transparency is ignored. Value will be from 0 to 2^24 */\n public static getRgb(tbgr: ColorDefProps): number {\n scratchUInt32[0] = tbgr;\n return (scratchBytes[0] << 16) + (scratchBytes[1] << 8) + scratchBytes[2];\n }\n\n /** Return a copy of this ColorDef with the specified alpha component.\n * @param alpha the new alpha value as an integer between 0-255.\n * @returns A ColorDef with equivalent red, green, and blue components to this one but with the specified alpha.\n */\n public withAlpha(alpha: number): ColorDef {\n const tbgr = ColorDef.withAlpha(this._tbgr, alpha);\n return tbgr === this._tbgr ? this : ColorDef.fromTbgr(tbgr);\n }\n\n /** Return a color equivalent to the specified 0xTTBBGGRR but with modified alpha component.\n * @param alpha the new alpha value as an integer between 0-255.\n * @returns The 0xTTBBGGRR value equivalent to `tbgr` but with the specified alpha.\n */\n public static withAlpha(tbgr: ColorDefProps, alpha: number): number {\n scratchUInt32[0] = tbgr;\n scratchBytes[3] = 255 - (alpha | 0);\n return scratchUInt32[0];\n }\n\n /** Get the alpha value for this ColorDef. Will be between 0-255 */\n public getAlpha(): number {\n return ColorDef.getAlpha(this._tbgr);\n }\n\n /** Extract the alpha value from a 0xTTBBGGRR color. */\n public static getAlpha(tbgr: ColorDefProps): number {\n scratchUInt32[0] = tbgr;\n return 255 - scratchBytes[3];\n }\n\n /** True if this ColorDef is fully opaque. */\n public get isOpaque(): boolean {\n return ColorDef.isOpaque(this._tbgr);\n }\n\n /** True if the specified 0xTTBBGGRR color is fully opaque. */\n public static isOpaque(tbgr: ColorDefProps): boolean {\n return 255 === this.getAlpha(tbgr);\n }\n\n /** Get the transparency value for this ColorDef (inverse of alpha). Will be between 0-255. */\n public getTransparency(): number {\n return ColorDef.getTransparency(this._tbgr);\n }\n\n /** Extract the transparency component from a 0xTTBBGGRR color as an integer between 0-255.. */\n public static getTransparency(tbgr: ColorDefProps): number {\n scratchUInt32[0] = tbgr;\n return scratchBytes[3];\n }\n\n /** Create a copy of this ColorDef with the specified transparency.\n * @param transparency the new transparency value. Must be between 0-255, where 0 means 'fully opaque' and 255 means 'fully transparent'.\n * @returns a new ColorDef with the same color as this one and the specified transparency.\n */\n public withTransparency(transparency: number): ColorDef {\n const tbgr = ColorDef.withTransparency(this._tbgr, transparency);\n return tbgr === this._tbgr ? this : ColorDef.fromTbgr(tbgr);\n }\n\n /** Compute the 0xTTBBGGRR value of the specified color and transparency.\n * @param transparency the new transparency as an integer between 0-255.\n * @returns The 0xTTBBGGRR value equivalent to `tbgr` but with the specified transparency.\n */\n public static withTransparency(tbgr: ColorDefProps, transparency: number): ColorDefProps {\n return this.withAlpha(tbgr, 255 - transparency);\n }\n\n /** The \"known name\" for this ColorDef. Will be undefined if color value is not in [[ColorByName]] list */\n public get name(): string | undefined {\n return ColorDef.getName(this.tbgr);\n }\n\n /** Obtain the name of the color in the [[ColorByName]] list associated with the specified 0xTTBBGGRR value, or undefined if no such named color exists.\n * @note A handful of colors (like \"aqua\" and \"cyan\") have identical tbgr values; in such cases the first match will be returned.\n */\n public static getName(tbgr: ColorDefProps): string | undefined {\n for (const [key, value] of Object.entries(ColorByName))\n if (value === tbgr)\n return key;\n\n return undefined;\n }\n\n /** Convert this ColorDef to a string in the form \"#rrggbb\" where values are hex digits of the respective colors */\n public toHexString(): string {\n return ColorDef.toHexString(this.tbgr);\n }\n\n /** Convert the 0xTTBBGGRR value to a string in the form \"#rrggbb\". */\n public static toHexString(tbgr: ColorDefProps): string {\n return `#${(`000000${this.getRgb(tbgr).toString(16)}`).slice(-6)}`;\n }\n\n private static getColorsString(tbgr: ColorDefProps) {\n const c = this.getColors(tbgr);\n return `${c.r},${c.g},${c.b}`;\n }\n\n /** Convert this ColorDef to a string in the form \"rgb(r,g,b)\" where values are decimal digits of the respective colors. */\n public toRgbString(): string {\n return ColorDef.toRgbString(this.tbgr);\n }\n\n /** Convert the 0xTTBBGGRR color to a string in the form \"rgb(r,g,b)\" where each component is specified in decimal. */\n public static toRgbString(tbgr: ColorDefProps): string {\n return `rgb(${this.getColorsString(tbgr)})`;\n }\n\n /** Convert this ColorDef to a string in the form \"rgba(r,g,b,a)\" where color values are decimal digits and a is a fraction */\n public toRgbaString(): string {\n return ColorDef.toRgbaString(this.tbgr);\n }\n\n /** Convert the 0xTTBBGGRR color to a string of the form \"rgba(r,g,b,a)\" where the color components are specified in decimal and the alpha component is a fraction. */\n public static toRgbaString(tbgr: ColorDefProps): string {\n return `rgba(${this.getColorsString(tbgr)},${this.getAlpha(tbgr) / 255.})`;\n }\n\n /** Create a ColorDef that is the linear interpolation of this ColorDef and another ColorDef, using a weighting factor.\n * @param color2 The other color\n * @param weight The weighting factor for color2. 0.0 = this color, 1.0 = color2.\n * @param result Optional ColorDef to hold result. If undefined, a new ColorDef is created.\n */\n public lerp(color2: ColorDef, weight: number): ColorDef {\n return ColorDef.fromTbgr(ColorDef.lerp(this.tbgr, color2.tbgr, weight));\n }\n\n /** Interpolate between two 0xTTBBGGRR colors using a weighting factor.\n * @param tbgr1 The first color\n * @param tbgr2 The other color\n * @param weight The weighting factor in [0..1]. A value of 0.0 selects `tbgr1`; 1.0 selects `tbgr2`; 0.5 mixes them evenly; etc.\n * @returns The linear interpolation between `tbgr1` and `tbgr2` using the specified weight.\n */\n public static lerp(tbgr1: ColorDefProps, tbgr2: ColorDefProps, weight: number): ColorDefProps {\n const c = this.getColors(tbgr1);\n const color = this.getColors(tbgr2);\n c.r += (color.r - c.r) * weight;\n c.g += (color.g - c.g) * weight;\n c.b += (color.b - c.b) * weight;\n return this.computeTbgrFromComponents(c.r, c.g, c.b, c.t);\n }\n\n /** Create a new ColorDef that is the inverse (all colors set to 255 - this) of this color. Ignores transparency - result has 0 transparency. */\n public inverse(): ColorDef {\n return ColorDef.fromTbgr(ColorDef.inverse(this.tbgr));\n }\n\n /** Return a 0xTTBBGGRR color whose color components are the inverse of the input color. The result has 0 transparency. */\n public static inverse(tbgr: ColorDefProps): ColorDefProps {\n const colors = this.getColors(tbgr);\n return this.computeTbgrFromComponents(255 - colors.r, 255 - colors.g, 255 - colors.b);\n }\n\n /** Create a ColorDef from hue, saturation, lightness values */\n public static fromHSL(h: number, s: number, l: number, transparency = 0): ColorDef {\n return this.fromTbgr(this.computeTbgrFromHSL(h, s, l, transparency));\n }\n\n /** Compute the 0xTTBBGGRR color corresponding to the specified hue, saturation, lightness values. */\n public static computeTbgrFromHSL(h: number, s: number, l: number, transparency = 0): ColorDefProps {\n const torgb = (p1: number, q1: number, t: number) => {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n\n if (t < 1 / 6)\n return p1 + (q1 - p1) * 6 * t;\n if (t < 1 / 2)\n return q1;\n if (t < 2 / 3)\n return p1 + (q1 - p1) * 6 * (2 / 3 - t);\n\n return p1;\n };\n\n const hue2rgb = (p1: number, q1: number, t: number) => Math.round(torgb(p1, q1, t) * 255);\n const modulo = (n: number, m: number) => ((n % m) + m) % m;\n\n // h,s,l ranges are in 0.0 - 1.0\n h = modulo(h, 1);\n s = Geometry.clamp(s, 0, 1);\n l = Geometry.clamp(l, 0, 1);\n\n if (s === 0) {\n l *= 255;\n return this.computeTbgrFromComponents(l, l, l, transparency);\n }\n\n const p = l <= 0.5 ? l * (1 + s) : l + s - (l * s);\n const q = (2 * l) - p;\n return this.computeTbgrFromComponents(\n hue2rgb(q, p, h + 1 / 3),\n hue2rgb(q, p, h),\n hue2rgb(q, p, h - 1 / 3),\n transparency);\n }\n\n /** Create an [[HSLColor]] from this ColorDef */\n public toHSL(): HSLColor {\n // h,s,l ranges are in 0.0 - 1.0\n const col = this.colors;\n col.r /= 255;\n col.g /= 255;\n col.b /= 255;\n const max = Math.max(col.r, col.g, col.b);\n const min = Math.min(col.r, col.g, col.b);\n\n let hue = 0;\n let saturation;\n const lightness = (min + max) / 2.0;\n\n if (min === max) {\n saturation = 0;\n } else {\n const delta = max - min;\n saturation = lightness <= 0.5 ? delta / (max + min) : delta / (2 - max - min);\n switch (max) {\n case col.r:\n hue = (col.g - col.b) / delta + (col.g < col.b ? 6 : 0);\n break;\n case col.g:\n hue = (col.b - col.r) / delta + 2;\n break;\n case col.b:\n hue = (col.r - col.g) / delta + 4;\n break;\n }\n\n hue /= 6;\n }\n\n return new HSLColor(hue, saturation, lightness);\n }\n\n /** Create an [[HSVColor]] from this ColorDef */\n public toHSV(): HSVColor {\n const { r, g, b } = this.colors;\n let min = (r < g) ? r : g;\n if (b < min)\n min = b;\n\n let max = (r > g) ? r : g;\n if (b > max)\n max = b;\n\n /* amount of \"blackness\" present */\n const v = Math.floor((max / 255.0 * 100) + 0.5);\n const deltaRgb = max - min;\n const s = (max !== 0.0) ? Math.floor((deltaRgb / max * 100) + 0.5) : 0;\n let h = 0;\n\n if (s) {\n const redDistance = (max - r) / deltaRgb;\n const greenDistance = (max - g) / deltaRgb;\n const blueDistance = (max - b) / deltaRgb;\n\n let intermediateHue: number;\n if (r === max) /* color between yellow & magenta */\n intermediateHue = blueDistance - greenDistance;\n else if (g === max) /* color between cyan & yellow */\n intermediateHue = 2.0 + redDistance - blueDistance;\n else /* color between magenta & cyan */\n intermediateHue = 4.0 + greenDistance - redDistance;\n\n /* intermediate hue is [0..6] */\n intermediateHue *= 60;\n\n if (intermediateHue < 0.0)\n intermediateHue += 360;\n\n h = Math.floor(intermediateHue + 0.5);\n\n if (h >= 360)\n h = 0;\n } else {\n h = 0;\n }\n\n return new HSVColor(h, s, v);\n }\n\n /** Create a ColorDef from an HSVColor */\n public static fromHSV(hsv: HSVColor, transparency = 0): ColorDef {\n // Check for simple case first.\n if ((!hsv.s) || (hsv.h === -1)) {\n // hue must be undefined, have no color only white\n const white = 0xff & Math.floor(((255.0 * hsv.v) / 100.0) + 0.5 + 3.0e-14);\n return ColorDef.from(white, white, white, 0);\n }\n\n let dhue = hsv.h, dsaturation = hsv.s, dvalue = hsv.v;\n if (dhue === 360)\n dhue = 0.0;\n\n dhue /= 60; // hue is now [0..6]\n const hueIntpart = Math.floor(dhue); // convert double -> int\n const hueFractpart = dhue - hueIntpart;\n dvalue /= 100;\n dsaturation /= 100;\n\n const p = 0xff & Math.floor((dvalue * (1.0 - dsaturation) * 255.0) + 0.5);\n const q = 0xff & Math.floor((dvalue * (1.0 - (dsaturation * hueFractpart)) * 255.0) + 0.5);\n const t = 0xff & Math.floor((dvalue * (1.0 - (dsaturation * (1.0 - hueFractpart))) * 255.0) + 0.5);\n const v = 0xff & Math.floor(dvalue * 255 + 0.5);\n\n let r = 0, b = 0, g = 0;\n switch (hueIntpart) {\n case 0: r = v; g = t; b = p; break; // reddish\n case 1: r = q, g = v; b = p; break; // yellowish\n case 2: r = p, g = v; b = t; break; // greenish\n case 3: r = p, g = q; b = v; break; // cyanish\n case 4: r = t, g = p; b = v; break; // bluish\n case 5: r = v, g = p; b = q; break; // magenta-ish\n }\n\n return ColorDef.from(r, g, b, transparency);\n }\n\n private visibilityCheck(other: ColorDef): number {\n const fg = this.colors;\n const bg = other.colors;\n // Compute luminosity\n const red = Math.abs(fg.r - bg.r);\n const green = Math.abs(fg.g - bg.g);\n const blue = Math.abs(fg.b - bg.b);\n return (0.30 * red) + (0.59 * green) + (0.11 * blue);\n }\n\n /**\n * Create a new ColorDef that is adjusted from this ColorDef for maximum contrast against another color. The color will either be lighter\n * or darker, depending on which has more visibility against the other color.\n * @param other the color to contrast with\n * @param alpha optional alpha value for the adjusted color. If not supplied alpha from this color is used.\n */\n public adjustedForContrast(other: ColorDef, alpha?: number): ColorDef {\n const visibility = this.visibilityCheck(other);\n if (HSVConstants.VISIBILITY_GOAL <= visibility) {\n return undefined !== alpha ? this.withAlpha(alpha) : this;\n }\n\n const adjPercent = Math.floor(((HSVConstants.VISIBILITY_GOAL - visibility) / 255.0) * 100.0);\n let darkerHSV = this.toHSV();\n let brightHSV = darkerHSV.clone();\n\n darkerHSV = darkerHSV.adjusted(true, adjPercent);\n brightHSV = brightHSV.adjusted(false, adjPercent);\n\n if (undefined === alpha)\n alpha = this.getAlpha();\n\n const darker = ColorDef.fromHSV(darkerHSV).withAlpha(alpha);\n const bright = ColorDef.fromHSV(brightHSV).withAlpha(alpha);\n\n if (bright.getRgb() === other.getRgb()) // Couldn't adjust brighter...\n return darker;\n\n if (darker.getRgb() === other.getRgb()) // Couldn't adjust darker...\n return bright;\n\n // NOTE: Best choice is the one most visible against the other color...\n return (bright.visibilityCheck(other) >= darker.visibilityCheck(other)) ? bright : darker;\n }\n\n /** True if the value of this ColorDef is the same as another ColorDef. */\n public equals(other: ColorDef): boolean {\n return this._tbgr === other._tbgr;\n }\n\n /** pure black */\n public static readonly black = new ColorDef(ColorByName.black);\n /** pure white */\n public static readonly white = new ColorDef(ColorByName.white);\n /** pure red */\n public static readonly red = new ColorDef(ColorByName.red);\n /** pure green */\n public static readonly green = new ColorDef(ColorByName.green);\n /** pure blue */\n public static readonly blue = new ColorDef(ColorByName.blue);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ColorDef.js","sourceRoot":"","sources":["../../src/ColorDef.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAgD;AAChD,+CAA4C;AAC5C,yCAAsC;AACtC,yCAAoD;AAE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,CAAC,MAAM,EAAE,EAAE,4BAA4B;YAClE,OAAO,MAAM,CAAC;QAEhB,uEAAuE;QACvE,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5F,CAAC;IAED,0EAA0E;IACnE,MAAM,CAAC,KAAe;QAC3B,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC;IACpC,CAAC;IAED,iBAAiB;IACV,MAAM,CAAU,KAAK,GAAG,IAAI,QAAQ,CAAC,yBAAW,CAAC,KAAK,CAAC,CAAC;IAC/D,iBAAiB;IACV,MAAM,CAAU,KAAK,GAAG,IAAI,QAAQ,CAAC,yBAAW,CAAC,KAAK,CAAC,CAAC;IAC/D,eAAe;IACR,MAAM,CAAU,GAAG,GAAG,IAAI,QAAQ,CAAC,yBAAW,CAAC,GAAG,CAAC,CAAC;IAC3D,iBAAiB;IACV,MAAM,CAAU,KAAK,GAAG,IAAI,QAAQ,CAAC,yBAAW,CAAC,KAAK,CAAC,CAAC;IAC/D,gBAAgB;IACT,MAAM,CAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,yBAAW,CAAC,IAAI,CAAC,CAAC;;AAnmB/D,4BAomBC","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 Symbology\r\n */\r\n\r\nimport { Geometry } from \"@itwin/core-geometry\";\r\nimport { ColorByName } from \"./ColorByName\";\r\nimport { HSLColor } from \"./HSLColor\";\r\nimport { HSVColor, HSVConstants } from \"./HSVColor\";\r\n\r\n// cspell: ignore ttbbggrr bbggrr rrggbb aabbggrr abgr rrggbb hsla lerp torgb dhue dsaturation dvalue intpart fractpart cyanish\r\n\r\n// portions adapted from Three.js Copyright © 2010-2024 three.js authors\r\n\r\nconst scratchBytes = new Uint8Array(4);\r\nconst scratchUInt32 = new Uint32Array(scratchBytes.buffer);\r\n\r\n/** The JSON representation of a [[ColorDef]] - an unsigned 32-bit integer in 0xTTBBGGRR format.\r\n * @public\r\n * @extensions\r\n */\r\nexport type ColorDefProps = number;\r\n\r\n/** An immutable integer representation of a color.\r\n *\r\n * A color consists of 4 components: Red, Blue, Green, and Transparency. Each component is an 8-bit unsigned integer in the range [0..255]. A value of zero means that component contributes nothing\r\n * to the color: e.g., a color with Red=0 contains no shade of red, and a color with Transparency=0 is fully opaque. A value of 255 means that component contributes its maximum\r\n * value to the color: e.g., a color with Red=255 is as red as it is possible to be, and a color with Transparency=255 is fully transparent.\r\n *\r\n * Internally, these 4 components are combined into a single 32-bit unsigned integer as represented by [[ColorDefProps]]. This representation can result in some confusion regarding:\r\n * 1. The ordering of the individual components; and\r\n * 2. Whether to specify transparency or opacity (sometimes referred to as \"alpha\").\r\n *\r\n * ColorDef uses `0xTTBBGGRR` internally, which uses Transparency and puts Red in the low byte and Transparency in the high byte. It can be converted to `0xRRGGBB` format (blue in the low byte)\r\n * using [[getRgb]] and `0xAABBGGRRx format (red in the low byte, using opacity instead of transparency) using [[getAbgr]].\r\n *\r\n * A ColorDef can be created from a numeric [[ColorDefProps]], from a string in one of the common HTML formats (e.g., [[fromString]]), or by specifying values for the individual components\r\n * (e.g., [[from]]).\r\n *\r\n * ColorDef is **immutable**. To obtain a modified copy of a ColorDef, use methods like [[adjustedForContrast]], [[inverse]], or [[withTransparency]]. For example:\r\n * ```ts\r\n * const semiTransparentBlue = ColorDef.blue.withTransparency(100);\r\n * ```\r\n * @public\r\n * @extensions\r\n */\r\nexport class ColorDef {\r\n private readonly _tbgr: number;\r\n\r\n private constructor(tbgr: number) {\r\n scratchUInt32[0] = tbgr; // Force to be a 32-bit unsigned integer\r\n this._tbgr = scratchUInt32[0];\r\n }\r\n\r\n /**\r\n * Create a new ColorDef.\r\n * @param val value to use.\r\n * If a number, it is interpreted as a 0xTTBBGGRR (Red in the low byte, high byte is transparency 0==fully opaque) value.\r\n * If a string, it must be in one of the forms supported by [[fromString]] - any unrecognized string will produce [[black]].\r\n */\r\n public static create(val?: string | ColorDefProps) {\r\n return this.fromTbgr(this.computeTbgr(val));\r\n }\r\n\r\n /** Compute the 0xTTBBGGRR value corresponding to the specified representation of a color.\r\n * @see [[fromString]] for a description of valid string representations.\r\n */\r\n public static computeTbgr(val?: string | ColorDefProps): ColorDefProps {\r\n switch (typeof val) {\r\n case \"number\":\r\n return val;\r\n case \"string\":\r\n return this.computeTbgrFromString(val);\r\n default:\r\n return 0;\r\n }\r\n }\r\n\r\n /** Convert this ColorDef to a 32 bit number representing the 0xTTBBGGRR value */\r\n public toJSON(): ColorDefProps { return this._tbgr; }\r\n\r\n /** Create a new ColorDef from a json object. If the json object is a number, it is assumed to be a 0xTTBBGGRR value. */\r\n public static fromJSON(json?: ColorDefProps): ColorDef {\r\n return this.create(json);\r\n }\r\n\r\n /** Create a ColorDef from Red, Green, Blue, Transparency values. All inputs should be integers between 0-255. */\r\n public static from(red: number, green: number, blue: number, transparency?: number): ColorDef {\r\n return this.fromTbgr(this.computeTbgrFromComponents(red, green, blue, transparency));\r\n }\r\n\r\n /** Compute the 0xTTBBGGRR value corresponding to the specified Red, Green, Blue, Transparency components. All inputs should be integers between 0-255. */\r\n public static computeTbgrFromComponents(red: number, green: number, blue: number, transparency?: number): ColorDefProps {\r\n scratchBytes[0] = red;\r\n scratchBytes[1] = green;\r\n scratchBytes[2] = blue;\r\n scratchBytes[3] = transparency || 0;\r\n return scratchUInt32[0];\r\n }\r\n\r\n /** Create a ColorDef from its 0xTTBBGGRR representation. */\r\n public static fromTbgr(tbgr: ColorDefProps): ColorDef {\r\n switch (tbgr) {\r\n case ColorByName.black:\r\n return this.black;\r\n case ColorByName.white:\r\n return this.white;\r\n case ColorByName.red:\r\n return this.red;\r\n case ColorByName.green:\r\n return this.green;\r\n case ColorByName.blue:\r\n return this.blue;\r\n default:\r\n return new ColorDef(tbgr);\r\n }\r\n }\r\n\r\n /** Create a ColorDef from its 0xAABBGGRR representation. */\r\n public static fromAbgr(abgr: number): ColorDef {\r\n return this.fromTbgr(this.getAbgr(abgr));\r\n }\r\n\r\n /** Create a ColorDef from a string representation. The following representations are supported:\r\n * *\"rgb(255,0,0)\"*\r\n * *\"rgba(255,0,0,.2)\"*\r\n * *\"rgb(100%,0%,0%)\"*\r\n * *\"hsl(120,50%,50%)\"*\r\n * *\"#rrbbgg\"*\r\n * *\"blanchedAlmond\"* (see possible values from [[ColorByName]]). Case-insensitive.\r\n *\r\n * If `val` is not a valid color string, this function returns [[black]].\r\n * @see [[isValidColor]] to determine if `val` is a valid color string.\r\n */\r\n public static fromString(val: string): ColorDef {\r\n return this.fromTbgr(this.computeTbgrFromString(val));\r\n }\r\n\r\n /** Determine whether the input is a valid representation of a ColorDef.\r\n * @see [[fromString]] for the definition of a valid string representation.\r\n * @see [[ColorDefProps]] for the definition of a valid numeric representation.\r\n */\r\n public static isValidColor(val: string | number): boolean {\r\n if (typeof val === \"number\")\r\n return val >= 0 && val <= 0xffffffff && Math.floor(val) === val;\r\n\r\n return undefined !== this.tryComputeTbgrFromString(val);\r\n }\r\n\r\n /** Compute the 0xTTBBGGRR value corresponding to a string representation of a color.\r\n * If `val` is not a valid color string, this function returns 0 (black).\r\n * @see [[fromString]] for the definition of a valid color string.\r\n * @see [[tryComputeTbgrFromString]] to determine if `val` is a valid color string.\r\n */\r\n public static computeTbgrFromString(val: string): ColorDefProps {\r\n return this.tryComputeTbgrFromString(val) ?? 0;\r\n }\r\n\r\n /** Try to compute the 0xTTBBGGRR value corresponding to a string representation of a ColorDef.\r\n * @returns the corresponding numeric representation, or `undefined` if the input does not represent a color.\r\n * @see [[fromString]] for the definition of a valid color string.\r\n */\r\n public static tryComputeTbgrFromString(val: string): ColorDefProps | undefined {\r\n if (typeof val !== \"string\")\r\n return undefined;\r\n\r\n val = val.toLowerCase();\r\n let m = /^((?:rgb|hsl)a?)\\(\\s*([^\\)]*)\\)/.exec(val);\r\n if (m) { // rgb / hsl\r\n let color;\r\n const name = m[1];\r\n const components = m[2];\r\n\r\n const hasPercent = (str: string) => str[str.length - 1] === \"%\";\r\n const floatOrPercent = (str: string) => {\r\n const v = parseFloat(str);\r\n return 255 * Geometry.clamp(hasPercent(str) ? v / 100 : v, 0, 1);\r\n };\r\n const intOrPercent = (str: string) => {\r\n const v = hasPercent(str) ? (parseFloat(str) / 100) * 255 : parseInt(str, 10);\r\n return Geometry.clamp(v, 0, 255);\r\n };\r\n\r\n switch (name) {\r\n case \"rgb\":\r\n case \"rgba\":\r\n color = /^(\\d+%*)\\s*[, ]\\s*(\\d+%*)\\s*[, ]\\s*(\\d+%*)\\s*([,\\/]\\s*([0-9]*\\.?[0-9]+%*)\\s*)?$/.exec(components);\r\n if (color) { // rgb(255,0,0) rgba(255,0,0,0.5)\r\n return this.computeTbgrFromComponents(\r\n intOrPercent(color[1]),\r\n intOrPercent(color[2]),\r\n intOrPercent(color[3]),\r\n typeof color[5] === \"string\" ? 255 - floatOrPercent(color[5]) : 0);\r\n }\r\n\r\n break;\r\n case \"hsl\":\r\n case \"hsla\":\r\n color = /^([0-9]*\\.?[0-9]+)\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(components);\r\n if (color) { // hsl(120,50%,50%) hsla(120,50%,50%,0.5)\r\n const h = parseFloat(color[1]) / 360;\r\n const s = parseInt(color[2], 10) / 100;\r\n const l = parseInt(color[3], 10) / 100;\r\n const t = typeof color[5] === \"string\" ? 255 - floatOrPercent(color[5]) : 0;\r\n return this.computeTbgrFromHSL(h, s, l, t);\r\n }\r\n\r\n break;\r\n }\r\n } else if (m = /^\\#([a-f0-9]+)$/.exec(val)) { // hex color\r\n const hex = m[1];\r\n const size = hex.length;\r\n\r\n if (size === 3) { // #ff0\r\n return this.computeTbgrFromComponents(\r\n parseInt(hex.charAt(0) + hex.charAt(0), 16),\r\n parseInt(hex.charAt(1) + hex.charAt(1), 16),\r\n parseInt(hex.charAt(2) + hex.charAt(2), 16), 0);\r\n }\r\n if (size === 6) { // #ff0000\r\n return this.computeTbgrFromComponents(\r\n parseInt(hex.charAt(0) + hex.charAt(1), 16),\r\n parseInt(hex.charAt(2) + hex.charAt(3), 16),\r\n parseInt(hex.charAt(4) + hex.charAt(5), 16), 0);\r\n }\r\n }\r\n\r\n if (val && val.length > 0) { // ColorRgb value\r\n for (const [key, value] of Object.entries(ColorByName))\r\n if (key.toLowerCase() === val)\r\n return value;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Get the red, green, blue, and transparency values from this ColorDef. Values will be integers between 0-255. */\r\n public get colors(): { r: number, g: number, b: number, t: number } {\r\n return ColorDef.getColors(this._tbgr);\r\n }\r\n\r\n /** Get the r,g,b,t values encoded in an 0xTTBBGGRR value. Values will be integers between 0-255. */\r\n public static getColors(tbgr: ColorDefProps) {\r\n scratchUInt32[0] = tbgr;\r\n return {\r\n b: scratchBytes[2],\r\n g: scratchBytes[1],\r\n r: scratchBytes[0],\r\n t: scratchBytes[3],\r\n };\r\n }\r\n\r\n /** The color value of this ColorDef as an integer in the form 0xTTBBGGRR (red in the low byte) */\r\n public get tbgr(): ColorDefProps { return this._tbgr; }\r\n\r\n /** Get the value of the color as a number in 0xAABBGGRR format (i.e. red is in low byte). Transparency (0==fully opaque) converted to alpha (0==fully transparent). */\r\n public getAbgr(): number {\r\n return ColorDef.getAbgr(this._tbgr);\r\n }\r\n\r\n /** Get the value of a 0xTTBBGGRR color as a number in 0xAABBGGRR format (i.e. red is in low byte). Transparency (0==fully opaque) converted to alpha (0==fully transparent). */\r\n public static getAbgr(tbgr: ColorDefProps): number {\r\n scratchUInt32[0] = tbgr;\r\n scratchBytes[3] = 255 - scratchBytes[3];\r\n return scratchUInt32[0];\r\n }\r\n\r\n /** Get the RGB value of the color as a number in 0xRRGGBB format (i.e blue is in the low byte). Transparency is ignored. Value will be from 0 to 2^24 */\r\n public getRgb(): number {\r\n return ColorDef.getRgb(this._tbgr);\r\n }\r\n\r\n /** Get the RGB value of the 0xTTBBGGRR color as a number in 0xRRGGBB format (i.e blue is in the low byte). Transparency is ignored. Value will be from 0 to 2^24 */\r\n public static getRgb(tbgr: ColorDefProps): number {\r\n scratchUInt32[0] = tbgr;\r\n return (scratchBytes[0] << 16) + (scratchBytes[1] << 8) + scratchBytes[2];\r\n }\r\n\r\n /** Return a copy of this ColorDef with the specified alpha component.\r\n * @param alpha the new alpha value as an integer between 0-255.\r\n * @returns A ColorDef with equivalent red, green, and blue components to this one but with the specified alpha.\r\n */\r\n public withAlpha(alpha: number): ColorDef {\r\n const tbgr = ColorDef.withAlpha(this._tbgr, alpha);\r\n return tbgr === this._tbgr ? this : ColorDef.fromTbgr(tbgr);\r\n }\r\n\r\n /** Return a color equivalent to the specified 0xTTBBGGRR but with modified alpha component.\r\n * @param alpha the new alpha value as an integer between 0-255.\r\n * @returns The 0xTTBBGGRR value equivalent to `tbgr` but with the specified alpha.\r\n */\r\n public static withAlpha(tbgr: ColorDefProps, alpha: number): number {\r\n scratchUInt32[0] = tbgr;\r\n scratchBytes[3] = 255 - (alpha | 0);\r\n return scratchUInt32[0];\r\n }\r\n\r\n /** Get the alpha value for this ColorDef. Will be between 0-255 */\r\n public getAlpha(): number {\r\n return ColorDef.getAlpha(this._tbgr);\r\n }\r\n\r\n /** Extract the alpha value from a 0xTTBBGGRR color. */\r\n public static getAlpha(tbgr: ColorDefProps): number {\r\n scratchUInt32[0] = tbgr;\r\n return 255 - scratchBytes[3];\r\n }\r\n\r\n /** True if this ColorDef is fully opaque. */\r\n public get isOpaque(): boolean {\r\n return ColorDef.isOpaque(this._tbgr);\r\n }\r\n\r\n /** True if the specified 0xTTBBGGRR color is fully opaque. */\r\n public static isOpaque(tbgr: ColorDefProps): boolean {\r\n return 255 === this.getAlpha(tbgr);\r\n }\r\n\r\n /** Get the transparency value for this ColorDef (inverse of alpha). Will be between 0-255. */\r\n public getTransparency(): number {\r\n return ColorDef.getTransparency(this._tbgr);\r\n }\r\n\r\n /** Extract the transparency component from a 0xTTBBGGRR color as an integer between 0-255.. */\r\n public static getTransparency(tbgr: ColorDefProps): number {\r\n scratchUInt32[0] = tbgr;\r\n return scratchBytes[3];\r\n }\r\n\r\n /** Create a copy of this ColorDef with the specified transparency.\r\n * @param transparency the new transparency value. Must be between 0-255, where 0 means 'fully opaque' and 255 means 'fully transparent'.\r\n * @returns a new ColorDef with the same color as this one and the specified transparency.\r\n */\r\n public withTransparency(transparency: number): ColorDef {\r\n const tbgr = ColorDef.withTransparency(this._tbgr, transparency);\r\n return tbgr === this._tbgr ? this : ColorDef.fromTbgr(tbgr);\r\n }\r\n\r\n /** Compute the 0xTTBBGGRR value of the specified color and transparency.\r\n * @param transparency the new transparency as an integer between 0-255.\r\n * @returns The 0xTTBBGGRR value equivalent to `tbgr` but with the specified transparency.\r\n */\r\n public static withTransparency(tbgr: ColorDefProps, transparency: number): ColorDefProps {\r\n return this.withAlpha(tbgr, 255 - transparency);\r\n }\r\n\r\n /** The \"known name\" for this ColorDef. Will be undefined if color value is not in [[ColorByName]] list */\r\n public get name(): string | undefined {\r\n return ColorDef.getName(this.tbgr);\r\n }\r\n\r\n /** Obtain the name of the color in the [[ColorByName]] list associated with the specified 0xTTBBGGRR value, or undefined if no such named color exists.\r\n * @note A handful of colors (like \"aqua\" and \"cyan\") have identical tbgr values; in such cases the first match will be returned.\r\n */\r\n public static getName(tbgr: ColorDefProps): string | undefined {\r\n for (const [key, value] of Object.entries(ColorByName))\r\n if (value === tbgr)\r\n return key;\r\n\r\n return undefined;\r\n }\r\n\r\n /** Convert this ColorDef to a string in the form \"#rrggbb\" where values are hex digits of the respective colors */\r\n public toHexString(): string {\r\n return ColorDef.toHexString(this.tbgr);\r\n }\r\n\r\n /** Convert the 0xTTBBGGRR value to a string in the form \"#rrggbb\". */\r\n public static toHexString(tbgr: ColorDefProps): string {\r\n return `#${(`000000${this.getRgb(tbgr).toString(16)}`).slice(-6)}`;\r\n }\r\n\r\n private static getColorsString(tbgr: ColorDefProps) {\r\n const c = this.getColors(tbgr);\r\n return `${c.r},${c.g},${c.b}`;\r\n }\r\n\r\n /** Convert this ColorDef to a string in the form \"rgb(r,g,b)\" where values are decimal digits of the respective colors. */\r\n public toRgbString(): string {\r\n return ColorDef.toRgbString(this.tbgr);\r\n }\r\n\r\n /** Convert the 0xTTBBGGRR color to a string in the form \"rgb(r,g,b)\" where each component is specified in decimal. */\r\n public static toRgbString(tbgr: ColorDefProps): string {\r\n return `rgb(${this.getColorsString(tbgr)})`;\r\n }\r\n\r\n /** Convert this ColorDef to a string in the form \"rgba(r,g,b,a)\" where color values are decimal digits and a is a fraction */\r\n public toRgbaString(): string {\r\n return ColorDef.toRgbaString(this.tbgr);\r\n }\r\n\r\n /** Convert the 0xTTBBGGRR color to a string of the form \"rgba(r,g,b,a)\" where the color components are specified in decimal and the alpha component is a fraction. */\r\n public static toRgbaString(tbgr: ColorDefProps): string {\r\n return `rgba(${this.getColorsString(tbgr)},${this.getAlpha(tbgr) / 255.})`;\r\n }\r\n\r\n /** Create a ColorDef that is the linear interpolation of this ColorDef and another ColorDef, using a weighting factor.\r\n * @param color2 The other color\r\n * @param weight The weighting factor for color2. 0.0 = this color, 1.0 = color2.\r\n * @param result Optional ColorDef to hold result. If undefined, a new ColorDef is created.\r\n */\r\n public lerp(color2: ColorDef, weight: number): ColorDef {\r\n return ColorDef.fromTbgr(ColorDef.lerp(this.tbgr, color2.tbgr, weight));\r\n }\r\n\r\n /** Interpolate between two 0xTTBBGGRR colors using a weighting factor.\r\n * @param tbgr1 The first color\r\n * @param tbgr2 The other color\r\n * @param weight The weighting factor in [0..1]. A value of 0.0 selects `tbgr1`; 1.0 selects `tbgr2`; 0.5 mixes them evenly; etc.\r\n * @returns The linear interpolation between `tbgr1` and `tbgr2` using the specified weight.\r\n */\r\n public static lerp(tbgr1: ColorDefProps, tbgr2: ColorDefProps, weight: number): ColorDefProps {\r\n const c = this.getColors(tbgr1);\r\n const color = this.getColors(tbgr2);\r\n c.r += (color.r - c.r) * weight;\r\n c.g += (color.g - c.g) * weight;\r\n c.b += (color.b - c.b) * weight;\r\n return this.computeTbgrFromComponents(c.r, c.g, c.b, c.t);\r\n }\r\n\r\n /** Create a new ColorDef that is the inverse (all colors set to 255 - this) of this color. Ignores transparency - result has 0 transparency. */\r\n public inverse(): ColorDef {\r\n return ColorDef.fromTbgr(ColorDef.inverse(this.tbgr));\r\n }\r\n\r\n /** Return a 0xTTBBGGRR color whose color components are the inverse of the input color. The result has 0 transparency. */\r\n public static inverse(tbgr: ColorDefProps): ColorDefProps {\r\n const colors = this.getColors(tbgr);\r\n return this.computeTbgrFromComponents(255 - colors.r, 255 - colors.g, 255 - colors.b);\r\n }\r\n\r\n /** Create a ColorDef from hue, saturation, lightness values */\r\n public static fromHSL(h: number, s: number, l: number, transparency = 0): ColorDef {\r\n return this.fromTbgr(this.computeTbgrFromHSL(h, s, l, transparency));\r\n }\r\n\r\n /** Compute the 0xTTBBGGRR color corresponding to the specified hue, saturation, lightness values. */\r\n public static computeTbgrFromHSL(h: number, s: number, l: number, transparency = 0): ColorDefProps {\r\n const torgb = (p1: number, q1: number, t: number) => {\r\n if (t < 0)\r\n t += 1;\r\n if (t > 1)\r\n t -= 1;\r\n\r\n if (t < 1 / 6)\r\n return p1 + (q1 - p1) * 6 * t;\r\n if (t < 1 / 2)\r\n return q1;\r\n if (t < 2 / 3)\r\n return p1 + (q1 - p1) * 6 * (2 / 3 - t);\r\n\r\n return p1;\r\n };\r\n\r\n const hue2rgb = (p1: number, q1: number, t: number) => Math.round(torgb(p1, q1, t) * 255);\r\n const modulo = (n: number, m: number) => ((n % m) + m) % m;\r\n\r\n // h,s,l ranges are in 0.0 - 1.0\r\n h = modulo(h, 1);\r\n s = Geometry.clamp(s, 0, 1);\r\n l = Geometry.clamp(l, 0, 1);\r\n\r\n if (s === 0) {\r\n l *= 255;\r\n return this.computeTbgrFromComponents(l, l, l, transparency);\r\n }\r\n\r\n const p = l <= 0.5 ? l * (1 + s) : l + s - (l * s);\r\n const q = (2 * l) - p;\r\n return this.computeTbgrFromComponents(\r\n hue2rgb(q, p, h + 1 / 3),\r\n hue2rgb(q, p, h),\r\n hue2rgb(q, p, h - 1 / 3),\r\n transparency);\r\n }\r\n\r\n /** Create an [[HSLColor]] from this ColorDef */\r\n public toHSL(): HSLColor {\r\n // h,s,l ranges are in 0.0 - 1.0\r\n const col = this.colors;\r\n col.r /= 255;\r\n col.g /= 255;\r\n col.b /= 255;\r\n const max = Math.max(col.r, col.g, col.b);\r\n const min = Math.min(col.r, col.g, col.b);\r\n\r\n let hue = 0;\r\n let saturation;\r\n const lightness = (min + max) / 2.0;\r\n\r\n if (min === max) {\r\n saturation = 0;\r\n } else {\r\n const delta = max - min;\r\n saturation = lightness <= 0.5 ? delta / (max + min) : delta / (2 - max - min);\r\n switch (max) {\r\n case col.r:\r\n hue = (col.g - col.b) / delta + (col.g < col.b ? 6 : 0);\r\n break;\r\n case col.g:\r\n hue = (col.b - col.r) / delta + 2;\r\n break;\r\n case col.b:\r\n hue = (col.r - col.g) / delta + 4;\r\n break;\r\n }\r\n\r\n hue /= 6;\r\n }\r\n\r\n return new HSLColor(hue, saturation, lightness);\r\n }\r\n\r\n /** Create an [[HSVColor]] from this ColorDef */\r\n public toHSV(): HSVColor {\r\n const { r, g, b } = this.colors;\r\n let min = (r < g) ? r : g;\r\n if (b < min)\r\n min = b;\r\n\r\n let max = (r > g) ? r : g;\r\n if (b > max)\r\n max = b;\r\n\r\n /* amount of \"blackness\" present */\r\n const v = Math.floor((max / 255.0 * 100) + 0.5);\r\n const deltaRgb = max - min;\r\n const s = (max !== 0.0) ? Math.floor((deltaRgb / max * 100) + 0.5) : 0;\r\n let h = 0;\r\n\r\n if (s) {\r\n const redDistance = (max - r) / deltaRgb;\r\n const greenDistance = (max - g) / deltaRgb;\r\n const blueDistance = (max - b) / deltaRgb;\r\n\r\n let intermediateHue: number;\r\n if (r === max) /* color between yellow & magenta */\r\n intermediateHue = blueDistance - greenDistance;\r\n else if (g === max) /* color between cyan & yellow */\r\n intermediateHue = 2.0 + redDistance - blueDistance;\r\n else /* color between magenta & cyan */\r\n intermediateHue = 4.0 + greenDistance - redDistance;\r\n\r\n /* intermediate hue is [0..6] */\r\n intermediateHue *= 60;\r\n\r\n if (intermediateHue < 0.0)\r\n intermediateHue += 360;\r\n\r\n h = Math.floor(intermediateHue + 0.5);\r\n\r\n if (h >= 360)\r\n h = 0;\r\n } else {\r\n h = 0;\r\n }\r\n\r\n return new HSVColor(h, s, v);\r\n }\r\n\r\n /** Create a ColorDef from an HSVColor */\r\n public static fromHSV(hsv: HSVColor, transparency = 0): ColorDef {\r\n // Check for simple case first.\r\n if ((!hsv.s) || (hsv.h === -1)) {\r\n // hue must be undefined, have no color only white\r\n const white = 0xff & Math.floor(((255.0 * hsv.v) / 100.0) + 0.5 + 3.0e-14);\r\n return ColorDef.from(white, white, white, 0);\r\n }\r\n\r\n let dhue = hsv.h, dsaturation = hsv.s, dvalue = hsv.v;\r\n if (dhue === 360)\r\n dhue = 0.0;\r\n\r\n dhue /= 60; // hue is now [0..6]\r\n const hueIntpart = Math.floor(dhue); // convert double -> int\r\n const hueFractpart = dhue - hueIntpart;\r\n dvalue /= 100;\r\n dsaturation /= 100;\r\n\r\n const p = 0xff & Math.floor((dvalue * (1.0 - dsaturation) * 255.0) + 0.5);\r\n const q = 0xff & Math.floor((dvalue * (1.0 - (dsaturation * hueFractpart)) * 255.0) + 0.5);\r\n const t = 0xff & Math.floor((dvalue * (1.0 - (dsaturation * (1.0 - hueFractpart))) * 255.0) + 0.5);\r\n const v = 0xff & Math.floor(dvalue * 255 + 0.5);\r\n\r\n let r = 0, b = 0, g = 0;\r\n switch (hueIntpart) {\r\n case 0: r = v; g = t; b = p; break; // reddish\r\n case 1: r = q, g = v; b = p; break; // yellowish\r\n case 2: r = p, g = v; b = t; break; // greenish\r\n case 3: r = p, g = q; b = v; break; // cyanish\r\n case 4: r = t, g = p; b = v; break; // bluish\r\n case 5: r = v, g = p; b = q; break; // magenta-ish\r\n }\r\n\r\n return ColorDef.from(r, g, b, transparency);\r\n }\r\n\r\n private visibilityCheck(other: ColorDef): number {\r\n const fg = this.colors;\r\n const bg = other.colors;\r\n // Compute luminosity\r\n const red = Math.abs(fg.r - bg.r);\r\n const green = Math.abs(fg.g - bg.g);\r\n const blue = Math.abs(fg.b - bg.b);\r\n return (0.30 * red) + (0.59 * green) + (0.11 * blue);\r\n }\r\n\r\n /**\r\n * Create a new ColorDef that is adjusted from this ColorDef for maximum contrast against another color. The color will either be lighter\r\n * or darker, depending on which has more visibility against the other color.\r\n * @param other the color to contrast with\r\n * @param alpha optional alpha value for the adjusted color. If not supplied alpha from this color is used.\r\n */\r\n public adjustedForContrast(other: ColorDef, alpha?: number): ColorDef {\r\n const visibility = this.visibilityCheck(other);\r\n if (HSVConstants.VISIBILITY_GOAL <= visibility) {\r\n return undefined !== alpha ? this.withAlpha(alpha) : this;\r\n }\r\n\r\n const adjPercent = Math.floor(((HSVConstants.VISIBILITY_GOAL - visibility) / 255.0) * 100.0);\r\n let darkerHSV = this.toHSV();\r\n let brightHSV = darkerHSV.clone();\r\n\r\n darkerHSV = darkerHSV.adjusted(true, adjPercent);\r\n brightHSV = brightHSV.adjusted(false, adjPercent);\r\n\r\n if (undefined === alpha)\r\n alpha = this.getAlpha();\r\n\r\n const darker = ColorDef.fromHSV(darkerHSV).withAlpha(alpha);\r\n const bright = ColorDef.fromHSV(brightHSV).withAlpha(alpha);\r\n\r\n if (bright.getRgb() === other.getRgb()) // Couldn't adjust brighter...\r\n return darker;\r\n\r\n if (darker.getRgb() === other.getRgb()) // Couldn't adjust darker...\r\n return bright;\r\n\r\n // NOTE: Best choice is the one most visible against the other color...\r\n return (bright.visibilityCheck(other) >= darker.visibilityCheck(other)) ? bright : darker;\r\n }\r\n\r\n /** True if the value of this ColorDef is the same as another ColorDef. */\r\n public equals(other: ColorDef): boolean {\r\n return this._tbgr === other._tbgr;\r\n }\r\n\r\n /** pure black */\r\n public static readonly black = new ColorDef(ColorByName.black);\r\n /** pure white */\r\n public static readonly white = new ColorDef(ColorByName.white);\r\n /** pure red */\r\n public static readonly red = new ColorDef(ColorByName.red);\r\n /** pure green */\r\n public static readonly green = new ColorDef(ColorByName.green);\r\n /** pure blue */\r\n public static readonly blue = new ColorDef(ColorByName.blue);\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonLoggerCategory.js","sourceRoot":"","sources":["../../src/CommonLoggerCategory.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;;GAIG;AACH,IAAY,oBAWX;AAXD,WAAY,oBAAoB;IAC9B,4EAA4E;IAC5E,+DAAuC,CAAA;IACvC,2EAA2E;IAC3E,iEAAyC,CAAA;IACzC,uEAAuE;IACvE,yDAAiC,CAAA;IACjC,sGAAsG;IACtG,yEAAiD,CAAA;IACjD,uGAAuG;IACvG,2EAAmD,CAAA;AACrD,CAAC,EAXW,oBAAoB,oCAApB,oBAAoB,QAW/B","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 Logging\n */\n\n/** Logger categories used by this package\n * @see [Logger]($bentley)\n * @public\n * @extensions\n */\nexport enum CommonLoggerCategory {\n /** The logger category used by common APIs relating to text annotations. */\n Annotations = \"core-common.Annotations\",\n /** The logger category used by common classes relating to ElementProps. */\n ElementProps = \"core-common.ElementProps\",\n /** The logger category used by common classes relating to Geometry. */\n Geometry = \"core-common.Geometry\",\n /** The logger category used by the portions of the RpcInterface framework that run on the backend. */\n RpcInterfaceBackend = \"core-backend.RpcInterface\",\n /** The logger category used by the portions of the RpcInterface framework that run on the frontend. */\n RpcInterfaceFrontend = \"core-frontend.RpcInterface\",\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CommonLoggerCategory.js","sourceRoot":"","sources":["../../src/CommonLoggerCategory.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;;GAIG;AACH,IAAY,oBAWX;AAXD,WAAY,oBAAoB;IAC9B,4EAA4E;IAC5E,+DAAuC,CAAA;IACvC,2EAA2E;IAC3E,iEAAyC,CAAA;IACzC,uEAAuE;IACvE,yDAAiC,CAAA;IACjC,sGAAsG;IACtG,yEAAiD,CAAA;IACjD,uGAAuG;IACvG,2EAAmD,CAAA;AACrD,CAAC,EAXW,oBAAoB,oCAApB,oBAAoB,QAW/B","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 Logging\r\n */\r\n\r\n/** Logger categories used by this package\r\n * @see [Logger]($bentley)\r\n * @public\r\n * @extensions\r\n */\r\nexport enum CommonLoggerCategory {\r\n /** The logger category used by common APIs relating to text annotations. */\r\n Annotations = \"core-common.Annotations\",\r\n /** The logger category used by common classes relating to ElementProps. */\r\n ElementProps = \"core-common.ElementProps\",\r\n /** The logger category used by common classes relating to Geometry. */\r\n Geometry = \"core-common.Geometry\",\r\n /** The logger category used by the portions of the RpcInterface framework that run on the backend. */\r\n RpcInterfaceBackend = \"core-backend.RpcInterface\",\r\n /** The logger category used by the portions of the RpcInterface framework that run on the frontend. */\r\n RpcInterfaceFrontend = \"core-frontend.RpcInterface\",\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConcurrentQuery.js","sourceRoot":"","sources":["../../src/ConcurrentQuery.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;A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ChB,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,6DAAc,CAAA;IACd,uDAAW,CAAA;AACb,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AA0CD,cAAc;AACd,MAAa,YAAa,SAAQ,2BAAY;IACT;IAA+B;IAAlE,YAAmC,QAAa,EAAkB,OAAa,EAAE,EAAa;QAC5F,KAAK,CAAC,EAAE,IAAI,uBAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAD5C,aAAQ,GAAR,QAAQ,CAAK;QAAkB,YAAO,GAAP,OAAO,CAAM;IAE/E,CAAC;IACM,MAAM,CAAC,YAAY,CAAC,QAAa,EAAE,OAAa;QACrD,IAAK,QAAQ,CAAC,MAAiB,IAAK,gBAAgB,CAAC,KAAgB,EAAE,CAAC;YACtE,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC5C,CAAC;QACD,IAAI,QAAQ,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,EAAE,CAAC;YAChD,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,uBAAQ,CAAC,mBAAmB,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CACF;AAZD,oCAYC","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 { BentleyError, CompressedId64Set, DbResult, Id64, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\nimport { Base64 } from \"js-base64\";\n\n/**\n * Specifies the format of the rows returned by the `query` and `restartQuery` methods of\n * [IModelConnection]($frontend), [IModelDb]($backend), and [ECDb]($backend).\n *\n * @public\n * @extensions\n */\nexport enum QueryRowFormat {\n /** Each row is an object in which each non-null column value can be accessed by its name as defined in the ECSql.\n * Null values are omitted.\n */\n UseECSqlPropertyNames,\n /** Each row is an array of values accessed by an index corresponding to the property's position in the ECSql SELECT statement.\n * Null values are included if they are followed by a non-null column, but trailing null values at the end of the array are omitted.\n */\n UseECSqlPropertyIndexes,\n /** Each row is an object in which each non-null column value can be accessed by a [remapped property name]($docs/learning/ECSqlRowFormat.md).\n * This format is backwards-compatible with the format produced by iTwin.js 2.x. Null values are omitted.\n * @depreacted in 4.11. Switch to UseECSqlPropertyIndexes for best performance, and UseECSqlPropertyNames if you want a JSON object as the result.\n */\n UseJsPropertyNames,\n}\n\n/**\n * Specify limit or range of rows to return\n * @public\n * @extensions\n * */\nexport interface QueryLimit {\n /** Number of rows to return */\n count?: number;\n /** Offset from which to return rows */\n offset?: number;\n}\n\n/** @public */\nexport interface QueryPropertyMetaData {\n /** The class name is set to empty if the property is a generated one, otherwise, it is the name of the ECClass that the property is contained within. */\n className: string;\n /** Access string is the property's alias if the property is a generated one, otherwise it is the ECSQL property path. */\n accessString?: string;\n /** True if the property is a generated one. False, if the property directly refers to one of the classes in the FROM or JOIN clauses.\n * Note: Using a column alias always generates a property. So in the ECSQL <c>SELECT AssetID, Length * Breadth AS Area FROM myschema.Cubicle</c> the first column (AssetID) would not be a generated property, but the second (Area) would be.\n */\n generated: boolean;\n /** The index of the property value if the result is formatted as an array */\n index: number;\n /** The JSON name is the property's alias if the property is a generated one, otherwise, it is the ECSQL property path for the system property.\n * The JSON names are unique and _%d is added for duplicate property JSON names to make them unique.\n */\n jsonName: string;\n /** The name is the property's alias if the property is a generated one, otherwise, it is the name of the property. */\n name: string;\n /** If this property is a PrimitiveECProperty, extend type is the extended type name of this property, if it is not defined locally will be inherited from base property if one exists, otherwise extend type is set to an empty string.\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use extendedType instead\n */\n extendType: string;\n /** If this property is a PrimitiveECProperty, extended type is the extended type name of this property, if it is not defined locally will be inherited from base property if one exists, otherwise extended type will be undefined. */\n extendedType?: string;\n /** The type name is set to 'navigation' if the property is a navigation property, otherwise, it is the type name for the property. */\n typeName: string;\n}\n\n/** @beta */\nexport interface DbRuntimeStats {\n cpuTime: number;\n totalTime: number;\n timeLimit: number;\n memLimit: number;\n memUsed: number;\n prepareTime: number;\n}\n\n/**\n * Quota hint for the query.\n * @public\n * @extensions\n * */\nexport interface QueryQuota {\n /** Max time allowed in seconds. This is hint and may not be honoured but help in prioritize request */\n time?: number;\n /** Max memory allowed in bytes. This is hint and may not be honoured but help in prioritize request */\n memory?: number;\n}\n\n/**\n * Config for all request made to concurrent query engine.\n * @public\n * @extensions\n */\nexport interface BaseReaderOptions {\n /** Determine priority of this query default to 0, used as hint and can be overriden by backend. */\n priority?: number;\n /** If specified cancel last query (if any) with same restart token and queue the new query */\n restartToken?: string;\n /** For editing apps this can be set to true and all query will run on primary connection\n * his may cause slow queries execution but the most recent data changes will be visitable via query\n */\n usePrimaryConn?: boolean;\n /** Restrict time or memory for query but use as hint and may be changed base on backend settings */\n quota?: QueryQuota;\n /**\n * @internal\n * Allow query to be be deferred by milliseconds specified. This parameter is ignore by default unless\n * concurrent query is configure to honour it.\n */\n delay?: number;\n}\n\n/**\n * ECSql query config\n * @public\n * @extensions\n * */\nexport interface QueryOptions extends BaseReaderOptions {\n /**\n * default to false. It abbreviate blobs to single bytes. This help cases where wildcard is\n * used in select clause. Use BlobReader api to read individual blob specially if its of large size.\n * */\n abbreviateBlobs?: boolean;\n /**\n * default to false. It will suppress error and will not log it. Useful in cases where we expect query\n * can fail.\n */\n suppressLogErrors?: boolean;\n /** This is used internally. If true it query will return meta data about query. */\n includeMetaData?: boolean;\n /** Limit range of rows returned by query*/\n limit?: QueryLimit;\n /**\n * Convert ECClassId, SourceECClassId, TargetECClassId and RelClassId to respective name.\n * When true, XXXXClassId property will be returned as className.\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use ecsql function ec_classname to get class name instead.\n * */\n convertClassIdsToClassNames?: boolean;\n /**\n * Determine row format.\n */\n rowFormat?: QueryRowFormat;\n}\n/** @beta */\nexport type BlobRange = QueryLimit;\n\n/** @beta */\nexport interface BlobOptions extends BaseReaderOptions {\n range?: BlobRange;\n}\n\n/** @public */\nexport class QueryOptionsBuilder {\n public constructor(private _options: QueryOptions = {}) { }\n public getOptions(): QueryOptions { return this._options; }\n /**\n * @internal\n * Allow to set priority of query. Query will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\n * @param val integer value which can be negative as well. By default its zero.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setPriority(val: number) {\n this._options.priority = val;\n return this;\n }\n /**\n * Allow to set restart token. If restart token is set then any other query(s) in queue with same token is cancelled if its not already executed.\n * @param val A string token identifying a use case in which previous query with same token is cancelled.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setRestartToken(val: string) {\n this._options.restartToken = val;\n return this;\n }\n /**\n * Allow to set quota restriction for query. Its a hint and may be overriden or ignored by concurrent query manager.\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setQuota(val: QueryQuota) {\n this._options.quota = val;\n return this;\n }\n /**\n * Force a query to be executed synchronously against primary connection. This option is ignored if provided by frontend.\n * @param val A boolean value to force use primary connection on main thread to execute query.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setUsePrimaryConnection(val: boolean) {\n this._options.usePrimaryConn = val;\n return this;\n }\n /**\n * By default all blobs are abbreviated to save memory and network bandwidth. If set to false, all blob data will be returned by query as is.\n * Use @type BlobReader to access blob data more efficiently.\n * @param val A boolean value, if set to false will return complete blob type property data. This could cost time and network bandwidth.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setAbbreviateBlobs(val: boolean) {\n this._options.abbreviateBlobs = val;\n return this;\n }\n /**\n * When query fail to prepare it will log error. This setting will suppress log errors in case where query come from user typing it and its expected to fail often.\n * @param val A boolean value, if set to true, any error logging will be suppressed.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setSuppressLogErrors(val: boolean) {\n this._options.suppressLogErrors = val;\n return this;\n }\n /**\n * If set ECClassId, SourceECClassId and TargetECClassId system properties will return qualified name of class instead of a @typedef Id64String.\n * @param val A boolean value.\n * @returns @type QueryOptionsBuilder for fluent interface.\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use ecsql function ec_classname to get class name instead.\n */\n public setConvertClassIdsToNames(val: boolean) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this._options.convertClassIdsToClassNames = val;\n return this;\n }\n /**\n * Specify limit for query. Limit determine number of rows and offset in result-set.\n * @param val Specify count and offset from within the result-set of a ECSQL query.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setLimit(val: QueryLimit) {\n this._options.limit = val;\n return this;\n }\n /**\n * Specify row format returned by concurrent query manager.\n * @param val @enum QueryRowFormat specifying format for result.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setRowFormat(val: QueryRowFormat) {\n this._options.rowFormat = val;\n return this;\n }\n /**\n * @internal\n * Defers execution of query in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\n * @param val Number of milliseconds.\n * @returns @type QueryOptionsBuilder for fluent interface.\n */\n public setDelay(val: number) {\n this._options.delay = val;\n return this;\n }\n}\n/** @beta */\nexport class BlobOptionsBuilder {\n public constructor(private _options: BlobOptions = {}) { }\n public getOptions(): BlobOptions { return this._options; }\n /**\n * @internal\n * Allow to set priority of blob request. Blob request will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\n * @param val integer value which can be negative as well. By default its zero.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setPriority(val: number) {\n this._options.priority = val;\n return this;\n }\n /**\n * Allow to set restart token. If restart token is set then any other blob request in queue with same token is cancelled if its not already executed.\n * @param val A string token identifying a use case in which previous blob request with same token is cancelled.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setRestartToken(val: string) {\n this._options.restartToken = val;\n return this;\n }\n /**\n * Allow to set quota restriction for blob request. Its a hint and may be overriden or ignored by concurrent query manager.\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setQuota(val: QueryQuota) {\n this._options.quota = val;\n return this;\n }\n /**\n * Force a blob request to be executed synchronously against primary connection. This option is ignored if provided by frontend.\n * @param val A boolean value to force use primary connection on main thread to execute blob request.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setUsePrimaryConnection(val: boolean) {\n this._options.usePrimaryConn = val;\n return this;\n }\n /**\n * Specify range with in the blob that need to be returned.\n * @param val Specify offset and count of bytes that need to be returned.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setRange(val: BlobRange) {\n this._options.range = val;\n return this;\n }\n /**\n * @internal\n * Defers execution of blob request in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\n * @param val Number of milliseconds.\n * @returns @type BlobOptionsBuilder for fluent interface.\n */\n public setDelay(val: number) {\n this._options.delay = val;\n return this;\n }\n}\n\n/** @internal */\nexport enum QueryParamType {\n Boolean = 0,\n Double = 1,\n Id = 2,\n IdSet = 3,\n Integer = 4,\n Long = 5,\n Null = 6,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Point2d = 7,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n Point3d = 8,\n String = 9,\n Blob = 10,\n Struct = 11,\n}\n\n/**\n * Bind values to an ECSQL query.\n *\n * All binding class methods accept an `indexOrName` parameter as a `string | number` type and a value to bind to it.\n * A binding must be mapped either by a positional index or a string/name. See the examples below.\n *\n * @example\n * Parameter By Index:\n * ```sql\n * SELECT a, v FROM test.Foo WHERE a=? AND b=?\n * ```\n * The first `?` is index 1 and the second `?` is index 2. The parameter index starts with 1 and not 0.\n *\n * @example\n * Parameter By Name:\n * ```sql\n * SELECT a, v FROM test.Foo WHERE a=:name_a AND b=:name_b\n * ```\n * Using \"name_a\" as the `indexOrName` will bind the provided value to `name_a` in the query. And the same goes for\n * using \"name_b\" and the `name_b` binding respectively.\n *\n * @see\n * - [ECSQL Parameters]($docs/learning/ECSQL.md#ecsql-parameters)\n * - [ECSQL Parameter Types]($docs/learning/ECSQLParameterTypes)\n * - [ECSQL Code Examples]($docs/learning/backend/ECSQLCodeExamples#parameter-bindings)\n *\n * @public\n */\nexport class QueryBinder {\n private _args = {};\n private verify(indexOrName: string | number) {\n if (typeof indexOrName === \"number\") {\n if (indexOrName < 1)\n throw new Error(\"expect index to be >= 1\");\n return;\n }\n if (!/^[a-zA-Z_]+\\w*$/i.test(indexOrName)) {\n throw new Error(\"expect named parameter to meet identifier specification\");\n }\n }\n\n /**\n * Bind boolean value to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val Boolean value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindBoolean(indexOrName: string | number, val: boolean) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true,\n value: {\n type: QueryParamType.Boolean,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind blob value to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val Blob value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindBlob(indexOrName: string | number, val: Uint8Array) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n const base64 = Base64.fromUint8Array(val);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Blob,\n value: base64,\n },\n });\n return this;\n }\n\n /**\n * Bind double value to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val Double value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindDouble(indexOrName: string | number, val: number) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Double,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind @typedef Id64String value to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val @typedef Id64String value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindId(indexOrName: string | number, val: Id64String) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Id,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind @type OrderedId64Iterable to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val @type OrderedId64Iterable value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindIdSet(indexOrName: string | number, val: OrderedId64Iterable) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n OrderedId64Iterable.uniqueIterator(val);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.IdSet,\n value: CompressedId64Set.sortAndCompress(OrderedId64Iterable.uniqueIterator(val)),\n },\n });\n return this;\n }\n\n /**\n * Bind integer to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val Integer value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindInt(indexOrName: string | number, val: number) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Integer,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind struct to ECSQL statement. Struct specified as object.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val struct value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindStruct(indexOrName: string | number, val: object) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Struct,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind long to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val Long value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindLong(indexOrName: string | number, val: number) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Long,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind string to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val String value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindString(indexOrName: string | number, val: string) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.String,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind null to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindNull(indexOrName: string | number) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Null,\n value: null,\n },\n });\n return this;\n }\n\n /**\n * Bind @type Point2d to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val @type Point2d value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindPoint2d(indexOrName: string | number, val: Point2d) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Point2d,\n value: val,\n },\n });\n return this;\n }\n\n /**\n * Bind @type Point3d to ECSQL statement.\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\n * @param val @type Point3d value to bind to ECSQL statement.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public bindPoint3d(indexOrName: string | number, val: Point3d) {\n this.verify(indexOrName);\n const name = String(indexOrName);\n Object.defineProperty(this._args, name, {\n enumerable: true, value: {\n type: QueryParamType.Point3d,\n value: val,\n },\n });\n return this;\n }\n\n private static bind(params: QueryBinder, nameOrId: string | number, val: any) {\n if (typeof val === \"boolean\") {\n params.bindBoolean(nameOrId, val);\n } else if (typeof val === \"number\") {\n params.bindDouble(nameOrId, val);\n } else if (typeof val === \"string\") {\n params.bindString(nameOrId, val);\n } else if (val instanceof Uint8Array) {\n params.bindBlob(nameOrId, val);\n } else if (val instanceof Point2d) {\n params.bindPoint2d(nameOrId, val);\n } else if (val instanceof Point3d) {\n params.bindPoint3d(nameOrId, val);\n } else if (val instanceof Array && val.length > 0 && typeof val[0] === \"string\" && Id64.isValidId64(val[0])) {\n params.bindIdSet(nameOrId, val);\n } else if (typeof val === \"undefined\" || val === null) {\n params.bindNull(nameOrId);\n } else if (typeof val === \"object\" && !Array.isArray(val)) {\n params.bindStruct(nameOrId, val);\n } else {\n throw new Error(\"unsupported type\");\n }\n }\n\n /**\n * Allow bulk bind either parameters by index as value array or by parameter names as object.\n * @param args if array of values is provided then array index is used as index. If object is provided then object property name is used as parameter name of reach value.\n * @returns @type QueryBinder to allow fluent interface.\n */\n public static from(args: any[] | object | undefined): QueryBinder {\n const params = new QueryBinder();\n if (typeof args === \"undefined\")\n return params;\n\n if (Array.isArray(args)) {\n let i = 1;\n for (const val of args) {\n this.bind(params, i++, val);\n }\n } else {\n for (const prop of Object.getOwnPropertyNames(args)) {\n this.bind(params, prop, (args as any)[prop]);\n }\n }\n return params;\n }\n\n public serialize(): object {\n return this._args;\n }\n}\n\n/** @internal */\nexport enum DbRequestKind {\n BlobIO = 0,\n ECSql = 1\n}\n\n/** @internal */\nexport enum DbResponseKind {\n BlobIO = DbRequestKind.BlobIO,\n ECSql = DbRequestKind.ECSql,\n NoResult = 2\n}\n\n/** @internal */\nexport enum DbResponseStatus {\n Done = 1, /* query ran to completion. */\n Cancel = 2, /* Requested by user.*/\n Partial = 3, /* query was running but ran out of quota.*/\n Timeout = 4, /* query time quota expired while it was in queue.*/\n QueueFull = 5, /* could not submit the query as queue was full.*/\n ShuttingDown = 6, /* Shutdown is in progress. */\n Error = 100, /* generic error*/\n Error_ECSql_PreparedFailed = Error + 1, /* ecsql prepared failed*/\n Error_ECSql_StepFailed = Error + 2, /* ecsql step failed*/\n Error_ECSql_RowToJsonFailed = Error + 3, /* ecsql failed to serialized row to json.*/\n Error_ECSql_BindingFailed = Error + 4, /* ecsql binding failed.*/\n Error_BlobIO_OpenFailed = Error + 5, /* class or property or instance specified was not found or property as not of type blob.*/\n Error_BlobIO_OutOfRange = Error + 6, /* range specified is invalid based on size of blob.*/\n}\n\n/** @internal */\nexport enum DbValueFormat {\n ECSqlNames = 0,\n JsNames = 1\n}\n\n/** @internal */\nexport interface DbRequest extends BaseReaderOptions {\n kind?: DbRequestKind;\n}\n\n/** @internal */\nexport interface DbQueryRequest extends DbRequest, QueryOptions {\n valueFormat?: DbValueFormat;\n query: string;\n args?: object;\n}\n\n/** @internal */\nexport interface DbBlobRequest extends DbRequest, BlobOptions {\n className: string;\n accessString: string;\n instanceId: Id64String;\n}\n\n/** @internal */\nexport interface DbResponse {\n stats: DbRuntimeStats;\n status: DbResponseStatus;\n kind: DbResponseKind;\n error?: string;\n}\n\n/** @internal */\nexport interface DbQueryResponse extends DbResponse {\n meta: QueryPropertyMetaData[];\n data: any[];\n rowCount: number;\n}\n\n/** @internal */\nexport interface DbBlobResponse extends DbResponse {\n data?: Uint8Array;\n rawBlobSize: number;\n}\n\n/** @public */\nexport class DbQueryError extends BentleyError {\n public constructor(public readonly response: any, public readonly request?: any, rc?: DbResult) {\n super(rc ?? DbResult.BE_SQLITE_ERROR, response.error, { response, request });\n }\n public static throwIfError(response: any, request?: any) {\n if ((response.status as number) >= (DbResponseStatus.Error as number)) {\n throw new DbQueryError(response, request);\n }\n if (response.status === DbResponseStatus.Cancel) {\n throw new DbQueryError(response, request, DbResult.BE_SQLITE_INTERRUPT);\n }\n }\n}\n\n/** @internal */\nexport interface DbRequestExecutor<TRequest extends DbRequest, TResponse extends DbResponse> {\n execute(request: TRequest): Promise<TResponse>;\n}\n\n/** @internal */\nexport interface DbQueryConfig {\n globalQuota?: QueryQuota;\n /** For testing */\n ignoreDelay?: boolean;\n /** Priority of request is ignored */\n ignorePriority?: boolean;\n /** Max queue size after which queries are rejected with error QueueFull */\n requestQueueSize?: number;\n /** Number of worker thread, default to 4 */\n workerThreads?: number;\n /** Use thread connection to prepare the statement */\n doNotUsePrimaryConnToPrepare?: boolean;\n /** After no activity for given time concurrent query will automatically shutdown */\n autoShutdownWhenIdleForSeconds?: number;\n /** Maximum number of statement cache per worker. Default to 40 */\n statementCacheSizePerWorker?: number;\n /* Monitor poll interval in milliseconds. Its responsible for cancelling queries that pass quota. It can be set between 1000 and Max time quota for query */\n monitorPollInterval?: number;\n /** Set memory map io for each worker connection size in bytes. Default to zero mean do not use mmap io */\n memoryMapFileSize?: number;\n /** How often to measure progress of a running ECSql statement which is used to enforced time limit */\n progressOpCount?: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ConcurrentQuery.js","sourceRoot":"","sources":["../../src/ConcurrentQuery.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAuH;AACvH,wDAAwD;AACxD,yCAAmC;AAEnC;;;;;;GAMG;AACH,IAAY,cAcX;AAdD,WAAY,cAAc;IACxB;;OAEG;IACH,qFAAqB,CAAA;IACrB;;OAEG;IACH,yFAAuB,CAAA;IACvB;;;OAGG;IACH,+EAAkB,CAAA;AACpB,CAAC,EAdW,cAAc,8BAAd,cAAc,QAczB;AA+HD,cAAc;AACd,MAAa,mBAAmB;IACH;IAA3B,YAA2B,WAAyB,EAAE;QAA3B,aAAQ,GAAR,QAAQ,CAAmB;IAAI,CAAC;IACpD,UAAU,KAAmB,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3D;;;;;OAKG;IACI,WAAW,CAAC,GAAW;QAC5B,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,GAAG,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;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AY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC5C,CAAC;QACD,IAAI,QAAQ,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,EAAE,CAAC;YAChD,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,uBAAQ,CAAC,mBAAmB,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CACF;AAZD,oCAYC","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 { BentleyError, CompressedId64Set, DbResult, Id64, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport { Point2d, Point3d } from \"@itwin/core-geometry\";\r\nimport { Base64 } from \"js-base64\";\r\n\r\n/**\r\n * Specifies the format of the rows returned by the `query` and `restartQuery` methods of\r\n * [IModelConnection]($frontend), [IModelDb]($backend), and [ECDb]($backend).\r\n *\r\n * @public\r\n * @extensions\r\n */\r\nexport enum QueryRowFormat {\r\n /** Each row is an object in which each non-null column value can be accessed by its name as defined in the ECSql.\r\n * Null values are omitted.\r\n */\r\n UseECSqlPropertyNames,\r\n /** Each row is an array of values accessed by an index corresponding to the property's position in the ECSql SELECT statement.\r\n * Null values are included if they are followed by a non-null column, but trailing null values at the end of the array are omitted.\r\n */\r\n UseECSqlPropertyIndexes,\r\n /** Each row is an object in which each non-null column value can be accessed by a [remapped property name]($docs/learning/ECSqlRowFormat.md).\r\n * This format is backwards-compatible with the format produced by iTwin.js 2.x. Null values are omitted.\r\n * @depreacted in 4.11. Switch to UseECSqlPropertyIndexes for best performance, and UseECSqlPropertyNames if you want a JSON object as the result.\r\n */\r\n UseJsPropertyNames,\r\n}\r\n\r\n/**\r\n * Specify limit or range of rows to return\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryLimit {\r\n /** Number of rows to return */\r\n count?: number;\r\n /** Offset from which to return rows */\r\n offset?: number;\r\n}\r\n\r\n/** @public */\r\nexport interface QueryPropertyMetaData {\r\n /** The class name is set to empty if the property is a generated one, otherwise, it is the name of the ECClass that the property is contained within. */\r\n className: string;\r\n /** Access string is the property's alias if the property is a generated one, otherwise it is the ECSQL property path. */\r\n accessString?: string;\r\n /** True if the property is a generated one. False, if the property directly refers to one of the classes in the FROM or JOIN clauses.\r\n * Note: Using a column alias always generates a property. So in the ECSQL <c>SELECT AssetID, Length * Breadth AS Area FROM myschema.Cubicle</c> the first column (AssetID) would not be a generated property, but the second (Area) would be.\r\n */\r\n generated: boolean;\r\n /** The index of the property value if the result is formatted as an array */\r\n index: number;\r\n /** The JSON name is the property's alias if the property is a generated one, otherwise, it is the ECSQL property path for the system property.\r\n * The JSON names are unique and _%d is added for duplicate property JSON names to make them unique.\r\n */\r\n jsonName: string;\r\n /** The name is the property's alias if the property is a generated one, otherwise, it is the name of the property. */\r\n name: string;\r\n /** If this property is a PrimitiveECProperty, extend type is the extended type name of this property, if it is not defined locally will be inherited from base property if one exists, otherwise extend type is set to an empty string.\r\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use extendedType instead\r\n */\r\n extendType: string;\r\n /** If this property is a PrimitiveECProperty, extended type is the extended type name of this property, if it is not defined locally will be inherited from base property if one exists, otherwise extended type will be undefined. */\r\n extendedType?: string;\r\n /** The type name is set to 'navigation' if the property is a navigation property, otherwise, it is the type name for the property. */\r\n typeName: string;\r\n}\r\n\r\n/** @beta */\r\nexport interface DbRuntimeStats {\r\n cpuTime: number;\r\n totalTime: number;\r\n timeLimit: number;\r\n memLimit: number;\r\n memUsed: number;\r\n prepareTime: number;\r\n}\r\n\r\n/**\r\n * Quota hint for the query.\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryQuota {\r\n /** Max time allowed in seconds. This is hint and may not be honoured but help in prioritize request */\r\n time?: number;\r\n /** Max memory allowed in bytes. This is hint and may not be honoured but help in prioritize request */\r\n memory?: number;\r\n}\r\n\r\n/**\r\n * Config for all request made to concurrent query engine.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BaseReaderOptions {\r\n /** Determine priority of this query default to 0, used as hint and can be overriden by backend. */\r\n priority?: number;\r\n /** If specified cancel last query (if any) with same restart token and queue the new query */\r\n restartToken?: string;\r\n /** For editing apps this can be set to true and all query will run on primary connection\r\n * his may cause slow queries execution but the most recent data changes will be visitable via query\r\n */\r\n usePrimaryConn?: boolean;\r\n /** Restrict time or memory for query but use as hint and may be changed base on backend settings */\r\n quota?: QueryQuota;\r\n /**\r\n * @internal\r\n * Allow query to be be deferred by milliseconds specified. This parameter is ignore by default unless\r\n * concurrent query is configure to honour it.\r\n */\r\n delay?: number;\r\n}\r\n\r\n/**\r\n * ECSql query config\r\n * @public\r\n * @extensions\r\n * */\r\nexport interface QueryOptions extends BaseReaderOptions {\r\n /**\r\n * default to false. It abbreviate blobs to single bytes. This help cases where wildcard is\r\n * used in select clause. Use BlobReader api to read individual blob specially if its of large size.\r\n * */\r\n abbreviateBlobs?: boolean;\r\n /**\r\n * default to false. It will suppress error and will not log it. Useful in cases where we expect query\r\n * can fail.\r\n */\r\n suppressLogErrors?: boolean;\r\n /** This is used internally. If true it query will return meta data about query. */\r\n includeMetaData?: boolean;\r\n /** Limit range of rows returned by query*/\r\n limit?: QueryLimit;\r\n /**\r\n * Convert ECClassId, SourceECClassId, TargetECClassId and RelClassId to respective name.\r\n * When true, XXXXClassId property will be returned as className.\r\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use ecsql function ec_classname to get class name instead.\r\n * */\r\n convertClassIdsToClassNames?: boolean;\r\n /**\r\n * Determine row format.\r\n */\r\n rowFormat?: QueryRowFormat;\r\n}\r\n/** @beta */\r\nexport type BlobRange = QueryLimit;\r\n\r\n/** @beta */\r\nexport interface BlobOptions extends BaseReaderOptions {\r\n range?: BlobRange;\r\n}\r\n\r\n/** @public */\r\nexport class QueryOptionsBuilder {\r\n public constructor(private _options: QueryOptions = {}) { }\r\n public getOptions(): QueryOptions { return this._options; }\r\n /**\r\n * @internal\r\n * Allow to set priority of query. Query will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\r\n * @param val integer value which can be negative as well. By default its zero.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setPriority(val: number) {\r\n this._options.priority = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set restart token. If restart token is set then any other query(s) in queue with same token is cancelled if its not already executed.\r\n * @param val A string token identifying a use case in which previous query with same token is cancelled.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setRestartToken(val: string) {\r\n this._options.restartToken = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set quota restriction for query. Its a hint and may be overriden or ignored by concurrent query manager.\r\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setQuota(val: QueryQuota) {\r\n this._options.quota = val;\r\n return this;\r\n }\r\n /**\r\n * Force a query to be executed synchronously against primary connection. This option is ignored if provided by frontend.\r\n * @param val A boolean value to force use primary connection on main thread to execute query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setUsePrimaryConnection(val: boolean) {\r\n this._options.usePrimaryConn = val;\r\n return this;\r\n }\r\n /**\r\n * By default all blobs are abbreviated to save memory and network bandwidth. If set to false, all blob data will be returned by query as is.\r\n * Use @type BlobReader to access blob data more efficiently.\r\n * @param val A boolean value, if set to false will return complete blob type property data. This could cost time and network bandwidth.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setAbbreviateBlobs(val: boolean) {\r\n this._options.abbreviateBlobs = val;\r\n return this;\r\n }\r\n /**\r\n * When query fail to prepare it will log error. This setting will suppress log errors in case where query come from user typing it and its expected to fail often.\r\n * @param val A boolean value, if set to true, any error logging will be suppressed.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setSuppressLogErrors(val: boolean) {\r\n this._options.suppressLogErrors = val;\r\n return this;\r\n }\r\n /**\r\n * If set ECClassId, SourceECClassId and TargetECClassId system properties will return qualified name of class instead of a @typedef Id64String.\r\n * @param val A boolean value.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n * @deprecated in 4.11 - will not be removed until after 2026-06-13. Use ecsql function ec_classname to get class name instead.\r\n */\r\n public setConvertClassIdsToNames(val: boolean) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this._options.convertClassIdsToClassNames = val;\r\n return this;\r\n }\r\n /**\r\n * Specify limit for query. Limit determine number of rows and offset in result-set.\r\n * @param val Specify count and offset from within the result-set of a ECSQL query.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setLimit(val: QueryLimit) {\r\n this._options.limit = val;\r\n return this;\r\n }\r\n /**\r\n * Specify row format returned by concurrent query manager.\r\n * @param val @enum QueryRowFormat specifying format for result.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setRowFormat(val: QueryRowFormat) {\r\n this._options.rowFormat = val;\r\n return this;\r\n }\r\n /**\r\n * @internal\r\n * Defers execution of query in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\r\n * @param val Number of milliseconds.\r\n * @returns @type QueryOptionsBuilder for fluent interface.\r\n */\r\n public setDelay(val: number) {\r\n this._options.delay = val;\r\n return this;\r\n }\r\n}\r\n/** @beta */\r\nexport class BlobOptionsBuilder {\r\n public constructor(private _options: BlobOptions = {}) { }\r\n public getOptions(): BlobOptions { return this._options; }\r\n /**\r\n * @internal\r\n * Allow to set priority of blob request. Blob request will be inserted int queue base on priority value. This value will be ignored if concurrent query is configured with ignored priority is true.\r\n * @param val integer value which can be negative as well. By default its zero.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setPriority(val: number) {\r\n this._options.priority = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set restart token. If restart token is set then any other blob request in queue with same token is cancelled if its not already executed.\r\n * @param val A string token identifying a use case in which previous blob request with same token is cancelled.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setRestartToken(val: string) {\r\n this._options.restartToken = val;\r\n return this;\r\n }\r\n /**\r\n * Allow to set quota restriction for blob request. Its a hint and may be overriden or ignored by concurrent query manager.\r\n * @param val @type QueryQuota Specify time and memory that can be used by a query.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setQuota(val: QueryQuota) {\r\n this._options.quota = val;\r\n return this;\r\n }\r\n /**\r\n * Force a blob request to be executed synchronously against primary connection. This option is ignored if provided by frontend.\r\n * @param val A boolean value to force use primary connection on main thread to execute blob request.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setUsePrimaryConnection(val: boolean) {\r\n this._options.usePrimaryConn = val;\r\n return this;\r\n }\r\n /**\r\n * Specify range with in the blob that need to be returned.\r\n * @param val Specify offset and count of bytes that need to be returned.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setRange(val: BlobRange) {\r\n this._options.range = val;\r\n return this;\r\n }\r\n /**\r\n * @internal\r\n * Defers execution of blob request in queue by specified milliseconds. This parameter is ignored by default unless concurrent query is configure to not ignore it.\r\n * @param val Number of milliseconds.\r\n * @returns @type BlobOptionsBuilder for fluent interface.\r\n */\r\n public setDelay(val: number) {\r\n this._options.delay = val;\r\n return this;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport enum QueryParamType {\r\n Boolean = 0,\r\n Double = 1,\r\n Id = 2,\r\n IdSet = 3,\r\n Integer = 4,\r\n Long = 5,\r\n Null = 6,\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n Point2d = 7,\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n Point3d = 8,\r\n String = 9,\r\n Blob = 10,\r\n Struct = 11,\r\n}\r\n\r\n/**\r\n * Bind values to an ECSQL query.\r\n *\r\n * All binding class methods accept an `indexOrName` parameter as a `string | number` type and a value to bind to it.\r\n * A binding must be mapped either by a positional index or a string/name. See the examples below.\r\n *\r\n * @example\r\n * Parameter By Index:\r\n * ```sql\r\n * SELECT a, v FROM test.Foo WHERE a=? AND b=?\r\n * ```\r\n * The first `?` is index 1 and the second `?` is index 2. The parameter index starts with 1 and not 0.\r\n *\r\n * @example\r\n * Parameter By Name:\r\n * ```sql\r\n * SELECT a, v FROM test.Foo WHERE a=:name_a AND b=:name_b\r\n * ```\r\n * Using \"name_a\" as the `indexOrName` will bind the provided value to `name_a` in the query. And the same goes for\r\n * using \"name_b\" and the `name_b` binding respectively.\r\n *\r\n * @see\r\n * - [ECSQL Parameters]($docs/learning/ECSQL.md#ecsql-parameters)\r\n * - [ECSQL Parameter Types]($docs/learning/ECSQLParameterTypes)\r\n * - [ECSQL Code Examples]($docs/learning/backend/ECSQLCodeExamples#parameter-bindings)\r\n *\r\n * @public\r\n */\r\nexport class QueryBinder {\r\n private _args = {};\r\n private verify(indexOrName: string | number) {\r\n if (typeof indexOrName === \"number\") {\r\n if (indexOrName < 1)\r\n throw new Error(\"expect index to be >= 1\");\r\n return;\r\n }\r\n if (!/^[a-zA-Z_]+\\w*$/i.test(indexOrName)) {\r\n throw new Error(\"expect named parameter to meet identifier specification\");\r\n }\r\n }\r\n\r\n /**\r\n * Bind boolean value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Boolean value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindBoolean(indexOrName: string | number, val: boolean) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true,\r\n value: {\r\n type: QueryParamType.Boolean,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind blob value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Blob value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindBlob(indexOrName: string | number, val: Uint8Array) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n const base64 = Base64.fromUint8Array(val);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Blob,\r\n value: base64,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind double value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Double value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindDouble(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Double,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @typedef Id64String value to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @typedef Id64String value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindId(indexOrName: string | number, val: Id64String) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Id,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type OrderedId64Iterable to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type OrderedId64Iterable value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindIdSet(indexOrName: string | number, val: OrderedId64Iterable) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n OrderedId64Iterable.uniqueIterator(val);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.IdSet,\r\n value: CompressedId64Set.sortAndCompress(OrderedId64Iterable.uniqueIterator(val)),\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind integer to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Integer value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindInt(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Integer,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind struct to ECSQL statement. Struct specified as object.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val struct value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindStruct(indexOrName: string | number, val: object) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Struct,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind long to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val Long value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindLong(indexOrName: string | number, val: number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Long,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind string to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val String value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindString(indexOrName: string | number, val: string) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.String,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind null to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindNull(indexOrName: string | number) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Null,\r\n value: null,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type Point2d to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type Point2d value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindPoint2d(indexOrName: string | number, val: Point2d) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Point2d,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n /**\r\n * Bind @type Point3d to ECSQL statement.\r\n * @param indexOrName Specify parameter index or its name used in ECSQL statement.\r\n * @param val @type Point3d value to bind to ECSQL statement.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public bindPoint3d(indexOrName: string | number, val: Point3d) {\r\n this.verify(indexOrName);\r\n const name = String(indexOrName);\r\n Object.defineProperty(this._args, name, {\r\n enumerable: true, value: {\r\n type: QueryParamType.Point3d,\r\n value: val,\r\n },\r\n });\r\n return this;\r\n }\r\n\r\n private static bind(params: QueryBinder, nameOrId: string | number, val: any) {\r\n if (typeof val === \"boolean\") {\r\n params.bindBoolean(nameOrId, val);\r\n } else if (typeof val === \"number\") {\r\n params.bindDouble(nameOrId, val);\r\n } else if (typeof val === \"string\") {\r\n params.bindString(nameOrId, val);\r\n } else if (val instanceof Uint8Array) {\r\n params.bindBlob(nameOrId, val);\r\n } else if (val instanceof Point2d) {\r\n params.bindPoint2d(nameOrId, val);\r\n } else if (val instanceof Point3d) {\r\n params.bindPoint3d(nameOrId, val);\r\n } else if (val instanceof Array && val.length > 0 && typeof val[0] === \"string\" && Id64.isValidId64(val[0])) {\r\n params.bindIdSet(nameOrId, val);\r\n } else if (typeof val === \"undefined\" || val === null) {\r\n params.bindNull(nameOrId);\r\n } else if (typeof val === \"object\" && !Array.isArray(val)) {\r\n params.bindStruct(nameOrId, val);\r\n } else {\r\n throw new Error(\"unsupported type\");\r\n }\r\n }\r\n\r\n /**\r\n * Allow bulk bind either parameters by index as value array or by parameter names as object.\r\n * @param args if array of values is provided then array index is used as index. If object is provided then object property name is used as parameter name of reach value.\r\n * @returns @type QueryBinder to allow fluent interface.\r\n */\r\n public static from(args: any[] | object | undefined): QueryBinder {\r\n const params = new QueryBinder();\r\n if (typeof args === \"undefined\")\r\n return params;\r\n\r\n if (Array.isArray(args)) {\r\n let i = 1;\r\n for (const val of args) {\r\n this.bind(params, i++, val);\r\n }\r\n } else {\r\n for (const prop of Object.getOwnPropertyNames(args)) {\r\n this.bind(params, prop, (args as any)[prop]);\r\n }\r\n }\r\n return params;\r\n }\r\n\r\n public serialize(): object {\r\n return this._args;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport enum DbRequestKind {\r\n BlobIO = 0,\r\n ECSql = 1\r\n}\r\n\r\n/** @internal */\r\nexport enum DbResponseKind {\r\n BlobIO = DbRequestKind.BlobIO,\r\n ECSql = DbRequestKind.ECSql,\r\n NoResult = 2\r\n}\r\n\r\n/** @internal */\r\nexport enum DbResponseStatus {\r\n Done = 1, /* query ran to completion. */\r\n Cancel = 2, /* Requested by user.*/\r\n Partial = 3, /* query was running but ran out of quota.*/\r\n Timeout = 4, /* query time quota expired while it was in queue.*/\r\n QueueFull = 5, /* could not submit the query as queue was full.*/\r\n ShuttingDown = 6, /* Shutdown is in progress. */\r\n Error = 100, /* generic error*/\r\n Error_ECSql_PreparedFailed = Error + 1, /* ecsql prepared failed*/\r\n Error_ECSql_StepFailed = Error + 2, /* ecsql step failed*/\r\n Error_ECSql_RowToJsonFailed = Error + 3, /* ecsql failed to serialized row to json.*/\r\n Error_ECSql_BindingFailed = Error + 4, /* ecsql binding failed.*/\r\n Error_BlobIO_OpenFailed = Error + 5, /* class or property or instance specified was not found or property as not of type blob.*/\r\n Error_BlobIO_OutOfRange = Error + 6, /* range specified is invalid based on size of blob.*/\r\n}\r\n\r\n/** @internal */\r\nexport enum DbValueFormat {\r\n ECSqlNames = 0,\r\n JsNames = 1\r\n}\r\n\r\n/** @internal */\r\nexport interface DbRequest extends BaseReaderOptions {\r\n kind?: DbRequestKind;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryRequest extends DbRequest, QueryOptions {\r\n valueFormat?: DbValueFormat;\r\n query: string;\r\n args?: object;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbBlobRequest extends DbRequest, BlobOptions {\r\n className: string;\r\n accessString: string;\r\n instanceId: Id64String;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbResponse {\r\n stats: DbRuntimeStats;\r\n status: DbResponseStatus;\r\n kind: DbResponseKind;\r\n error?: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryResponse extends DbResponse {\r\n meta: QueryPropertyMetaData[];\r\n data: any[];\r\n rowCount: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbBlobResponse extends DbResponse {\r\n data?: Uint8Array;\r\n rawBlobSize: number;\r\n}\r\n\r\n/** @public */\r\nexport class DbQueryError extends BentleyError {\r\n public constructor(public readonly response: any, public readonly request?: any, rc?: DbResult) {\r\n super(rc ?? DbResult.BE_SQLITE_ERROR, response.error, { response, request });\r\n }\r\n public static throwIfError(response: any, request?: any) {\r\n if ((response.status as number) >= (DbResponseStatus.Error as number)) {\r\n throw new DbQueryError(response, request);\r\n }\r\n if (response.status === DbResponseStatus.Cancel) {\r\n throw new DbQueryError(response, request, DbResult.BE_SQLITE_INTERRUPT);\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport interface DbRequestExecutor<TRequest extends DbRequest, TResponse extends DbResponse> {\r\n execute(request: TRequest): Promise<TResponse>;\r\n}\r\n\r\n/** @internal */\r\nexport interface DbQueryConfig {\r\n globalQuota?: QueryQuota;\r\n /** For testing */\r\n ignoreDelay?: boolean;\r\n /** Priority of request is ignored */\r\n ignorePriority?: boolean;\r\n /** Max queue size after which queries are rejected with error QueueFull */\r\n requestQueueSize?: number;\r\n /** Number of worker thread, default to 4 */\r\n workerThreads?: number;\r\n /** Use thread connection to prepare the statement */\r\n doNotUsePrimaryConnToPrepare?: boolean;\r\n /** After no activity for given time concurrent query will automatically shutdown */\r\n autoShutdownWhenIdleForSeconds?: number;\r\n /** Maximum number of statement cache per worker. Default to 40 */\r\n statementCacheSizePerWorker?: number;\r\n /* Monitor poll interval in milliseconds. Its responsible for cancelling queries that pass quota. It can be set between 1000 and Max time quota for query */\r\n monitorPollInterval?: number;\r\n /** Set memory map io for each worker connection size in bytes. Default to zero mean do not use mmap io */\r\n memoryMapFileSize?: number;\r\n /** How often to measure progress of a running ECSql statement which is used to enforced time limit */\r\n progressOpCount?: number;\r\n}\r\n"]}
|