From 7c236bcfc8d55602bf041aa01ef0bb733497acfa Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Sun, 20 Apr 2025 22:59:23 +1000 Subject: [PATCH] [API] Remove broken: node.addInputs & addOutputs (#950) The current impls. do not work as intended; they will only assign the additional info properties if there are at least three items in the input array. Adding replacements would be trivial, if required, and would benefit by not inheriting the current public interface. Confirmed unused via code search. --- src/LGraphNode.ts | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/src/LGraphNode.ts b/src/LGraphNode.ts index 5cab0393e..feba139b5 100644 --- a/src/LGraphNode.ts +++ b/src/LGraphNode.ts @@ -1441,28 +1441,6 @@ export class LGraphNode implements Positionable, IPinnable, IColorable { return output } - /** - * add a new output slot to use in this node - * @param array of triplets like [[name,type,extra_info],[...]] - */ - addOutputs(array: [string, ISlotType, Partial][]): void { - for (const info of array) { - const o = new NodeOutputSlot({ name: info[0], type: info[1], links: null }) - // TODO: Checking the wrong variable here - confirm no downstream consumers, then remove. - if (array[2]) Object.assign(o, info[2]) - - this.outputs ||= [] - this.outputs.push(o) - this.onOutputAdded?.(o) - - if (LiteGraph.auto_load_slot_types) - LiteGraph.registerNodeAndSlotType(this, info[1], true) - } - - this.expandToFitContent() - this.setDirtyCanvas(true, true) - } - /** * remove an existing output slot */ @@ -1508,27 +1486,6 @@ export class LGraphNode implements Positionable, IPinnable, IColorable { return input } - /** - * add several new input slots in this node - * @param array of triplets like [[name,type,extra_info],[...]] - */ - addInputs(array: [string, ISlotType, Partial][]): void { - for (const info of array) { - const o: INodeInputSlot = new NodeInputSlot({ name: info[0], type: info[1], link: null }) - // TODO: Checking the wrong variable here - confirm no downstream consumers, then remove. - if (array[2]) Object.assign(o, info[2]) - - this.inputs ||= [] - this.inputs.push(o) - this.onInputAdded?.(o) - - LiteGraph.registerNodeAndSlotType(this, info[1]) - } - - this.expandToFitContent() - this.setDirtyCanvas(true, true) - } - /** * remove an existing input slot */