mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 22:59:14 +00:00
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:
@@ -94,6 +94,7 @@ export class LGraph {
|
||||
onSerialize?(data: ISerialisedGraph): void
|
||||
onConfigure?(data: ISerialisedGraph): void
|
||||
onGetNodeMenuOptions?(options: IContextMenuValue[], node: LGraphNode): void
|
||||
onNodeConnectionChange?(nodeSlotType: ISlotType, targetNode: LGraphNode, slotIndex: number, sourceNode?: LGraphNode, sourceSlotIndex?: number): void
|
||||
|
||||
private _input_nodes?: LGraphNode[]
|
||||
|
||||
|
||||
2754
src/LGraphNode.ts
2754
src/LGraphNode.ts
File diff suppressed because it is too large
Load Diff
@@ -99,6 +99,13 @@ export interface LiteGraphCanvasGroupEvent extends CustomEvent<{
|
||||
/** https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#lgraphnode */
|
||||
|
||||
export interface LGraphNodeConstructor<T extends LGraphNode = LGraphNode> {
|
||||
title?: string
|
||||
type?: string
|
||||
size?: Size
|
||||
min_height?: number
|
||||
slot_start_y?: number
|
||||
widgets_info?: any
|
||||
collapsable?: boolean
|
||||
nodeData: any
|
||||
new(): T
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user