UNPKG

@mirei/ts-collections

Version:

A collection of wrappers for common data structures in TypeScript

555 lines (537 loc) 688 kB
export declare abstract class AbstractCollection<TElement> extends AbstractReadonlyCollection<TElement> implements ICollection<TElement> { protected constructor(comparator?: EqualityComparator<TElement>); addAll<TSource extends TElement>(collection: Iterable<TSource>): boolean; reset<TSource extends TElement>(collection: Iterable<TSource>): void; abstract add(element: TElement): boolean; abstract clear(): void; } declare abstract class AbstractDictionary<TKey, TValue> extends AbstractReadonlyDictionary<TKey, TValue> implements IDictionary<TKey, TValue> { protected constructor(valueComparator: EqualityComparator<TValue>, keyValueComparator: EqualityComparator<KeyValuePair<TKey, TValue>>); put(key: TKey, value: TValue): TValue | null; tryAdd(key: TKey, value: TValue): boolean; abstract add(key: TKey, value: TValue): TValue; abstract clear(): void; abstract remove(key: TKey): TValue | null; abstract set(key: TKey, value: TValue): void; } export declare abstract class AbstractEnumerable<TElement> implements IEnumerable<TElement> { protected readonly comparer: EqualityComparator<TElement>; protected constructor(comparator?: EqualityComparator<TElement>); aggregate(accumulator: Accumulator<TElement, TElement>): TElement; aggregate<TAccumulate>(accumulator: Accumulator<TElement, TAccumulate>, seed: TAccumulate): TAccumulate; aggregate<TAccumulate, TResult>(accumulator: Accumulator<TElement, TAccumulate>, seed: TAccumulate, resultSelector: Selector<TAccumulate, TResult>): TResult; aggregateBy<TKey, TAccumulate = TElement>(keySelector: Selector<TElement, TKey>, seedSelector: Selector<TKey, TAccumulate> | TAccumulate, accumulator: Accumulator<TElement, TAccumulate>, keyComparator?: EqualityComparator<TKey>): IEnumerable<KeyValuePair<TKey, TAccumulate>>; all(predicate: Predicate<TElement>): boolean; any(predicate?: Predicate<TElement>): boolean; append(element: TElement): IEnumerable<TElement>; atLeast(count: number, predicate?: Predicate<TElement>): boolean; atMost(count: number, predicate?: Predicate<TElement>): boolean; average(this: Iterable<number>): number; average(selector: Selector<TElement, number>): number; cartesian<TSecond>(iterable: Iterable<TSecond>): IEnumerable<[TElement, TSecond]>; cast<TResult>(): IEnumerable<TResult>; chunk(size: number): IEnumerable<IEnumerable<TElement>>; combinations(size?: number): IEnumerable<IEnumerable<TElement>>; compact(): IEnumerable<NonNullable<TElement>>; concat(iterable: Iterable<TElement>): IEnumerable<TElement>; contains(element: TElement, comparator?: EqualityComparator<TElement>): boolean; correlation<TSecond>(iterable: Iterable<TSecond>, selector?: Selector<TElement, number>, otherSelector?: Selector<TSecond, number>): number; correlationBy(leftSelector: Selector<TElement, number>, rightSelector: Selector<TElement, number>): number; count(predicate?: Predicate<TElement>): number; countBy<TKey>(keySelector: Selector<TElement, TKey>, comparator?: EqualityComparator<TKey>): IEnumerable<KeyValuePair<TKey, number>>; covariance<TSecond>(iterable: Iterable<TSecond>, selector?: Selector<TElement, number>, otherSelector?: Selector<TSecond, number>, sample?: boolean): number; covarianceBy(leftSelector: Selector<TElement, number>, rightSelector: Selector<TElement, number>, sample?: boolean): number; cycle(count?: number): IEnumerable<TElement>; defaultIfEmpty(value?: TElement | null): IEnumerable<TElement | null>; disjoint<TSecond>(iterable: Iterable<TSecond>, comparator?: EqualityComparator<TElement | TSecond>): boolean; disjointBy<TSecond, TKey, TSecondKey>(iterable: Iterable<TSecond>, keySelector: Selector<TElement, TKey>, otherKeySelector: Selector<TSecond, TSecondKey>, keyComparator?: EqualityComparator<TKey | TSecondKey>): boolean; distinct(keyComparator?: EqualityComparator<TElement>): IEnumerable<TElement>; distinctBy<TKey>(keySelector: Selector<TElement, TKey>, keyComparator?: EqualityComparator<TKey>): IEnumerable<TElement>; distinctUntilChanged(comparator?: EqualityComparator<TElement>): IEnumerable<TElement>; distinctUntilChangedBy<TKey>(keySelector: Selector<TElement, TKey>, keyComparator?: EqualityComparator<TKey>): IEnumerable<TElement>; elementAt(index: number): TElement; elementAtOrDefault(index: number): TElement | null; exactly(count: number, predicate?: Predicate<TElement>): boolean; except(iterable: Iterable<TElement>, comparator?: EqualityComparator<TElement> | OrderComparator<TElement>): IEnumerable<TElement>; exceptBy<TKey>(iterable: Iterable<TElement>, keySelector: Selector<TElement, TKey>, keyComparator?: EqualityComparator<TKey> | OrderComparator<TKey>): IEnumerable<TElement>; first<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): TFiltered; first(predicate?: Predicate<TElement>): TElement; firstOrDefault<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): TFiltered | null; firstOrDefault(predicate?: Predicate<TElement>): TElement | null; forEach(action: IndexedAction<TElement>): void; groupBy<TKey>(keySelector: Selector<TElement, TKey>, keyComparator?: EqualityComparator<TKey>, hashSelector?: Selector<TElement, PropertyKey>): IEnumerable<IGroup<TKey, TElement>>; groupJoin<TInner, TKey, TResult>(innerEnumerable: IEnumerable<TInner>, outerKeySelector: Selector<TElement, TKey>, innerKeySelector: Selector<TInner, TKey>, resultSelector: JoinSelector<TElement, IEnumerable<TInner>, TResult>, keyComparator?: EqualityComparator<TKey>): IEnumerable<TResult>; index(): IEnumerable<[number, TElement]>; interleave<TSecond>(iterable: Iterable<TSecond>): IEnumerable<TElement | TSecond>; intersect(iterable: Iterable<TElement>, comparator?: EqualityComparator<TElement> | OrderComparator<TElement>): IEnumerable<TElement>; intersectBy<TKey>(iterable: Iterable<TElement>, keySelector: Selector<TElement, TKey>, keyComparator?: EqualityComparator<TKey> | OrderComparator<TKey>): IEnumerable<TElement>; intersperse<TSeparator = TElement>(separator: TSeparator): IEnumerable<TElement | TSeparator>; join<TInner, TKey, TResult>(innerEnumerable: IEnumerable<TInner>, outerKeySelector: Selector<TElement, TKey>, innerKeySelector: Selector<TInner, TKey>, resultSelector: JoinSelector<TElement, TInner, TResult>, keyComparator?: EqualityComparator<TKey>): IEnumerable<TResult>; last<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): TFiltered; last(predicate?: Predicate<TElement>): TElement; lastOrDefault<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): TFiltered | null; lastOrDefault(predicate?: Predicate<TElement>): TElement | null; leftJoin<TInner, TKey, TResult>(innerEnumerable: IEnumerable<TInner>, outerKeySelector: Selector<TElement, TKey>, innerKeySelector: Selector<TInner, TKey>, resultSelector: JoinSelector<TElement, TInner, TResult>, keyComparator?: EqualityComparator<TKey>): IEnumerable<TResult>; max(this: Iterable<number>): number; max(selector: Selector<TElement, number>): number; maxBy<TKey>(keySelector: Selector<TElement, TKey>, comparator?: OrderComparator<TKey>): TElement; median(selector?: Selector<TElement, number>, tie?: MedianTieStrategy): number; min(this: Iterable<number>): number; min(selector: Selector<TElement, number>): number; minBy<TKey>(keySelector: Selector<TElement, TKey>, comparator?: OrderComparator<TKey>): TElement; mode<TKey>(keySelector?: Selector<TElement, TKey>): TElement; modeOrDefault<TKey>(keySelector?: Selector<TElement, TKey>): TElement | null; multimode<TKey>(keySelector?: Selector<TElement, TKey>): IEnumerable<TElement>; none(predicate?: Predicate<TElement>): boolean; ofType<TResult extends ObjectType>(type: TResult): IEnumerable<InferredType<TResult>>; order(comparator?: OrderComparator<TElement>): IOrderedEnumerable<TElement>; orderBy<TKey>(keySelector: Selector<TElement, TKey>, comparator?: OrderComparator<TKey>): IOrderedEnumerable<TElement>; orderByDescending<TKey>(keySelector: Selector<TElement, TKey>, comparator?: OrderComparator<TKey>): IOrderedEnumerable<TElement>; orderDescending(comparator?: OrderComparator<TElement>): IOrderedEnumerable<TElement>; pairwise(resultSelector: PairwiseSelector<TElement, TElement>): IEnumerable<[TElement, TElement]>; partition<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): [IEnumerable<TFiltered>, IEnumerable<Exclude<TElement, TFiltered>>]; partition(predicate: Predicate<TElement>): [IEnumerable<TElement>, IEnumerable<TElement>]; percentile(this: Iterable<number>, percent: number, strategy?: PercentileStrategy): number; percentile(percent: number, selector: Selector<TElement, number>, strategy?: PercentileStrategy): number; permutations(size?: number): IEnumerable<IEnumerable<TElement>>; pipe<TResult>(operator: PipeOperator<TElement, TResult>): TResult; prepend(element: TElement): IEnumerable<TElement>; product(this: Iterable<number>): number; product(selector: Selector<TElement, number>): number; reverse(): IEnumerable<TElement>; rightJoin<TInner, TKey, TResult>(innerEnumerable: IEnumerable<TInner>, outerKeySelector: Selector<TElement, TKey>, innerKeySelector: Selector<TInner, TKey>, resultSelector: JoinSelector<TElement | null, TInner, TResult>, keyComparator?: EqualityComparator<TKey>): IEnumerable<TResult>; rotate(shift: number): IEnumerable<TElement>; scan(accumulator: Accumulator<TElement, TElement>): IEnumerable<TElement>; scan<TAccumulate>(accumulator: Accumulator<TElement, TAccumulate>, seed: TAccumulate): IEnumerable<TAccumulate>; select<TResult>(selector: IndexedSelector<TElement, TResult>): IEnumerable<TResult>; selectMany<TResult>(selector: IndexedSelector<TElement, Iterable<TResult>>): IEnumerable<TResult>; sequenceEqual(iterable: Iterable<TElement>, comparator?: EqualityComparator<TElement>): boolean; shuffle(): IEnumerable<TElement>; single<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): TFiltered; single(predicate?: Predicate<TElement>): TElement; singleOrDefault<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): TFiltered | null; singleOrDefault(predicate?: Predicate<TElement>): TElement | null; skip(count: number): IEnumerable<TElement>; skipLast(count: number): IEnumerable<TElement>; skipUntil<TFiltered extends TElement>(predicate: IndexedTypePredicate<TElement, TFiltered>): IEnumerable<TFiltered>; skipUntil(predicate: IndexedPredicate<TElement>): IEnumerable<TElement>; skipWhile(predicate: IndexedPredicate<TElement>): IEnumerable<TElement>; span<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): [IEnumerable<TFiltered>, IEnumerable<TElement>]; span(predicate: Predicate<TElement>): [IEnumerable<TElement>, IEnumerable<TElement>]; standardDeviation(selector?: Selector<TElement, number>, sample?: boolean): number; step(stepNumber: number): IEnumerable<TElement>; sum(this: Iterable<number>): number; sum(selector: Selector<TElement, number>): number; take(count: number): IEnumerable<TElement>; takeLast(count: number): IEnumerable<TElement>; takeUntil<TFiltered extends TElement>(predicate: IndexedTypePredicate<TElement, TFiltered>): IEnumerable<TFiltered>; takeUntil(predicate: IndexedPredicate<TElement>): IEnumerable<TElement>; takeWhile<TFiltered extends TElement>(predicate: IndexedTypePredicate<TElement, TFiltered>): IEnumerable<TFiltered>; takeWhile(predicate: IndexedPredicate<TElement>): IEnumerable<TElement>; tap(action: IndexedAction<TElement>): IEnumerable<TElement>; toArray(): TElement[]; toCircularLinkedList(comparator?: EqualityComparator<TElement, TElement>): CircularLinkedList<TElement>; toCircularQueue(comparator?: EqualityComparator<TElement>): CircularQueue<TElement>; toCircularQueue(capacity: number, comparator?: EqualityComparator<TElement>): CircularQueue<TElement>; toDictionary<TKey, TValue>(keySelector: Selector<TElement, TKey>, valueSelector: Selector<TElement, TValue>, valueComparator?: EqualityComparator<TValue>): Dictionary<TKey, TValue>; toEnumerableSet(): EnumerableSet<TElement>; toImmutableCircularQueue(comparator?: EqualityComparator<TElement>): ImmutableCircularQueue<TElement>; toImmutableCircularQueue(capacity: number, comparator?: EqualityComparator<TElement>): ImmutableCircularQueue<TElement>; toImmutableDictionary<TKey, TValue>(keySelector: Selector<TElement, TKey>, valueSelector: Selector<TElement, TValue>, valueComparator?: EqualityComparator<TValue>): ImmutableDictionary<TKey, TValue>; toImmutableList(comparator?: EqualityComparator<TElement>): ImmutableList<TElement>; toImmutablePriorityQueue(comparator?: OrderComparator<TElement>): ImmutablePriorityQueue<TElement>; toImmutableQueue(comparator?: EqualityComparator<TElement>): ImmutableQueue<TElement>; toImmutableSet(): ImmutableSet<TElement>; toImmutableSortedDictionary<TKey, TValue>(keySelector: Selector<TElement, TKey>, valueSelector: Selector<TElement, TValue>, keyComparator?: OrderComparator<TKey>, valueComparator?: EqualityComparator<TValue>): ImmutableSortedDictionary<TKey, TValue>; toImmutableSortedSet(comparator?: OrderComparator<TElement>): ImmutableSortedSet<TElement>; toImmutableStack(comparator?: EqualityComparator<TElement>): ImmutableStack<TElement>; toLinkedList(comparator?: EqualityComparator<TElement>): LinkedList<TElement>; toList(comparator?: EqualityComparator<TElement>): List<TElement>; toLookup<TKey, TValue>(keySelector: Selector<TElement, TKey>, valueSelector: Selector<TElement, TValue>, keyComparator?: OrderComparator<TKey>): ILookup<TKey, TValue>; toMap<TKey, TValue>(keySelector: Selector<TElement, TKey>, valueSelector: Selector<TElement, TValue>): Map<TKey, TValue>; toObject<TKey extends PropertyKey, TValue>(keySelector: Selector<TElement, TKey>, valueSelector: Selector<TElement, TValue>): Record<TKey, TValue>; toPriorityQueue(comparator?: OrderComparator<TElement>): PriorityQueue<TElement>; toQueue(comparator?: EqualityComparator<TElement>): Queue<TElement>; toSet(): Set<TElement>; toSortedDictionary<TKey, TValue>(keySelector: Selector<TElement, TKey>, valueSelector: Selector<TElement, TValue>, keyComparator?: OrderComparator<TKey>, valueComparator?: EqualityComparator<TValue>): SortedDictionary<TKey, TValue>; toSortedSet(comparator?: OrderComparator<TElement>): SortedSet<TElement>; toStack(comparator?: EqualityComparator<TElement>): Stack<TElement>; union(iterable: Iterable<TElement>, comparator?: EqualityComparator<TElement>): IEnumerable<TElement>; unionBy<TKey>(iterable: Iterable<TElement>, keySelector: Selector<TElement, TKey>, comparator?: EqualityComparator<TKey>): IEnumerable<TElement>; variance(selector?: Selector<TElement, number>, sample?: boolean): number; where<TFiltered extends TElement>(predicate: IndexedTypePredicate<TElement, TFiltered>): IEnumerable<TFiltered>; where(predicate: IndexedPredicate<TElement>): IEnumerable<TElement>; windows(size: number): IEnumerable<IEnumerable<TElement>>; zip<TSecond>(iterable: Iterable<TSecond>): IEnumerable<[TElement, TSecond]>; zip<TSecond, TResult = [TElement, TSecond]>(iterable: Iterable<TSecond>, zipper?: Zipper<TElement, TSecond, TResult>): IEnumerable<TResult>; zipMany<TIterable extends readonly Iterable<unknown>[]>(...iterables: [...TIterable]): IEnumerable<[TElement, ...UnpackIterableTuple<TIterable>]>; zipMany<TIterable extends readonly Iterable<unknown>[], TResult>(...iterablesAndZipper: [...TIterable, ZipManyZipper<[TElement, ...UnpackIterableTuple<TIterable>], TResult>]): IEnumerable<TResult>; protected getIterableSize(iterable: Iterable<TElement>): number; abstract [Symbol.iterator](): Iterator<TElement>; } export declare abstract class AbstractImmutableCollection<TElement> extends AbstractReadonlyCollection<TElement> implements IImmutableCollection<TElement> { protected constructor(comparator?: EqualityComparator<TElement>); abstract add(element: TElement): IImmutableCollection<TElement>; abstract addAll<TSource extends TElement>(collection: Iterable<TSource>): IImmutableCollection<TElement>; abstract clear(): IImmutableCollection<TElement>; abstract reset<TSource extends TElement>(collection: Iterable<TSource>): IImmutableCollection<TElement>; } declare abstract class AbstractImmutableDictionary<TKey, TValue> extends AbstractReadonlyDictionary<TKey, TValue> implements IImmutableDictionary<TKey, TValue> { protected constructor(valueComparator: EqualityComparator<TValue>, keyValueComparator: EqualityComparator<KeyValuePair<TKey, TValue>>); abstract add(key: TKey, value: TValue): IImmutableDictionary<TKey, TValue>; abstract clear(): IImmutableDictionary<TKey, TValue>; abstract put(key: TKey, value: TValue): IImmutableDictionary<TKey, TValue>; abstract remove(key: TKey): IImmutableDictionary<TKey, TValue>; abstract set(key: TKey, value: TValue): IImmutableDictionary<TKey, TValue>; abstract get length(): number; } export declare abstract class AbstractList<TElement> extends AbstractRandomAccessCollection<TElement> implements IList<TElement> { protected constructor(comparator?: EqualityComparator<TElement>); add(element: TElement): boolean; contains(element: TElement, comparator?: EqualityComparator<TElement>): boolean; elementAt(index: number): TElement; elementAtOrDefault(index: number): TElement | null; entries(): IterableIterator<[number, TElement]>; first<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): TFiltered; first(predicate?: Predicate<TElement>): TElement; firstOrDefault<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): TFiltered | null; firstOrDefault(predicate?: Predicate<TElement>): TElement | null; indexOf(element: TElement, comparator?: EqualityComparator<TElement>): number; last<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): TFiltered; last(predicate?: Predicate<TElement>): TElement; lastIndexOf(element: TElement, comparator?: EqualityComparator<TElement>): number; lastOrDefault<TFiltered extends TElement>(predicate: TypePredicate<TElement, TFiltered>): TFiltered | null; lastOrDefault(predicate?: Predicate<TElement>): TElement | null; removeAll<TSource extends TElement>(collection: Iterable<TSource>): boolean; removeIf(predicate: Predicate<TElement>): boolean; abstract addAt(element: TElement, index: number): boolean; abstract get(index: number): TElement; abstract getRange(index: number, count: number): IList<TElement>; abstract removeAt(index: number): TElement; abstract set(index: number, element: TElement): TElement; abstract sort(comparator?: OrderComparator<TElement>): void; } export declare abstract class AbstractRandomAccessCollection<TElement> extends AbstractCollection<TElement> implements IRandomAccessCollection<TElement> { retainAll<TSource extends TElement>(collection: Iterable<TSource>): boolean; abstract remove(element: TElement): boolean; abstract removeAll<TSource extends TElement>(collection: Iterable<TSource>): boolean; abstract removeIf(predicate: Predicate<TElement>): boolean; } export declare abstract class AbstractRandomAccessImmutableCollection<TElement> extends AbstractImmutableCollection<TElement> implements IRandomAccessImmutableCollection<TElement> { abstract remove(element: TElement): IRandomAccessImmutableCollection<TElement>; abstract removeAll<TSource extends TElement>(collection: Iterable<TSource>): IRandomAccessImmutableCollection<TElement>; abstract removeIf(predicate: (element: TElement) => boolean): IRandomAccessImmutableCollection<TElement>; abstract retainAll<TSource extends TElement>(collection: Iterable<TSource>): IRandomAccessImmutableCollection<TElement>; } export declare abstract class AbstractReadonlyCollection<TElement> extends AbstractEnumerable<TElement> implements IReadonlyCollection<TElement> { protected constructor(comparator?: EqualityComparator<TElement>); any(predicate?: Predicate<TElement>): boolean; containsAll<TSource extends TElement>(collection: Iterable<TSource>): boolean; count(predicate?: Predicate<TElement>): number; isEmpty(): boolean; toString(): string; toString(separator?: string): string; toString(separator?: string, selector?: Selector<TElement, string>): string; get comparator(): EqualityComparator<TElement> | OrderComparator<TElement>; abstract size(): number; abstract get length(): number; } declare abstract class AbstractReadonlyDictionary<TKey, TValue> implements IReadonlyDictionary<TKey, TValue> { protected readonly keyValueComparer: EqualityComparator<KeyValuePair<TKey, TValue>>; protected readonly valueComparer: EqualityComparator<TValue>; protected constructor(valueComparator: EqualityComparator<TValue>, keyValueComparator: EqualityComparator<KeyValuePair<TKey, TValue>>); aggregate(accumulator: Accumulator<KeyValuePair<TKey, TValue>, KeyValuePair<TKey, TValue>>): KeyValuePair<TKey, TValue>; aggregate<TAccumulate>(accumulator: Accumulator<KeyValuePair<TKey, TValue>, TAccumulate>, seed: TAccumulate): TAccumulate; aggregate<TAccumulate, TResult>(accumulator: Accumulator<KeyValuePair<TKey, TValue>, TAccumulate>, seed: TAccumulate, resultSelector: Selector<TAccumulate, TResult>): TResult; aggregateBy<TAggregateKey, TAccumulate = KeyValuePair<TKey, TValue>>(keySelector: Selector<KeyValuePair<TKey, TValue>, TAggregateKey>, seedSelector: Selector<TAggregateKey, TAccumulate> | TAccumulate, accumulator: Accumulator<KeyValuePair<TKey, TValue>, TAccumulate>, keyComparator?: EqualityComparator<TAggregateKey>): IEnumerable<KeyValuePair<TAggregateKey, TAccumulate>>; all(predicate: Predicate<KeyValuePair<TKey, TValue>>): boolean; any(predicate?: Predicate<KeyValuePair<TKey, TValue>>): boolean; append(element: KeyValuePair<TKey, TValue>): IEnumerable<KeyValuePair<TKey, TValue>>; asObject<TObjectKey extends PropertyKey>(): Record<TObjectKey, TValue>; atLeast(count: number, predicate?: Predicate<KeyValuePair<TKey, TValue>>): boolean; atMost(count: number, predicate?: Predicate<KeyValuePair<TKey, TValue>>): boolean; average(this: Iterable<number>): number; average(selector: Selector<KeyValuePair<TKey, TValue>, number>): number; cartesian<TSecond>(iterable: Iterable<TSecond>): IEnumerable<[KeyValuePair<TKey, TValue>, TSecond]>; cast<TResult>(): IEnumerable<TResult>; chunk(size: number): IEnumerable<IEnumerable<KeyValuePair<TKey, TValue>>>; combinations(size?: number): IEnumerable<IEnumerable<KeyValuePair<TKey, TValue>>>; compact(): IEnumerable<NonNullable<KeyValuePair<TKey, TValue>>>; concat(iterable: Iterable<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; contains(element: KeyValuePair<TKey, TValue>, comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): boolean; correlation<TSecond>(iterable: Iterable<TSecond>, selector?: Selector<KeyValuePair<TKey, TValue>, number>, otherSelector?: Selector<TSecond, number>): number; correlationBy(leftSelector: Selector<KeyValuePair<TKey, TValue>, number>, rightSelector: Selector<KeyValuePair<TKey, TValue>, number>): number; count(predicate?: Predicate<KeyValuePair<TKey, TValue>>): number; countBy<TCountKey>(keySelector: Selector<KeyValuePair<TKey, TValue>, TCountKey>, comparator?: EqualityComparator<TCountKey>): IEnumerable<KeyValuePair<TCountKey, number>>; covariance<TSecond>(iterable: Iterable<TSecond>, selector?: Selector<KeyValuePair<TKey, TValue>, number>, otherSelector?: Selector<TSecond, number>, sample?: boolean): number; covarianceBy(leftSelector: Selector<KeyValuePair<TKey, TValue>, number>, rightSelector: Selector<KeyValuePair<TKey, TValue>, number>, sample?: boolean): number; cycle(count?: number): IEnumerable<KeyValuePair<TKey, TValue>>; defaultIfEmpty(value?: KeyValuePair<TKey, TValue> | null): IEnumerable<KeyValuePair<TKey, TValue> | null>; disjoint<TSecond>(iterable: Iterable<TSecond>, comparator?: EqualityComparator<KeyValuePair<TKey, TValue> | TSecond>): boolean; disjointBy<TSecond, TDisjointKey, TSecondDisjointKey>(iterable: Iterable<TSecond>, keySelector: Selector<KeyValuePair<TKey, TValue>, TDisjointKey>, otherKeySelector: Selector<TSecond, TSecondDisjointKey>, keyComparator?: EqualityComparator<TDisjointKey | TSecondDisjointKey>): boolean; distinct(keyComparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; distinctBy<TDistinctKey>(keySelector: Selector<KeyValuePair<TKey, TValue>, TDistinctKey>, comparator?: EqualityComparator<TDistinctKey>): IEnumerable<KeyValuePair<TKey, TValue>>; distinctUntilChanged(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; distinctUntilChangedBy<TDistinctKey>(keySelector: Selector<KeyValuePair<TKey, TValue>, TDistinctKey>, keyComparator?: EqualityComparator<TDistinctKey>): IEnumerable<KeyValuePair<TKey, TValue>>; elementAt(index: number): KeyValuePair<TKey, TValue>; elementAtOrDefault(index: number): KeyValuePair<TKey, TValue> | null; exactly(count: number, predicate?: Predicate<KeyValuePair<TKey, TValue>>): boolean; except(iterable: Iterable<KeyValuePair<TKey, TValue>>, comparator?: EqualityComparator<KeyValuePair<TKey, TValue>> | OrderComparator<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; exceptBy<TExceptKey>(iterable: Iterable<KeyValuePair<TKey, TValue>>, keySelector: Selector<KeyValuePair<TKey, TValue>, TExceptKey>, keyComparator?: EqualityComparator<TExceptKey> | OrderComparator<TExceptKey>): IEnumerable<KeyValuePair<TKey, TValue>>; first<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: TypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): TFiltered; first(predicate?: Predicate<KeyValuePair<TKey, TValue>>): KeyValuePair<TKey, TValue>; firstOrDefault<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: TypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): TFiltered | null; firstOrDefault(predicate?: Predicate<KeyValuePair<TKey, TValue>>): KeyValuePair<TKey, TValue> | null; forEach(action: IndexedAction<KeyValuePair<TKey, TValue>>): void; groupBy<TGroupKey>(keySelector: Selector<KeyValuePair<TKey, TValue>, TGroupKey>, keyComparator?: EqualityComparator<TGroupKey>): IEnumerable<IGroup<TGroupKey, KeyValuePair<TKey, TValue>>>; groupJoin<TInner, TGroupKey, TResult>(innerEnumerable: IEnumerable<TInner>, outerKeySelector: Selector<KeyValuePair<TKey, TValue>, TGroupKey>, innerKeySelector: Selector<TInner, TGroupKey>, resultSelector: JoinSelector<KeyValuePair<TKey, TValue>, IEnumerable<TInner>, TResult>, keyComparator?: EqualityComparator<TGroupKey>): IEnumerable<TResult>; index(): IEnumerable<[number, KeyValuePair<TKey, TValue>]>; interleave<TSecond>(iterable: Iterable<TSecond>): IEnumerable<KeyValuePair<TKey, TValue> | TSecond>; intersect(iterable: Iterable<KeyValuePair<TKey, TValue>>, comparator?: EqualityComparator<KeyValuePair<TKey, TValue>> | OrderComparator<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; intersectBy<TIntersectKey>(iterable: Iterable<KeyValuePair<TKey, TValue>>, keySelector: Selector<KeyValuePair<TKey, TValue>, TIntersectKey>, keyComparator?: EqualityComparator<TIntersectKey> | OrderComparator<TIntersectKey>): IEnumerable<KeyValuePair<TKey, TValue>>; intersperse<TSeparator = KeyValuePair<TKey, TValue>>(separator: TSeparator): IEnumerable<KeyValuePair<TKey, TValue> | TSeparator>; isEmpty(): boolean; join<TInner, TGroupKey, TResult>(innerEnumerable: IEnumerable<TInner>, outerKeySelector: Selector<KeyValuePair<TKey, TValue>, TGroupKey>, innerKeySelector: Selector<TInner, TGroupKey>, resultSelector: JoinSelector<KeyValuePair<TKey, TValue>, TInner, TResult>, keyComparator?: EqualityComparator<TGroupKey>): IEnumerable<TResult>; last<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: TypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): TFiltered; last(predicate?: Predicate<KeyValuePair<TKey, TValue>>): KeyValuePair<TKey, TValue>; lastOrDefault<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: TypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): TFiltered | null; lastOrDefault(predicate?: Predicate<KeyValuePair<TKey, TValue>>): KeyValuePair<TKey, TValue> | null; leftJoin<TInner, TGroupKey, TResult>(innerEnumerable: IEnumerable<TInner>, outerKeySelector: Selector<KeyValuePair<TKey, TValue>, TGroupKey>, innerKeySelector: Selector<TInner, TGroupKey>, resultSelector: JoinSelector<KeyValuePair<TKey, TValue>, TInner, TResult>, keyComparator?: EqualityComparator<TGroupKey>): IEnumerable<TResult>; max(this: Iterable<number>): number; max(selector: Selector<KeyValuePair<TKey, TValue>, number>): number; maxBy<TMaxKey>(keySelector: Selector<KeyValuePair<TKey, TValue>, TMaxKey>, comparator?: OrderComparator<TMaxKey>): KeyValuePair<TKey, TValue>; median(selector?: Selector<KeyValuePair<TKey, TValue>, number>, tie?: MedianTieStrategy): number; min(this: Iterable<number>): number; min(selector: Selector<KeyValuePair<TKey, TValue>, number>): number; minBy<TMinKey>(keySelector: Selector<KeyValuePair<TKey, TValue>, TMinKey>, comparator?: OrderComparator<TMinKey>): KeyValuePair<TKey, TValue>; mode<TModeKey>(keySelector?: Selector<KeyValuePair<TKey, TValue>, TModeKey>): KeyValuePair<TKey, TValue>; modeOrDefault<TModeKey>(keySelector?: Selector<KeyValuePair<TKey, TValue>, TModeKey>): KeyValuePair<TKey, TValue> | null; multimode<TModeKey>(keySelector?: Selector<KeyValuePair<TKey, TValue>, TModeKey>): IEnumerable<KeyValuePair<TKey, TValue>>; none(predicate?: Predicate<KeyValuePair<TKey, TValue>>): boolean; ofType<TResult extends ObjectType>(type: TResult): IEnumerable<InferredType<TResult>>; order(comparator?: OrderComparator<KeyValuePair<TKey, TValue>>): IOrderedEnumerable<KeyValuePair<TKey, TValue>>; orderBy<TOrderKey>(keySelector: Selector<KeyValuePair<TKey, TValue>, TOrderKey>, comparator?: OrderComparator<TOrderKey>): IOrderedEnumerable<KeyValuePair<TKey, TValue>>; orderByDescending<TOrderKey>(keySelector: Selector<KeyValuePair<TKey, TValue>, TOrderKey>, comparator?: OrderComparator<TOrderKey>): IOrderedEnumerable<KeyValuePair<TKey, TValue>>; orderDescending(comparator?: OrderComparator<KeyValuePair<TKey, TValue>>): IOrderedEnumerable<KeyValuePair<TKey, TValue>>; pairwise(resultSelector?: PairwiseSelector<KeyValuePair<TKey, TValue>, KeyValuePair<TKey, TValue>>): IEnumerable<[KeyValuePair<TKey, TValue>, KeyValuePair<TKey, TValue>]>; partition<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: TypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): [IEnumerable<TFiltered>, IEnumerable<Exclude<KeyValuePair<TKey, TValue>, TFiltered>>]; partition(predicate: Predicate<KeyValuePair<TKey, TValue>>): [IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>]; percentile(this: Iterable<number>, percent: number, strategy?: PercentileStrategy): number; percentile(percent: number, selector: Selector<KeyValuePair<TKey, TValue>, number>, strategy?: PercentileStrategy): number; permutations(size?: number): IEnumerable<IEnumerable<KeyValuePair<TKey, TValue>>>; pipe<TResult>(operator: PipeOperator<KeyValuePair<TKey, TValue>, TResult>): TResult; prepend(element: KeyValuePair<TKey, TValue>): IEnumerable<KeyValuePair<TKey, TValue>>; product(this: Iterable<number>): number; product(selector: Selector<KeyValuePair<TKey, TValue>, number>): number; reverse(): IEnumerable<KeyValuePair<TKey, TValue>>; rightJoin<TInner, TGroupKey, TResult>(innerEnumerable: IEnumerable<TInner>, outerKeySelector: Selector<KeyValuePair<TKey, TValue>, TGroupKey>, innerKeySelector: Selector<TInner, TGroupKey>, resultSelector: JoinSelector<KeyValuePair<TKey, TValue> | null, TInner, TResult>, keyComparator?: EqualityComparator<TGroupKey>): IEnumerable<TResult>; rotate(shift: number): IEnumerable<KeyValuePair<TKey, TValue>>; scan(accumulator: Accumulator<KeyValuePair<TKey, TValue>, KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; scan<TAccumulate>(accumulator: Accumulator<KeyValuePair<TKey, TValue>, TAccumulate>, seed: TAccumulate): IEnumerable<TAccumulate>; select<TResult>(selector: IndexedSelector<KeyValuePair<TKey, TValue>, TResult>): IEnumerable<TResult>; selectMany<TResult>(selector: IndexedSelector<KeyValuePair<TKey, TValue>, Iterable<TResult>>): IEnumerable<TResult>; sequenceEqual(iterable: Iterable<KeyValuePair<TKey, TValue>>, comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): boolean; shuffle(): IEnumerable<KeyValuePair<TKey, TValue>>; single<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: TypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): TFiltered; single(predicate?: Predicate<KeyValuePair<TKey, TValue>>): KeyValuePair<TKey, TValue>; singleOrDefault<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: TypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): TFiltered | null; singleOrDefault(predicate?: Predicate<KeyValuePair<TKey, TValue>>): KeyValuePair<TKey, TValue> | null; skip(count: number): IEnumerable<KeyValuePair<TKey, TValue>>; skipLast(count: number): IEnumerable<KeyValuePair<TKey, TValue>>; skipUntil<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: IndexedTypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): IEnumerable<TFiltered>; skipUntil(predicate: IndexedPredicate<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; skipWhile(predicate: IndexedPredicate<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; span<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: TypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): [IEnumerable<TFiltered>, IEnumerable<KeyValuePair<TKey, TValue>>]; span(predicate: Predicate<KeyValuePair<TKey, TValue>>): [IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>]; standardDeviation(selector?: Selector<KeyValuePair<TKey, TValue>, number>, sample?: boolean): number; step(stepNumber: number): IEnumerable<KeyValuePair<TKey, TValue>>; sum(this: Iterable<number>): number; sum(selector: Selector<KeyValuePair<TKey, TValue>, number>): number; take(count: number): IEnumerable<KeyValuePair<TKey, TValue>>; takeLast(count: number): IEnumerable<KeyValuePair<TKey, TValue>>; takeUntil<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: IndexedTypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): IEnumerable<TFiltered>; takeUntil(predicate: IndexedPredicate<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; takeWhile<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: IndexedTypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): IEnumerable<TFiltered>; takeWhile(predicate: IndexedPredicate<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; tap(action: IndexedAction<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; toArray(): KeyValuePair<TKey, TValue>[]; toCircularLinkedList(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): CircularLinkedList<KeyValuePair<TKey, TValue>>; toCircularQueue(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): CircularQueue<KeyValuePair<TKey, TValue>>; toCircularQueue(capacity: number, comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): CircularQueue<KeyValuePair<TKey, TValue>>; toDictionary<TDictKey, TDictValue>(keySelector: Selector<KeyValuePair<TKey, TValue>, TDictKey>, valueSelector: Selector<KeyValuePair<TKey, TValue>, TDictValue>, valueComparator?: EqualityComparator<TDictValue>): Dictionary<TDictKey, TDictValue>; toEnumerableSet(): EnumerableSet<KeyValuePair<TKey, TValue>>; toImmutableCircularQueue(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): ImmutableCircularQueue<KeyValuePair<TKey, TValue>>; toImmutableCircularQueue(capacity: number, comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): ImmutableCircularQueue<KeyValuePair<TKey, TValue>>; toImmutableDictionary<TDictKey, TDictValue>(keySelector: Selector<KeyValuePair<TKey, TValue>, TDictKey>, valueSelector: Selector<KeyValuePair<TKey, TValue>, TDictValue>, valueComparator?: EqualityComparator<TDictValue>): ImmutableDictionary<TDictKey, TDictValue>; toImmutableList(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): ImmutableList<KeyValuePair<TKey, TValue>>; toImmutablePriorityQueue(comparator?: OrderComparator<KeyValuePair<TKey, TValue>>): ImmutablePriorityQueue<KeyValuePair<TKey, TValue>>; toImmutableQueue(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): ImmutableQueue<KeyValuePair<TKey, TValue>>; toImmutableSet(): ImmutableSet<KeyValuePair<TKey, TValue>>; toImmutableSortedDictionary<TDictKey, TDictValue>(keySelector: Selector<KeyValuePair<TKey, TValue>, TDictKey>, valueSelector: Selector<KeyValuePair<TKey, TValue>, TDictValue>, keyComparator?: OrderComparator<TDictKey>, valueComparator?: EqualityComparator<TDictValue>): ImmutableSortedDictionary<TDictKey, TDictValue>; toImmutableSortedSet(comparator?: OrderComparator<KeyValuePair<TKey, TValue>>): ImmutableSortedSet<KeyValuePair<TKey, TValue>>; toImmutableStack(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): ImmutableStack<KeyValuePair<TKey, TValue>>; toLinkedList(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): LinkedList<KeyValuePair<TKey, TValue>>; toList(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): List<KeyValuePair<TKey, TValue>>; toLookup<TLookupKey, TLookupValue>(keySelector: Selector<KeyValuePair<TKey, TValue>, TLookupKey>, valueSelector: Selector<KeyValuePair<TKey, TValue>, TLookupValue>, keyComparator?: OrderComparator<TLookupKey>): ILookup<TLookupKey, TLookupValue>; toMap<TMapKey, TMapValue>(keySelector: Selector<KeyValuePair<TKey, TValue>, TMapKey>, valueSelector: Selector<KeyValuePair<TKey, TValue>, TMapValue>): Map<TMapKey, TMapValue>; toObject<TObjectKey extends PropertyKey, TObjectValue>(keySelector: Selector<KeyValuePair<TKey, TValue>, TObjectKey>, valueSelector: Selector<KeyValuePair<TKey, TValue>, TObjectValue>): Record<TObjectKey, TObjectValue>; toPriorityQueue(comparator?: OrderComparator<KeyValuePair<TKey, TValue>>): PriorityQueue<KeyValuePair<TKey, TValue>>; toQueue(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): Queue<KeyValuePair<TKey, TValue>>; toSet(): Set<KeyValuePair<TKey, TValue>>; toSortedDictionary<TDictKey, TDictValue>(keySelector: Selector<KeyValuePair<TKey, TValue>, TDictKey>, valueSelector: Selector<KeyValuePair<TKey, TValue>, TDictValue>, keyComparator?: OrderComparator<TDictKey>, valueComparator?: EqualityComparator<TDictValue>): SortedDictionary<TDictKey, TDictValue>; toSortedSet(comparator?: OrderComparator<KeyValuePair<TKey, TValue>>): SortedSet<KeyValuePair<TKey, TValue>>; toStack(comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): Stack<KeyValuePair<TKey, TValue>>; toString(): string; toString(selector?: Selector<KeyValuePair<TKey, TValue>, string>): string; union(iterable: Iterable<KeyValuePair<TKey, TValue>>, comparator?: EqualityComparator<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; unionBy<TUnionKey>(iterable: Iterable<KeyValuePair<TKey, TValue>>, keySelector: Selector<KeyValuePair<TKey, TValue>, TUnionKey>, comparator?: EqualityComparator<TUnionKey>): IEnumerable<KeyValuePair<TKey, TValue>>; variance(selector?: Selector<KeyValuePair<TKey, TValue>, number>, sample?: boolean): number; where<TFiltered extends KeyValuePair<TKey, TValue>>(predicate: IndexedTypePredicate<KeyValuePair<TKey, TValue>, TFiltered>): IEnumerable<TFiltered>; where(predicate: IndexedPredicate<KeyValuePair<TKey, TValue>>): IEnumerable<KeyValuePair<TKey, TValue>>; windows(size: number): IEnumerable<IEnumerable<KeyValuePair<TKey, TValue>>>; zip<TSecond, TResult = [KeyValuePair<TKey, TValue>, TSecond]>(iterable: Iterable<TSecond>, zipper?: Zipper<KeyValuePair<TKey, TValue>, TSecond, TResult>): IEnumerable<[KeyValuePair<TKey, TValue>, TSecond]> | IEnumerable<TResult>; zipMany<TIterable extends readonly Iterable<unknown>[]>(...iterables: [...TIterable]): IEnumerable<[KeyValuePair<TKey, TValue>, ...UnpackIterableTuple<TIterable>]>; zipMany<TIterable extends readonly Iterable<unknown>[], TResult>(...iterablesAndZipper: [...TIterable, ZipManyZipper<[KeyValuePair<TKey, TValue>, ...UnpackIterableTuple<TIterable>], TResult>]): IEnumerable<TResult>; get keyValueComparator(): EqualityComparator<KeyValuePair<TKey, TValue>>; get valueComparator(): EqualityComparator<TValue>; abstract [Symbol.iterator](): Iterator<KeyValuePair<TKey, TValue>>; abstract containsKey(key: TKey): boolean; abstract containsValue(value: TValue, comparator?: EqualityComparator<TValue>): boolean; abstract entries(): IterableIterator<[TKey, TValue]>; abstract get(key: TKey): TValue | null; abstract keys(): ISet<TKey>; abstract size(): number; abstract values(): IImmutableCollection<TValue>; abstract get length(): number; } export declare abstract class AbstractSet<TElement> extends AbstractRandomAccessCollection<TElement> implements ISet<TElement> { protected constructor(comparator?: EqualityComparator<TElement>); exceptWith(other: Iterable<TElement>): void; intersectWith(other: Iterable<TElement>): void; isProperSubsetOf(other: Iterable<TElement>): boolean; isProperSupersetOf(other: Iterable<TElement>): boolean; isSubsetOf(other: Iterable<TElement>): boolean; isSupersetOf(other: Iterable<TElement>): boolean; overlaps(other: Iterable<TElement>): boolean; } export declare abstract class AbstractTree<TElement> extends AbstractRandomAccessCollection<TElement> implements ITree<TElement> { protected readonly orderComparator: OrderComparator<TElement>; protected root: INode<TElement> | null; protected treeSize: number; protected constructor(comparator?: OrderComparator<TElement>); [Symbol.iterator](): Iterator<TElement>; clear(): void; contains(element: TElement, comparator?: EqualityComparator<TElement>): boolean; find(predicate: Predicate<TElement>): TElement | null; findBy<TKey>(key: TKey, selector: Selector<TElement, TKey>, comparator?: OrderComparator<TKey>): TElement | null; forEach(action: IndexedAction<TElement>): void; getRootData(): TElement | null; isEmpty(): boolean; remove(element: TElement): boolean; removeBy<TKey>(key: TKey, selector: Selector<TElement, TKey>, comparator?: OrderComparator<TKey>): TElement | null; size(): number; toArray(): TElement[]; traverseToArray(direction?: TraverseType): TElement[]; get length(): number; protected toInorderArray(root: INode<TElement> | null, target: TElement[]): void; protected toPostorderArray(root: INode<TElement> | null, target: TElement[]): void; protected toPreorderArray(root: INode<TElement> | null, target: TElement[]): void; private containsRecursive; private findByRecursive; private findRecursive; private removeByRecursive; private toArrayRecursive; abstract add(element: TElement): boolean; abstract delete(element: TElement): void; abstract insert(element: TElement): void; abstract search(element: TElement): boolean; } export declare interface Accumulator<TElement, TAccumulate> { (acc: TAccumulate, item: TElement): TAccumulate; } /** * Combines the elements of the sequence by applying an accumulator to each element and optionally projecting the final result. * @template TElement Type of elements within the `source` iterable. * @template TAccumulate Type of the intermediate accumulator. Defaults to `TElement` when no seed is provided. * @template TResult Type returned when a `resultSelector` is supplied. * @param source The source iterable. * @param accumulator Function that merges the running accumulator with the next element. * @param seed Optional initial accumulator value. When omitted, the first element is used as the starting accumulator. * @param resultSelector Optional projection applied to the final accumulator before it is returned. * @returns {TAccumulate|TResult} The final accumulator (or its projection). * @throws {NoElementsException} Thrown when `source` has no elements and no `seed` is provided. * @remarks The source sequence is enumerated exactly once. Supply a `seed` to avoid exceptions on empty sequences and to control the accumulator type. * @example * ```typescript * const numbers = [1, 2, 3, 4, 5]; * const sum = aggregate(numbers, (acc, x) => acc + x); * console.log(sum); // 15 * * const product = aggregate(numbers, (acc, x) => acc * x, 1); * console.log(product); // 120 * ``` */ export declare function aggregate<TElement>(source: Iterable<TElement>, accumulator: Accumulator<TElement, TElement>): TElement; export declare function aggregate<TElement, TAccumulate>(source: Iterable<TElement>, accumulator: Accumulator<TElement, TAccumulate>, seed: TAccumulate): TAccumulate; export declare function aggregate<TElement, TAccumulate, TResult>(source: Iterable<TElement>, accumulator: Accumulator<TElement, TAccumulate>, seed: TAccumulate, resultSelector: Selector<TAccumulate, TResult>): TResult; /** * Groups elements by a computed key and aggregates each group by applying an accumulator within that group. * @template TElement Type of elements within the `source` iterable. * @template TKey Type returned by `keySelector` and used to organise groups. * @template TAccumulate Type of the accumulated value created for each group. * @param source The source iterable. * @param keySelector Selector that derives the grouping key for each element. * @param seedSelector Either an initial accumulator value applied to every group or a factory invoked with the group key to produce that value. * @param accumulator Function that merges the current accumulator with the next element in the group. * @param keyComparator Optional equality comparator used to match group keys. * @returns {IEnumerable<KeyValuePair<TKey, TAccumulate>>} A sequence containing one key-value pair per group and its aggregated result. * @remarks When `seedSelector` is a factory function, it is evaluated once per group to obtain the initial accumulator. * @example * ```typescript * const products = [ * { name: 'Apple', category: 'Fruit', price: 1.2 }, * { name: 'Banana', category: 'Fruit', price: 0.5 }, * { name: 'Carrot', category: 'Vegetable', price: 0.8 }, * { name: 'Broccoli', category: 'Vegetable', price: 1.5 }, * ]; * * const totalPriceByCategory = aggregateBy( * from(products), * p => p.category, * 0, * (acc, p) => acc + p.price * ).toArray(); * * console.log(totalPriceByCategory); * // [ * // { key: 'Fruit', value: 1.7 }, * // { key: 'Vegetable', value: 2.3 } * // ] * ``` */ export declare const aggregateBy: <TElement, TKey, TAccumulate = TElement>(source: IEnumerable<TElement>, keySelector: Selector<TElement, TKey>, seedSelector: Selector<TKey, TAccumulate> | TAccumulate, accumulator: Accumulator<TElement, TAccumulate>, keyComparator?: EqualityComparator<TKey>) => IEnumerable<KeyValuePair<TKey, TAccumulate>>; /** * Determines whether every element in the sequence satisfies the supplied predicate. * @template TElement Type of elements within the `source` iterable. * @param source The source iterable. * @param predicate Function that evaluates each element and returns `true` when it satisfies the condition. * @returns {boolean} `true` when all elements satisfy the predicate; otherwise, `false`. * @remarks Enumeration stops as soon as the predicate returns `false`. * @example * ```typescript * const numbers = [1, 2, 3, 4, 5]; * const allPositive = all(numbers, x => x > 0); * console.log(allPositive); // true * * const mixedNumbers = [-1, 2, 3, -4, 5]; * const allPositive2 = all(mixedNumbers, x => x > 0); * console.log(allPositive2); // false * ``` */ export declare const all: <TElement>(source: Iterable<TElement>, predicate: Predicate<TElement>) => boolean; /** * Determines whether the sequence contains at least one element that matches the optional predicate. * @template TElement Type of elements within the `source` iterable. * @param source The source iterable. * @param predicate Optional function used to test elements. When omitted, the function returns `true` if `source` contains any element. * @returns {boolean} `true` when a matching element is fo