@thi.ng/associative
Version:
ES Map/Set-compatible implementations with customizable equality semantics & supporting operations
26 lines • 1.08 kB
TypeScript
import type { Reducer } from "@thi.ng/transducers";
/**
* Computes the intersection of sets `a` and `b` and writes results into
* new set or optionally given set `out` (assumed to be empty for
* correct results). If `out` is *not* given, the returned Set type will
* be that of `a` (provided it defines `Symbol.species`).
*
* @param a - first set
* @param b - other set
* @param out - result set
*/
export declare const intersection: <T>(a: Set<T>, b: Set<T>, out?: Set<T>) => Set<T>;
/**
* Reducer version of {@link intersection}. If `src` is given returns the
* reduced intersection of given inputs, else merely returns a reducer to be
* used with
* [`reduce`](https://docs.thi.ng/umbrella/transducers/functions/reduce.html)
* /
* [`transduce`](https://docs.thi.ng/umbrella/transducers/functions/transduce.html)
* functions.
*
* @param src - input collections
*/
export declare function intersectionR<T>(): Reducer<Iterable<T>, Set<T>>;
export declare function intersectionR<T>(src: Iterable<Iterable<T>>): Set<T>;
//# sourceMappingURL=intersection.d.ts.map