import type { Stream, Streamable } from '@rimbu/stream'; import type { GraphBase, GraphElement } from '../../common/index.mjs'; export interface EdgeGraphBase< N, Tp extends EdgeGraphBase.Types = EdgeGraphBase.Types, > extends GraphBase { /** * Returns false since this is an arrow (directed) graph instance. */ readonly isDirected: false; } export namespace EdgeGraphBase { export interface NonEmpty< N, Tp extends EdgeGraphBase.Types = EdgeGraphBase.Types, > 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 * EdgeGraphHashed.of([1], [2, 3]).stream().toArray() // => [[1], [2, 3]] * ``` */ stream(): Stream.NonEmpty>; } export interface Builder< N, Tp extends EdgeGraphBase.Types = EdgeGraphBase.Types, > extends GraphBase.Builder {} export interface Context< UN, Tp extends EdgeGraphBase.Types = EdgeGraphBase.Types, > extends GraphBase.Context { readonly isDirected: false; } /** * Utility interface that provides higher-kinded types for this collection. */ export interface Types extends GraphBase.Types { readonly normal: EdgeGraphBase; readonly nonEmpty: EdgeGraphBase.NonEmpty; readonly context: EdgeGraphBase.Context; readonly builder: EdgeGraphBase.Builder; } }