mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-02 03:30:04 +00:00
Typescript conversion 0.7.84 (#194)
* Convert litegraph.js to TS
* Overhaul static litegraph.d.ts with updated types
* Fix rename oversights and revert fix unused param
- Some functions were broken by merging updated TS function signatures which included param renames
- Removal of unused params does not belong in the TS conversion PR, and has been reverted
* Remove legacy static .d.ts file
* Add callback decl from #180
Support allowing links to widgets (#180)
c23e610c11
* Convert NodeId to string | number
Results in significantly less downstream changes, despite being a change from the old static file.
---------
Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
This commit is contained in:
@@ -1,17 +1,40 @@
|
||||
// @ts-nocheck
|
||||
import type { Point, Size } from "./interfaces"
|
||||
import type { LGraph } from "./LGraph"
|
||||
import { LiteGraph } from "./litegraph";
|
||||
import { LGraphCanvas } from "./LGraphCanvas";
|
||||
import { overlapBounding } from "./LiteGraphGlobal";
|
||||
import { LGraphNode } from "./LGraphNode";
|
||||
|
||||
export interface IGraphGroup {
|
||||
_pos: Point
|
||||
_size: Size
|
||||
title: string
|
||||
}
|
||||
|
||||
export interface IGraphGroupFlags extends Record<string, unknown> {
|
||||
pinned?: true
|
||||
}
|
||||
|
||||
export class LGraphGroup {
|
||||
pos: Point
|
||||
color: string
|
||||
title: string
|
||||
font?: string
|
||||
font_size: number
|
||||
_bounding: Float32Array
|
||||
_pos: Point
|
||||
_size: Size
|
||||
_nodes: LGraphNode[]
|
||||
graph?: LGraph
|
||||
flags: IGraphGroupFlags
|
||||
size?: Size
|
||||
|
||||
constructor(title) {
|
||||
constructor(title?: string) {
|
||||
this._ctor(title);
|
||||
}
|
||||
|
||||
_ctor(title) {
|
||||
_ctor(title?: string) {
|
||||
this.title = title || "Group";
|
||||
this.font_size = LiteGraph.DEFAULT_GROUP_FONT || 24;
|
||||
this.color = LGraphCanvas.node_colors.pale_blue
|
||||
|
||||
Reference in New Issue
Block a user