Line data Source code
1 : import type { ISlotType } from './interfaces'
2 : import type { LinkId } from './linkId'
3 : import type { NodeId } from './nodeId'
4 : import { UNASSIGNED_NODE_ID } from './nodeId'
5 : import type { RerouteId } from './rerouteId'
6 : import type { OwningGraphId } from './graphScopeId'
7 :
8 : export interface LinkTopology {
9 : readonly id: LinkId
10 : graphId: OwningGraphId
11 :
12 : originNodeId: NodeId
13 : originSlot: number
14 :
15 : targetNodeId: NodeId
16 : targetSlot: number
17 : type: ISlotType
18 :
19 : parentId?: RerouteId
20 : }
21 :
22 744084 : export function isFloatingTopology(topology: LinkTopology): boolean {
23 744084 : return (
24 : topology.originNodeId === UNASSIGNED_NODE_ID ||
25 : topology.targetNodeId === UNASSIGNED_NODE_ID
26 : )
27 : }
|