import { Rect } from "../../Core/Rect"; import { ISelectorCallbacks } from "../../Interface/ISelectorCallbacks"; import { Selector } from "./Selector"; /** * The selector to define a polygon-region. */ export declare class PolygonSelector extends Selector { /** * Default radius for the point element. Can be redefined through css styles. */ private static DEFAULT_POINT_RADIUS; /** * Default radius for the point element. Can be redefined through css styles. */ private static DEFAULT_SELECTOR_RADIUS; /** * The `CrossElement` to define point position */ private crossA; /** * The element to add a new point. */ private nextPoint; /** * The line segment to add a new point. */ private nextSegment; /** * The line to the new point from the first point. */ private nextL1; /** * The line to the new point from the last point. */ private nextLN; /** * The grouping element for polyline points. */ private pointsGroup; /** * The polygon element. */ private polygon; /** * Collection of points composing polyline data. */ private points; /** * The last point. */ private lastPoint; /** * Current state of selector. */ private isCapturing; /** * When undo is called, those points are pushed into this queue. * If new points are added the redo queue is cleared. */ private redoQueue; /** * Creates new `PolygonSelector` object. * @param parent - The parent SVG-element. * @param paper - The `Snap.Paper` element to draw on. * @param boundRect - The bounding box. * @param callbacks - The collection of callbacks. */ constructor(parent: SVGSVGElement, paper: Snap.Paper, boundRect: Rect, callbacks?: ISelectorCallbacks); /** * Resizes the selector to specified `width` and `height`. * @param newWidth - The new `width`. * @param newHeight - The new `height`. * @param oldWidth - The previous `width` before the resize. * @param oldHeight - The previous `height` before the resize. */ resize(newWidth: number, newHeight: number, oldWidth?: number, oldHeight?: number): void; /** * Hides the selector. */ hide(): void; /** * Shows the selector. */ show(): void; /** * Undo the last point drawn, if there is something to undo */ undo(): void; /** * Redo the last point that was undone */ redo(): void; canRedo(): boolean; canUndo(): boolean; /** * Disables and hides this selector. */ disable(): void; /** * Resets the selector. */ reset(): void; /** * Builds selector's UI. */ private buildUIElements; /** * Adds a new point to polygon at specified coordinates * @param x - x-coordinate of the new point. * @param y - y-coordinate of the new point. */ private addPoint; private redrawPoints; /** * Submits the new polygon region to the callback function. */ private submitPolygon; }