import { HashMap, HashSet } from '@rimbu/hashed'; import type { Stream, Streamable } from '@rimbu/stream'; import type { GraphElement, EdgeGraphHashedCreators } from '@rimbu/graph/custom'; import { type EdgeGraphBase } from '@rimbu/graph/custom'; /** * A type-invariant immutable edge (undirected) graph. * The connections are internally maintained using hashed collections. * See the [Graph documentation](https://rimbu.org/docs/collections/graph) and the [EdgeGraphHashed API documentation](https://rimbu.org/api/rimbu/graph/EdgeGraphHashed/interface) * @typeparam N - the node type * @example * ```ts * const g1 = EdgeGraphHashed.empty() * const g2 = EdgeGraphHashed.of([1], [2, 3], [2, 4]) * ``` */ export interface EdgeGraphHashed extends EdgeGraphBase { } export declare namespace EdgeGraphHashed { /** * A non-empty type-invariant immutable edge (undirected) graph. * The connections are internally maintained using hashed collections. * See the [Graph documentation](https://rimbu.org/docs/collections/graph) and the [EdgeGraphHashed API documentation](https://rimbu.org/api/rimbu/graph/EdgeGraphHashed/interface) * @typeparam N - the node type */ interface NonEmpty extends EdgeGraphBase.NonEmpty, Omit, keyof EdgeGraphBase.NonEmpty>, Streamable.NonEmpty> { /** * Returns a non-empty `Stream` containing all graph elements of this collection as single tuples for isolated nodes * and 2-valued tuples of nodes for connections. * @example * ```ts * EdgeGraphHashed.of([1], [2, 3]).stream().toArray() // => [[1], [2, 3]] * ``` */ stream(): Stream.NonEmpty>; } /** * A mutable `EdgeGraphHashed` builder used to efficiently create new immutable instances. * See the [Graph documentation](https://rimbu.org/docs/collections/graph) and the [EdgeGraphHashed.Builder API documentation](https://rimbu.org/api/rimbu/graph/EdgeGraphHashed/Builder/interface) * @typeparam N - the node type */ interface Builder extends EdgeGraphBase.Builder { } /** * The EdgeGraphHashed's Context instance that serves as a factory for all related immutable instances and builders. * @typeparam UN - the upper type limit for node types for which this context can create instances */ interface Context extends EdgeGraphBase.Context { readonly typeTag: 'EdgeGraphHashed'; } /** * Utility interface that provides higher-kinded types for this collection. */ interface Types extends EdgeGraphBase.Types { readonly normal: EdgeGraphHashed; readonly nonEmpty: EdgeGraphHashed.NonEmpty; readonly context: EdgeGraphHashed.Context; readonly builder: EdgeGraphHashed.Builder; readonly linkMap: HashMap>; readonly linkMapNonEmpty: HashMap.NonEmpty>; readonly linkMapContext: HashMap.Context; readonly linkConnectionsContext: HashSet.Context; readonly linkMapBuilder: HashMap.Builder>; readonly linkConnectionsBuilder: HashSet.Builder; readonly linkConnections: HashSet; } } export declare const EdgeGraphHashed: EdgeGraphHashedCreators;