/// /// module Rx { export interface ObservableStatic { /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * @param {Mixed} error An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ throw(exception: Error, scheduler?: IScheduler): Observable; /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * @param {Mixed} error An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ throw(exception: any, scheduler?: IScheduler): Observable; } } (function () { var o : Rx.Observable; o = Rx.Observable.throw(new Error()); o = Rx.Observable.throw(new Error(), Rx.Scheduler.async); o = Rx.Observable.throw('abc'); o = Rx.Observable.throw('abc', Rx.Scheduler.async); });