UNPKG

@itwin/measure-tools-react

Version:
45 lines 3.2 kB
import type { Measurement } from "./Measurement.js"; import { BeUiEvent } from "@itwin/core-bentley"; export type AcceptMeasurementHandler = (args: Measurement) => boolean; /** UI events for measurements. Maintains app state of each event type, so events only trigger when the state actually changes. */ export declare class MeasurementUIEvents { private static _clearMeasurementState; private static _shouldClearMeasurementHandler?; private static _toggleMeasurementAxestate; private static _showToggleMeaurementAxesHandler?; /** Occurs when the visibility state of the "Clear Measurements" button changes */ static readonly onClearMeasurementButtonVisibilityChanged: BeUiEvent<boolean>; /** Occurs when the visibility state of the "Toggle Measurement Axes" button changes */ static readonly onToggleMeasurementAxesButtonVisibilityChanged: BeUiEvent<boolean>; /** Occurs whenever notifyMeasurementsChanged() is called. Query the measurement manager or active measurement tool for changes. */ static readonly onMeasurementsChanged: BeUiEvent<void>; /** Notify UI (e.g. property grid) if the following measurements have modified and need to refresh the UI. */ static readonly onMeasurementPropertiesChanged: BeUiEvent<Measurement[]>; /** Gets or sets the User-defined handler to override default behavior of determining whether a measurement should be cleared. By default * the UI button is visible if there exists at least one non-locked measurement. */ static get shouldClearMeasurementHandler(): AcceptMeasurementHandler | undefined; static set shouldClearMeasurementHandler(handler: AcceptMeasurementHandler | undefined); /** * Gets or sets the User-defined handler to override default behavior of determining whether a measurement is counted towards showing * the "Toggle Measurement Axes" button. By default the UI button is visible if there exists at least one Distance Measurement. */ static get showToggleMeasurementAxesHandler(): AcceptMeasurementHandler | undefined; static set showToggleMeasurementAxesHandler(handler: AcceptMeasurementHandler | undefined); /** Get the visibility state of the "Clear Measurements" button */ static get isClearMeasurementButtonVisible(): boolean; /** Get the visibility state of the "Toggle Measurement Axes" button */ static get isToggleMeasurementAxesButtonVisible(): boolean; /** * Notify listeners who need to refresh if measurement properties have changed. E.g. measurement property grid. * @param measurements Measurements whose properties have changed. */ static notifyMeasurementPropertiesChanged(measurements: Measurement[]): void; /** Notify a change in measurements. If you implement a new measurement creation tool, you should call this if you make changes to it's measurement state (the measurement decorator already does this). */ static notifyMeasurementsChanged(): void; private static determineClearMeasurementStateChange; private static determineToggleMeasurementAxesStateChange; private static queryActiveMeasurementCount; } //# sourceMappingURL=MeasurementUIEvents.d.ts.map