import { ISettableObservable, ITransaction } from "../base.js"; import { BaseObservable } from "./baseObservable.js"; import { EqualityComparer, IDisposable } from "../commonFacade/deps.js"; import { DebugNameData } from "../debugName.js"; import { DebugLocation } from "../debugLocation.js"; /** * Creates an observable value. * Observers get informed when the value changes. * @template TChange An arbitrary type to describe how or why the value changed. Defaults to `void`. * Observers will receive every single change value. */ export declare function observableValue(name: string, initialValue: T): ISettableObservable; export declare function observableValue(owner: object, initialValue: T): ISettableObservable; export declare class ObservableValue extends BaseObservable implements ISettableObservable { private readonly _debugNameData; private readonly _equalityComparator; protected _value: T; get debugName(): string; constructor(_debugNameData: DebugNameData, initialValue: T, _equalityComparator: EqualityComparer, debugLocation: DebugLocation); get(): T; set(value: T, tx: ITransaction | undefined, change: TChange): void; toString(): string; protected _setValue(newValue: T): void; debugGetState(): { value: T; }; debugSetValue(value: unknown): void; } /** * A disposable observable. When disposed, its value is also disposed. * When a new value is set, the previous value is disposed. */ export declare function disposableObservableValue(nameOrOwner: string | object, initialValue: T, debugLocation?: DebugLocation): ISettableObservable & IDisposable; export declare class DisposableObservableValue extends ObservableValue implements IDisposable { protected _setValue(newValue: T): void; dispose(): void; }