From 79ce3199d49d1dfcf597fdcc90d68593ca65a2f8 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Thu, 24 Apr 2025 22:47:20 +1000 Subject: [PATCH] [Cleanup] Documentation (#963) Adds / cleans JSDoc. --- src/LGraphNode.ts | 5 +++-- src/interfaces.ts | 6 +++++- src/litegraph.ts | 5 ++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/LGraphNode.ts b/src/LGraphNode.ts index a5a823fa6..f0a5c95b3 100644 --- a/src/LGraphNode.ts +++ b/src/LGraphNode.ts @@ -174,8 +174,9 @@ export interface LGraphNode { // #endregion Types /** - * Base Class for all the node type classes - * @param {string} name a name for the node + * Base class for all nodes + * @param title a name for the node + * @param type a type for the node */ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging export class LGraphNode implements Positionable, IPinnable, IColorable { diff --git a/src/interfaces.ts b/src/interfaces.ts index ca1f9643e..15a3fccfc 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -58,7 +58,11 @@ export interface Parent { */ export interface Positionable extends Parent, HasBoundingRect { readonly id: NodeId | RerouteId | number - /** Position in graph coordinates. Default: 0,0 */ + /** + * Position in graph coordinates. This may be the top-left corner, + * the centre, or another point depending on concrete type. + * @default 0,0 + */ readonly pos: Point /** true if this object is part of the selection, otherwise false. */ selected?: boolean diff --git a/src/litegraph.ts b/src/litegraph.ts index cba4da8cd..574464d18 100644 --- a/src/litegraph.ts +++ b/src/litegraph.ts @@ -64,9 +64,9 @@ export interface LinkReleaseContextExtended { export interface LiteGraphCanvasEvent extends CustomEvent {} -/** https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#lgraphnode */ - export interface LGraphNodeConstructor { + new (title: string, type?: string): T + title: string type: string size?: Size @@ -82,7 +82,6 @@ export interface LGraphNodeConstructor { title_text_color?: string keepAllLinksOnBypass: boolean nodeData: any - new (): T } // End backwards compat