/** * Flowchart Graph Operations * * Graph surgery and chain operations for the Flowchart class. * These methods are added to the Flowchart prototype. */ import type { Flowchart } from './flowchart.js'; import type { AddLinkOptions } from './flowchart-types.js'; /** * Insert a node between two connected nodes. * If A --> B exists, insertBetween('X', 'A', 'B') creates A --> X --> B */ export declare function insertBetween(this: Flowchart, newNodeId: string, source: string, target: string, nodeText?: string): Flowchart; /** * Remove a node and reconnect its neighbors. * If A --> B --> C, removeAndReconnect('B') creates A --> C */ export declare function removeAndReconnect(this: Flowchart, nodeId: string): Flowchart; /** * Get all nodes that can be reached from a starting node. */ export declare function getReachable(this: Flowchart, startId: string): string[]; /** * Get all nodes that can reach a target node. */ export declare function getAncestors(this: Flowchart, targetId: string): string[]; /** * Get the shortest path between two nodes. */ export declare function getPath(this: Flowchart, source: string, target: string): string[]; /** * Get a linear chain of nodes between two points. * Only works if there's a single path (no branching). */ export declare function getChain(this: Flowchart, startId: string, endId: string): string[]; /** * Yank (remove) a chain of nodes and reconnect around them. * If we have X -> A -> B -> C -> Y and we yank [A, B, C], we get X -> Y. */ export declare function yankChain(this: Flowchart, nodeIds: string[]): Flowchart; /** * Splice a chain of existing nodes between two points. */ export declare function spliceChain(this: Flowchart, nodeIds: string[], source: string, target: string, options?: AddLinkOptions): Flowchart; /** * Reverse the direction of all links in a chain. */ export declare function reverseChain(this: Flowchart, nodeIds: string[]): Flowchart; /** * Extract a subchain from the graph, removing it but keeping internal links intact. * Returns the extracted nodes as a new Flowchart. */ export declare function extractChain(this: Flowchart, nodeIds: string[]): Flowchart; /** * Rebase nodes - move a set of nodes to be children of a new parent. */ export declare function rebaseNodes(this: Flowchart, nodeIds: string[], newParent: string): Flowchart; //# sourceMappingURL=flowchart-graph-ops.d.ts.map