@itwin/core-common 3.6.0-dev.8 → 4.0.0-dev.2
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/LICENSE.md +1 -1
- package/lib/cjs/AuthorizationClient.d.ts +9 -3
- package/lib/cjs/AuthorizationClient.d.ts.map +1 -1
- package/lib/cjs/AuthorizationClient.js.map +1 -1
- package/lib/cjs/BackendTypes.d.ts +3 -3
- package/lib/cjs/BackendTypes.d.ts.map +1 -1
- package/lib/cjs/BackendTypes.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.d.ts +2 -2
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/CloudStorage.d.ts +5 -5
- package/lib/cjs/CloudStorage.js +3 -3
- package/lib/cjs/CloudStorage.js.map +1 -1
- package/lib/cjs/CloudStorageTileCache.d.ts +1 -1
- package/lib/cjs/CloudStorageTileCache.js +1 -1
- package/lib/cjs/CloudStorageTileCache.js.map +1 -1
- package/lib/cjs/Code.d.ts +31 -10
- package/lib/cjs/Code.d.ts.map +1 -1
- package/lib/cjs/Code.js +17 -29
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ContextRealityModel.d.ts +30 -3
- package/lib/cjs/ContextRealityModel.d.ts.map +1 -1
- package/lib/cjs/ContextRealityModel.js +23 -8
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.d.ts +4 -0
- package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js +5 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ElementMesh.js +2 -2
- package/lib/cjs/ElementMesh.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +5 -1
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EntityProps.d.ts +2 -1
- package/lib/cjs/EntityProps.d.ts.map +1 -1
- package/lib/cjs/EntityProps.js +1 -0
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/FeatureSymbology.d.ts +3 -3
- package/lib/cjs/FeatureSymbology.js +3 -3
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/IModel.d.ts +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.d.ts +10 -4
- package/lib/cjs/IModelError.d.ts.map +1 -1
- package/lib/cjs/IModelError.js +3 -4
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/Localization.d.ts +1 -1
- package/lib/cjs/Localization.d.ts.map +1 -1
- package/lib/cjs/Localization.js +8 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/MaterialProps.d.ts +42 -7
- package/lib/cjs/MaterialProps.d.ts.map +1 -1
- package/lib/cjs/MaterialProps.js +13 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.d.ts +65 -0
- package/lib/cjs/RealityModelDisplaySettings.d.ts.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js +30 -2
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/RenderMaterial.d.ts +1 -1
- package/lib/cjs/RenderMaterial.d.ts.map +1 -1
- package/lib/cjs/RenderMaterial.js +1 -1
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderTexture.d.ts +1 -1
- package/lib/cjs/RenderTexture.js +1 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/RpcInterface.d.ts.map +1 -1
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/RpcManager.d.ts.map +1 -1
- package/lib/cjs/RpcManager.js.map +1 -1
- package/lib/cjs/TerrainSettings.d.ts +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.d.ts +5 -3
- package/lib/cjs/TextureMapping.d.ts.map +1 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/ViewFlags.d.ts +2 -6
- package/lib/cjs/ViewFlags.d.ts.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.d.ts +2 -2
- package/lib/cjs/ViewProps.d.ts.map +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/core-common.d.ts +0 -1
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +0 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.d.ts +15 -2
- package/lib/cjs/geometry/BoundingSphere.d.ts.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js +18 -4
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.d.ts +59 -10
- package/lib/cjs/geometry/FrustumPlanes.d.ts.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js +94 -33
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +12 -12
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.d.ts +2 -2
- package/lib/cjs/rpc/IModelTileRpcInterface.js +4 -4
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.d.ts.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js +1 -0
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/WipRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.d.ts +6 -1
- package/lib/cjs/rpc/core/RpcConstants.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js +7 -1
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js +1 -0
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js +1 -0
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js +1 -0
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js +1 -0
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js +1 -0
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequestContext.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js +1 -0
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js +1 -0
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.d.ts.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +1 -0
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.d.ts +1 -0
- package/lib/cjs/rpc/web/OpenAPI.d.ts.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js +1 -0
- package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +2 -0
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js +1 -0
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js +5 -5
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js +2 -2
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js +5 -5
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js +6 -6
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
- package/lib/cjs/tile/IModelTileIO.js +12 -12
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js +5 -5
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js +3 -3
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/esm/AuthorizationClient.d.ts +9 -3
- package/lib/esm/AuthorizationClient.d.ts.map +1 -1
- package/lib/esm/AuthorizationClient.js.map +1 -1
- package/lib/esm/BackendTypes.d.ts +3 -3
- package/lib/esm/BackendTypes.d.ts.map +1 -1
- package/lib/esm/BackendTypes.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.d.ts +2 -2
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/CloudStorage.d.ts +5 -5
- package/lib/esm/CloudStorage.js +3 -3
- package/lib/esm/CloudStorage.js.map +1 -1
- package/lib/esm/CloudStorageTileCache.d.ts +1 -1
- package/lib/esm/CloudStorageTileCache.js +1 -1
- package/lib/esm/CloudStorageTileCache.js.map +1 -1
- package/lib/esm/Code.d.ts +31 -10
- package/lib/esm/Code.d.ts.map +1 -1
- package/lib/esm/Code.js +17 -29
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ContextRealityModel.d.ts +30 -3
- package/lib/esm/ContextRealityModel.d.ts.map +1 -1
- package/lib/esm/ContextRealityModel.js +23 -8
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.d.ts +4 -0
- package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/esm/DisplayStyleSettings.js +5 -1
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ElementMesh.js +2 -2
- package/lib/esm/ElementMesh.js.map +1 -1
- package/lib/esm/ElementProps.d.ts +5 -1
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EntityProps.d.ts +2 -1
- package/lib/esm/EntityProps.d.ts.map +1 -1
- package/lib/esm/EntityProps.js +1 -0
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/FeatureSymbology.d.ts +3 -3
- package/lib/esm/FeatureSymbology.js +3 -3
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/IModel.d.ts +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.d.ts +10 -4
- package/lib/esm/IModelError.d.ts.map +1 -1
- package/lib/esm/IModelError.js +3 -2
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/Localization.d.ts +1 -1
- package/lib/esm/Localization.d.ts.map +1 -1
- package/lib/esm/Localization.js +8 -1
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/MaterialProps.d.ts +42 -7
- package/lib/esm/MaterialProps.d.ts.map +1 -1
- package/lib/esm/MaterialProps.js +12 -0
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.d.ts +65 -0
- package/lib/esm/RealityModelDisplaySettings.d.ts.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js +30 -2
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/RenderMaterial.d.ts +1 -1
- package/lib/esm/RenderMaterial.d.ts.map +1 -1
- package/lib/esm/RenderMaterial.js +1 -1
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderTexture.d.ts +1 -1
- package/lib/esm/RenderTexture.js +1 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/RpcInterface.d.ts.map +1 -1
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/RpcManager.d.ts.map +1 -1
- package/lib/esm/RpcManager.js.map +1 -1
- package/lib/esm/TerrainSettings.d.ts +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.d.ts +5 -3
- package/lib/esm/TextureMapping.d.ts.map +1 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/ViewFlags.d.ts +2 -6
- package/lib/esm/ViewFlags.d.ts.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/ViewProps.d.ts +2 -2
- package/lib/esm/ViewProps.d.ts.map +1 -1
- package/lib/esm/ViewProps.js.map +1 -1
- package/lib/esm/core-common.d.ts +0 -1
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +0 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.d.ts +15 -2
- package/lib/esm/geometry/BoundingSphere.d.ts.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js +18 -4
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.d.ts +59 -10
- package/lib/esm/geometry/FrustumPlanes.d.ts.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js +94 -33
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +12 -12
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.d.ts +2 -2
- package/lib/esm/rpc/IModelTileRpcInterface.js +4 -4
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.d.ts.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js +1 -0
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/WipRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.d.ts +6 -1
- package/lib/esm/rpc/core/RpcConstants.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js +7 -1
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js +1 -0
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js +1 -0
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js +1 -0
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js +1 -0
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js +1 -0
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequestContext.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js +1 -0
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js +1 -0
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.d.ts.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +1 -0
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.d.ts +1 -0
- package/lib/esm/rpc/web/OpenAPI.d.ts.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js +1 -0
- package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +2 -0
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js +1 -0
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js +5 -5
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js +2 -2
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js +5 -5
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js +6 -6
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.d.ts +2 -2
- package/lib/esm/tile/IModelTileIO.js +12 -12
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js +5 -5
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js +3 -3
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/package.json +7 -7
- package/lib/cjs/FeatureGates.d.ts +0 -32
- package/lib/cjs/FeatureGates.d.ts.map +0 -1
- package/lib/cjs/FeatureGates.js +0 -56
- package/lib/cjs/FeatureGates.js.map +0 -1
- package/lib/esm/FeatureGates.d.ts +0 -32
- package/lib/esm/FeatureGates.d.ts.map +0 -1
- package/lib/esm/FeatureGates.js +0 -52
- package/lib/esm/FeatureGates.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelTileIO.js","sourceRoot":"","sources":["../../../src/tile/IModelTileIO.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,2BAA2B,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAN,IAAY,SASX;AATD,WAAY,SAAS;IACnB,uBAAuB;IACvB,yCAAQ,CAAA;IACR,6CAA6C;IAC7C,6DAAuB,CAAA;IACvB,wEAAwE;IACxE,qDAAmB,CAAA;IACnB,mEAAmE;IACnE,2EAA8B,CAAA;AAChC,CAAC,EATW,SAAS,KAAT,SAAS,QASpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,kBAYX;AAZD,WAAY,kBAAkB;IAC5B;;;OAGG;IACH,8DAAU,CAAA;IACV;;OAEG;IACH,6DAAS,CAAA;IACT,kGAAkG;IAClG,yEAAkC,CAAA;AACpC,CAAC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MAAM,OAAO,kBAAkB;IAU7B,YAAoC,MAAc,EAChC,WAAmB,EACnB,KAAa;QAFK,WAAM,GAAN,MAAM,CAAQ;QAChC,gBAAW,GAAX,WAAW,CAAQ;QACnB,UAAK,GAAL,KAAK,CAAQ;IAAI,CAAC;IAX7B,MAAM,CAAC,QAAQ,CAAC,MAAkB;QACvC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAC9F,CAAC;;AAEa,8BAAW,GAAG,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tile\r\n */\r\n\r\nimport { assert, ByteStream } from \"@itwin/core-bentley\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { ElementAlignedBox3d } from \"../geometry/Placement\";\r\nimport { nextPoint3d64FromByteStream, TileFormat, TileHeader } from \"./TileIO\";\r\n\r\n/** Flags describing the geometry contained within a tile in iMdl format.\r\n * @internal\r\n */\r\nexport enum ImdlFlags {\r\n /** No special flags */\r\n None = 0,\r\n /** The tile contains some curved geometry */\r\n ContainsCurves = 1 << 0,\r\n /** Some geometry within the tile range was omitted based on its size */\r\n Incomplete = 1 << 2,\r\n /** The tile must be refined by sub-division, not magnification. */\r\n DisallowMagnification = 1 << 3,\r\n}\r\n\r\n/** Describes the maximum major and minor version of the iMdl tile format supported by this version of this package.\r\n * @internal\r\n */\r\nexport enum CurrentImdlVersion {\r\n /** The unsigned 16-bit major version number. If the major version specified in the tile header is greater than this value, then this\r\n * front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a\r\n * greater minor version than CurrentVersion.Minor, although some data may be skipped.\r\n */\r\n Major = 30,\r\n /** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can\r\n * read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.\r\n */\r\n Minor = 0,\r\n /** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */\r\n Combined = (Major << 0x10) | Minor,\r\n}\r\n\r\n/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.\r\n * @internal\r\n */\r\nexport class ImdlHeader extends TileHeader {\r\n /** The size of this header in bytes. */\r\n public readonly headerLength: number;\r\n /** Flags describing the geometry contained within the tile */\r\n public readonly flags: ImdlFlags;\r\n /** A bounding box no larger than the tile's range, tightly enclosing the tile's geometry; or a null range if the tile is empty */\r\n public readonly contentRange: ElementAlignedBox3d;\r\n /** The chord tolerance in meters at which the tile's geometry was faceted */\r\n public readonly tolerance: number;\r\n /** The number of elements which contributed at least some geometry to the tile content */\r\n public readonly numElementsIncluded: number;\r\n /** The number of elements within the tile range which contributed no geometry to the tile content */\r\n public readonly numElementsExcluded: number;\r\n /** The total number of bytes in the binary tile data, including this header */\r\n public readonly tileLength: number;\r\n /** A bitfield wherein each set bit indicates an empty sub-volume. */\r\n public readonly emptySubRanges: number;\r\n\r\n public get versionMajor(): number { return this.version >>> 0x10; }\r\n public get versionMinor(): number { return (this.version & 0xffff) >>> 0; }\r\n\r\n public get isValid(): boolean { return TileFormat.IModel === this.format; }\r\n public get isReadableVersion(): boolean { return this.versionMajor <= CurrentImdlVersion.Major; }\r\n\r\n /** Deserialize a header from the binary data at the stream's current position.\r\n * If the binary data does not contain a valid header, the Header will be marked 'invalid'.\r\n */\r\n public constructor(stream: ByteStream) {\r\n super(stream);\r\n this.headerLength = stream.readUint32();\r\n this.flags = stream.readUint32();\r\n\r\n this.contentRange = new Range3d();\r\n nextPoint3d64FromByteStream(stream, this.contentRange.low);\r\n nextPoint3d64FromByteStream(stream, this.contentRange.high);\r\n\r\n this.tolerance = stream.readFloat64();\r\n this.numElementsIncluded = stream.readUint32();\r\n this.numElementsExcluded = stream.readUint32();\r\n this.tileLength = stream.readUint32();\r\n\r\n // empty sub-volume bit field introduced in format v02.00\r\n this.emptySubRanges = this.versionMajor >= 2 ? stream.readUint32() : 0;\r\n\r\n // Skip any unprocessed bytes in header\r\n const remainingHeaderBytes = this.headerLength - stream.curPos;\r\n assert(remainingHeaderBytes >= 0);\r\n stream.advance(remainingHeaderBytes);\r\n\r\n if (stream.isPastTheEnd)\r\n this.invalidate();\r\n }\r\n}\r\n\r\n/** Header preceding the feature table embedded in an iMdl tile's content.\r\n * @internal\r\n */\r\nexport class FeatureTableHeader {\r\n public static readFrom(stream: ByteStream) {\r\n const length = stream.readUint32();\r\n const maxFeatures = stream.readUint32();\r\n const count = stream.readUint32();\r\n return stream.isPastTheEnd ? undefined : new FeatureTableHeader(length, maxFeatures, count);\r\n }\r\n\r\n public static sizeInBytes = 12;\r\n\r\n private constructor(public readonly length: number,\r\n public readonly maxFeatures: number,\r\n public readonly count: number) { }\r\n}\r\n"]}
|
|
@@ -12,11 +12,11 @@ import { TileFormat, TileHeader } from "./TileIO";
|
|
|
12
12
|
export class PntsHeader extends TileHeader {
|
|
13
13
|
constructor(stream) {
|
|
14
14
|
super(stream);
|
|
15
|
-
this.length = stream.
|
|
16
|
-
this.featureTableJsonLength = stream.
|
|
17
|
-
this.featureTableBinaryLength = stream.
|
|
18
|
-
this.batchTableJsonLength = stream.
|
|
19
|
-
this.batchTableBinaryLength = stream.
|
|
15
|
+
this.length = stream.readUint32();
|
|
16
|
+
this.featureTableJsonLength = stream.readUint32();
|
|
17
|
+
this.featureTableBinaryLength = stream.readUint32();
|
|
18
|
+
this.batchTableJsonLength = stream.readUint32();
|
|
19
|
+
this.batchTableBinaryLength = stream.readUint32();
|
|
20
20
|
}
|
|
21
21
|
get isValid() { return TileFormat.Pnts === this.format; }
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PntsTileIO.js","sourceRoot":"","sources":["../../../src/tile/PntsTileIO.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IAQxC,YAAmB,MAAkB;QACnC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"PntsTileIO.js","sourceRoot":"","sources":["../../../src/tile/PntsTileIO.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IAQxC,YAAmB,MAAkB;QACnC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAClC,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAClD,IAAI,CAAC,wBAAwB,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACpD,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAChD,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACpD,CAAC;IATD,IAAW,OAAO,KAAc,OAAO,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;CAU1E","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 Tile\r\n */\r\n\r\nimport { ByteStream } from \"@itwin/core-bentley\";\r\nimport { TileFormat, TileHeader } from \"./TileIO\";\r\n\r\n/** Header preceding tile content in [pnts](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/PointCloud) format.\r\n * @internal\r\n */\r\nexport class PntsHeader extends TileHeader {\r\n public readonly length: number;\r\n public readonly featureTableJsonLength: number;\r\n public readonly featureTableBinaryLength: number;\r\n public readonly batchTableJsonLength: number;\r\n public readonly batchTableBinaryLength: number;\r\n public get isValid(): boolean { return TileFormat.Pnts === this.format; }\r\n\r\n public constructor(stream: ByteStream) {\r\n super(stream);\r\n this.length = stream.readUint32();\r\n this.featureTableJsonLength = stream.readUint32();\r\n this.featureTableBinaryLength = stream.readUint32();\r\n this.batchTableJsonLength = stream.readUint32();\r\n this.batchTableBinaryLength = stream.readUint32();\r\n }\r\n}\r\n"]}
|
package/lib/esm/tile/TileIO.js
CHANGED
|
@@ -89,8 +89,8 @@ export class TileReadError extends BentleyError {
|
|
|
89
89
|
export class TileHeader {
|
|
90
90
|
/** Construct a Header from the binary data at the supplied stream's current read position */
|
|
91
91
|
constructor(stream) {
|
|
92
|
-
this._format = tileFormatFromNumber(stream.
|
|
93
|
-
this.version = stream.
|
|
92
|
+
this._format = tileFormatFromNumber(stream.readUint32());
|
|
93
|
+
this.version = stream.readUint32();
|
|
94
94
|
}
|
|
95
95
|
get format() { return this._format; }
|
|
96
96
|
/** Mark the header as representing invalid data */
|
|
@@ -102,7 +102,7 @@ export class TileHeader {
|
|
|
102
102
|
* @internal
|
|
103
103
|
*/
|
|
104
104
|
export function nextPoint3d64FromByteStream(stream, result) {
|
|
105
|
-
const x = stream.
|
|
105
|
+
const x = stream.readFloat64(), y = stream.readFloat64(), z = stream.readFloat64();
|
|
106
106
|
if (undefined === result)
|
|
107
107
|
return new Point3d(x, y, z);
|
|
108
108
|
result.set(x, y, z);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileIO.js","sourceRoot":"","sources":["../../../src/tile/TileIO.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAN,IAAY,UASX;AATD,WAAY,UAAU;IACpB,iDAAW,CAAA;IACX,oDAAiB,CAAA;IACjB,oDAAiB,CAAA;IACjB,oDAAiB,CAAA;IACjB,wDAAmB,CAAA;IACnB,oDAAiB,CAAA;IACjB,oDAAiB,CAAA;IACjB,+CAAc,CAAA;AAChB,CAAC,EATW,UAAU,KAAV,UAAU,QASrB;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,QAAQ,MAAM,EAAE;QACd,KAAK,UAAU,CAAC,OAAO,CAAC;QACxB,KAAK,UAAU,CAAC,IAAI,CAAC;QACrB,KAAK,UAAU,CAAC,IAAI,CAAC;QACrB,KAAK,UAAU,CAAC,MAAM,CAAC;QACvB,KAAK,UAAU,CAAC,IAAI,CAAC;QACrB,KAAK,UAAU,CAAC,IAAI,CAAC;QACrB,KAAK,UAAU,CAAC,IAAI,CAAC;QACrB,KAAK,UAAU,CAAC,GAAG;YACjB,OAAO,IAAI,CAAC;QACd;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,YAAoB;IACvD,MAAM,MAAM,GAAG,YAA0B,CAAC;IAC1C,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,yDAAW,CAAA;IACX,yEA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AAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,IAAW,WAAW,KAAc,OAAO,cAAc,CAAC,QAAQ,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;CAC3F;AAED;;;;GAIG;AACH,MAAM,OAAgB,UAAU;IAI9B,6FAA6F;IAC7F,YAAmB,MAAkB;QACnC,IAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC;IAED,IAAW,MAAM,KAAiB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAKxD,mDAAmD;IACzC,UAAU;QAClB,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAkB,EAAE,MAAgB;IAC9E,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,EAC5B,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,EACxB,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IAE3B,IAAI,SAAS,KAAK,MAAM;QACtB,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE9B,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACpB,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tile\r\n */\r\n\r\nimport { BentleyError, ByteStream } from \"@itwin/core-bentley\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\n\r\n/** Type codes for various tile formats. Often these are embedded as 32-bit 'magic numbers' in a binary stream to indicate the format.\r\n * @internal\r\n */\r\nexport enum TileFormat {\r\n Unknown = 0,\r\n B3dm = 0x6d643362, // \"b3dm\"\r\n Gltf = 0x46546c67, // \"glTF\"\r\n Pnts = 0x73746e70, // \"pnts\"\r\n IModel = 0x6c644d69, // \"iMdl\"\r\n Cmpt = 0x74706d63, // cmpt\r\n I3dm = 0x6d643369, // i3dm\r\n A3x = 0x583341, // A3X0 (numeric 0 not char '0')\r\n}\r\n\r\n/** Given a magic number, return whether it identifies a known tile format.\r\n * @internal\r\n */\r\nexport function isKnownTileFormat(format: number) {\r\n switch (format) {\r\n case TileFormat.Unknown:\r\n case TileFormat.B3dm:\r\n case TileFormat.Gltf:\r\n case TileFormat.IModel:\r\n case TileFormat.Pnts:\r\n case TileFormat.Cmpt:\r\n case TileFormat.I3dm:\r\n case TileFormat.A3x:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n}\r\n\r\n/** Given a magic number, attempt to convert it to a known TileFormat.\r\n * @internal\r\n */\r\nexport function tileFormatFromNumber(formatNumber: number): TileFormat {\r\n const format = formatNumber as TileFormat;\r\n return isKnownTileFormat(format) ? format : TileFormat.Unknown;\r\n}\r\n\r\n/** Status codes for tile reading operations\r\n * @internal\r\n */\r\nexport enum TileReadStatus {\r\n Success = 0,\r\n InvalidTileData,\r\n InvalidHeader,\r\n InvalidBatchTable,\r\n InvalidScene,\r\n InvalidFeatureTable,\r\n NewerMajorVersion,\r\n Canceled,\r\n}\r\n\r\nconst readStatusMessages = [\r\n \"Success\",\r\n \"Invalid tile data\",\r\n \"Invalid tile header\",\r\n \"Invalid batch table\",\r\n \"Invalid scene\",\r\n \"Invalid feature table\",\r\n \"Major version too new\",\r\n \"Canceled\",\r\n];\r\n\r\n/** Exception thrown by functions that deserialize tiles.\r\n * @internal\r\n */\r\nexport class TileReadError extends BentleyError {\r\n public constructor(status: TileReadStatus, message?: string) {\r\n if (undefined === message)\r\n message = readStatusMessages[status];\r\n\r\n super(status, message);\r\n }\r\n\r\n public get wasCanceled(): boolean { return TileReadStatus.Canceled === this.errorNumber; }\r\n}\r\n\r\n/** The base header preceding tile data of most formats, identifying the tile format and version of that format.\r\n * Specific tile formats may define their own headers as sub-types of this Header, appending\r\n * additional format-specific data.\r\n * @internal\r\n */\r\nexport abstract class TileHeader {\r\n private _format: TileFormat;\r\n public version: number;\r\n\r\n /** Construct a Header from the binary data at the supplied stream's current read position */\r\n public constructor(stream: ByteStream) {\r\n this._format = tileFormatFromNumber(stream.readUint32());\r\n this.version = stream.readUint32();\r\n }\r\n\r\n public get format(): TileFormat { return this._format; }\r\n\r\n /** Returns whether the header represents valid data */\r\n public abstract get isValid(): boolean;\r\n\r\n /** Mark the header as representing invalid data */\r\n protected invalidate(): void {\r\n this._format = TileFormat.Unknown;\r\n }\r\n}\r\n\r\n/** Read 3 64-bit floating point numbers at the byte stream's current read position, advance by 24 bytes, and return a Point3d constructed from the 3 numbers.\r\n * @internal\r\n */\r\nexport function nextPoint3d64FromByteStream(stream: ByteStream, result?: Point3d): Point3d {\r\n const x = stream.readFloat64(),\r\n y = stream.readFloat64(),\r\n z = stream.readFloat64();\r\n\r\n if (undefined === result)\r\n return new Point3d(x, y, z);\r\n\r\n result.set(x, y, z);\r\n return result;\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-dev.2",
|
|
4
4
|
"description": "iTwin.js components common to frontend and backend",
|
|
5
5
|
"main": "lib/cjs/core-common.js",
|
|
6
6
|
"module": "lib/esm/core-common.js",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"js-base64": "^3.6.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@itwin/core-bentley": "^
|
|
32
|
-
"@itwin/core-geometry": "^
|
|
31
|
+
"@itwin/core-bentley": "^4.0.0-dev.2",
|
|
32
|
+
"@itwin/core-geometry": "^4.0.0-dev.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@itwin/build-tools": "
|
|
36
|
-
"@itwin/core-bentley": "
|
|
37
|
-
"@itwin/core-geometry": "
|
|
38
|
-
"@itwin/eslint-plugin": "
|
|
35
|
+
"@itwin/build-tools": "4.0.0-dev.2",
|
|
36
|
+
"@itwin/core-bentley": "4.0.0-dev.2",
|
|
37
|
+
"@itwin/core-geometry": "4.0.0-dev.2",
|
|
38
|
+
"@itwin/eslint-plugin": "4.0.0-dev.2",
|
|
39
39
|
"@types/chai": "4.3.1",
|
|
40
40
|
"@types/flatbuffers": "~1.10.0",
|
|
41
41
|
"@types/mocha": "^8.2.2",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BeEvent } from "@itwin/core-bentley";
|
|
2
|
-
/** @internal */
|
|
3
|
-
export declare type GateValue = number | boolean | string | undefined;
|
|
4
|
-
/** A set of "gates" that can enable or disable features at runtime.
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare class FeatureGates {
|
|
8
|
-
/** Event raised every time any feature changes. */
|
|
9
|
-
onChanged: BeEvent<(feature: string, val: GateValue) => void>;
|
|
10
|
-
/** A map of the current set of features. */
|
|
11
|
-
readonly gates: Map<string, GateValue>;
|
|
12
|
-
/** Get the value of a potentially gated feature.
|
|
13
|
-
* @param feature The name of the feature to check. May be a "path" of period-separated feature sub-groups (e.g. "feature1.groupA.showMe").
|
|
14
|
-
* Feature names are case-sensitive.
|
|
15
|
-
* @param defaultVal Optionally, value to return if feature is undefined.
|
|
16
|
-
*/
|
|
17
|
-
check(feature: string, defaultVal?: GateValue): GateValue;
|
|
18
|
-
/** Gate access to a feature.
|
|
19
|
-
* @param feature The name of the feature to gate. May be a "path" of period-separated feature sub-groups (e.g. "feature1.groupA.showMe").
|
|
20
|
-
* Feature names are case-sensitive.
|
|
21
|
-
* @param val Value to set. If undefined, feature is deleted.
|
|
22
|
-
*/
|
|
23
|
-
setGate(feature: string, val: GateValue): void;
|
|
24
|
-
/** Register a listener to be called whenever the value of a specific gate changes.
|
|
25
|
-
* @param feature The name of the feature to monitor
|
|
26
|
-
* @param monitor The listener to call when `feature` changes. Receives a single argument holding the new value of the feature (may be undefined).
|
|
27
|
-
* @returns A function that may be called to remove the listener.
|
|
28
|
-
* @note Use [[onChanged]] to listen to changes for *all* gates.
|
|
29
|
-
*/
|
|
30
|
-
addMonitor(feature: string, monitor: (val: GateValue) => void): () => void;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=FeatureGates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureGates.d.ts","sourceRoot":"","sources":["../../src/FeatureGates.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,gBAAgB;AAChB,oBAAY,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9D;;GAEG;AACH,qBAAa,YAAY;IACvB,mDAAmD;IAC5C,SAAS,oBAAyB,MAAM,OAAO,SAAS,KAAK,IAAI,EAAI;IAE5E,4CAA4C;IAC5C,SAAgB,KAAK,yBAAgC;IAErD;;;;OAIG;IACI,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS;IAKhE;;;;OAIG;IACI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI;IAWrD;;;;;OAKG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,GAAG,MAAM,IAAI;CAMlF"}
|
package/lib/cjs/FeatureGates.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FeatureGates = void 0;
|
|
4
|
-
/*---------------------------------------------------------------------------------------------
|
|
5
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
9
|
-
/** A set of "gates" that can enable or disable features at runtime.
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
class FeatureGates {
|
|
13
|
-
constructor() {
|
|
14
|
-
/** Event raised every time any feature changes. */
|
|
15
|
-
this.onChanged = new core_bentley_1.BeEvent();
|
|
16
|
-
/** A map of the current set of features. */
|
|
17
|
-
this.gates = new Map();
|
|
18
|
-
}
|
|
19
|
-
/** Get the value of a potentially gated feature.
|
|
20
|
-
* @param feature The name of the feature to check. May be a "path" of period-separated feature sub-groups (e.g. "feature1.groupA.showMe").
|
|
21
|
-
* Feature names are case-sensitive.
|
|
22
|
-
* @param defaultVal Optionally, value to return if feature is undefined.
|
|
23
|
-
*/
|
|
24
|
-
check(feature, defaultVal) {
|
|
25
|
-
const val = this.gates.get(feature);
|
|
26
|
-
return val === undefined ? defaultVal : val;
|
|
27
|
-
}
|
|
28
|
-
/** Gate access to a feature.
|
|
29
|
-
* @param feature The name of the feature to gate. May be a "path" of period-separated feature sub-groups (e.g. "feature1.groupA.showMe").
|
|
30
|
-
* Feature names are case-sensitive.
|
|
31
|
-
* @param val Value to set. If undefined, feature is deleted.
|
|
32
|
-
*/
|
|
33
|
-
setGate(feature, val) {
|
|
34
|
-
if (feature.length === 0)
|
|
35
|
-
return;
|
|
36
|
-
if (val === undefined)
|
|
37
|
-
this.gates.delete(feature);
|
|
38
|
-
else
|
|
39
|
-
this.gates.set(feature, val);
|
|
40
|
-
this.onChanged.raiseEvent(feature, val);
|
|
41
|
-
}
|
|
42
|
-
/** Register a listener to be called whenever the value of a specific gate changes.
|
|
43
|
-
* @param feature The name of the feature to monitor
|
|
44
|
-
* @param monitor The listener to call when `feature` changes. Receives a single argument holding the new value of the feature (may be undefined).
|
|
45
|
-
* @returns A function that may be called to remove the listener.
|
|
46
|
-
* @note Use [[onChanged]] to listen to changes for *all* gates.
|
|
47
|
-
*/
|
|
48
|
-
addMonitor(feature, monitor) {
|
|
49
|
-
return this.onChanged.addListener((changed, val) => {
|
|
50
|
-
if (changed === feature)
|
|
51
|
-
monitor(val);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.FeatureGates = FeatureGates;
|
|
56
|
-
//# sourceMappingURL=FeatureGates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureGates.js","sourceRoot":"","sources":["../../src/FeatureGates.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAA8C;AAK9C;;GAEG;AACH,MAAa,YAAY;IAAzB;QACE,mDAAmD;QAC5C,cAAS,GAAG,IAAI,sBAAO,EAA6C,CAAC;QAE5E,4CAA4C;QAC5B,UAAK,GAAG,IAAI,GAAG,EAAqB,CAAC;IAwCvD,CAAC;IAtCC;;;;OAIG;IACI,KAAK,CAAC,OAAe,EAAE,UAAsB;QAClD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACI,OAAO,CAAC,OAAe,EAAE,GAAc;QAC5C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YACtB,OAAO;QACT,IAAI,GAAG,KAAK,SAAS;YACnB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;;YAE3B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAE/B,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,OAAe,EAAE,OAAiC;QAClE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;YACjD,IAAI,OAAO,KAAK,OAAO;gBACrB,OAAO,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA7CD,oCA6CC","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\nimport { BeEvent } from \"@itwin/core-bentley\";\r\n\r\n/** @internal */\r\nexport type GateValue = number | boolean | string | undefined;\r\n\r\n/** A set of \"gates\" that can enable or disable features at runtime.\r\n * @internal\r\n */\r\nexport class FeatureGates {\r\n /** Event raised every time any feature changes. */\r\n public onChanged = new BeEvent<(feature: string, val: GateValue) => void>();\r\n\r\n /** A map of the current set of features. */\r\n public readonly gates = new Map<string, GateValue>();\r\n\r\n /** Get the value of a potentially gated feature.\r\n * @param feature The name of the feature to check. May be a \"path\" of period-separated feature sub-groups (e.g. \"feature1.groupA.showMe\").\r\n * Feature names are case-sensitive.\r\n * @param defaultVal Optionally, value to return if feature is undefined.\r\n */\r\n public check(feature: string, defaultVal?: GateValue): GateValue {\r\n const val = this.gates.get(feature);\r\n return val === undefined ? defaultVal : val;\r\n }\r\n\r\n /** Gate access to a feature.\r\n * @param feature The name of the feature to gate. May be a \"path\" of period-separated feature sub-groups (e.g. \"feature1.groupA.showMe\").\r\n * Feature names are case-sensitive.\r\n * @param val Value to set. If undefined, feature is deleted.\r\n */\r\n public setGate(feature: string, val: GateValue): void {\r\n if (feature.length === 0)\r\n return;\r\n if (val === undefined)\r\n this.gates.delete(feature);\r\n else\r\n this.gates.set(feature, val);\r\n\r\n this.onChanged.raiseEvent(feature, val);\r\n }\r\n\r\n /** Register a listener to be called whenever the value of a specific gate changes.\r\n * @param feature The name of the feature to monitor\r\n * @param monitor The listener to call when `feature` changes. Receives a single argument holding the new value of the feature (may be undefined).\r\n * @returns A function that may be called to remove the listener.\r\n * @note Use [[onChanged]] to listen to changes for *all* gates.\r\n */\r\n public addMonitor(feature: string, monitor: (val: GateValue) => void): () => void {\r\n return this.onChanged.addListener((changed, val) => {\r\n if (changed === feature)\r\n monitor(val);\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BeEvent } from "@itwin/core-bentley";
|
|
2
|
-
/** @internal */
|
|
3
|
-
export declare type GateValue = number | boolean | string | undefined;
|
|
4
|
-
/** A set of "gates" that can enable or disable features at runtime.
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare class FeatureGates {
|
|
8
|
-
/** Event raised every time any feature changes. */
|
|
9
|
-
onChanged: BeEvent<(feature: string, val: GateValue) => void>;
|
|
10
|
-
/** A map of the current set of features. */
|
|
11
|
-
readonly gates: Map<string, GateValue>;
|
|
12
|
-
/** Get the value of a potentially gated feature.
|
|
13
|
-
* @param feature The name of the feature to check. May be a "path" of period-separated feature sub-groups (e.g. "feature1.groupA.showMe").
|
|
14
|
-
* Feature names are case-sensitive.
|
|
15
|
-
* @param defaultVal Optionally, value to return if feature is undefined.
|
|
16
|
-
*/
|
|
17
|
-
check(feature: string, defaultVal?: GateValue): GateValue;
|
|
18
|
-
/** Gate access to a feature.
|
|
19
|
-
* @param feature The name of the feature to gate. May be a "path" of period-separated feature sub-groups (e.g. "feature1.groupA.showMe").
|
|
20
|
-
* Feature names are case-sensitive.
|
|
21
|
-
* @param val Value to set. If undefined, feature is deleted.
|
|
22
|
-
*/
|
|
23
|
-
setGate(feature: string, val: GateValue): void;
|
|
24
|
-
/** Register a listener to be called whenever the value of a specific gate changes.
|
|
25
|
-
* @param feature The name of the feature to monitor
|
|
26
|
-
* @param monitor The listener to call when `feature` changes. Receives a single argument holding the new value of the feature (may be undefined).
|
|
27
|
-
* @returns A function that may be called to remove the listener.
|
|
28
|
-
* @note Use [[onChanged]] to listen to changes for *all* gates.
|
|
29
|
-
*/
|
|
30
|
-
addMonitor(feature: string, monitor: (val: GateValue) => void): () => void;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=FeatureGates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureGates.d.ts","sourceRoot":"","sources":["../../src/FeatureGates.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,gBAAgB;AAChB,oBAAY,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9D;;GAEG;AACH,qBAAa,YAAY;IACvB,mDAAmD;IAC5C,SAAS,oBAAyB,MAAM,OAAO,SAAS,KAAK,IAAI,EAAI;IAE5E,4CAA4C;IAC5C,SAAgB,KAAK,yBAAgC;IAErD;;;;OAIG;IACI,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS;IAKhE;;;;OAIG;IACI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI;IAWrD;;;;;OAKG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,GAAG,MAAM,IAAI;CAMlF"}
|
package/lib/esm/FeatureGates.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { BeEvent } from "@itwin/core-bentley";
|
|
6
|
-
/** A set of "gates" that can enable or disable features at runtime.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export class FeatureGates {
|
|
10
|
-
constructor() {
|
|
11
|
-
/** Event raised every time any feature changes. */
|
|
12
|
-
this.onChanged = new BeEvent();
|
|
13
|
-
/** A map of the current set of features. */
|
|
14
|
-
this.gates = new Map();
|
|
15
|
-
}
|
|
16
|
-
/** Get the value of a potentially gated feature.
|
|
17
|
-
* @param feature The name of the feature to check. May be a "path" of period-separated feature sub-groups (e.g. "feature1.groupA.showMe").
|
|
18
|
-
* Feature names are case-sensitive.
|
|
19
|
-
* @param defaultVal Optionally, value to return if feature is undefined.
|
|
20
|
-
*/
|
|
21
|
-
check(feature, defaultVal) {
|
|
22
|
-
const val = this.gates.get(feature);
|
|
23
|
-
return val === undefined ? defaultVal : val;
|
|
24
|
-
}
|
|
25
|
-
/** Gate access to a feature.
|
|
26
|
-
* @param feature The name of the feature to gate. May be a "path" of period-separated feature sub-groups (e.g. "feature1.groupA.showMe").
|
|
27
|
-
* Feature names are case-sensitive.
|
|
28
|
-
* @param val Value to set. If undefined, feature is deleted.
|
|
29
|
-
*/
|
|
30
|
-
setGate(feature, val) {
|
|
31
|
-
if (feature.length === 0)
|
|
32
|
-
return;
|
|
33
|
-
if (val === undefined)
|
|
34
|
-
this.gates.delete(feature);
|
|
35
|
-
else
|
|
36
|
-
this.gates.set(feature, val);
|
|
37
|
-
this.onChanged.raiseEvent(feature, val);
|
|
38
|
-
}
|
|
39
|
-
/** Register a listener to be called whenever the value of a specific gate changes.
|
|
40
|
-
* @param feature The name of the feature to monitor
|
|
41
|
-
* @param monitor The listener to call when `feature` changes. Receives a single argument holding the new value of the feature (may be undefined).
|
|
42
|
-
* @returns A function that may be called to remove the listener.
|
|
43
|
-
* @note Use [[onChanged]] to listen to changes for *all* gates.
|
|
44
|
-
*/
|
|
45
|
-
addMonitor(feature, monitor) {
|
|
46
|
-
return this.onChanged.addListener((changed, val) => {
|
|
47
|
-
if (changed === feature)
|
|
48
|
-
monitor(val);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=FeatureGates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureGates.js","sourceRoot":"","sources":["../../src/FeatureGates.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C;;GAEG;AACH,MAAM,OAAO,YAAY;IAAzB;QACE,mDAAmD;QAC5C,cAAS,GAAG,IAAI,OAAO,EAA6C,CAAC;QAE5E,4CAA4C;QAC5B,UAAK,GAAG,IAAI,GAAG,EAAqB,CAAC;IAwCvD,CAAC;IAtCC;;;;OAIG;IACI,KAAK,CAAC,OAAe,EAAE,UAAsB;QAClD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACI,OAAO,CAAC,OAAe,EAAE,GAAc;QAC5C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YACtB,OAAO;QACT,IAAI,GAAG,KAAK,SAAS;YACnB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;;YAE3B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAE/B,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,OAAe,EAAE,OAAiC;QAClE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;YACjD,IAAI,OAAO,KAAK,OAAO;gBACrB,OAAO,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;CACF","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\nimport { BeEvent } from \"@itwin/core-bentley\";\r\n\r\n/** @internal */\r\nexport type GateValue = number | boolean | string | undefined;\r\n\r\n/** A set of \"gates\" that can enable or disable features at runtime.\r\n * @internal\r\n */\r\nexport class FeatureGates {\r\n /** Event raised every time any feature changes. */\r\n public onChanged = new BeEvent<(feature: string, val: GateValue) => void>();\r\n\r\n /** A map of the current set of features. */\r\n public readonly gates = new Map<string, GateValue>();\r\n\r\n /** Get the value of a potentially gated feature.\r\n * @param feature The name of the feature to check. May be a \"path\" of period-separated feature sub-groups (e.g. \"feature1.groupA.showMe\").\r\n * Feature names are case-sensitive.\r\n * @param defaultVal Optionally, value to return if feature is undefined.\r\n */\r\n public check(feature: string, defaultVal?: GateValue): GateValue {\r\n const val = this.gates.get(feature);\r\n return val === undefined ? defaultVal : val;\r\n }\r\n\r\n /** Gate access to a feature.\r\n * @param feature The name of the feature to gate. May be a \"path\" of period-separated feature sub-groups (e.g. \"feature1.groupA.showMe\").\r\n * Feature names are case-sensitive.\r\n * @param val Value to set. If undefined, feature is deleted.\r\n */\r\n public setGate(feature: string, val: GateValue): void {\r\n if (feature.length === 0)\r\n return;\r\n if (val === undefined)\r\n this.gates.delete(feature);\r\n else\r\n this.gates.set(feature, val);\r\n\r\n this.onChanged.raiseEvent(feature, val);\r\n }\r\n\r\n /** Register a listener to be called whenever the value of a specific gate changes.\r\n * @param feature The name of the feature to monitor\r\n * @param monitor The listener to call when `feature` changes. Receives a single argument holding the new value of the feature (may be undefined).\r\n * @returns A function that may be called to remove the listener.\r\n * @note Use [[onChanged]] to listen to changes for *all* gates.\r\n */\r\n public addMonitor(feature: string, monitor: (val: GateValue) => void): () => void {\r\n return this.onChanged.addListener((changed, val) => {\r\n if (changed === feature)\r\n monitor(val);\r\n });\r\n }\r\n}\r\n"]}
|