export type Key = string | symbol; export type AddNodeOptions = { before?: (Key | T) | (Key | T)[] | undefined; after?: (Key | T) | (Key | T)[] | undefined; }; type DAGEventType = 'node:added' | 'node:removed'; type DAGEvents = { 'node:added': { key: Key; value: T; type: 'isolated' | 'connected'; }; 'node:removed': { key: Key; type: 'isolated' | 'connected'; }; }; export declare class DAG { private allVertices; /** Nodes that are fully unlinked */ private isolatedVertices; private connectedVertices; private sortedConnectedValues; private needsSort; private listeners; private emit; on(type: K, handler: (data: DAGEvents[K]) => void): void; off(type: K, handler: (data: DAGEvents[K]) => void): void; protected get sortedVertices(): T[]; private moveToIsolated; private moveToConnected; private getKey; protected add(key: Key, value: T, options?: AddNodeOptions): void; protected remove(key: Key | T): void; protected mapNodes(callback: (value: T, index: number) => U): U[]; protected forEachNode(callback: (value: T, index: number) => void): void; protected getValueByKey(key: Key): T | undefined; private sort; protected clear(): void; static isKey(value: any): value is Key; static isValue(value: any): value is T; } export {};