pddl-workspace
Version:
32 lines (31 loc) • 1.01 kB
TypeScript
/**
* Map that stringifies the key objects in order to leverage
* the javascript native Map and preserve key uniqueness.
*/
export declare abstract class StringifyingMap<K, V> {
private map;
private keyMap;
has(key: K): boolean;
get(key: K): V | undefined;
set(key: K, value: V): StringifyingMap<K, V>;
/**
* Puts new key/value if key is absent.
* @param key key
* @param defaultValue default value factory
*/
putIfAbsent(key: K, defaultValue: () => V): boolean;
keys(): IterableIterator<K>;
keyList(): K[];
values(): IterableIterator<V>;
valueList(): V[];
delete(key: K): boolean;
clear(): void;
size(): number;
get length(): number;
forEach(callbackfn: (value: V, key: string, map: Map<string, V>) => void, thisArg?: unknown): void;
/**
* Turns the `key` object to a primitive `string` for the underlying `Map`
* @param key key to be stringified
*/
protected abstract stringifyKey(key: K): string;
}