[TS] Fix node constructor signature (#3276)

This commit is contained in:
Chenlei Hu
2025-03-29 20:55:11 -04:00
committed by GitHub
parent fcc22f06ac
commit 28def833f9
3 changed files with 4 additions and 8 deletions

View File

@@ -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: '' }

View File

@@ -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

View File

@@ -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 }