import { SharedSettings } from "@hylimo/diagram-protocol"; import { type Matrix } from "transformation-matrix"; import { type HandleMoveResult } from "../../move/moveHandler.js"; import type { ResizeMoveCursor } from "../../cursor/cursor.js"; import type { SnapLines } from "../../snap/model.js"; import { SnapHandler } from "../../snap/snapHandler.js"; import type { SCanvasConnection } from "../../../model/canvas/sCanvasConnection.js"; import type { SModelElementImpl } from "sprotty"; import { SnapMoveHandler } from "../../snap/snapMoveHandler.js"; import type { SCanvasAxisAlignedSegment } from "../../../model/canvas/sCanvasAxisAlignedSegment.js"; /** * Represents the result of a snap operation for an axis-aligned segment. * Contains information about the snapped position and any snap lines that should be displayed. */ interface AxisAlignedSegmentSnapResult { /** * The position value after snapping, normalized between 0 and 1 */ snappedPos: number; /** * Visual snap lines to display in the UI, if any */ snapLines: SnapLines | undefined; } /** * Move handler for moving the vertical segment of an axis aligned connection segment. * Expects relative coordinates in the canvas connection parent canvas coordinate system. */ export declare class AxisAlignedSegmentEditMoveHandler extends SnapMoveHandler { private readonly original; private readonly start; private readonly end; private readonly vertical; /** * The id of the CanvasAxisAlignedConnectionSegment to move */ private readonly element; /** * Creates a new AxisAlignedSegmentEditHandler * * @param element the id of the CanvasAxisAlignedConnectionSegment to move * @param original the original verticalPos/horizontalPos of the segment * @param start the x/y cooridnate of the start of the whole axis aligned segment * @param end the x/y cooridnate of the end of the whole axis aligned segment * @param vertical true if the vertical segment is moved, otherwise false * @param snapHandler the snap handler to use for snapping functionality, if enabled * @param transformationMatrix transformation matrix to apply to obtain the relative position * @param moveCursor the cursor to use while moving */ constructor(original: number, start: number, end: number, vertical: boolean, segment: SCanvasAxisAlignedSegment, otherStart: number, otherEnd: number, settings: SharedSettings | undefined, snappingEnabled: boolean, transformationMatrix: Matrix, moveCursor: ResizeMoveCursor | undefined); handleMove(x: number, y: number, event: MouseEvent, target: SModelElementImpl): HandleMoveResult; } /** * Snap handler for axis aligned segment edits. * Handles snapping functionality when moving axis aligned segments in a connection. */ declare class AxisAlignedSegmentEditSnapHandler extends SnapHandler { private readonly vertical; private readonly otherStart; private readonly otherEnd; /** * Canvas id that serves as the context for snapping operations */ private readonly context; /** * Transformation matrix to convert from context coordinates to target coordinates */ private readonly contextToTargetMatrix; /** * Transformation matrix to convert from target coordinates to context coordinates */ private readonly targetToContextMatrix; /** * Whether the segment is effectively vertical after considering rotations */ private readonly effectivelyVertical; /** * Creates a new AxisAlignedSegmentEditSnapHandler * * @param connection the canvas connection containing the segment being edited * @param vertical whether the segment being moved is vertical (true) or horizontal (false) * @param otherStart the start coordinate of the segment for the off-axis * @param otherEnd the end coordinate of the segment for the off-axis */ constructor(connection: SCanvasConnection, vertical: boolean, otherStart: number, otherEnd: number, settings: SharedSettings | undefined); /** * Gets the snapped value and associated snap lines based on the current position * * @param pos the current position value of the segment being edited * @param start the x/y cooridnate of the start of the whole axis aligned segment * @param end the x/y cooridnate of the end of the whole axis aligned segment * @param zoom the current zoom level of the viewport * @returns an object containing the snapped pos and snap lines to display */ snap(pos: number, start: number, end: number, zoom: number): AxisAlignedSegmentSnapResult | undefined; /** * Gets snap result data based on the current value * * @param value the current position value of the segment being edited * @param zoom the current zoom level of the viewport * @returns the snap result data */ private getSnapResult; } export {}; //# sourceMappingURL=axisAlignedSegmentEditMoveHandler.d.ts.map