import { IObservable, IDestroyable, ICancellation, IObserver } from "./interfaces"; declare type Handler = (x: T) => void; declare type Initializer = (notify: Handler, error: (e: any) => void, complete: () => void) => void; export declare class Observable implements IObservable { private _once; private _observers; private _complete; private _error; constructor(func?: Initializer); /** * Registers handlers for the current observable object. * * @param next the handler for events * @param error the handler for a error * @param complete the handler for a completion * @returns {IDestroyable} the handler for the current subscription, this * handler can be used to unsubscribe from events. * */ on(next: Handler, error?: Handler, complete?: () => void): IDestroyable; subscribe(next: IObserver | Handler, error?: Handler, complete?: () => void): IDestroyable; private _addObserver; /** * Waits for the next event. This method can't be used to read messages * as a sequence since it can skip some messages between calls. * * @param ct a cancellation token */ next(ct?: ICancellation): Promise; private _addOnce; protected onObserverException(e: any): void; private _removeOnce; private _removeObserver; private _notify; protected _notifyNext(evt: T): void; protected _notifyError(e: any): void; protected _notifyCompleted(): void; } export {};