import { EventEmitter, h } from '../../stencil-public-runtime';
import { Vector3 } from '@vertexvis/geometry';
import { Formatter } from '../../lib/formatter';
import { MeasurementModel } from '../../lib/measurement';
import { DistanceUnitType, FrameCameraBase } from '../../lib/types';
import { PointToPointHitProvider } from './interactions';
import { Anchor } from './utils';
/**
 * Contains the bounding boxes of child elements of this component. This
 * information is useful for positioning popups or other elements around the
 * measurement.
 *
 * @see {@link ViewerDistanceMeasurement.computeElementMetrics} - For
 * calculating element metrics.
 */
export interface ViewerMeasurementDistanceElementMetrics {
    startAnchor: DOMRect;
    endAnchor: DOMRect;
    label: DOMRect;
}
/**
 * The supported measurement modes.
 *
 * @see {@link ViewerDistanceMeasurement.mode} - For more details about modes.
 */
export type ViewerMeasurementDistanceMode = 'edit' | 'replace' | '';
/**
 * A details object describing the edit begin event.
 */
export interface EditBeginEventDetails {
    type: Exclude<ViewerMeasurementDistanceMode, ''>;
    anchor: Anchor;
}
/**
 * A details object describing the edit end event.
 */
export interface EditEndEventDetails {
    start: Vector3.Vector3;
    end: Vector3.Vector3;
    valid: boolean;
}
/**
 * @slot start-anchor - An HTML element for the starting point anchor.
 *
 * @slot start-label - An HTML or text element that displays next to the start
 * anchor.
 *
 * @slot end-anchor - An HTML element for the ending point anchor.
 *
 * @slot end-label - An HTML or text element that displays next to the end
 * anchor.
 *
 * @slot indicator - An HTML element for the measurement indicator. The
 * indicator represents the position where a measurement will be placed while
 * editing.
 */
