[Cleanup] Documentation (#963)

Adds / cleans JSDoc.
This commit is contained in:
filtered
2025-04-24 22:47:20 +10:00
committed by GitHub
parent d70260615b
commit 79ce3199d4
3 changed files with 10 additions and 6 deletions

View File

@@ -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 {

View File

@@ -58,7 +58,11 @@ export interface Parent<TChild> {
*/
export interface Positionable extends Parent<Positionable>, 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

View File

@@ -64,9 +64,9 @@ export interface LinkReleaseContextExtended {
export interface LiteGraphCanvasEvent extends CustomEvent<CanvasEventDetail> {}
/** https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#lgraphnode */
export interface LGraphNodeConstructor<T extends LGraphNode = LGraphNode> {
new (title: string, type?: string): T
title: string
type: string
size?: Size
@@ -82,7 +82,6 @@ export interface LGraphNodeConstructor<T extends LGraphNode = LGraphNode> {
title_text_color?: string
keepAllLinksOnBypass: boolean
nodeData: any
new (): T
}
// End backwards compat