diff --git a/src/LLink.ts b/src/LLink.ts index 3037090324..ed40f670b7 100644 --- a/src/LLink.ts +++ b/src/LLink.ts @@ -20,6 +20,8 @@ export type SerialisedLLinkArray = [ type: ISlotType, ] +type BasicReadonlyNetwork = Pick + // this is the class in charge of storing link information export class LLink implements LinkSegment, Serialisable { /** Link ID */ @@ -162,7 +164,7 @@ export class LLink implements LinkSegment, Serialisable { * @param linkId The ID of the link to get the origin node of * @returns The origin node of the link, or `undefined` if the link is not found or the origin node is not found */ - static getOriginNode(network: Pick, linkId: LinkId): LGraphNode | undefined { + static getOriginNode(network: BasicReadonlyNetwork, linkId: LinkId): LGraphNode | undefined { const id = network.links.get(linkId)?.origin_id return network.getNodeById(id) ?? undefined } @@ -173,7 +175,7 @@ export class LLink implements LinkSegment, Serialisable { * @param linkId The ID of the link to get the target node of * @returns The target node of the link, or `undefined` if the link is not found or the target node is not found */ - static getTargetNode(network: Pick, linkId: LinkId): LGraphNode | undefined { + static getTargetNode(network: BasicReadonlyNetwork, linkId: LinkId): LGraphNode | undefined { const id = network.links.get(linkId)?.target_id return network.getNodeById(id) ?? undefined } diff --git a/src/types/serialisation.ts b/src/types/serialisation.ts index ba00bb8f71..501ee5f826 100644 --- a/src/types/serialisation.ts +++ b/src/types/serialisation.ts @@ -40,7 +40,7 @@ export interface BaseExportedGraph { /** Definitions of re-usable objects that are referenced elsewhere in this exported graph. */ definitions?: { /** The base definition of subgraphs used in this workflow. That is, what you see when you open / edit a subgraph. */ - subgraphs?: Record[] + subgraphs?: Record } } @@ -99,7 +99,7 @@ export interface ExportedSubgraphInstance extends NodeSubgraphSharedProps { * The ID of the actual subgraph definition. * @see {@link ExportedSubgraph.subgraphs} */ - subgraphId: UUID + type: UUID } /** @@ -123,7 +123,7 @@ export interface ISerialisedGraph extends BaseExportedGraph { * Defines a subgraph and its contents. * Can be referenced multiple times in a schema. */ -export interface ExportedSubgraph extends ISerialisedGraph { +export interface ExportedSubgraph extends SerialisableGraph { /** The display name of the subgraph. */ name: string /** Ordered list of inputs to the subgraph itself. Similar to a reroute, with the input side in the graph, and the output side in the subgraph. */