scats
Version:
Useful scala classes in typescript
25 lines (24 loc) • 1.12 kB
TypeScript
import { Option } from '../option.js';
import { AbstractMap, Tuple2 } from '../abstract-map.js';
import * as immutable from '../hashmap.js';
export declare class HashMap<K, V> extends AbstractMap<K, V, HashMap<K, V>> {
constructor(map?: Map<K, V>);
protected fromArray(array: Tuple2<K, V>[]): HashMap<K, V>;
static of<K, V>(...values: Tuple2<K, V>[]): HashMap<K, V>;
static from<K, V>(values: Iterable<Tuple2<K, V>>): HashMap<K, V>;
addAll(values: Iterable<Tuple2<K, V>>): this;
updateWith(key: K): (remappingFunction: (maybeValue: Option<V>) => Option<V>) => Option<V>;
subtractAll(values: Iterable<K>): this;
clear(): void;
clone(): HashMap<K, V>;
filterInPlace(p: (entry: Tuple2<K, V>) => boolean): this;
mapValuesInPlace(f: (entry: Tuple2<K, V>) => V): this;
getOrElseUpdate(key: K, defaultValue: () => V): V;
set(key: K, value: V): this;
put(key: K, value: V): Option<V>;
remove(key: K): Option<V>;
update(key: K, value: V): void;
addOne(elem: Tuple2<K, V>): this;
subtractOne(key: K): this;
get toImmutable(): immutable.HashMap<K, V>;
}