import { EventEmitter } from "../EventEmitter"; export type GraphCallback = (state: S) => S | Promise; export type GraphNodeState = "pending" | "rejected" | "fulfilled" | "loading"; export declare class GraphEdge { readonly from: PropertyKey; readonly to: PropertyKey; state: GraphNodeState; constructor(from: PropertyKey, to: PropertyKey); } export declare class GraphNode { readonly name: PropertyKey; private readonly ref; state: GraphNodeState; result?: S; error?: Error; constructor(name: PropertyKey, ref: GraphCallback); run(state: S): Promise; } export interface GraphEventTarget { data: S; state: GraphNodeState; current: GraphNode; nodes: Record; edges: GraphEdge[]; } export declare class Graph extends EventEmitter<{ start: [GraphEventTarget]; update: [GraphEventTarget]; end: [GraphEventTarget]; fulfilled: [GraphEventTarget]; successful: [GraphEventTarget]; rejected: [GraphEventTarget]; newNode: [PropertyKey]; newEdge: [PropertyKey, PropertyKey, GraphEdge]; }> { static START: symbol; static END: symbol; private _nodes; private _edges; constructor(); private process; addNode(name: PropertyKey, callback: GraphCallback): PropertyKey; addNode(callback: GraphCallback): PropertyKey; hasEdge(from: PropertyKey, to: PropertyKey): boolean; hasConflictEdge(from: PropertyKey, to: PropertyKey): boolean; addEdge(from: PropertyKey, to: PropertyKey): void; run(state: S): Promise; } //# sourceMappingURL=index.d.ts.map