Fix typechecking and linting

Note: the proxywidget code is still marked as ignored. This will require
further careful review in the future.
This commit is contained in:
Austin Mroz
2025-09-12 13:19:47 -05:00
parent ec06e28af7
commit 073175a719
4 changed files with 132 additions and 103 deletions

View File

@@ -1,19 +1,15 @@
// @ts-nocheck
// FIXME: typechecking for proxy system
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
import { SubgraphNode } from '@/lib/litegraph/src/subgraph/SubgraphNode'
import { useExtensionService } from '@/services/extensionService'
import { useDomWidgetStore } from '@/stores/domWidgetStore'
useExtensionService().registerExtension({
name: "Comfy.SubgraphProxyWidgets",
name: 'Comfy.SubgraphProxyWidgets',
nodeCreated(node: LGraphNode) {
if (node instanceof SubgraphNode) {
setTimeout(() => injectProperty(node),0)
node.addProxyWidget = (nodeId, widgetName) =>
addProxyWidget(node, nodeId, widgetName)
setTimeout(() => injectProperty(node), 0)
}
}
})
@@ -48,7 +44,11 @@ function injectProperty(subgraphNode: SubgraphNode) {
subgraphNode.properties.proxyWidgets = proxyWidgets
}
function addProxyWidget(subgraphNode: SubgraphNode, nodeId: string, widgetName: string) {
function addProxyWidget(
subgraphNode: SubgraphNode,
nodeId: string,
widgetName: string
) {
const overlay = { nodeId, widgetName }
return addProxyFromOverlay(subgraphNode, { __proto__: overlay })
}