import { Undefinable } from "./Types"; /** * Lazy wrapper for a factory. */ export default class Lazy { #private; /** * Create a new Lazy object that invokes the factory when * `value` is called for the first time. * * By default, if the factory returns `undefined`, the value of * `isValueCreated` will not be true. To alter this set * `waitForValue` to false. */ constructor(factory: () => T, waitForValue?: boolean); /** * Get or create the value. */ get value(): Undefinable; /** * Returns `true` if the value has been created. */ get isValueCreated(): boolean; }