parallel-es
Version:
Simple parallelization for EcmaScript
33 lines (32 loc) • 1.06 kB
TypeScript
/**
* A very simple implementation of a map. Do not use with complex objects as Key.
* @param K type of the key
* @param V type of the value
*/
export declare class SimpleMap<K, V> {
private data;
/**
* Gets the value for the given key if available
* @param key the key to look up
* @returns the looked up value or undefined if the map does not contain any value associated with the given key
*/
get(key: K): V | undefined;
/**
* Tests if the map contains value stored by the given key
* @param key the key
* @returns true if the map contains a value by the given key, false otherwise
*/
has(key: K): boolean;
/**
* Sets the value for the given key. If the map already contains a value stored by the given key, then this value is
* overridden
* @param key the key
* @param value the value to associate with the given key
*/
set(key: K, value: V): void;
/**
* Clears all values from the map
*/
clear(): void;
private toInternalKey(key);
}