/** * Links an arrow function to an LRU cache. The function converts * a string to a value of type T. The string itself is used as * the cache key. * * Examples: * * Caching a number or date pattern. The cache key is the string * representation of the pattern. * * Caching any object that is expensive to create, where the cache * key identifies the type of object to cache. * * @public */ export declare class Cache { private builder; private storage; constructor(builder: (s: string) => T, capacity: number); /** * Return the number of items stored in the cache. * * @public */ size(): number; /** * Fetch an item from the cache. If the item is not found, * it will be built and stored in the cache. * * @public */ get(raw: string): T; }