import type { Comparator } from '../../common'; export interface TreeSetOptions { comparator?: Comparator; /** * Pass-through to the underlying RedBlackTree/BST `isMapMode` option. * * - `true` (default in core): store values in an internal key→value store. * - `false`: store values on tree nodes (Node Mode). */ isMapMode?: boolean; /** * Enable order-statistic operations (select, rank, rangeByRank). */ enableOrderStatistic?: boolean; /** * Transform raw elements into keys. * When provided, the constructor accepts `Iterable` instead of `Iterable`. */ toElementFn?: (rawElement: R) => K; } export type TreeSetRangeOptions = { lowInclusive?: boolean; highInclusive?: boolean; }; /** * Callback used by TreeSet element-wise utilities. * * `SELF` is intentionally generic to avoid type-layer circular imports. * Implementations (e.g. `TreeSet`) should bind `SELF` at use sites. */ export type TreeSetElementCallback = (value: K, index: number, set: SELF) => R; /** * Reducer callback used by TreeSet. * * `SELF` is intentionally generic to avoid type-layer circular imports. */ export type TreeSetReduceCallback = (acc: A, value: K, index: number, set: SELF) => A;