@rimbu/sorted
Version:
Immutable SortedMap and SortedSet implementations for TypeScript
26 lines (25 loc) • 1.34 kB
text/typescript
import type { RelatedTo } from '@rimbu/common';
import { type StreamSource } from '@rimbu/stream';
import type { SortedSet } from '@rimbu/sorted/set';
import type { SortedSetContext } from '@rimbu/sorted/set-custom';
import { SortedBuilder } from '@rimbu/sorted/common';
export declare class SortedSetBuilder<T> extends SortedBuilder<T> {
readonly context: SortedSetContext<T>;
source?: undefined | SortedSet<T>;
_entries?: undefined | T[];
_children?: undefined | SortedSetBuilder<T>[];
size: number;
constructor(context: SortedSetContext<T>, source?: undefined | SortedSet<T>, _entries?: undefined | T[], _children?: undefined | SortedSetBuilder<T>[], size?: number);
createNew(source?: undefined | SortedSet<T>, entries?: undefined | T[], children?: undefined | SortedSetBuilder<T>[], size?: undefined | number): SortedSetBuilder<T>;
prepareMutate(): void;
get children(): SortedSetBuilder<T>[];
set children(value: SortedSetBuilder<T>[]);
has: <U>(value: RelatedTo<T, U>) => boolean;
add: (value: T) => boolean;
addAll: (source: StreamSource<T>) => boolean;
remove: <U>(value: RelatedTo<T, U>) => boolean;
removeAll: <U>(values: StreamSource<RelatedTo<T, U>>) => boolean;
build: () => SortedSet<T>;
addInternal(value: T): boolean;
removeInternal(value: T): boolean;
}