[API] Rewrite LGraphCanvas.setGraph for subgraph (#1002)

Code search showed no usage.

Fixes TS type on LGraph.
This commit is contained in:
filtered
2025-05-03 08:01:59 +10:00
committed by GitHub
parent 9dcc3bf39a
commit 27fbc2ea7c
2 changed files with 13 additions and 13 deletions

View File

@@ -30,12 +30,12 @@ export class Subgraph extends LGraph implements BaseLGraph, Serialisable<Exporte
}
/** @inheritdoc */
get pathToRootGraph(): readonly [LGraph, ...GraphOrSubgraph[]] {
get pathToRootGraph(): readonly [LGraph, ...Subgraph[]] {
return [...this.parents, this]
}
constructor(
readonly parents: readonly [LGraph, ...GraphOrSubgraph[]],
readonly parents: readonly [LGraph, ...Subgraph[]],
data: ExportedSubgraph,
) {
if (!parents.length) throw new Error("Subgraph must have at least one parent")