import { GraphOrSubgraph } from './Subgraph'; import { SubgraphInput } from './SubgraphInput'; import { SubgraphOutput } from './SubgraphOutput'; import { INodeInputSlot, INodeOutputSlot, Positionable } from '../interfaces'; import { LGraph } from '../LGraph'; import { ISerialisedNode, SerialisableLLink, SubgraphIO } from '../types/serialisation'; import { UUID } from '../utils/uuid'; import { LGraphGroup } from '../LGraphGroup'; import { LGraphNode } from '../LGraphNode'; import { LLink, ResolvedConnection } from '../LLink'; import { Reroute } from '../Reroute'; import { SubgraphInputNode } from './SubgraphInputNode'; import { SubgraphOutputNode } from './SubgraphOutputNode'; export interface FilteredItems { nodes: Set; reroutes: Set; groups: Set; subgraphInputNodes: Set; subgraphOutputNodes: Set; unknown: Set; } export declare function splitPositionables(items: Iterable): FilteredItems; interface BoundaryLinks { boundaryLinks: LLink[]; boundaryFloatingLinks: LLink[]; internalLinks: LLink[]; boundaryInputLinks: LLink[]; boundaryOutputLinks: LLink[]; } export declare function getBoundaryLinks(graph: LGraph, items: Set): BoundaryLinks; export declare function multiClone(nodes: Iterable): ISerialisedNode[]; /** * Groups resolved connections by output object. If the output is nullish, the connection will be in its own group. * @param resolvedConnections The resolved connections to group * @returns A map of grouped connections. */ export declare function groupResolvedByOutput(resolvedConnections: ResolvedConnection[]): Map; export declare function mapSubgraphInputsAndLinks(resolvedInputLinks: ResolvedConnection[], links: SerialisableLLink[]): SubgraphIO[]; /** * Clones the output slots, and updates existing links, when converting items to a subgraph. * @param resolvedOutputLinks The resolved output links. * @param links The links to add to the subgraph. * @returns The subgraph output slots. */ export declare function mapSubgraphOutputsAndLinks(resolvedOutputLinks: ResolvedConnection[], links: SerialisableLLink[]): SubgraphIO[]; /** * Collects all subgraph IDs used directly in a single graph (non-recursive). * @param graph The graph to check for subgraph nodes * @returns Set of subgraph IDs used in this graph */ export declare function getDirectSubgraphIds(graph: GraphOrSubgraph): Set; /** * Collects all subgraph IDs referenced in a graph hierarchy using BFS. * @param rootGraph The graph to start from * @param subgraphRegistry Map of all available subgraphs * @returns Set of all subgraph IDs found */ export declare function findUsedSubgraphIds(rootGraph: GraphOrSubgraph, subgraphRegistry: Map): Set; /** * Type guard to check if a slot is a SubgraphInput. * @param slot The slot to check * @returns true if the slot is a SubgraphInput */ export declare function isSubgraphInput(slot: unknown): slot is SubgraphInput; /** * Type guard to check if a slot is a SubgraphOutput. * @param slot The slot to check * @returns true if the slot is a SubgraphOutput */ export declare function isSubgraphOutput(slot: unknown): slot is SubgraphOutput; /** * Type guard to check if a slot is a regular node slot (INodeInputSlot or INodeOutputSlot). * @param slot The slot to check * @returns true if the slot is a regular node slot */ export declare function isNodeSlot(slot: unknown): slot is INodeInputSlot | INodeOutputSlot; export {};