import * as O from "../../../Option/index.js"; import { AtomicNumber } from "../../../Support/AtomicNumber/index.js"; export declare const HashMapTypeId: unique symbol; export declare type HashMapTypeId = typeof HashMapTypeId; declare class Node implements Iterable { readonly k: K; v: V; next?: Node | undefined; constructor(k: K, v: V, next?: Node | undefined); [Symbol.iterator](): Iterator; } /** * A Mutable HashMap */ export declare class HashMap implements Iterable { readonly _typeId: HashMapTypeId; readonly backingMap: Map>; readonly length: AtomicNumber; get(k: K): O.Option; remove(k: K): HashMap; set(k: K, v: V): HashMap; update(k: K, f: (v: V) => V): HashMap; [Symbol.iterator](): Iterator; } /** * Creates a new map */ export declare function make(): HashMap; /** * Creates a new map from an Iterable */ export declare function from(xs: Iterable): HashMap; /** * Lookup the value for `key` in `map` using internal hash function. */ export declare function get_(map: HashMap, key: K): O.Option; /** * Lookup the value for `key` in `map` using internal hash function. * * @ets_data_first get_ */ export declare function get(key: K): (map: HashMap) => O.Option; /** * Store `value` for `key` in `map` using internal hash function. */ export declare function set_(map: HashMap, key: K, value: V): HashMap; /** * Store `value` for `key` in `map` using internal hash function. * * @ets_data_first set_ */ export declare function set(key: K, value: V): (map: HashMap) => HashMap; /** * Remove the entry for `key` in `map` using internal hash. */ export declare function remove_(map: HashMap, key: K): HashMap; /** * Remove the entry for `key` in `map` using internal hash. * * @ets_data_first remove_ */ export declare function remove(key: K): (map: HashMap) => HashMap; /** * Calculate the number of key/value pairs in a map */ export declare function size(map: HashMap): number; /** * Update a value if exists */ export declare function update_(map: HashMap, key: K, f: (v: V) => V): HashMap; /** * Update a value if exists * * @ets_data_first update_ */ export declare function update(key: K, f: (v: V) => V): (map: HashMap) => HashMap; /** * Alter the value stored for `key` in `map` using function `f` using internal hash function. * * `f` is invoked with the current value for `k` if it exists, * or no arguments if no such value exists. * * `modify` will always either update or insert a value into the map. * Returns a map with the modified value. Does not alter `map`. */ export declare function modify_(map: HashMap, key: K, f: (v: O.Option) => O.Option): HashMap; /** * Alter the value stored for `key` in `map` using function `f` using internal hash function. * * `f` is invoked with the current value for `k` if it exists, * or no arguments if no such value exists. * * `modify` will always either update or insert a value into the map. * Returns a map with the modified value. Does not alter `map`. * * @ets_data_first modify_ */ export declare function modify(key: K, f: (v: O.Option) => O.Option): (map: HashMap) => HashMap; export {}; //# sourceMappingURL=index.d.ts.map