import type { SankeyLayoutEdge, SankeyLayoutModel, SankeyLayoutNode } from '../types/sankey-internal.js'; /** * Id lookups for a single layout. `edgesByFrom` maps `fromId` → `toId` * → the edges between that pair. That array holds a single edge in the normal * case; it holds more only for parallel edges (multiple edges between the same * node pair), which are rare. Resolving one of those by its `edgeIndex` with a * short `find` reads more simply than a third nested map and, given the array * is almost always length one, is effectively just as fast. */ export interface SankeyLayoutIndex { nodesById: Map; edgesByFrom: Map>; } /** * Seeds the cache with an index that `generateSankeyLayout` collected during * d3-sankey's own single pass over the graph, so the resolvers stay `O(1)` * without `buildIndex` ever re-scanning the nodes and edges. */ export declare function primeLayoutIndex(layout: SankeyLayoutModel, index: SankeyLayoutIndex): void; /** * Resolves a node by id against the current layout in `O(1)`, or `undefined` * when the id is absent (e.g. after a data change dropped it). */ export declare function resolveLayoutNode(layout: SankeyLayoutModel, nodeId: string): SankeyLayoutNode | undefined; /** * Resolves an edge by its source/target ids and per-layout edge index against * the current layout, together with both resolved endpoint nodes. Returns * `undefined` when the edge is absent or either endpoint is unresolved. The * `edgeIndex` discriminant picks the right edge when parallel edges share the * same source and target ids; with the usual single edge per pair it simply * matches that one. */ export declare function resolveLayoutEdge(layout: SankeyLayoutModel, fromId: string, toId: string, edgeIndex: number): { edge: SankeyLayoutEdge; source: SankeyLayoutNode; target: SankeyLayoutNode; } | undefined; //# sourceMappingURL=layout-index.d.ts.map