d3-dag
Version:
Layout algorithms for visualizing directed acylic graphs.
34 lines (33 loc) • 1.16 kB
TypeScript
/**
* Utilities for working with collections
*
* @packageDocumentation
*/
/** determines if two sets are equal */
export declare function setEqual<T>(first: Set<T>, second: Set<T>): boolean;
/** determines if two sets intersect */
export declare function setIntersect<T>(first: Set<T>, second: Set<T>): boolean;
/**
* returns a single arbitrary element from the Set, or undefined if empty
*/
export declare function setNext<T>(elems: Set<T>): T | undefined;
/**
* removes a single arbitrary element from the Set, or undefined if missing
*
* @remarks
* if the set contains undefined, then this doesn't distinguish in output,
* but will properly remove it.
*/
export declare function setPop<T>(elems: Set<T>): T | undefined;
/**
* push val onto key list for multimap
*/
export declare function listMultimapPush<K, V>(multimap: Map<K, V[]>, key: K, val: V): void;
/**
* add val to key set for multimap
*/
export declare function setMultimapAdd<K, V>(multimap: Map<K, Set<V>>, key: K, val: V): void;
/**
* delete val from key set for multimap
*/
export declare function setMultimapDelete<K, V>(multimap: Map<K, Set<V>>, key: K, val: V): void;