@d1g1tal/collections
Version:
JavaScript Collections ES Modules
19 lines (16 loc) • 666 B
TypeScript
import { List } from './list.js';
/** A {@link Map} that can contain multiple values for the same key */
declare class MultiMap<K, V> extends Map<K, List<V>> {
/**
* Adds a new element with a specified key and value to the MultiMap.
* If an element with the same key already exists, the value will be added to the underlying {@link List}.
*
* @override
* @param {K} key The key to set.
* @param {V} value The value to add to the MultiMap
* @returns {MultiMap<K, V>} The MultiMap with the updated key and value.
*/
set(key: K, value: V): MultiMap<K, V>;
get [Symbol.toStringTag](): string;
}
export { MultiMap };