@rimbu/graph
Version:
Immutable Graph data structures for TypeScript
24 lines (23 loc) • 1.63 kB
text/typescript
import type { ArrayNonEmpty } from '@rimbu/common';
import { type StreamSource } from '@rimbu/stream';
import type { GraphBase, GraphElement, WithGraphValues } from '../../common/index.cjs';
export interface GraphTypesContextImpl extends GraphBase.Types {
readonly context: GraphContext<this['_N'], string, boolean>;
}
export declare class GraphContext<UN, TT extends string, Dir extends boolean, Tp extends GraphTypesContextImpl = GraphTypesContextImpl> implements GraphBase.Context<UN, Tp> {
readonly isDirected: Dir;
readonly typeTag: TT;
readonly linkMapContext: WithGraphValues<Tp, UN, any>['linkMapContext'];
readonly linkConnectionsContext: WithGraphValues<Tp, UN, any>['linkConnectionsContext'];
readonly _fixedType: any;
readonly _empty: WithGraphValues<Tp, UN, any>['normal'];
constructor(isDirected: Dir, typeTag: TT, linkMapContext: WithGraphValues<Tp, UN, any>['linkMapContext'], linkConnectionsContext: WithGraphValues<Tp, UN, any>['linkConnectionsContext']);
isNonEmptyInstance(source: any): source is WithGraphValues<Tp, UN, any>['nonEmpty'];
readonly empty: <N extends UN>() => any;
readonly from: any;
readonly of: <N>(...values: ArrayNonEmpty<GraphElement<N>>) => any;
readonly builder: () => any;
reducer: <N extends UN>(source?: StreamSource<GraphElement<N>>) => any;
createBuilder<N extends UN>(source?: WithGraphValues<Tp, N, any>['nonEmpty']): WithGraphValues<Tp, N, any>['builder'];
createNonEmpty<N extends UN>(linkMap: WithGraphValues<Tp, N, any>['linkMapNonEmpty'], connectionSize: number): WithGraphValues<Tp, N, any>['nonEmpty'];
}