import { CaughtException, IDerivation, IDerivationState_, IEqualsComparer, IObservable, Lambda } from "../internal"; export interface IComputedValue { get(): T; set(value: T): void; } export interface IComputedValueOptions { get?: () => T; set?: (value: T) => void; name?: string; equals?: IEqualsComparer; context?: any; requiresReaction?: boolean; keepAlive?: boolean; } export type IComputedDidChange = { type: "update"; observableKind: "computed"; object: unknown; debugObjectName: string; newValue: T; oldValue: T | undefined; }; export declare class ComputedValue implements IObservable, IComputedValue, IDerivation { dependenciesState_: IDerivationState_; observing_: IObservable[]; newObserving_: null; observers_: Set; runId_: number; lastAccessedBy_: number; lowestObserverState_: IDerivationState_; unboundDepsCount_: number; protected value_: T | undefined | CaughtException; name_: string; triggeredBy_?: string; private flags_; derivation: () => T; setter_?: (value: T) => void; scope_: Object | undefined; private equals_; private requiresReaction_; keepAlive_: boolean; /** * Create a new computed value based on a function expression. * * The `name` property is for debug purposes only. * * The `equals` property specifies the comparer function used to determine if a newly produced * value differs from the previous value. Structural comparison can be convenient if you always * produce a new aggregated object and don't want to notify observers if it is structurally the same. * This is useful for working with vectors, mouse coordinates etc. */ constructor(options: IComputedValueOptions); onBecomeStale_(): void; onBOL: Set | undefined; onBUOL: Set | undefined; onBO(): void; onBUO(): void; private get isComputing(); private set isComputing(value); private get isRunningSetter(); private set isRunningSetter(value); get isBeingObserved(): boolean; set isBeingObserved(newValue: boolean); get isPendingUnobservation(): boolean; set isPendingUnobservation(newValue: boolean); get diffValue(): 0 | 1; set diffValue(newValue: 0 | 1); /** * Returns the current value of this computed value. * Will evaluate its computation first if needed. */ get(): T; set(value: T): void; trackAndCompute(): boolean; computeValue_(track: boolean): T | CaughtException; suspend_(): void; warnAboutUntrackedRead_(): void; toString(): string; valueOf(): T; [Symbol.toPrimitive](): T; } export declare const isComputedValue: (x: any) => x is ComputedValue;