import { type Matrix } from "transformation-matrix"; import { type SnapElementData, type SnapLines, type SnapOptions, type SnapReferenceData, type SnapResult } from "./model.js"; import { type Vector } from "@hylimo/diagram-common"; /** * Tolerance for snapping to be considered valid * This is used to filter out snaps that are too far away from the actual snap point due to rounding. */ export declare const SNAP_TOLERANCE = 2.5; /** * Calculates snapping information for elements based on reference data. * * @param state The current state of the elements being moved/snapped * @param referenceState Reference data for elements to snap against * @param zoom The current zoom level of the viewport * @param elementOffset The offset to apply to the elements being moved (applied to the state) * @param options Configuration options for the snapping behavior * @returns Snap result containing offset and snap lines information */ export declare function getSnaps(state: SnapElementData, referenceState: SnapReferenceData, zoom: number, elementOffset: Vector, options: SnapOptions): SnapResult; /** * Due to rounding, actual snap points may sometimes be slightly off. * If the distance to the actual snap point is larger than a threshold, snaps are ignored. * Modifies the snap result in place. * * @param snapResult the snap result where snaps are potentially removed * @param transform the transform to apply * @returns true if the snap result has changed */ export declare function filterValidSnaps(snapResult: SnapResult, transform: Matrix): boolean; /** * Converts snap results into visual snap lines for rendering. * * @param snapResult The snap result containing nearest snaps for x and y axes * @param transform The transformation matrix to apply to the snap lines * @returns Map of snap lines grouped by context ID, or undefined if no snap lines are found */ export declare function getSnapLines(snapResult: SnapResult, transform: Matrix): SnapLines | undefined; /** * Snap distance with zoom value taken into consideration * * @param zoomValue the zoom value of the canvas * @returns the snap distance */ export declare function getSnapDistance(zoomValue: number): number; //# sourceMappingURL=snapping.d.ts.map