Add TS types / merge ComfyLGraphNode (#902)

* Add TS type for LGraphNodeConstructor

* Add TS type & move shared prop to parent

* Add TS types - Comfy augmentations

* nit - TS type

* Merge ComfyLGNode into existing augmentations

* nit - fix missed explicit type on import
This commit is contained in:
filtered
2024-09-21 19:18:27 +10:00
committed by GitHub
parent 88acabb355
commit c7f123766e
7 changed files with 42 additions and 42 deletions

View File

@@ -74,7 +74,6 @@ app.registerExtension({
const link = app.graph.links[linkId]
if (!link) return
const node = app.graph.getNodeById(link.origin_id)
// @ts-expect-error Nodes that extend LGraphNode will not have a static type property
const type = node.constructor.type
if (type === 'Reroute') {
if (node === this) {
@@ -113,7 +112,6 @@ app.registerExtension({
if (!link) continue
const node = app.graph.getNodeById(link.target_id)
// @ts-expect-error Nodes that extend LGraphNode will not have a static type property
const type = node.constructor.type
if (type === 'Reroute') {
@@ -179,7 +177,6 @@ app.registerExtension({
}
if (!targetWidget) {
targetWidget = targetNode.widgets?.find(
// @ts-expect-error fix widget types
(w) => w.name === targetInput.widget.name
)
}