import { type SnapIndex } from './spatial'; export declare const SNAP_THRESHOLD = 8; export declare const FINE_GRID_SIZE = 8; export declare const GUIDE_PAD = 14; export declare const SNAP_MATCH = 0.51; export declare const SLIDE_MARGIN = 40; export declare const RELATED_GAP = 240; export declare const MAX_CTRL_MEASURES = 8; /** Same-row/column objects beat a slightly closer distant line. */ export declare const RELATION_WEIGHT = 4; export type SnapKind = 'edge' | 'center' | 'canvas' | 'spacing' | 'size' | 'grid' | 'measure'; export type SnapMode = 'smart' | 'grid'; export interface SnapGuide { type: 'vertical' | 'horizontal'; kind?: SnapKind; axis: { x: number; y: number; }; length: number; marks?: number[]; label?: string; } export interface SnapBox { minX: number; maxX: number; minY: number; maxY: number; } export interface SnapCanvas { width: number; height: number; } export interface SnapOptions { mode: SnapMode; canvas: SnapCanvas; gridSize: number; threshold?: number; index?: SnapIndex; /** When set, append Ctrl distance badges for the already-queried k-set. */ ctrlMeasures?: boolean; } /** Search pad for the per-move Flatbush query: snap threshold or related-object reach. */ export declare const snapQueryPad: (threshold?: number) => number; export declare const sameSnapGuides: (a: SnapGuide[], b: SnapGuide[]) => boolean; export interface SnapResult { offsetX: number; offsetY: number; guides: SnapGuide[]; } export declare const boxWidth: (box: SnapBox) => number; export declare const boxHeight: (box: SnapBox) => number; export declare const boxCenterX: (box: SnapBox) => number; export declare const boxCenterY: (box: SnapBox) => number; export declare const translateBox: (box: SnapBox, dx: number, dy: number) => SnapBox; export declare const snapToGrid: (value: number, gridSize: number) => number; /** Alt uses the visible layout grid, or an 8px fine grid when none is shown. */ export declare const resolveGridSize: (visibleGridSize: number, forceGrid: boolean) => number; export declare const formatSnapLabel: (value: number) => string; export declare const formatMeasureLabel: (value: number) => string; export declare const unionBoxes: (boxes: SnapBox[]) => SnapBox | null; export declare const snapMovingBox: (moving: SnapBox, others: SnapBox[], options: SnapOptions) => SnapResult; export interface ResizeSnapOptions extends SnapOptions { moving?: SnapBox; resizeWidth?: boolean; resizeHeight?: boolean; } export declare const snapResizePoint: (currentX: number | null, currentY: number | null, others: SnapBox[], options: ResizeSnapOptions) => SnapResult; /** * Cross-axis for a distance badge: stay on the moving box. * Shared row/column uses the overlap; otherwise project onto the moving center. */ export declare const projectMeasureCross: (moving0: number, moving1: number, other0: number, other1: number) => number; /** * Ctrl-held distance badges: adjacent gaps along live guides, both axes to * the most related object, nearest same-row/column neighbors, and slide margins. */ export declare const collectCtrlMeasures: (moving: SnapBox, others: SnapBox[], canvas: SnapCanvas, guides?: SnapGuide[]) => SnapGuide[];