image-in-browser
Version:
Package for encoding / decoding images, transforming images, applying filters, drawing primitives on images on the client side (no need for server Node.js)
18 lines (17 loc) • 723 B
TypeScript
/** @format */
/**
* Abstract class containing utility methods for Map operations.
*/
export declare abstract class MapUtils {
/**
* Returns the value associated with the specified key if it exists in the map.
* If the key is not present, computes a new value using the provided function,
* inserts it into the map, and returns the new value.
*
* @param {Map<K, V>} map - The map to operate on.
* @param {K} key - The key to look up.
* @param {() => V} ifAbsent - Function to generate a value if the key is absent.
* @returns {V} The existing or newly created value associated with the key.
*/
static putIfAbsent<K, V>(map: Map<K, V>, key: K, ifAbsent: () => V): V;
}