import { MarshaledObjectLifetime, RpcMarshalable } from './MarshalableObject'; /** * An observer of some value production. */ export interface IObserver { /** * Notifies the observer of the next object in the sequence. * @param value The next value in the observable sequence. */ onNext(value: T): void; /** * Notifies the observer that the end of the sequence has been reached, and that no more values will be produced. */ onCompleted(): void; /** * Notifies the observer that an error occurred at the value source, and that no more values will be produced. * @param reason The error that occurred at the value source. */ onError(reason: any): void; } export interface IObservable { /** * Adds an observer to an observable object. * @param observer The observer to receive values. * @returns A function to call to cancel the subscription. */ subscribe(observer: IObserver): () => void; } export declare class Observer implements IObserver, RpcMarshalable { private readonly next; private readonly completion?; readonly _jsonRpcMarshalableLifetime: MarshaledObjectLifetime; error: any; get completed(): boolean; constructor(next: (value: T) => void, completion?: ((error?: any) => void) | undefined); onNext(value: T): void; onCompleted(): void; onError(reason: any): void; }