Update Litegraph (TypeScript conversion) (#1145)

* Fix various type errors

* Fix rest of ts errors

* update litegraph

* nit
This commit is contained in:
Chenlei Hu
2024-10-07 11:31:54 -04:00
committed by GitHub
parent 9cbfc9856b
commit dee1ec1a2a
15 changed files with 36 additions and 69 deletions

View File

@@ -98,6 +98,7 @@ class GroupNodeBuilder {
const nodesInOrder = app.graph.computeExecutionOrder(false)
this.nodes = this.nodes
.map((node) => ({ index: nodesInOrder.indexOf(node), node }))
// @ts-expect-error id might be string
.sort((a, b) => a.index - b.index || a.node.id - b.node.id)
.map(({ node }) => node)
}
@@ -801,7 +802,6 @@ export class GroupNodeHandler {
this.groupData.nodeData.nodes.map((n, i) => {
const innerNode = LiteGraph.createNode(n.type)
innerNode.configure(n)
// @ts-expect-error
innerNode.id = `${this.node.id}:${i}`
return innerNode
})