/** * TTL cache with discrete iterations * Keys are stringified using JSON.stringify * * @template K the key type * @template T the value type */ export declare class LayoutCache { readonly maxAge: number; /** * The cache to use, contains item-age pairs */ private cache; /** * Creates a new layout cache * * @param maxAge the time (number of diagram renderings) after which items are removed from the cache */ constructor(maxAge: number); /** * Starts the next iteration */ nextIteration(): void; /** * Clears the cache */ clear(): void; /** * Gets the value if already present, otherwise computes it * Also refreshes the time to live of the value * * @param key the key of the cache entry * @param compute the function to compute the value if not present * @returns the value */ getOrCompute(key: K, compute: () => T): T; } //# sourceMappingURL=layoutCache.d.ts.map