import { SharedSettings } from "@hylimo/diagram-protocol"; import { type HandleMoveResult } from "../move/moveHandler.js"; import type { SRoot } from "../../model/sRoot.js"; import type { SModelElementImpl } from "sprotty"; import type { Action } from "sprotty-protocol"; import { type SnapLine } from "../snap/model.js"; import type { CanvasElement, Point } from "@hylimo/diagram-common"; import { SnapHandler } from "../snap/snapHandler.js"; import { SnapMoveHandler } from "../snap/snapMoveHandler.js"; /** * Create move handler to create canvas elements, typically used for toolbox edits */ export declare class CreateElementMoveHandler extends SnapMoveHandler { private readonly edit; private readonly root; private readonly editTarget; private readonly pointerId; /** * Creates a new create element move handler * * @param edit the edit to perform * @param root the root element * @param editTarget the id of the target element to edit * @param pointerId the pointer id, used to set pointer capture * @param snapHandler the snap handler to use for snapping, if enabled * @param settings the shared settings * @param snappingEnabled whether snapping is enabled */ constructor(edit: `toolbox/${string}`, root: SRoot, editTarget: Pick, pointerId: number, settings: SharedSettings | undefined, snappingEnabled: boolean); generateActions(target: SModelElementImpl, event: MouseEvent, committed: boolean, transactionId: string, sequenceNumber: number): Action[]; handleMove(x: number, y: number, event: MouseEvent, target: SModelElementImpl): HandleMoveResult; } /** * Snap handler for creating new elements */ declare class CreateElementSnapHandler extends SnapHandler { /** * The context of the snap handler, the id of the root element */ private readonly context; /** * Creates a new create element snap handler * * @param root the root element * @param settings the shared settings */ constructor(root: SRoot, settings: SharedSettings | undefined); /** * Gets the snapped values and snap lines based on the current translation * * @param values the current translation * @param zoom the current zoom level * @returns the snapped values and snap lines */ snap(values: Point, zoom: number): { snappedValues: Point; snapLines: Map | undefined; }; /** * Creates a translation matrix with rounded coordinates * * @param point the point to translate by after rounding * @returns a translation matrix with the rounded coordinates */ private createRoundedTranslation; /** * Rounds the coordinates of a point to the translation precision specified in the settings. * This ensures consistent precision when elements are moved or created on the canvas. * * @param point The point whose coordinates need to be rounded * @returns A new point with coordinates rounded according to translation precision settings */ private roundToTranslationPrecision; } export {}; //# sourceMappingURL=createElementMoveHandler.d.ts.map