Skip to main content

namespace ValuedGraphElement

undocumented

Companion type: ValuedGraphElement<N,V>

Functions

Returns the nodes of the link graph element if the given element e is a Link element, or undefined otherwise.

Definition

function getLink<N, V>(e: ValuedGraphElement<N, V>): Link<N> | undefined;

Type parameters
NameDescription
N
V

Parameters

NameTypeDescription
eValuedGraphElement<N, V>the graph element

getLinkElement

Returns the element at the given key in the graph element e, if the element is a Link element, or returns the given otherwise value otherwise.

Definition

function getLinkElement<N, V, K extends keyof ValuedGraphElement<N, V>>(e: ValuedGraphElement<N, V>, key: K): ValuedLink<N, V>[K] | undefined;

Type parameters
NameDescription
N
V
K

Parameters

NameTypeDescription
eValuedGraphElement<N, V>the graph element
keyKthe link key

getSingleNode

Returns the value of a single node graph element if the given element e is a single node, or the given otherwise fallback value otherwise.

Definition

function getSingleNode<N>(e: ValuedGraphElement<N, any>): N | undefined;

Type parameters
NameDescription
N

Parameters

NameTypeDescription
eValuedGraphElement<N, any>the graph element

Returns true if the given graph element e is a 3-tuple. Instructs the compiler that the type is a 3-tuple.

Definition

function isLink(e: ValuedGraphElement<any, any>): e is [unknown, unknown, unknown];

Parameters

NameTypeDescription
eValuedGraphElement<any, any>the graph element

isSingleNode

Returns true if the given graph element e is a single node. Instructs the compiler that the type is a 1-tuple.

Definition

function isSingleNode(e: ValuedGraphElement<any, any>): e is [unknown];

Parameters

NameTypeDescription
eValuedGraphElement<any, any>the graph element