export declare class ViewerMeasurementDistance {
    /**
     * The world position of the starting anchor.
     */
    start?: Vector3.Vector3;
    /**
     * The world position of the starting anchor, as a JSON string. The JSON
     * string can be an array or object representation in the format of `[x, y,
     * z]` or `{"x": 0, "y": 0, "z": 0}`.
     */
    startJson?: string;
    /**
     * The world position of the ending anchor.
     */
    end?: Vector3.Vector3;
    /**
     * The world position of the ending anchor, as a JSON string. The JSON string
     * can be an array or object representation in the format of `[x, y, z]` or
     * `{"x": 0, "y": 0, "z": 0}`.
     */
    endJson?: string;
    /**
     * The distance between `start` and `end` in real world units. Value will be
     * undefined if the start and end positions are undefined, or if the
     * measurement is invalid.
     */
    distance?: number;
    /**
     * Enables the display of axis reference lines between the start and end
     * point.
     */
    showAxisReferenceLines: boolean;
    /**
     * The distance, in pixels, between the mouse and nearest snappable edge. A
     * value of 0 disables snapping.
     */
    snapDistance: number;
    /**
     * The unit of measurement.
     */
    units: DistanceUnitType;
    /**
     * The number of fraction digits to display.
     */
    fractionalDigits: number;
    /**
     * An optional formatter that can be used to format the display of a distance.
     * The formatting function is passed a calculated real-world distance and is
     * expected to return a string.
     */
    labelFormatter?: Formatter<number | undefined>;
    /**
     * The distance from an anchor to its label.
     */
    anchorLabelOffset: number;
    /**
     * The length of the caps at each end of the distance measurement.
     */
    lineCapLength: number;
    /**
     * A mode that specifies how the measurement component should behave.
     *
     * When unset, the component will not respond to interactions with the
     * handles.
     *
     * When `edit`, the measurement anchors are interactive and the user is able
     * to reposition them.
     *
     * When `replace`, anytime the user clicks on the canvas, a new measurement
     * will be created and replace any existing measurement. After a measurement
     * is created, the measurement will be editable.
     */
    mode: ViewerMeasurementDistanceMode;
    /**
     * A property that reflects which anchor is currently being interacted with.
     */
    interactingAnchor: Anchor | 'none';
    /**
     * Indicates if the measurement is invalid. A measurement is invalid if either
     * the start or end position are not on the surface of the model.
     */
    invalid: boolean;
    /**
     * The camera used to position the anchors. If `viewer` is defined, then the
     * projection view matrix of the viewer will be used.
     */
    camera?: FrameCameraBase;
    /**
     * @internal
     */
    hitProvider?: PointToPointHitProvider;
    /**
     * @internal
     */
    indicatorPt?: Vector3.Vector3;
    /**
     * The viewer to connect to this measurement. The measurement will redraw any
     * time the viewer redraws the scene.
     */
    viewer?: HTMLVertexViewerElement;
    /**
     * The measurement model that will be updated when this measurement changes.
     * You can pass this to a <vertex-viewer-measurement-details> component to
     * display measurement outcomes.
     */
    measurementModel: MeasurementModel;
    /**
     * An event that is dispatched anytime the user begins editing the
     * measurement.
     */
    editBegin: EventEmitter<EditBeginEventDetails>;
    /**
     * An event that is dispatched when the user has finished editing the
     * measurement.
     */
    editEnd: EventEmitter<EditEndEventDetails>;
    private viewport;
    private elementBounds?;
    private interactionCount;
    private internalCamera?;
    private invalidateStateCounter;
    private stateMap;
    private measurementUnits;
    private hostEl;
    private model;
    private controller;
    private interaction?;
    private overlays;
    private overlay?;
    private isUserInteractingWithModel;
    private newInteractionHandler?;
    /**
     * Computes the bounding boxes of the anchors and label. **Note:** invoking
     * this function uses `getBoundingClientRect` internally and will cause a
     * relayout of the DOM.
     */
    computeElementMetrics(): Promise<ViewerMeasurementDistanceElementMetrics | undefined>;
    /**
     * @ignore
     */
    protected connectedCallback(): void;
    /**
     * @ignore
     */
    protected disconnectedCallback(): void;
    /**
     * @ignore
     */
    protected componentWillLoad(): Promise<void>;
    /**
     * @ignore
     */
    protected componentDidLoad(): void;
    /**
     * @ignore
     */
    protected componentWillUpdate(): Promise<void>;
    /**
     * @ignore
     */
    protected render(): h.JSX.IntrinsicElements;
    private renderMeasurement;
    /**
     * @ignore
     */
    protected handleViewerChanged(newViewer?: HTMLVertexViewerElement, oldViewer?: HTMLVertexViewerElement): Promise<void>;
    /**
     * @ignore
     */
    protected handleUnitsChanged(): void;
    /**
     * @ignore
     */
    protected handleCameraChanged(): void;
    /**
     * @ignore
     */
    protected handleModeChanged(): Promise<void>;
    /**
     * @ignore
     */
    protected handleStartChanged(): void;
    /**
     * @ignore
     */
    protected handleEndChanged(): void;
    /**
     * @ignore
     */
    protected handleInvalidChanged(): void;
    private computePropsAndState;
    private updateOverlays;
    private setCursor;
    private computeElementPositions;
    private computeEditOrViewElementPositions;
    private computeReplaceElementPositions;
    private computeLineElementPositions;
    private updateCamera;
    private updateDepthBuffer;
    private updateViewport;
    private updatePropsFromJson;
    private updateInteractionModel;
    private handleFrameDrawn;
    private invalidateState;
    private addInteractionListeners;
    private removeInteractionListeners;
    private clearIndicator;
    private updateStartAnchor;
    private newMeasurement;
    private handleEditAnchor;
    private createInteractionMoveHandler;
    private getStencilBuffer;
    private snapPoint;
    private formatDistance;
    private beginEditing;
    private endEditing;
    private updateMeasurementModel;
    private getHitProvider;
    private getHitTester;
    private updateMeasurementPropsFromModel;
    private updateIndicator;
    private setDepthBuffers;
    private resetDepthBuffers;
}
