diff --git a/src/litegraph.d.ts b/src/litegraph.d.ts index 551601a11..69220a8df 100644 --- a/src/litegraph.d.ts +++ b/src/litegraph.d.ts @@ -242,7 +242,7 @@ export const LiteGraph: { wrapFunctionAsNode( name: string, func: (...args: any[]) => any, - param_types?: [], + param_types?: string[], return_type?: string, properties?: object ): void; @@ -1216,7 +1216,7 @@ export declare class LGraphCanvas { /** selects a given node (or adds it to the current selection) */ selectNode(node: LGraphNode, add?: boolean): void; /** selects several nodes (or adds them to the current selection) */ - selectNodes(nodes: LGraphNode[], add?: boolean): void; + selectNodes(nodes?: LGraphNode[], add?: boolean): void; /** removes a node from the current selection */ deselectNode(node: LGraphNode): void; /** removes all nodes from the current selection */ @@ -1239,7 +1239,7 @@ export declare class LGraphCanvas { /** draws the front canvas (the one containing all the nodes) */ drawFrontCanvas(): void; /** draws some useful stats in the corner of the canvas */ - renderInfo(): void; + renderInfo(ctx: CanvasRenderingContext2D, x: number, y: number): void; /** draws the back canvas (the one containing the background and the connections) */ drawBackCanvas(): void; /** draws the given node inside the canvas */ diff --git a/src/litegraph.js b/src/litegraph.js index 7de6f9ac0..b8b1b39fc 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -1555,7 +1555,7 @@ /** * Tell this graph it has a global graph input of this type - * @method addGlobalInput + * @method addInput * @param {String} name * @param {String} type * @param {*} value [optional] @@ -1581,7 +1581,7 @@ /** * Assign a data to the global graph input - * @method setGlobalInputData + * @method setInputData * @param {String} name * @param {*} data */ diff --git a/src/nodes/network.js b/src/nodes/network.js index 07bd72c12..0deef5c79 100644 --- a/src/nodes/network.js +++ b/src/nodes/network.js @@ -86,10 +86,10 @@ this._ws.onmessage = function(e) { that.boxcolor = "#AFA"; var data = JSON.parse(e.data); - if (data.room && data.room != this.properties.room) { + if (data.room && data.room != that.properties.room) { return; } - if (e.data.type == 1) { + if (data.type == 1) { if ( data.data.object_class && LiteGraph[data.data.object_class] @@ -105,7 +105,7 @@ that.triggerSlot(0, data.data); } } else { - that._last_received_data[e.data.channel || 0] = data.data; + that._last_received_data[data.channel || 0] = data.data; } }; this._ws.onerror = function(e) {