@rimbu/graph
Version:
Immutable Graph data structures for TypeScript
28 lines (27 loc) • 1.56 kB
text/typescript
import { Token } from '@rimbu/base';
import { OptLazy, OptLazyOr, type RelatedTo, type ToJSON } from '@rimbu/common';
import { type StreamSource } from '@rimbu/stream';
import type { ValuedGraphBase, ValuedGraphTypesContextImpl } from '@rimbu/graph/custom';
import type { WithGraphValues } from '../../common/index.mjs';
import { GraphEmptyBase } from '../../common/index.mjs';
export declare class ValuedGraphEmpty<N, V, Tp extends ValuedGraphTypesContextImpl, TpG extends WithGraphValues<Tp, N, V> = WithGraphValues<Tp, N, V>> extends GraphEmptyBase implements ValuedGraphBase<N, V, Tp> {
readonly isDirected: boolean;
readonly context: TpG['context'];
_NonEmptyType: TpG['nonEmpty'];
constructor(isDirected: boolean, context: TpG['context']);
get linkMap(): TpG['linkMap'];
getValue<UN, O>(node1: RelatedTo<N, UN>, node2: RelatedTo<N, UN>, otherwise?: OptLazy<O>): O;
getConnectionsFrom(): TpG['linkConnections'];
addNode(node: N): TpG['nonEmpty'];
addNodes(nodes: StreamSource<N>): WithGraphValues<Tp, N, V>['nonEmpty'];
connect(node1: N, node2: N, value: V): TpG['nonEmpty'];
connectAll(links: StreamSource<WithGraphValues<Tp, N, V>['link']>): WithGraphValues<Tp, N, V>['nonEmpty'];
modifyAt(node1: N, node2: N, options: {
ifNew?: OptLazyOr<V, Token>;
ifExists?: (value: V, remove: Token) => V | Token;
}): WithGraphValues<Tp, N, V>['normal'];
mapValues<V2>(): WithGraphValues<Tp, N, V2>['normal'];
toString(): string;
toJSON(): ToJSON<any[]>;
toBuilder(): TpG['builder'];
}