UNPKG

scats

Version:

Useful scala classes in typescript

26 lines (25 loc) 1.04 kB
import { ArrayIterable } from './array-iterable.js'; import { Option } from './option.js'; import { HashSet } from './hashset.js'; import { Collection } from './collection.js'; export declare type Tuple2<K, V> = [K, V]; export declare abstract class AbstractMap<K, V, S extends AbstractMap<K, V, any>> extends ArrayIterable<Tuple2<K, V>, S> { protected readonly map: Map<K, V>; protected constructor(map: Map<K, V>); get size(): number; get isEmpty(): boolean; get(key: K): Option<V>; getOrElse(key: K, defaultValue: () => V): V; getOrElseValue(key: K, defaultValue: V): V; get keySet(): HashSet<K>; get keyIterator(): IterableIterator<K>; get keys(): Collection<K>; get values(): Collection<V>; get valueIterator(): IterableIterator<V>; get entries(): Collection<Tuple2<K, V>>; get entriesIterator(): IterableIterator<Tuple2<K, V>>; containsKey(key: K): boolean; get toCollection(): Collection<Tuple2<K, V>>; get toMap(): Map<K, V>; get toArray(): Array<Tuple2<K, V>>; }