mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-04 20:50:06 +00:00
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:
@@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user