Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/graph/custom/common/interface/graph-base.ts>GraphBase

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
namespace GraphBase
import { GraphBase } from "https://deno.land/x/rimbu@1.0.3/graph/custom/common/interface/graph-base.ts";

Interfaces

Utility interface that provides higher-kinded types for this collection.

interface GraphBase
implements VariantGraphBase<N, unknown, Tp>, GraphConnect<N, unknown, Tp>
import { type GraphBase } from "https://deno.land/x/rimbu@1.0.3/graph/custom/common/interface/graph-base.ts";

Properties

readonly
linkMap: WithGraphValues<Tp, N, unknown>["linkMap"]

Returns the nested Map representation of the graph connections.

readonly
context: WithGraphValues<Tp, N, unknown>["context"]

Returns the context associated to this collection instance.

Methods

getConnectionsFrom<UN = N>(node1: RelatedTo<N, UN>): WithGraphValues<Tp, N, unknown>["linkConnections"]

Returns a Set containing the nodes reachable from given node1 node as keys, and their corresponding values.

connect(node1: N, node2: N): WithGraphValues<Tp, N, unknown>["nonEmpty"]

Returns the graph where given nodes node1 and node2 are connected.

toBuilder(): WithGraphValues<Tp, N, unknown>["builder"]

Returns a builder object containing the entries of this collection.