import { EventEmitter, h } from '../../stencil-public-runtime'; import { Dimensions, Point } from '@vertexvis/geometry'; import { Markup, MarkupCenteringBehavior, MarkupInteraction } from '../../lib/types/markup'; import { LineAnchorStyle } from '../viewer-markup-arrow/utils'; import { ViewerMarkupToolType } from '../viewer-markup-tool/viewer-markup-tool'; export declare class ViewerMarkup { /** * An HTML template that describes the HTML to use for new arrow * markup. It's expected that the template contains a * ``. */ arrowTemplateId?: string; /** * An HTML template that describes the HTML to use for new circle * markup. It's expected that the template contains a * ``. */ circleTemplateId?: string; /** * An HTML template that describes the HTML to use for new freeform * markup. It's expected that the template contains a * ``. */ freeformTemplateId?: string; /** * The type of markup to perform. */ tool: ViewerMarkupToolType; /** * If `true`, disables adding or editing of markup through user * interaction. */ disabled: boolean; /** * The viewer to connect to markup. If nested within a , * this property will be populated automatically. */ viewer?: HTMLVertexViewerElement; /** * The ID of the markup that is selected. */ selectedMarkupId?: string; /** * Indicates if new markup should be automatically selected. */ selectNew: boolean; /** * The style of the starting anchor. This defaults to none. */ startLineAnchorStyle: LineAnchorStyle; /** * The style of the ending anchor. This defaults to 'arrow-triangle.' */ endLineAnchorStyle: LineAnchorStyle; /** * The original viewport dimensions where this markup was created. This value is used * to determine where the markup should be rendered relative to the current viewport, * enabling some markup to appear "off-screen". * * When provided, all NDC values will be considered relative to this viewport. */ originatingViewport?: Dimensions.Dimensions; /** * Defines the behavior of the provided markup when the originating viewport is smaller * than the current viewport, or is scaled to a size smaller than the current viewport * using the `scale` property. * * Options: * - `x-only`: Markup will be centered horizontally, but not vertically. * - `y-only`: Markup will be centered vertically, but not horizontally. * - `both`: Markup will be centered both horizontally and vertically. * - `none`: Markup will not be centered (default). */ centeringBehavior: MarkupCenteringBehavior; /** * The current offset of the visible viewport. This value is used to determine where * markup should be rendered relative to the current viewport, enabling some markup to appear "off-screen". * * When provided, all computed coordinates will be offset by this amount. */ offset?: Point.Point; /** * The scale to render this markup at. This value is used to scale the element's bounds * along with any `offset` to determine the final computed coordinates. * * When provided, all computed coordinates will be scaled by this amount. */ scale: number; /** * Dispatched when a new markup is added, either through user interaction * or programmatically. */ markupAdded: EventEmitter; /** * Dispatched when an existing piece of markup is changed, either through user interaction * or programmatically. */ markupChanged: EventEmitter; /** * Dispatched when a markup is removed, either through user * interaction or programmatically. */ markupRemoved: EventEmitter; /** * Dispatched when markup selection changes. Will either be the * selected element or `undefined` indicating that selection * was cleared. */ markupSelectionChanged: EventEmitter; private hostEl; private toSelectMarkupId?; private pointerDownPosition?; protected disconnectedCallback(): void; /** * Adds a new markup as a child to this component. A new markup * component will be created from the template specified by * `arrow-template-id`, `circle-template-id`, or if undefined * a default element will be created. * * @param markup The markup to add. * @returns The markup element that was created. * @see {@link arrowTemplateId} * @see {@link circleTemplateId} */ addMarkup(markup: Markup): Promise; /** * Removes a markup with the given ID, and returns the HTML element * associated to the markup. Returns `undefined` if no markup is * found. * * @param id The ID of the markup to remove. * @returns The markup element, or undefined. */ removeMarkup(id: string): Promise; /** * Returns a list of markup elements that are children of this component. * * @returns A list of all markups. * @see {@link getMarkupElement} */ getMarkupElements(): Promise>; /** * Returns the markup element associated to the given ID. * * @param id The ID of the markup element to return. * @returns A markup element, or `undefined`. * @see {@link getMarkupElements} */ getMarkupElement(id: string): Promise; /** * @ignore */ protected handleSelectedMarkupIdChanged(): Promise; /** * @ignore */ protected handlePropertyChanged(): void; /** * @ignore */ protected handleViewerChanged(newViewer: HTMLVertexViewerElement | undefined): Promise; /** * @ignore */ protected handleDisabledChanged(): void; /** * @ignore */ protected handleStartLineAnchorStyleChanged(): Promise; /** * @ignore */ protected handleEndLineAnchorStyleChanged(): Promise; /** * @ignore */ protected handleMarkupEnd(event: CustomEvent): Promise; /** * @ignore */ protected handleMarkupUpdated(event: CustomEvent): Promise; /** * @ignore */ protected handleMarkupPointerDown(event: PointerEvent): Promise; /** * @ignore */ protected componentDidLoad(): void; /** * @ignore */ protected render(): h.JSX.IntrinsicElements; private handleSlotChange; private handlePointerMove; private handlePointerUp; private appendMarkupElement; private createArrowMarkupElement; private createCircleMarkupElement; private createFreeformMarkupElement; private updatePropsOnMarkups; private updatePropsOnMarkup; private updatePropsOnMarkupTool; private getMarkupTool; private getSelectedArrowMarkup; }