/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ /** * Helper class for lazy initialized values. Ensures the value is only generated once, and remain immutable. * @internal */ export declare class Lazy { private readonly valueGenerator; private _value; private _evaluated; /** * Instantiates an instance of Lazy. * @param valueGenerator - The function that will generate the value when value is accessed the first time. */ constructor(valueGenerator: () => T); /** * Return true if the value as been generated, otherwise false. */ get evaluated(): boolean; /** * Get the value. If this is the first call the value will be generated. */ get value(): T; } /** * A lazy evaluated promise. The execute function is delayed until * the promise is used, e.g. await, then, catch ... * The execute function is only called once. * All calls are then proxied to the promise returned by the execute method. * @legacy @beta */ export declare class LazyPromise implements Promise { private readonly execute; get [Symbol.toStringTag](): string; private result; constructor(execute: () => Promise); then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined): Promise; catch(onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; finally(onfinally?: (() => void) | null | undefined): Promise; private getPromise; } //# sourceMappingURL=lazy.d.ts.map