Update Litegraph (TypeScript conversion) (#1145)

* Fix various type errors

* Fix rest of ts errors

* update litegraph

* nit
This commit is contained in:
Chenlei Hu
2024-10-07 11:31:54 -04:00
committed by GitHub
parent 9cbfc9856b
commit dee1ec1a2a
15 changed files with 36 additions and 69 deletions

View File

@@ -42,29 +42,6 @@ declare module '@comfyorg/litegraph' {
): DOMWidget
}
interface IWidget<TValue = any, TOptions = any> {
type?: string
/**
* Allows for additional cleanup when removing a widget when converting to input.
*/
onRemove?(): void
serializeValue?(node?: LGraphNode, i?: string)
beforeQueued?(): void
/**
* DOM element used for the widget
*/
element?: HTMLElement
tooltip?: string
origType?: IWidget['type']
origComputeSize?: IWidget['computeSize']
origSerializeValue?: IWidget['serializeValue']
}
interface INodeSlot {
widget?: unknown & { name?: string }
}

View File

@@ -6,6 +6,7 @@ import type {
INodeOutputSlot,
INodeSlot
} from '@comfyorg/litegraph'
import type { ISlotType } from '@comfyorg/litegraph'
import { LiteGraph } from '@comfyorg/litegraph'
export class ConnectingLinkImpl implements ConnectingLink {
@@ -39,7 +40,7 @@ export class ConnectingLinkImpl implements ConnectingLink {
)
}
get type(): string | null {
get type(): ISlotType | null {
const result = this.input ? this.input.type : this.output.type
return result === -1 ? null : result
}