namespace ValuedGraphElement
undocumented
Companion type: ValuedGraphElement<N,V>
Functions
getLink
Returns the nodes of the link graph element if the given element e is a Link element, or undefined otherwise.
getLinke is a Link element, or undefined otherwise.Definition
function getLink<N, V>(e: ValuedGraphElement<N, V>): Link<N> | undefined;
Type parameters
| Name | Description | 
|---|---|
| N | |
| V | 
Parameters
| Name | Type | Description | 
|---|---|---|
| e | ValuedGraphElement<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.
getLinkElementkey 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
| Name | Description | 
|---|---|
| N | |
| V | |
| K | 
Parameters
| Name | Type | Description | 
|---|---|---|
| e | ValuedGraphElement<N, V> | the graph element | 
| key | K | the 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.
getSingleNodee is a single node, or the given otherwise fallback value otherwise.Definition
function getSingleNode<N>(e: ValuedGraphElement<N, any>): N | undefined;
Type parameters
| Name | Description | 
|---|---|
| N | 
Parameters
| Name | Type | Description | 
|---|---|---|
| e | ValuedGraphElement<N, any> | the graph element | 
isLink
Returns true if the given graph element e is a 3-tuple. Instructs the compiler that the type is a 3-tuple.
isLinke 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
| Name | Type | Description | 
|---|---|---|
| e | ValuedGraphElement<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.
isSingleNodee 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
| Name | Type | Description | 
|---|---|---|
| e | ValuedGraphElement<any, any> | the graph element |