import { IndexedSelector } from "../types/IndexedSelector"; import { SetFactory } from "../types/SetFactory"; /** * Materializes a sequence into a set, optionally projecting each element to a key before insertion. * * @typeParam T - Element type produced by the source iterable. * @typeParam TKey - Key type returned by `keySelector` when supplied. * @param src - Source iterable to materialize. * @param keySelector - Optional projection used to derive the value stored in the set; defaults to the element itself. * @param setFactory - Optional factory controlling the concrete set implementation to instantiate. * @returns A set containing one entry per projected value. * @throws {Error} If `keySelector` produces the same key more than once. * @example * ```ts * const lengths = _toSet(["a", "bb", "ccc"], (value) => value.length); * console.log([...lengths]); // [1, 2, 3] * ``` */ export declare function _toSet(src: Iterable, setFactory?: SetFactory): Set; export declare function _toSet(src: Iterable, keySelector: IndexedSelector, setFactory?: SetFactory): Set; /** * Curried version of {@link _toSet}. */ export declare function toSet(setFactory?: SetFactory): (src: Iterable) => Set; export declare function toSet(keySelector: IndexedSelector, setFactory?: SetFactory): (src: Iterable) => Set;