/** * Grid-intersection-based connector routing. * * Routes connectors through grid intersection points (cell corners) * using Dijkstra with 8-connected neighbors to avoid node circles. * Tracks used intersections to prefer fresh paths. */ import type { NormalizedNodeDef, NormalizedConnectorDef } from '../types.js'; import type { GridLayout } from './grid.js'; export interface IntPt { i: number; j: number; } export interface RouteResult { waypoints: { x: number; y: number; }[]; intersections: IntPt[]; } export declare function intPtKey(i: number, j: number): string; /** * Route a connector around nodes through grid intersections. * * Tries all 4×4 combinations of start/end cell corners. * Selection priority: * 1. Routes with fewer collisions with used intersections * 2. Among equal collision count, shortest total distance */ export declare function routeAroundNodes(conn: NormalizedConnectorDef, nodeMap: Map, allNodes: NormalizedNodeDef[], layout: GridLayout, usedIntersections?: Set): RouteResult | null; /** * Every non-endpoint node whose disc the connector's (possibly * way-pointed) polyline crosses. Returned in the order `allNodes` * supplies — first match wins per node, so the result has no * duplicates. Empty array ⇒ the direct line is clear. * * Used by the pipeline to (a) decide whether routing is needed and * (b) emit a `route-failed` diagnostic with the offending node ids * when no alternate path exists. */ export declare function findCrossingNodes(conn: NormalizedConnectorDef, nodeMap: Map, allNodes: NormalizedNodeDef[], layout: GridLayout): NormalizedNodeDef[]; /** * Back-compat boolean wrapper. Prefer `findCrossingNodes` when the * caller also wants the obstacle ids (diagnostic emission). */ export declare function connectorCrossesNode(conn: NormalizedConnectorDef, nodeMap: Map, allNodes: NormalizedNodeDef[], layout: GridLayout): boolean; //# sourceMappingURL=router.d.ts.map