import { Rect } from "../../Core/Rect"; import { RegionData } from "../../Core/RegionData"; import { ILineSegment } from "../../Interface/ILineSegment"; import { IRegionCallbacks } from "../../Interface/IRegionCallbacks"; import { RegionComponent } from "./RegionComponent"; /** * Component to represent mid-points along line segments in a region. */ export declare abstract class MidpointComponent extends RegionComponent { /** * Default (visual) radius for midpoints. */ static DEFAULT_RADIUS: number; /** * Midpoint elements mapped to line segment indices. */ protected midpointElements: Record; /** * Grouping element for midpoints. */ protected midpointNode: Snap.Element; /** * Creates a new `MidpointComponent` object. * @param paper - The `Snap.Paper` object to draw on. * @param paperRect - The parent bounding box for created component. * @param regionData - The `RegionData` object shared across components. Used also for initial setup. * @param callbacks - The external callbacks collection. */ constructor(paper: Snap.Paper, paperRect: Rect, regionData: RegionData, callbacks: IRegionCallbacks); redraw(): void; /** * Add event listeners to a midpoint's DOM node */ protected abstract subscribeMidpointToEvents(midpoint: Snap.Element, index: number): void; /** * Helper function to create a new midpoint. * @param paper - The `Snap.Paper` object to draw on. * @param x - The `x`-coordinate of the midpoint. * @param y - The `y`-coordinate of the midpoint. * @param style - Additional css style class to be applied. * @param r - The radius of the midpoint. */ protected createMidpoint(paper: Snap.Paper, x: number, y: number, style?: string, r?: number): Snap.Element; protected teardownMidpoints(): void; protected buildMidpoints(regionLineSegments: ILineSegment[]): void; private updateMidpoints; }