From ba762d5b386aa54e04aee5be2782f7b395196288 Mon Sep 17 00:00:00 2001 From: xuekai-china Date: Thu, 21 Jan 2021 19:17:10 +0800 Subject: [PATCH 1/4] Pref: ts support about LGraphNode.mouseOver. --- src/litegraph.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 9d3d37c02..98c432b87 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -599,6 +599,7 @@ export declare class LGraphNode { graph_version: number; pos: Vector2; is_selected: boolean; + mouseOver: boolean; id: number; From 2958f443c2492bcce1d67920d117b933dfcc2289 Mon Sep 17 00:00:00 2001 From: Lucas Nascimento Date: Thu, 28 Jan 2021 00:09:40 -0300 Subject: [PATCH 2/4] TS support about LGraphNode.has_errors --- src/litegraph.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 9d3d37c02..1e4d601fa 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -645,6 +645,8 @@ export declare class LGraphNode { resizable: boolean; /** slots are distributed horizontally */ horizontal: boolean; + /** if true, the node will show the bgcolor as 'red' */ + has_errors?: boolean; /** configure a node from an object containing the serialized info */ configure(info: SerializedLGraphNode): void; From efb5d6028315860d3ec6e7a8cea906caa3514850 Mon Sep 17 00:00:00 2001 From: Lucas Nascimento Date: Thu, 28 Jan 2021 00:10:57 -0300 Subject: [PATCH 3/4] TS support about LGraphNode.disconnectOutput --- src/litegraph.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 9d3d37c02..08aa591f5 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -858,7 +858,7 @@ export declare class LGraphNode { * @param target_node the target node to which this slot is connected [Optional, if not target_node is specified all nodes will be disconnected] * @return if it was disconnected successfully */ - disconnectOutput(slot: number | string, targetNode: LGraphNode): boolean; + disconnectOutput(slot: number | string, targetNode?: LGraphNode): boolean; /** * disconnect one input * @param slot (could be the number of the slot or the string with the name of the slot) From effe937e144d92e060b2141955a23c5765d28998 Mon Sep 17 00:00:00 2001 From: Lucas Nascimento Date: Thu, 28 Jan 2021 00:25:11 -0300 Subject: [PATCH 4/4] TS support about LGraphNode.onPropertyChanged --- src/litegraph.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 9d3d37c02..a7249c3a0 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -1003,6 +1003,15 @@ export declare class LGraphNode { ioSlot: (INodeOutputSlot | INodeInputSlot) ): void; + /** + * if returns false, will abort the `LGraphNode.setProperty` + * Called when a property is changed + * @param property + * @param value + * @param prevValue + */ + onPropertyChanged?(property: string, value: any, prevValue: any): void | boolean; + /** Called by `LGraphCanvas.processContextMenu` */ getMenuOptions?(graphCanvas: LGraphCanvas): ContextMenuItem[]; getSlotMenuOptions?(slot: INodeSlot): ContextMenuItem[];