import { CancellationToken } from '../../base/common/cancellation'; import { IDisposable } from '../../base/common/lifecycle'; export interface CacheResult extends IDisposable { promise: Promise; } export declare class Cache { private task; private result; constructor(task: (ct: CancellationToken) => Promise); get(): CacheResult; } /** * Uses a LRU cache to make a given parametrized function cached. * Caches just the last value. * The key must be JSON serializable. */ export declare class LRUCachedFunction { private readonly fn; private lastCache; private lastArgKey; constructor(fn: (arg: TArg) => TComputed); get(arg: TArg): TComputed; } /** * Uses an unbounded cache (referential equality) to memoize the results of the given function. */ export declare class CachedFunction { private readonly fn; private readonly _map; get cachedValues(): ReadonlyMap; constructor(fn: (arg: TArg) => TValue); get(arg: TArg): TValue; }