import { IObservable } from "../base.js"; export declare class ObservableLazy { private readonly _computeValue; private readonly _value; /** * The cached value. * Does not force a computation of the value. */ get cachedValue(): IObservable; constructor(_computeValue: () => T); /** * Returns the cached value. * Computes the value if the value has not been cached yet. */ getValue(): T; } /** * A promise whose state is observable. */ export declare class ObservablePromise { static fromFn(fn: () => Promise): ObservablePromise; static resolved(value: T): ObservablePromise; private readonly _value; /** * The promise that this object wraps. */ readonly promise: Promise; /** * The current state of the promise. * Is `undefined` if the promise didn't resolve yet. */ readonly promiseResult: IObservable | undefined>; constructor(promise: Promise); readonly resolvedValue: import("../base.js").IObservableWithChange; } export declare class PromiseResult { /** * The value of the resolved promise. * Undefined if the promise rejected. */ readonly data: T | undefined; /** * The error in case of a rejected promise. * Undefined if the promise resolved. */ readonly error: unknown | undefined; constructor( /** * The value of the resolved promise. * Undefined if the promise rejected. */ data: T | undefined, /** * The error in case of a rejected promise. * Undefined if the promise resolved. */ error: unknown | undefined); /** * Returns the value if the promise resolved, otherwise throws the error. */ getDataOrThrow(): T; } /** * A lazy promise whose state is observable. */ export declare class ObservableLazyPromise { private readonly _computePromise; private readonly _lazyValue; /** * Does not enforce evaluation of the promise compute function. * Is undefined if the promise has not been computed yet. */ readonly cachedPromiseResult: import("../base.js").IObservableWithChange | undefined, void>; constructor(_computePromise: () => Promise); getPromise(): Promise; }