[TS] Fix strict type on chain callback, widgetInput (#3727)

This commit is contained in:
filtered
2025-05-02 11:29:43 +10:00
committed by GitHub
parent 2c75948ab9
commit c82401c61c
2 changed files with 23 additions and 7 deletions

View File

@@ -9,7 +9,10 @@ import type {
} from '@comfyorg/litegraph'
import type { CanvasMouseEvent } from '@comfyorg/litegraph/dist/types/events'
import { useChainCallback } from '@/composables/functional/useChainCallback'
import {
type CallbackParams,
useChainCallback
} from '@/composables/functional/useChainCallback'
import type { InputSpec } from '@/schemas/nodeDefSchema'
import { app } from '@/scripts/app'
import { ComfyWidgets, addValueControlWidgets } from '@/scripts/widgets'
@@ -564,12 +567,9 @@ app.registerExtension({
const origOnInputDblClick = nodeType.prototype.onInputDblClick
nodeType.prototype.onInputDblClick = function (
this: LGraphNode,
slot: number
...[slot, ...args]: CallbackParams<typeof origOnInputDblClick>
) {
const r = origOnInputDblClick
? // @ts-expect-error fixme ts strict error
origOnInputDblClick.apply(this, arguments)
: undefined
const r = origOnInputDblClick?.apply(this, [slot, ...args])
const input = this.inputs[slot]
if (!input.widget) {