From 28def833f994134922d64237bc8f78919ae3ad94 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Sat, 29 Mar 2025 20:55:11 -0400 Subject: [PATCH] [TS] Fix node constructor signature (#3276) --- src/extensions/core/noteNode.ts | 6 ++---- src/extensions/core/widgetInputs.ts | 3 +-- src/services/litegraphService.ts | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/extensions/core/noteNode.ts b/src/extensions/core/noteNode.ts index 2e75568c6..13c405d17 100644 --- a/src/extensions/core/noteNode.ts +++ b/src/extensions/core/noteNode.ts @@ -19,8 +19,7 @@ app.registerExtension({ groupcolor = LGraphCanvas.node_colors.yellow.groupcolor isVirtualNode: boolean - constructor(title?: string) { - // @ts-expect-error fixme ts strict error + constructor(title: string) { super(title) if (!this.properties) { this.properties = { text: '' } @@ -58,8 +57,7 @@ app.registerExtension({ bgcolor = LGraphCanvas.node_colors.yellow.bgcolor groupcolor = LGraphCanvas.node_colors.yellow.groupcolor - constructor(title?: string) { - // @ts-expect-error fixme ts strict error + constructor(title: string) { super(title) if (!this.properties) { this.properties = { text: '' } diff --git a/src/extensions/core/widgetInputs.ts b/src/extensions/core/widgetInputs.ts index bcc5f43d3..648a2275f 100644 --- a/src/extensions/core/widgetInputs.ts +++ b/src/extensions/core/widgetInputs.ts @@ -39,8 +39,7 @@ export class PrimitiveNode extends LGraphNode { // @ts-expect-error fixme ts strict error lastType: string static category: string - constructor(title?: string) { - // @ts-expect-error fixme ts strict error + constructor(title: string) { super(title) this.addOutput('connect to widget input', '*') this.serialize_widgets = true diff --git a/src/services/litegraphService.ts b/src/services/litegraphService.ts index 70c1b1584..91b2c68b3 100644 --- a/src/services/litegraphService.ts +++ b/src/services/litegraphService.ts @@ -44,8 +44,7 @@ export const useLitegraphService = () => { static nodeData?: ComfyNodeDefV1 & ComfyNodeDefV2 static category?: string - constructor(title?: string) { - // @ts-expect-error fixme ts strict error + constructor(title: string) { super(title) const nodeMinSize = { width: 1, height: 1 }