@pkerschbaum/code-oss-file-service
Version:
VS Code ([microsoft/vscode](https://github.com/microsoft/vscode)) includes a rich "`FileService`" and "`DiskFileSystemProvider`" abstraction built on top of Node.js core modules (`fs`, `path`) and Electron's `shell` module. This package allows to use that
24 lines • 793 B
TypeScript
import { CancellationToken } from '../../base/common/cancellation';
import { IDisposable } from '../../base/common/lifecycle';
export interface CacheResult<T> extends IDisposable {
promise: Promise<T>;
}
export declare class Cache<T> {
private task;
private result;
constructor(task: (ct: CancellationToken) => Promise<T>);
get(): CacheResult<T>;
}
/**
* 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 LRUCachedComputed<TArg, TComputed> {
private readonly computeFn;
private lastCache;
private lastArgKey;
constructor(computeFn: (arg: TArg) => TComputed);
get(arg: TArg): TComputed;
}
//# sourceMappingURL=cache.d.ts.map