import type { SchemaSnapshot } from "../types.js"; /** * Pure, I/O-free graph core the D1 FK-cascade emitter orders rebuilds by. Edges * point child→parent (a table → the table(s) its foreign keys reference), * self-loops included for a self-referential table. */ /** Builds child→parent FK edges from a schema. Self-loops included. */ export declare function buildFkEdges(schema: SchemaSnapshot): Map>; /** Merges two edge maps into a new one; neither input is mutated. */ export declare function unionEdges(a: Map>, b: Map>): Map>; /** * `recreated` plus every transitive *referrer* — walk edges backwards: any * table with an edge into the current set (i.e. it references a member of the * set) joins the set, repeated to a fixpoint. */ export declare function affectedSet(recreated: ReadonlySet, edges: Map>): Set; /** * Kahn's algorithm over `nodes`, treating an edge `child→parent` as "parent * must come before child". Self-loops (`x→x`) and edges whose target is not * in `nodes` are dropped before ordering. `order` is parents-first. If nodes * remain when the queue empties, the sort cannot complete — those remaining * nodes (a multi-node cycle) are returned as `cycle` instead. */ export declare function topoOrder(nodes: Set, edges: Map>): { order: string[]; cycle: string[] | null; }; //# sourceMappingURL=fk-graph.d.ts.map