import type { Stream, Streamable } from '@rimbu/stream'; import type { GraphBase, GraphElement } from '@rimbu/graph/custom'; /** * A type-invariant immutable graph. * See the [Graph documentation](https://rimbu.org/docs/collections/graph) and the [Graph API documentation](https://rimbu.org/api/rimbu/graph/Graph/interface) * @typeparam N - the node type */ export interface Graph extends GraphBase { } export declare namespace Graph { /** * A non-empty type-invariant immutable graph. * See the [Graph documentation](https://rimbu.org/docs/collections/graph) and the [Graph API documentation](https://rimbu.org/api/rimbu/graph/Graph/interface) * @typeparam N - the node type */ interface NonEmpty extends GraphBase.NonEmpty, Omit, keyof GraphBase.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 * ArrowGraphHashed.of([1], [2, 3]).stream().toArray() // => [[1], [2, 3]] * ``` */ stream(): Stream.NonEmpty>; } /** * A mutable `Graph` builder used to efficiently create new immutable instances. * See the [Graph documentation](https://rimbu.org/docs/collections/graph) and the [Graph.Builder API documentation](https://rimbu.org/api/rimbu/graph/Graph/Builder/interface) * @typeparam N - the node type */ interface Builder extends GraphBase.Builder { } /** * The Graph'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 GraphBase.Context { } /** * Utility interface that provides higher-kinded types for this collection. */ interface Types extends GraphBase.Types { readonly normal: Graph; readonly nonEmpty: Graph.NonEmpty; readonly context: Graph.Context; } }