Skip to content

Commit

Permalink
Export Reroute class the same as other similar classes (#378)
Browse files Browse the repository at this point in the history
* Export Reroute class the same as other similar classes

* Update test expectations
  • Loading branch information
webfiltered authored Dec 15, 2024
1 parent 8e21d44 commit 71f8a1d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/LiteGraphGlobal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { LGraphNode } from "./LGraphNode"
import { SlotShape, SlotDirection, SlotType, LabelPosition } from "./draw"
import type { Dictionary, ISlotType, Rect } from "./interfaces"
import { distance, isInsideRectangle, overlapBounding } from "./measure"
import { Reroute } from "./Reroute"

/**
* The Global Scope. It contains all the registered node classes.
Expand Down Expand Up @@ -265,6 +266,7 @@ export class LiteGraphGlobal {
LGraphCanvas = LGraphCanvas
ContextMenu = ContextMenu
CurveEditor = CurveEditor
Reroute = Reroute

onNodeTypeRegistered?(type: string, base_class: typeof LGraphNode): void
onNodeTypeReplaced?(type: string, base_class: typeof LGraphNode, prev: unknown): void
Expand Down
1 change: 1 addition & 0 deletions src/litegraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export type {
ISerialisedGraph,
} from "./types/serialisation"
export { CanvasPointer } from "./CanvasPointer"
export { Reroute } from "./Reroute"
export { createBounds } from "./measure"

export function clamp(v: number, a: number, b: number): number {
Expand Down
1 change: 1 addition & 0 deletions test/__snapshots__/litegraph.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ LiteGraphGlobal {
"OUTPUT": 2,
"RIGHT": 4,
"ROUND_SHAPE": 2,
"Reroute": [Function],
"SPLINE_LINK": 2,
"STRAIGHT_LINK": 0,
"SlotDirection": {
Expand Down

0 comments on commit 71f8a1d

Please sign in to comment.