import { type Id64String } from "@itwin/core-bentley";
import type { XYAndZ, XYZProps } from "@itwin/core-geometry";
import { Point3d } from "@itwin/core-geometry";
import { Measurement, MeasurementPickContext, MeasurementSerializer } from "../api/Measurement.js";
import type { GeometryStreamProps } from "@itwin/core-common";
import type { DecorateContext } from "@itwin/core-frontend";
import type { MeasurementEqualityOptions, MeasurementWidgetData } from "../api/Measurement.js";
import type { MeasurementFormattingProps, MeasurementProps } from "../api/MeasurementProps.js";
/**
 * Props for serializing a [[DistanceMeasurement]].
 */
export interface DistanceMeasurementProps extends MeasurementProps {
    startPoint: XYZProps;
    endPoint: XYZProps;
    showAxes?: boolean;
    formatting?: DistanceMeasurementFormattingProps;
}
/** Formatting properties for distance measurement. */
export interface DistanceMeasurementFormattingProps {
    /** Defaults to "DefaultToolsUnits.LENGTH" and "Units.M" */
    length?: MeasurementFormattingProps;
    /** Defaults to "CivilUnits.BEARING" and "Units.RAD" */
    bearing?: MeasurementFormattingProps;
    /** Defaults to "DefaultToolsUnits.LENGTH_COORDINATE" and "Units.M" */
    coordinate?: MeasurementFormattingProps;
}
/** Serializer for a [[DistanceMeasurement]]. */
export declare class DistanceMeasurementSerializer extends MeasurementSerializer {
    static readonly distanceMeasurementName = "distanceMeasurement";
    get measurementName(): string;
    isValidType(measurement: Measurement): boolean;
    isValidJSON(json: any): boolean;
    protected parseSingle(data: MeasurementProps): Measurement | undefined;
}
/**
 * Distance measurement. Composed of a line and a formatted distance in a "text pill" in the middle of the line.
 */
export declare class DistanceMeasurement extends Measurement {
    static readonly serializer: MeasurementSerializer | undefined;
    private _startPoint;
    private _endPoint;
    private _showAxes;
    private _lengthKoQ;
    private _lengthPersistenceUnitName;
    private _bearingKoQ?;
    private _bearingPersistenceUnitName?;
    private _coordinateKoQ;
    private _coordinatePersistenceUnitName;
    private _isDynamic;
    private _textMarker?;
    private _runRiseAxes;
    private _textStyleOverride?;
    private _graphicStyleOverride?;
    get startPointRef(): Point3d;
    get endPointRef(): Point3d;
    get isDynamic(): boolean;
    set isDynamic(v: boolean);
    get showAxes(): boolean;
    set showAxes(v: boolean);
    get lengthKoQ(): string;
    set lengthKoQ(value: string);
    get lengthPersistenceUnitName(): string;
    set lengthPersistenceUnitName(value: string);
    get bearingKoQ(): string | undefined;
    set bearingKoQ(value: string);
    get bearingPersistenceUnitName(): string | undefined;
    set bearingPersistenceUnitName(value: string);
    get coordinateKoQ(): string;
    set coordinateKoQ(value: string);
    get coordinatePersistenceUnitName(): string;
    set coordinatePersistenceUnitName(value: string);
    private get isAxis();
    constructor(props?: DistanceMeasurementProps);
    setStartPoint(point: XYAndZ): void;
    setEndPoint(point: XYAndZ): void;
    setStartEndPoints(start: XYAndZ, end: XYAndZ): void;
    private setupAxis;
    private _lengthHandle?;
    private _bearingHandle?;
    private _coordinateHandle?;
    private _getLengthHandle;
    private _getBearingHandle;
    private _getCoordinateHandle;
    private _disposeHandles;
    onCleanup(): void;
    protected prepareFormatting(): Promise<void>;
    testDecorationHit(pickContext: MeasurementPickContext): boolean;
    getDecorationGeometry(pickContext: MeasurementPickContext): GeometryStreamProps | undefined;
    getDecorationToolTip(_pickContext: MeasurementPickContext): Promise<HTMLElement | string>;
    private getSnapId;
    protected onTransientIdChanged(_prevId: Id64String): void;
    decorate(context: DecorateContext): void;
    /** Clamps the segment to the current view frustum and return its midpoint.
     * @remarks Returns undefined if the segment is entirely 'behind' the camera eye
     */
    private calculateWorldTextLocation;
    private buildRunRiseAxes;
    protected onStyleChanged(_isLock: boolean, _prevStyle: string): void;
    protected onLockToggled(): void;
    protected onDisplayLabelsToggled(): void;
    onDisplayUnitsChanged(): void;
    private updateMarkerStyle;
    private createTextMarker;
    private handleTextMarkerButtonEvent;
    protected getDataForMeasurementWidgetInternal(): MeasurementWidgetData;
    /**
     * Tests equality with another measurement.
     * @param other Measurement to test equality for.
     * @param opts Options for equality testing.
     * @returns true if the other measurement is equal, false if some property is not the same or if the measurement is not of the same type.
     */
    equals(other: Measurement, opts?: MeasurementEqualityOptions): boolean;
    /**
     * Copies data from the other measurement into this instance.
     * @param other Measurement to copy property values from.
     */
    protected copyFrom(other: Measurement): void;
    /**
     * Deserializes properties (if they exist) from the JSON object.
     * @param json JSON object to read data from.
     */
    protected readFromJSON(json: MeasurementProps): void;
    /**
     * Serializes properties to a JSON object.
     * @param json JSON object to append data to.
     */
    protected writeToJSON(json: MeasurementProps): void;
    static create(start: Point3d, end: Point3d, viewType?: string, formatting?: DistanceMeasurementFormattingProps): DistanceMeasurement;
    static fromJSON(data: DistanceMeasurementProps): DistanceMeasurement;
}
//# sourceMappingURL=DistanceMeasurement.d.ts.map