/// <reference path="../../../../../angular2/typings/es6-promise/es6-promise.d.ts" />
/// <reference path="../../../../../angular2/typings/rx/rx.all.d.ts" />
export declare var __esModule: boolean;
import * as Rx from 'rx';
export declare var Promise: any;
export declare class PromiseWrapper {
    static resolve(obj: any): Promise<any>;
    static reject(obj: any, _: any): Promise<any>;
    static catchError<T>(promise: Promise<T>, onError: (error: any) => T | Thenable<T>): Promise<T>;
    static all(promises: List<Promise<any>>): Promise<any>;
    static then<T>(promise: Promise<T>, success: (value: any) => T | Thenable<T>, rejection: (error: any, stack?: any) => T | Thenable<T>): Promise<T>;
    static completer(): {
        promise: any;
        resolve: any;
        reject: any;
    };
    static setTimeout(fn: Function, millis: int): int;
    static clearTimeout(id: int): void;
    static setInterval(fn: Function, millis: int): int;
    static clearInterval(id: int): void;
    static isPromise(maybePromise: any): boolean;
}
export declare class ObservableWrapper {
    static subscribe(emitter: Observable, onNext: any, onThrow?: any, onReturn?: any): Object;
    static isObservable(obs: any): boolean;
    static dispose(subscription: any): void;
    static callNext(emitter: EventEmitter, value: any): void;
    static callThrow(emitter: EventEmitter, error: any): void;
    static callReturn(emitter: EventEmitter): void;
}
export declare class Observable {
    observer(generator: any): Object;
}
/**
 * Use Rx.Observable but provides an adapter to make it work as specified here:
 * https://github.com/jhusain/observable-spec
 *
 * Once a reference implementation of the spec is available, switch to it.
 */
export declare class EventEmitter extends Observable {
    _subject: Rx.Subject<any>;
    _immediateScheduler: any;
    constructor();
    observer(generator: any): Rx.IDisposable;
    toRx(): Rx.Observable<any>;
    next(value: any): void;
    throw(error: any): void;
    return(value: any): void;
}
