/** * Represents a class that can be used to create a singleton instance of a class that is created asynchronously. */ export default class AsyncSingleton { private readonly factory; private readonly checker; private queue; private instantiating; private value?; /** * Creates a new instance of the AsyncSingleton class. * @param factory The factory function that creates the instance. * @param checker The function that checks if the instance is valid. */ constructor(factory: (r: R) => Promise, checker?: (value: T) => Promise); /** * Gets the instance of the class. * @param r The configuration object for creating the instance. */ instance(r: R): Promise; /** * Gets the current value, may be undefined or invalid. */ getValue(): T | undefined; /** * Clears the current value and rejects all pending promises. */ clear(): void; private initHere; private awaitOtherInit; }