[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.
This commit is contained in:
filtered
2025-04-20 22:59:23 +10:00
committed by GitHub
parent b6a04d245b
commit 7c236bcfc8

View File

@@ -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<INodeOutputSlot>][]): 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<INodeInputSlot>][]): 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
*/