mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-08 00:50:05 +00:00
fix(changeTracker): type nodeOutputs and prompt callback with proper types
- Type nodeOutputs as Record<string, ExecutedWsMessage['output']> - Import CanvasPointerEvent from litegraph - Type prompt callback value as string | number - Type prompt callback function as (v: string) => void - Type event parameter as CanvasPointerEvent
This commit is contained in:
@@ -2,6 +2,7 @@ import _ from 'es-toolkit/compat'
|
||||
import * as jsondiffpatch from 'jsondiffpatch'
|
||||
import log from 'loglevel'
|
||||
|
||||
import type { CanvasPointerEvent } from '@/lib/litegraph/src/litegraph'
|
||||
import { LGraphCanvas, LiteGraph } from '@/lib/litegraph/src/litegraph'
|
||||
import {
|
||||
ComfyWorkflow,
|
||||
@@ -40,7 +41,7 @@ export class ChangeTracker {
|
||||
_restoringState: boolean = false
|
||||
|
||||
ds?: { scale: number; offset: [number, number] }
|
||||
nodeOutputs?: Record<string, any>
|
||||
nodeOutputs?: Record<string, ExecutedWsMessage['output']>
|
||||
|
||||
private subgraphState?: {
|
||||
navigation: string[]
|
||||
@@ -303,11 +304,11 @@ export class ChangeTracker {
|
||||
const prompt = LGraphCanvas.prototype.prompt
|
||||
LGraphCanvas.prototype.prompt = function (
|
||||
title: string,
|
||||
value: any,
|
||||
callback: (v: any) => void,
|
||||
event: any
|
||||
value: string | number,
|
||||
callback: (v: string) => void,
|
||||
event: CanvasPointerEvent
|
||||
) {
|
||||
const extendedCallback = (v: any) => {
|
||||
const extendedCallback = (v: string) => {
|
||||
callback(v)
|
||||
checkState()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user