Typescript LGraphNode (#207)

* nit - Fix whitespace

* nit - Remove outdated comments

* nit - Remove redundant jsdoc tag

* Format only

* Add TS types

* nit - Auto let/const

* Convert special-case vars

* nit - Redeclared params / vars

* nit - const/let

* Refactor - minor logic change

* Add TS types - overloads w/workaround

* Refactor - prefer typeof over constructor check

* Add TS types

* Remove unused params

* nit - Refactor

* Refactor LGraphNode.findSlotByType

* nit - Refactor / format

* Refactor - optional chaining

* Fix TS type - node shape
This commit is contained in:
filtered
2024-10-13 01:53:25 +11:00
committed by GitHub
parent f1bb7153da
commit 96866e8624
4 changed files with 1190 additions and 1575 deletions

View File

@@ -5,6 +5,7 @@ import type { LGraphNode, NodeId } from "@/LGraphNode"
import type { LiteGraph } from "@/litegraph"
import type { LinkId, LLink } from "@/LLink"
import type { TWidgetValue } from "@/types/widgets"
import { RenderShape } from "./globalEnums"
/** Serialised LGraphNode */
export interface ISerialisedNode {
@@ -19,7 +20,7 @@ export interface ISerialisedNode {
outputs?: INodeOutputSlot[]
inputs?: INodeInputSlot[]
properties?: Dictionary<unknown>
shape?: Rect
shape?: RenderShape
boxcolor?: CanvasColour
color?: CanvasColour
bgcolor?: string