/** * @module * * MeekMap data collection. */ /** * Like WeakMap. * * @template K Key type. * @template V Value type. */ export declare class MeekMap { /** * Type string. */ readonly [Symbol.toStringTag]: string; /** * Create a new MeekMap. * * @param iterable Initial pairs. */ constructor(iterable?: Iterable | null); /** * Iterator for key-value pairs in this map. * * @returns Key-value iterator. */ [Symbol.iterator](): MapIterator<[K, V]>; /** * Clear this map. */ clear(): void; /** * Delete a key from this map. * * @param key Key to delete. * @returns Whether the key was deleted. */ delete(key: K): boolean; /** * Iterator for key-value pairs in this map. * * @returns Key-value iterator. */ entries(): MapIterator<[K, V]>; /** * Call a function for each pair in this map. * * @param callbackfn Callback function. * @param thisArg This argument. */ forEach(callbackfn: (value: V, key: K, map: MeekMap) => void, thisArg?: any): void; /** * Get the value for a key from this map. * * @param key Key to get. * @returns Value for the key. */ get(key: K): V | undefined; /** * Get the value for a key from this map or insert the default value. * * @param key Key to get. * @param defaultValue Default value. * @returns Value for the key. */ getOrInsert(key: K, defaultValue: V): V; /** * Get the value for a key from this map or insert computed default value. * * @param key Key to get. * @param callback Compute the default value. * @returns Value for the key. */ getOrInsertComputed(key: K, callback: (key: K) => V): V; /** * Has a key in this map. * * @param key Key to check. * @returns Whether the key is in this map. */ has(key: K): boolean; /** * Iterator for keys in this map. * * @returns Key iterator. */ keys(): MapIterator; /** * Set a value for a key in this map. * * @param key Key to set. * @param value Value to set. * @returns This map. */ set(key: K, value: V): this; /** * The number of keys in this map. * Can be greater than number of active keys. */ get size(): number; /** * Iterator for values in this map. * * @returns Value iterator. */ values(): MapIterator; } /** * Readonly MeekMap. * * @template K Key type. * @template V Value type. */ export type ReadonlyMeekMap = Omit, 'clear' | 'delete' | 'getOrInsert' | 'getOrInsertComputed' | 'set'>; //# sourceMappingURL=map.d.ts.map