[TS] Use strict mode in LGraphCanvas (#664)

- Prefer `undefined` over `null`
- Primarily nullable type updates
This commit is contained in:
filtered
2025-03-02 08:58:50 +11:00
committed by GitHub
parent ab25d1fc6e
commit 539fa91b0d
4 changed files with 23 additions and 20 deletions

View File

@@ -199,7 +199,7 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
onOutputTypeChanged?(name: string, type: string): void
onOutputRemoved?(name: string): void
onBeforeChange?(graph: LGraph, info?: LGraphNode): void
onAfterChange?(graph: LGraph, info?: LGraphNode): void
onAfterChange?(graph: LGraph, info?: LGraphNode | null): void
onConnectionChange?(node: LGraphNode): void
on_change?(graph: LGraph): void
onSerialize?(data: ISerialisedGraph | SerialisableGraph): void
@@ -1352,7 +1352,7 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
}
// used to resend actions, called after any change is made to the graph
afterChange(info?: LGraphNode): void {
afterChange(info?: LGraphNode | null): void {
this.onAfterChange?.(this, info)
this.canvasAction(c => c.onAfterChange?.(this))
}