import type { DependencyGraph } from "./build.ts"; export type SCC = { /** Set of node names in this SCC. Self-loops count — a single node with a self-edge IS an SCC. */ nodes: string[]; /** * Edges entirely inside this SCC. Used to propose a break edge for the two-phase load. */ internalEdges: Array<{ source: string; target: string; fieldName: string; nillable: boolean; }>; /** * A recommended break edge — a nillable edge whose field will be set to null during the * first insert pass and back-filled in the second pass. Null if no nillable edge exists * in the SCC (which means the cycle cannot be safely broken without further intervention). */ breakEdge: { source: string; target: string; fieldName: string; } | null; }; /** * Tarjan's strongly-connected components. * Iterative (explicit stack) so we don't blow the call stack on deep graphs. * * Only returns SCCs that are "real cycles": * - size > 1, OR * - size === 1 AND the node has a self-edge * Single nodes without self-edges are not cycles and are omitted from the result. */ export declare function stronglyConnectedComponents(graph: DependencyGraph): SCC[];