import type { Fn, Fn0 } from "@thi.ng/api"; import type { Transducer } from "./api.js"; export interface DistinctOpts { /** * Key extractor function. */ key: Fn; /** * Cache factory. Must produce a ES6 Set-like instance used to keep * track of seen key values. */ cache: Fn0>; } /** * Stateful transducer. Removes any duplicate input values by keeping an * internal cache (user configurable) of previously seen inputs. See * {@link DistinctOpts}. * * @example * ```ts tangle:../export/distinct.ts * import { distinct } from "@thi.ng/transducers"; * * console.log( * [...distinct({ key: (x) => x.id }, [{id: 1, x: 2}, {id: 1, x: 3}])] * ); * // [ { id: 1, x: 2 } ] * ``` * * @param opts - */ export declare function distinct(opts?: Partial>): Transducer; export declare function distinct(src: Iterable): IterableIterator; export declare function distinct(opts: Partial>, src: Iterable): IterableIterator; //# sourceMappingURL=distinct.d.ts.map