From 139f9f8b8a6e9cfd790af00df673168c8e86b9e5 Mon Sep 17 00:00:00 2001 From: ralphwetzel Date: Sat, 13 Feb 2021 12:27:23 +0100 Subject: [PATCH 1/5] Update litegraph.d.ts Fix type definitions: - LiteGraph.active_graph - LGraphCanvas.getNodeTypesInCategory - LGraphCanvas.getNodeTypesCategories --- src/litegraph.d.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 4e990b3ac..2fb8c07a7 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -284,19 +284,23 @@ export const LiteGraph: { /** * Returns a list of node types matching one category - * @param category category name - * @return array with all the node classes + * @method getNodeTypesInCategory + * @param {String} category category name + * @param {String} filter only nodes with ctor.filter equal can be shown + * @return {Array} array with all the node classes */ getNodeTypesInCategory( category: string, - filter: any + filter: string ): LGraphNodeConstructor[]; /** * Returns a list with all the node type categories - * @return array with all the names of the categories - */ - getNodeTypesCategories(): string[]; + * @method getNodeTypesCategories + * @param {String} filter only nodes with ctor.filter equal can be shown + * @return {Array} array with all the names of the categories + */ + getNodeTypesCategories(filter: string): string[]; /** debug purposes: reloads all the js scripts that matches a wildcard */ reloadNodes(folder_wildcard: string): void; @@ -1125,6 +1129,8 @@ export declare class LGraphCanvas { } ); + static active_canvas: HTMLCanvasElement; + allow_dragcanvas: boolean; allow_dragnodes: boolean; /** allow to control widgets, buttons, collapse, etc */ From 0ad6104661cbc1269424ad083f26517801ede7c3 Mon Sep 17 00:00:00 2001 From: ralphwetzel Date: Sat, 13 Feb 2021 12:36:16 +0100 Subject: [PATCH 2/5] Update litegraph.d.ts Fix type definition: - LGraph.filter --- src/litegraph.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 2fb8c07a7..5265746c9 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -351,6 +351,7 @@ export declare class LGraph { constructor(o?: object); + filter: string; catch_errors: boolean; /** custom data */ config: object; From 5a680b9ac919166c6aef668268a981258c2d56ef Mon Sep 17 00:00:00 2001 From: ralphwetzel Date: Sat, 13 Feb 2021 12:55:37 +0100 Subject: [PATCH 3/5] Update litegraph.d.ts Fix type definitions: - ContextMenu.constructor --- 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 5265746c9..31a43296e 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -1466,7 +1466,7 @@ declare class ContextMenu { ): void; static isCursorOverElement(event: MouseEvent, element: HTMLElement): void; static closeAllContextMenus(window: Window): void; - constructor(values: ContextMenuItem[], options?: IContextMenuOptions); + constructor(values: ContextMenuItem[], options?: IContextMenuOptions, window?: Window); options: IContextMenuOptions; parentMenu?: ContextMenu; lock: boolean; From 3cb6e4586da322491f25d9721d1148ab8e33cd13 Mon Sep 17 00:00:00 2001 From: ralphwetzel Date: Sat, 13 Feb 2021 14:53:06 +0100 Subject: [PATCH 4/5] Update litegraph.d.ts Fix type definitions: - LGraph.beforeChange - LGraph.afterChange --- src/litegraph.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 31a43296e..730ced034 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -534,6 +534,8 @@ export declare class LGraph { removeOutput(name: string): boolean; triggerInput(name: string, value: any): void; setCallback(name: string, func: (...args: any[]) => any): void; + beforeChange(info: LGraphNode): void; + afterChange(info: LGraphNode): void; connectionChange(node: LGraphNode): void; /** returns if the graph is in live mode */ isLive(): boolean; From 6198a41972a646e5b1408b5aed98fabe2b9fd391 Mon Sep 17 00:00:00 2001 From: ralphwetzel Date: Sat, 13 Feb 2021 14:54:36 +0100 Subject: [PATCH 5/5] Update litegraph.d.ts Fix type definitions: - LGraph.beforeChange - LGraph.afterChange --- src/litegraph.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 730ced034..5a539f972 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -534,8 +534,8 @@ export declare class LGraph { removeOutput(name: string): boolean; triggerInput(name: string, value: any): void; setCallback(name: string, func: (...args: any[]) => any): void; - beforeChange(info: LGraphNode): void; - afterChange(info: LGraphNode): void; + beforeChange(info?: LGraphNode): void; + afterChange(info?: LGraphNode): void; connectionChange(node: LGraphNode): void; /** returns if the graph is in live mode */ isLive(): boolean;