Skip to main content

Class: LinksStore

Constructors

constructor

new LinksStore(rootStore)

Parameters

NameType
rootStoreRootStore

Accessors

linkCreation

get linkCreation(): LinkCreationState

Returns

LinkCreationState


get links(): ReadonlyMap<string, LinkState>

Returns

ReadonlyMap<string, LinkState>

Methods

addLink(link, rewriteIfAlreadyConnected?): SuccessOrErrorResult<LinkState, ILinkState>

Parameters

NameTypeDefault value
linkILinkStateundefined
rewriteIfAlreadyConnectedbooleanfalse

Returns

SuccessOrErrorResult<LinkState, ILinkState>


addLinks(links, rewriteIfAlreadyConnected?): SuccessOrErrorResult<LinkState, ILinkState>[]

Parameters

NameTypeDefault value
linksILinkState[]undefined
rewriteIfAlreadyConnectedbooleanfalse

Returns

SuccessOrErrorResult<LinkState, ILinkState>[]


areEndpointsConnected

areEndpointsConnected(source, target): boolean

Parameters

NameType
sourceILinkPortEndpoint
targetILinkPortEndpoint

Returns

boolean


export

export(): ILinkState[]

Returns

ILinkState[]


getEndpointPort

getEndpointPort(endpoint): undefined | PortState

Parameters

NameType
endpointILinkPortEndpoint

Returns

undefined | PortState


getEndpointPortOrError

getEndpointPortOrError(endpoint): SuccessOrErrorResult<PortState, undefined>

Parameters

NameType
endpointILinkPortEndpoint

Returns

SuccessOrErrorResult<PortState, undefined>


getLink(id): undefined | LinkState

Parameters

NameType
idstring

Returns

undefined | LinkState


getLinkForEndpointsIfExists

getLinkForEndpointsIfExists(source, target): undefined | LinkState

Parameters

NameType
sourceILinkPortEndpoint
targetILinkPortEndpoint

Returns

undefined | LinkState


getNodeLinks(nodeId): LinkState[]

Parameters

NameType
nodeIdstring

Returns

LinkState[]


getPortLinks(nodeId, portId): LinkState[]

Parameters

NameType
nodeIdstring
portIdstring

Returns

LinkState[]


import

import(newLinks?): void

Parameters

NameType
newLinks?ILinkState[]

Returns

void


removeLink(linkId): undefined | ILinkStateWithId

Parameters

NameType
linkIdstring

Returns

undefined | ILinkStateWithId


removeLinks(linkIds): SuccessOrErrorResult<ILinkStateWithId, string>[]

Parameters

NameType
linkIdsstring[]

Returns

SuccessOrErrorResult<ILinkStateWithId, string>[]


removeNodeLinks(nodeId): void

Parameters

NameType
nodeIdstring

Returns

void


removePortLinks(nodeId, portId): void

Parameters

NameType
nodeIdstring
portIdstring

Returns

void


validateLink(link, ignoreIfAlreadyConnected?): SuccessOrErrorResult<undefined, undefined>

Parameters

NameTypeDefault value
linkILinkStateundefined
ignoreIfAlreadyConnectedbooleanfalse

Returns

SuccessOrErrorResult<undefined, undefined>


validateLinkProperties

validateLinkProperties(link, ignoreIfAlreadyConnected?): SuccessOrErrorResult<undefined, undefined>

Parameters

NameTypeDefault value
linkILinkStateundefined
ignoreIfAlreadyConnectedbooleanfalse

Returns

SuccessOrErrorResult<undefined, undefined>