UNPKG

@itwin/measure-tools-react

Version:
80 lines 3.69 kB
import type { GuidString } from "@itwin/core-bentley"; import { BeUiEvent } from "@itwin/core-bentley"; /** Each feature has a human-readable name that should be unique, but also a GUID. */ export interface Feature { name: string; guid: GuidString; metaData?: Map<string, any>; } /** Feature tracking helper for MeasureTools. Can control if features should be tracked and hook into the notification. */ export declare class FeatureTracking { private static _enabled; /** Feature tracking notification event. */ static readonly onFeature: BeUiEvent<Feature>; /** * Gets if the feature tracking is enabled or not. */ static get isEnabled(): boolean; /** * Starts feature tracking events. */ static start(): void; /** * Stops feature tracking events. */ static stop(): void; /** * Emits an event that the specified feature was activated. * @param feature Feature that was activated. */ static notifyFeature(feature: Feature): void; /** * Emits an event that the specified feature was activated with the specified toggled state. * @param feature Feature that was activated. * @param isOn current toggle state of the feature. This is added as metadata. */ static notifyToggledFeature(feature: Feature, isOn: boolean): void; /** * Emits an event that the specified feature was activated. * @param featureName name of the feature that was activated. * @param featureGuid guid of the feature that was activated. * @param metaData optional metadata for the feature. */ static notifyFeatureByName(featureName: string, featureGuid: GuidString, metaData?: Map<string, any>): void; /** * Emits an event that the specified feature was activated with the specified toggled state. * @param featureName name of the feature that was activated. * @param featureGuid guid of the feature that was activated. * @param isOn current toggle state of the feature. This is added as metadata. * @param metaData optional additional metadata for the feature. */ static notifyToggledFeatureByName(featureName: string, featureGuid: GuidString, isOn: boolean, metaData?: Map<string, any>): void; } /** State for a feature that can be toggled on/off */ export declare enum ToggledState { On = "on", Off = "off" } /** Use this to create a feature that has metadata for a toggled "on/off" state. */ export declare function createToggledFeature(featureName: string, featureGuid: GuidString, isOn: boolean, metaDataMap?: Map<string, any>, copyMetaData?: boolean): Feature; export declare class MeasureToolsFeatures { static get Tools_ClearMeasurements(): Feature; static get Tools_ToggleDisplayMeasurementAxes(): Feature; static get Tools_MeasureArea(): Feature; static get Tools_MeasureDistance(): Feature; static get Tools_MeasureLocation(): Feature; static get Tools_MeasureAngle(): Feature; static get Tools_MeasureRadius(): Feature; static get Tools_MeasurePerpendicular(): Feature; static get MeasurementActionsToolbar_Open(): Feature; static get MeasurementActions_Delete(): Feature; static get MeasurementActions_Lock(): Feature; static get MeasurementActions_ToggleDisplayAxes(): Feature; static get MeasurementActions_ToggleDisplayLabels(): Feature; static get MeasurementActions_ToggleDisplayMeasurements(): Feature; static get Tools_MeasureDistance_createdInSheet(): Feature; static get Tools_MeasureArea_createdInSheet(): Feature; static get Tools_MeasureLocation_createdInSheet(): Feature; } //# sourceMappingURL=FeatureTracking.d.ts.map