/** Caches a value that must be loaded asynchronously. */ export default class CachedValue { /** The cached value. */ private cached; /** Loads the value to cache. */ private loader; /** Construct given the loader. */ constructor(loader: () => Promise); /** Returns the cached value, loading it if needed. */ value(): Promise; /** Defines a cached value with the given loader. */ static create(loader: () => Promise): CachedValue; }