[fix] Change parentSubgraphNode type to NodeLike (#1142)

This commit is contained in:
Christian Byrne
2025-07-20 23:18:08 -07:00
committed by GitHub
parent c0feaa5f94
commit 6f3f1f9f24
2 changed files with 6 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import type { CanvasColour, Point, RequiredProps, Size } from "../interfaces"
import type { CanvasPointer, LGraphCanvas, LGraphNode } from "../litegraph"
import type { CanvasPointerEvent } from "./events"
import type { NodeLike } from "./NodeLike"
export interface IWidgetOptions<TValues = unknown[]> {
on?: string
@@ -204,8 +205,10 @@ export interface IBaseWidget<
/**
* Reference to the subgraph container node when this widget is promoted from a subgraph.
* This allows the widget to know which SubgraphNode it belongs to in the parent graph.
* @remarks This property is a runtime reference and should not be serialized.
* It will be undefined after deserialization and needs to be reconstructed.
*/
parentSubgraphNode?: LGraphNode
parentSubgraphNode?: NodeLike
// TODO: Confirm this format
callback?(

View File

@@ -1,6 +1,7 @@
import type { Point } from "@/interfaces"
import type { CanvasPointer, LGraphCanvas, LGraphNode, Size } from "@/litegraph"
import type { CanvasPointerEvent } from "@/types/events"
import type { NodeLike } from "@/types/NodeLike"
import type { IBaseWidget } from "@/types/widgets"
import { drawTextInArea } from "@/draw"
@@ -60,7 +61,7 @@ export abstract class BaseWidget<TWidget extends IBaseWidget = IBaseWidget> impl
* Reference to the subgraph container node when this widget is promoted from a subgraph.
* This allows the widget to know which SubgraphNode it belongs to in the parent graph.
*/
parentSubgraphNode?: LGraphNode
parentSubgraphNode?: NodeLike
linkedWidgets?: IBaseWidget[]
name: string