export = SortableSet; /** * A subset of Set that offers sorting functionality * @template T item type in set * @extends {Set} */ declare class SortableSet extends Set { /** * Create a new sortable set * @param {Iterable=} initialIterable The initial iterable value * @typedef {function(T, T): number} SortFunction * @param {SortFunction=} defaultSort Default sorting function */ constructor( initialIterable?: Iterable | undefined, defaultSort?: (arg0: T, arg1: T) => number, ); /** @private @type {undefined | function(T, T): number}} */ private _sortFn; /** @private @type {typeof NONE | undefined | function(T, T): number}} */ private _lastActiveSortFn; /** @private @type {Map | undefined} */ private _cache; /** @private @type {Map | undefined} */ private _cacheOrderIndependent; /** * @param {T} value value to add to set * @returns {this} returns itself */ add(value: T): this; /** * Sort with a comparer function * @param {SortFunction} sortFn Sorting comparer function * @returns {void} */ sortWith(sortFn: (arg0: T, arg1: T) => number): void; sort(): SortableSet; /** * Get data from cache * @template R * @param {function(SortableSet): R} fn function to calculate value * @returns {R} returns result of fn(this), cached until set changes */ getFromCache(fn: (arg0: SortableSet) => R): R; /** * Get data from cache (ignoring sorting) * @template R * @param {function(SortableSet): R} fn function to calculate value * @returns {R} returns result of fn(this), cached until set changes */ getFromUnorderedCache(fn: (arg0: SortableSet) => R_1): R_1; /** * @private * @returns {void} */ private _invalidateCache; /** * @private * @returns {void} */ private _invalidateOrderedCache; /** * @returns {T[]} the raw array */ toJSON(): T[]; }