/** * Python style dictionary */ export default class Dict { private readonly internalMap; constructor(internalMap?: Map); get size(): number; [Symbol.iterator](): MapIterator<[K, V]>; get(key: K): V | undefined; set(key: K, value: V): Map; has(key: K): boolean; /** * Similar to how the python dictionary's setdefault function works: * If the key is not present, it is set to the given value, then that value is returned * Otherwise, `setdefault` returns the value stored in the dictionary without * modifying it */ setdefault(key: K, value: V): NonNullable; update(key: K, defaultVal: V, updater: (oldV: V) => V): V; entries(): [K, V][]; forEach(func: (key: K, value: V) => void): void; /** * Similar to `mapAsync`, but for an async mapping function that does not return any value */ forEachAsync(func: (k: K, v: V, index: number) => Promise): Promise; map(func: (key: K, value: V, index: number) => T): T[]; /** * Using a mapping function that returns a promise, transform a map * to another map with different keys and values. All calls to the mapping function * execute asynchronously */ mapAsync(func: (key: K, value: V, index: number) => Promise): Promise[]>; flatMap(func: (key: K, value: V, index: number) => U[]): U[]; } /** * Convenience class for maps that store an array of values */ export declare class ArrayMap extends Dict { add(key: K, item: V): void; } /** * Create an ArrayMap from an iterable of key value pairs */ export declare function arrayMapFrom>(pairs: Iterable<[K, V]>): ArrayMap; export declare function arrayMapFrom(pairs: Iterable<[K, V]>): ArrayMap;