import { CustomEventTarget } from '../infrastructure/CustomEventTarget'; import { LinkConnectorEventMap } from '../infrastructure/LinkConnectorEventMap'; import { LinkNetwork, Point } from '../interfaces'; import { LGraphNode } from '../LGraphNode'; import { INodeInputSlot, INodeOutputSlot, LLink, Reroute } from '../litegraph'; import { SubgraphInput } from '../subgraph/SubgraphInput'; import { SubgraphIONodeBase } from '../subgraph/SubgraphIONodeBase'; import { SubgraphOutput } from '../subgraph/SubgraphOutput'; import { LinkDirection } from '../types/globalEnums'; export interface RenderLink { /** The type of link being connected. */ readonly toType: "input" | "output"; /** The source {@link Point} of the link being connected. */ readonly fromPos: Point; /** The direction the link starts off as. If {@link toType} is `output`, this will be the direction the link input faces. */ readonly fromDirection: LinkDirection; /** If set, this will force a dragged link "point" from the cursor in the specified direction. */ dragDirection: LinkDirection; /** The network that the link belongs to. */ readonly network: LinkNetwork; /** The node that the link is being connected from. */ readonly node: LGraphNode | SubgraphIONodeBase; /** The slot that the link is being connected from. */ readonly fromSlot: INodeOutputSlot | INodeInputSlot | SubgraphInput | SubgraphOutput; /** The index of the slot that the link is being connected from. */ readonly fromSlotIndex: number; /** The reroute that the link is being connected from. */ readonly fromReroute?: Reroute; connectToInput(node: LGraphNode, input: INodeInputSlot, events?: CustomEventTarget): void; connectToOutput(node: LGraphNode, output: INodeOutputSlot, events?: CustomEventTarget): void; connectToSubgraphInput(input: SubgraphInput, events?: CustomEventTarget): void; connectToSubgraphOutput(output: SubgraphOutput, events?: CustomEventTarget): void; connectToRerouteInput(reroute: Reroute, { node, input, link }: { node: LGraphNode; input: INodeInputSlot; link: LLink; }, events: CustomEventTarget, originalReroutes: Reroute[]): void; connectToRerouteOutput(reroute: Reroute, outputNode: LGraphNode, output: INodeOutputSlot, events: CustomEventTarget): void; }