import { ISubgraphInput } from '../interfaces'; import { BaseLGraph, LGraph } from '../LGraph'; import { GraphOrSubgraph, Subgraph } from './Subgraph'; import { ExportedSubgraphInstance } from '../types/serialisation'; import { IBaseWidget } from '../types/widgets'; import { UUID } from '../utils/uuid'; import { LGraphButton } from '../LGraphButton'; import { LGraphCanvas } from '../LGraphCanvas'; import { LGraphNode } from '../LGraphNode'; import { INodeInputSlot, ISlotType, NodeId } from '../litegraph'; import { LLink, ResolvedConnection } from '../LLink'; import { ExecutableLGraphNode, ExecutionId } from './ExecutableNodeDTO'; /** * An instance of a {@link Subgraph}, displayed as a node on the containing (parent) graph. */ export declare class SubgraphNode extends LGraphNode implements BaseLGraph { #private; /** The (sub)graph that contains this subgraph instance. */ readonly graph: GraphOrSubgraph; /** The definition of this subgraph; how its nodes are configured, etc. */ readonly subgraph: Subgraph; inputs: (INodeInputSlot & Partial)[]; readonly type: UUID; readonly isVirtualNode: true; get rootGraph(): LGraph; get displayType(): string; isSubgraphNode(): this is SubgraphNode; widgets: IBaseWidget[]; constructor( /** The (sub)graph that contains this subgraph instance. */ graph: GraphOrSubgraph, /** The definition of this subgraph; how its nodes are configured, etc. */ subgraph: Subgraph, instanceData: ExportedSubgraphInstance); onTitleButtonClick(button: LGraphButton, canvas: LGraphCanvas): void; configure(info: ExportedSubgraphInstance): void; _internalConfigureAfterSlots(): void; /** * Ensures the subgraph slot is in the params before adding the input as normal. * @param name The name of the input slot. * @param type The type of the input slot. * @param inputProperties Properties that are directly assigned to the created input. Default: a new, empty object. * @returns The new input slot. * @remarks Assertion is required to instantiate empty generic POJO. */ addInput>(name: string, type: ISlotType, inputProperties?: TInput): INodeInputSlot & TInput; getInputLink(slot: number): LLink | null; /** * Finds the internal links connected to the given input slot inside the subgraph, and resolves the nodes / slots. * @param slot The slot index * @returns The resolved connections, or undefined if no input node is found. * @remarks This is used to resolve the input links when dragging a link from a subgraph input slot. */ resolveSubgraphInputLinks(slot: number): ResolvedConnection[]; /** * Finds the internal link connected to the given output slot inside the subgraph, and resolves the nodes / slots. * @param slot The slot index * @returns The output node if found, otherwise undefined. */ resolveSubgraphOutputLink(slot: number): ResolvedConnection | undefined; /** @internal Used to flatten the subgraph before execution. */ getInnerNodes( /** The set of computed node DTOs for this execution. */ executableNodes: Map, /** The path of subgraph node IDs. */ subgraphNodePath?: readonly NodeId[], /** Internal recursion param. The list of nodes to add to. */ nodes?: ExecutableLGraphNode[], /** Internal recursion param. The set of visited nodes. */ visited?: Set): ExecutableLGraphNode[]; removeWidgetByName(name: string): void; ensureWidgetRemoved(widget: IBaseWidget): void; onRemoved(): void; }