/** * Corner-grip gestures. Two ways to make a node bigger, and the rule that * lets one held button switch between them: * * - RESIZE reflows: the footprint changes, the type does not. * - RESCALE magnifies: one factor drives w, h and the content scale, so the * aspect ratio is preserved and everything inside grows with the box. * * Both take the corner the cursor is pointing at, so the caller can keep the * grab offset (cursor − corner) and hand over a corner rather than a cursor. * Rescale measures its factor against a BASE captured at the last rebase — * grip-down, or the moment shift was toggled — which is what makes the two * gestures interchangeable mid-drag: each starts from wherever the other * left the node, and a rebase is a no-op until the cursor actually moves. */ import { type SizeLaw } from "./grid.js"; import { type GraphNode } from "./graph.js"; /** magnification band a rescale may reach */ export declare const MIN_SCALE = 0.25; export declare const MAX_SCALE = 8; /** a node's geometry, as captured at a rebase */ export interface GripBase { w: number; h: number; scale: number; } export type GripSize = GripBase; /** the node's geometry right now — the base a rebase would capture */ export declare function gripBase(n: GraphNode): GripBase; /** * RESIZE to a corner at world (cx, cy). Grid-snapped, minimums respected, * stopped at neighbors. Node-size law: a node spans 1..radix grids at SOME * layer — exceeding radix grids promotes it to the next layer, snapped to * the limit. The content scale is untouched. */ export declare function gripResize(n: GraphNode, cx: number, cy: number, others: GraphNode[], radix: number, law?: SizeLaw): GripSize; /** * RESCALE to a corner at world (cx, cy), against `base`. The factor is the * corner's projection onto the base diagonal: exactly 1 when the corner is * the one the base was captured with, so a rebase never moves the node and * a drag out and back lands where it began. * * Only the width lands on the lattice — honoring the ratio means the bottom * edge follows from the factor rather than snapping on its own. Neighbors * still stop the growth, and whichever axis they stop first governs both. */ export declare function gripRescale(n: GraphNode, base: GripBase, cx: number, cy: number, others: GraphNode[], radix: number, law?: SizeLaw): GripSize; //# sourceMappingURL=grip.d.ts.map