import { type Factory, type Function1, type Function2, type Function3, type Optional, type SideEffect1, type SideEffect2, type Tuple2 } from "./functions.js"; export declare const EnumeratorLike_current: unique symbol; export declare const EnumeratorLike_hasCurrent: unique symbol; export declare const EnumeratorLike_isCompleted: unique symbol; export declare const EnumeratorLike_move: unique symbol; /** * An interactive mutable enumerator that can be used to iterate * over an underlying source of data. * * @noInheritDoc */ export interface EnumeratorLike { /** * Indicates if the `EnumeratorLike` is completed. */ readonly [EnumeratorLike_isCompleted]: boolean; /** * Returns the element if present. */ readonly [EnumeratorLike_current]: T; /** * Indicates if the `EnumeratorLike` has a current value. */ readonly [EnumeratorLike_hasCurrent]: boolean; /** * Advances the enumerator to the next value, if present. * * @returns true if successful, otherwise false. */ [EnumeratorLike_move](): boolean; } export declare const EnumerableLike_enumerate: unique symbol; /** * @noInheritDoc */ export interface EnumerableLike extends Iterable { [EnumerableLike_enumerate](): EnumeratorLike; } /** * @noInheritDoc */ export type ReadonlyObjectMapLike = { readonly [P in TKey]?: T; }; export declare const DictionaryLike_get: unique symbol; export declare const DictionaryLike_keys: unique symbol; /** * @noInheritDoc */ export interface DictionaryLike { readonly [DictionaryLike_keys]: EnumerableLike; [DictionaryLike_get](index: TKey): Optional; } export declare const Collection_T: unique symbol; export declare const Collection_type: unique symbol; export declare const Collection_TKey: unique symbol; /** * @noInheritDoc */ export interface Collection { readonly [Collection_T]?: unknown; readonly [Collection_type]?: unknown; readonly [Collection_TKey]?: TKey; } /** */ export type KeyOf = NonNullable; /** */ export type CollectionOf = KeyOf> = C extends { readonly [Collection_type]?: unknown; } ? NonNullable<(C & { readonly [Collection_T]: T; readonly [Collection_TKey]: TKey; })[typeof Collection_type]> : { readonly _C: C; readonly _T: () => T; readonly _TKey: () => TKey; }; /** * Utility type for a generic operator function that transforms a Collection's inner value type. */ export type CollectionOperator = KeyOf> = Function1, CollectionOf>; /** * @noInheritDoc */ export interface CollectionModule { /** * Return an Collection that emits no items. * */ empty = KeyOf>(): CollectionOf; /** */ entries = KeyOf>(): Function1, EnumerableLike>>; forEach = KeyOf>(selector: SideEffect2): SideEffect1>; keep = KeyOf>(predicate: Function2): CollectionOperator; /** * */ keys>(): Function1, EnumerableLike>; /** * Returns a CollectionOperator that applies the `selector` function to each * value emitted by the source. * * @param selector - A pure map function that is applied each value emitted by the source * @typeparam TA - The inner type of the source container * @typeparam TB - The inner type of the mapped container * */ map = KeyOf>(selector: Function2): CollectionOperator; /** */ reduce = KeyOf>(reducer: Function3, initialValue: Factory): Function1, TAcc>; /** * */ toDictionary>(): Function1, DictionaryLike>; /** * */ toReadonlyMap>(): Function1, ReadonlyMap>; /** * */ values = KeyOf>(): Function1, EnumerableLike>; } /** * @noInheritDoc */ export interface DictionaryCollectionModule extends CollectionModule { fromEntries>(): Function1>, CollectionOf>; union(m2: CollectionOf): Function1, CollectionOf>; } export declare const keySet: >(keys: >() => Function1, EnumerableLike>) => = KeyOf>(collection: CollectionOf) => ReadonlySet;