[TS] Use strict mode in LGraph (#579)

* [TS] Undefined is not a valid object key

* Deprecate unused code

Adds ts-expect-error to TS strict issues on unmaintained public interfaces.

* [TS] Fix nullability: asSerialisable return type

* nit - Remove outdated comment

* [TS] Strict mode: LGraph

- Adds minor coercion changes; would need extremely specific hacks performed to result in runtime change

* [TMP] Work around typescript-strict-plugin

Must be reverted once plugin removed.
See #578
This commit is contained in:
filtered
2025-02-24 22:12:46 +11:00
committed by GitHub
parent 9d6c867607
commit c8ffacf172
3 changed files with 26 additions and 9 deletions

View File

@@ -465,7 +465,7 @@ export class LGraphCanvas implements ConnectionColorContext {
node_in_panel?: LGraphNode
last_mouse: ReadOnlyPoint = [0, 0]
last_mouseclick: number = 0
graph!: LGraph
graph!: LGraph | null
canvas: HTMLCanvasElement
bgcanvas: HTMLCanvasElement
ctx?: CanvasRenderingContext2D