TypeScript conversion groundwork (#163)

* ContextMenu ES6 class conversion

* Fix compat with extensions

* CurveEditor ES6 class conversion

* Split most of the LiteGraph global out to a class

* Move remainder of LiteGraph global to class file

* Remove IIFE wrapper

* Fix jest tests throwing due to type narrowing
This commit is contained in:
filtered
2024-09-27 09:20:30 +10:00
committed by GitHub
parent 8a0adc55d8
commit 6ee95f1201
4 changed files with 1093 additions and 1028 deletions

View File

@@ -5,7 +5,9 @@ import {
describe("LGraphNode", () => {
it("should serialize position correctly", () => {
const node = new LGraphNode("TestNode");
// @ts-expect-error Expected - not a TS class yet.
node.pos = [10, 10];
// @ts-expect-error JS tests in TS format
expect(node.pos).toEqual(new Float32Array([10, 10]));
expect(node.serialize().pos).toEqual(new Float32Array([10, 10]));
});