mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-12 00:20:15 +00:00
[API] Add reroute convenience methods (#812)
Adds `LGraph.getReroute`, which accepts null & undefined IDs. Interface overloads result in `never` when given a _known_ `undefined` or `null` value.
This commit is contained in:
@@ -116,6 +116,8 @@ export interface ReadonlyLinkNetwork {
|
||||
readonly reroutes: ReadonlyMap<RerouteId, Reroute>
|
||||
readonly floatingLinks: ReadonlyMap<LinkId, LLink>
|
||||
getNodeById(id: NodeId): LGraphNode | null
|
||||
getReroute(parentId: null | undefined): undefined
|
||||
getReroute(parentId: RerouteId | null | undefined): Reroute | undefined
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,6 +128,7 @@ export interface LinkNetwork extends ReadonlyLinkNetwork {
|
||||
readonly reroutes: Map<RerouteId, Reroute>
|
||||
addFloatingLink(link: LLink): LLink
|
||||
removeReroute(id: number): unknown
|
||||
removeFloatingLink(link: LLink): void
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user