[TS] Add strict nullability to LGraphCanvas (#669)

- Updates typing in copy & paste
- Clean up
This commit is contained in:
filtered
2025-03-02 19:34:26 +11:00
committed by GitHub
parent d597271954
commit 78175e2c1b
4 changed files with 39 additions and 31 deletions

View File

@@ -5,6 +5,7 @@ import type {
LinkNetwork,
LinkSegment,
MethodNames,
OptionalProps,
Point,
Positionable,
} from "./interfaces"
@@ -1395,7 +1396,7 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
* Creates the object if it does not exist.
* @param serialisedReroute See {@link SerialisableReroute}
*/
setReroute({ id, parentId, pos, linkIds }: SerialisableReroute): Reroute {
setReroute({ id, parentId, pos, linkIds }: OptionalProps<SerialisableReroute, "id">): Reroute {
id ??= ++this.state.lastRerouteId
if (id > this.state.lastRerouteId) this.state.lastRerouteId = id