simple-bimap
Version:
<div align="center"> <h1>🗺️↔️ simple-bimap</h1> <a href="https://www.npmjs.com/package/simple-bimap"> <img src="https://img.shields.io/npm/v/simple-bimap" alt="simple-bimap on npm"> </a> <a href="https://github.com/aleksander-ciesielski/
21 lines (20 loc) • 769 B
TypeScript
export declare class Bimap<K, V> implements Map<K, V> {
readonly [Symbol.toStringTag]: string;
private readonly keyMap;
private readonly valueMap;
get size(): number;
constructor(entries?: Iterable<readonly [K, V]> | null);
get(key: K): V | undefined;
getByValue(value: V): K | undefined;
set(key: K, value: V): this;
has(key: K): boolean;
hasValue(value: V): boolean;
entries(): IterableIterator<[K, V]>;
keys(): IterableIterator<K>;
values(): IterableIterator<V>;
[Symbol.iterator](): IterableIterator<[K, V]>;
clear(): void;
delete(key: K): boolean;
deleteByValue(value: V): boolean;
forEach(callbackFn: (value: V, key: K, map: Bimap<K, V>) => void, thisArg?: any): void;
}