Skip to content

Commit eb2c6fa

Browse files
committed
Fix global declare
1 parent 8ba660d commit eb2c6fa

File tree

3 files changed

+196
-195
lines changed

3 files changed

+196
-195
lines changed

src/scripts/domWidget.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { app, ANIM_PREVIEW_WIDGET } from "./app.js";
2-
import { LGraphCanvas, LGraphNode, LiteGraph } from "/lib/litegraph.core.js";
3-
import type { LGraphNode as LGraphNodeType, Vector4 } from "/types/litegraph.js";
2+
import type { LGraphNode, Vector4 } from "/types/litegraph";
3+
44

55
const SIZE = Symbol();
66

@@ -21,7 +21,7 @@ interface DOMWidget {
2121
value?: any;
2222
y?: number;
2323
callback?: (value: any) => void;
24-
draw?: (ctx: CanvasRenderingContext2D, node: LGraphNodeType, widgetWidth: number, y: number, widgetHeight: number) => void;
24+
draw?: (ctx: CanvasRenderingContext2D, node: LGraphNode, widgetWidth: number, y: number, widgetHeight: number) => void;
2525
onRemove?: () => void;
2626
}
2727

@@ -35,8 +35,8 @@ function intersect(a: Rect, b: Rect): Vector4 | null {
3535
else return null;
3636
}
3737

38-
function getClipPath(node: LGraphNodeType, element: HTMLElement): string {
39-
const selectedNode: LGraphNodeType = Object.values(app.canvas.selected_nodes)[0] as LGraphNodeType;
38+
function getClipPath(node: LGraphNode, element: HTMLElement): string {
39+
const selectedNode: LGraphNode = Object.values(app.canvas.selected_nodes)[0] as LGraphNode;
4040
if (selectedNode && selectedNode !== node) {
4141
const elRect = element.getBoundingClientRect();
4242
const MARGIN = 7;
@@ -194,7 +194,7 @@ function computeSize(size: [number, number]): void {
194194
// Override the compute visible nodes function to allow us to hide/show DOM elements when the node goes offscreen
195195
const elementWidgets = new Set();
196196
const computeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes;
197-
LGraphCanvas.prototype.computeVisibleNodes = function (): LGraphNodeType[] {
197+
LGraphCanvas.prototype.computeVisibleNodes = function (): LGraphNode[] {
198198
const visibleNodes = computeVisibleNodes.apply(this, arguments);
199199
for (const node of app.graph._nodes) {
200200
if (elementWidgets.has(node)) {
@@ -260,7 +260,7 @@ LGraphNode.prototype.addDOMWidget = function (
260260
options.setValue?.(v);
261261
widget.callback?.(widget.value);
262262
},
263-
draw: function (ctx: CanvasRenderingContext2D, node: LGraphNodeType, widgetWidth: number, y: number, widgetHeight: number) {
263+
draw: function (ctx: CanvasRenderingContext2D, node: LGraphNode, widgetWidth: number, y: number, widgetHeight: number) {
264264
if (widget.computedHeight == null) {
265265
computeSize.call(node, node.size);
266266
}

0 commit comments

Comments
 (0)