diff --git a/rx/rx-lite.d.ts b/rx/rx-lite.d.ts index c7a148137..4b5acb81d 100644 --- a/rx/rx-lite.d.ts +++ b/rx/rx-lite.d.ts @@ -49,6 +49,8 @@ declare module Rx { export module helpers { function noop(): void; + function notDefined(value: any): boolean; + function isScheduler(value: any): boolean; function identity(value: T): T; function defaultNow(): number; function defaultComparer(left: any, right: any): boolean; @@ -394,6 +396,50 @@ declare module Rx { defer(observableFactory: () => Observable): Observable; defer(observableFactory: () => IPromise): Observable; empty(scheduler?: IScheduler): Observable; + + /** + * This method creates a new Observable sequence from an array object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param mapFn Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ + from(array: T[], mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable; + /** + * This method creates a new Observable sequence from an array object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param [mapFn] Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ + from(array: T[], mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; + + /** + * This method creates a new Observable sequence from an array-like object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param mapFn Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ + from(array: { length: number;[index: number]: T; }, mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable; + /** + * This method creates a new Observable sequence from an array-like object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param [mapFn] Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ + from(array: { length: number;[index: number]: T; }, mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; + + /** + * This method creates a new Observable sequence from an array-like or iterable object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param [mapFn] Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ + from(iterable: any, mapFn?: (value: any, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; + fromArray(array: T[], scheduler?: IScheduler): Observable; fromArray(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable; diff --git a/rx/rx.async-lite.d.ts b/rx/rx.async-lite.d.ts index be13320c2..77dc23b57 100644 --- a/rx/rx.async-lite.d.ts +++ b/rx/rx.async-lite.d.ts @@ -16,46 +16,46 @@ declare module Rx { fromCallback: { // with single result callback without selector - (func: (callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: (result: TResult) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: (result: TResult) => any) => any, context?: any): () => Observable; + (func: (arg1: T1, callback: (result: TResult) => any) => any, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: (result: TResult) => any) => any, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: (result: TResult) => any) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any callback with selector - (func: (callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): () => Observable; + (func: (arg1: T1, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any callback without selector - (func: (callback: Function) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: Function) => any, context?: any): () => Observable; + (func: (arg1: T1, callback: Function) => any, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any function with selector - (func: Function, scheduler: IScheduler, context: any, selector: (args: TCallbackResult[]) => TResult): (...args: any[]) => Observable; + (func: Function, context: any, selector: (args: TCallbackResult[]) => TResult): (...args: any[]) => Observable; // with any function without selector - (func: Function, scheduler?: IScheduler, context?: any): (...args: any[]) => Observable; + (func: Function, context?: any): (...args: any[]) => Observable; }; fromNodeCallback: { // with single result callback without selector - (func: (callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: T) => any) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: (err: any, result: T) => any) => any, context?: any): () => Observable; + (func: (arg1: T1, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any callback with selector - (func: (callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler: IScheduler, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: Function) => any, context: any, selector: (results: TC[]) => TR): () => Observable; + (func: (arg1: T1, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any callback without selector - (func: (callback: Function) => any, scheduler?: IScheduler, context?: any): () => Observable; - (func: (arg1: T1, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; + (func: (callback: Function) => any, context?: any): () => Observable; + (func: (arg1: T1, callback: Function) => any, context?: any): (arg1: T1) => Observable; + (func: (arg1: T1, arg2: T2, callback: Function) => any, context?: any): (arg1: T1, arg2: T2) => Observable; + (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; // with any function with selector - (func: Function, scheduler: IScheduler, context: any, selector: (results: TC[]) => T): (...args: any[]) => Observable; + (func: Function, context: any, selector: (results: TC[]) => T): (...args: any[]) => Observable; // with any function without selector - (func: Function, scheduler?: IScheduler, context?: any): (...args: any[]) => Observable; + (func: Function, context?: any): (...args: any[]) => Observable; }; fromEvent(element: NodeList, eventName: string, selector?: (arguments: any[]) => T): Observable; diff --git a/rx/rx.async-tests.ts b/rx/rx.async-tests.ts index 9c3bce516..4f8c102c4 100644 --- a/rx/rx.async-tests.ts +++ b/rx/rx.async-tests.ts @@ -10,8 +10,8 @@ module Rx.Tests.Async { var sch: Rx.IScheduler; function start() { - obsNum = Rx.Observable.start(()=> 10, sch, obsStr); - obsNum = Rx.Observable.start(()=> 10, sch); + obsNum = Rx.Observable.start(()=> 10, obsStr, sch); + obsNum = Rx.Observable.start(() => 10, obsStr); obsNum = Rx.Observable.start(()=> 10); } @@ -27,38 +27,34 @@ module Rx.Tests.Async { // 0 arguments var func0: (cb: (result: number)=> void)=> void; obsNum = Rx.Observable.fromCallback(func0)(); - obsNum = Rx.Observable.fromCallback(func0, sch)(); - obsNum = Rx.Observable.fromCallback(func0, sch, obsStr)(); - obsNum = Rx.Observable.fromCallback(func0, sch, obsStr, (results: number[]) => results[0])(); + obsNum = Rx.Observable.fromCallback(func0, obsStr)(); + obsNum = Rx.Observable.fromCallback(func0, obsStr, (results: number[]) => results[0])(); // 1 argument var func1: (a: string, cb: (result: number)=> void)=> number; obsNum = Rx.Observable.fromCallback(func1)(""); - obsNum = Rx.Observable.fromCallback(func1, sch)(""); - obsNum = Rx.Observable.fromCallback(func1, sch, {})(""); - obsNum = Rx.Observable.fromCallback(func1, sch, {}, (results: number[]) => results[0])(""); + obsNum = Rx.Observable.fromCallback(func1, {})(""); + obsNum = Rx.Observable.fromCallback(func1, {}, (results: number[]) => results[0])(""); // 2 arguments var func2: (a: number, b: string, cb: (result: string) => number) => Date; obsStr = Rx.Observable.fromCallback(func2)(1, ""); - obsStr = Rx.Observable.fromCallback(func2, sch)(1, ""); - obsStr = Rx.Observable.fromCallback(func2, sch, {})(1, ""); - obsStr = Rx.Observable.fromCallback(func2, sch, {}, (results: string[]) => results[0])(1, ""); + obsStr = Rx.Observable.fromCallback(func2, {})(1, ""); + obsStr = Rx.Observable.fromCallback(func2, {}, (results: string[]) => results[0])(1, ""); // 3 arguments var func3: (a: number, b: string, c: boolean, cb: (result: string) => number) => Date; obsStr = Rx.Observable.fromCallback(func3)(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, sch)(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, sch, {})(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, sch, {}, (results: string[]) => results[0])(1, "", true); + obsStr = Rx.Observable.fromCallback(func3, {})(1, "", true); + obsStr = Rx.Observable.fromCallback(func3, {}, (results: string[]) => results[0])(1, "", true); // multiple results var func0m: (cb: (result1: number, result2: number, result3: number) => void) => void; - obsNum = Rx.Observable.fromCallback(func0m, sch, obsStr, (results: number[]) => results[0])(); + obsNum = Rx.Observable.fromCallback(func0m, obsStr, (results: number[]) => results[0])(); var func1m: (a: string, cb: (result1: number, result2: number, result3: number) => void) => void; - obsNum = Rx.Observable.fromCallback(func1m, sch, obsStr, (results: number[]) => results[0])(""); + obsNum = Rx.Observable.fromCallback(func1m, obsStr, (results: number[]) => results[0])(""); var func2m: (a: string, b: number, cb: (result1: string, result2: string, result3: string) => void) => void; - obsStr = Rx.Observable.fromCallback(func2m, sch, obsStr, (results: string[]) => results[0])("", 10); + obsStr = Rx.Observable.fromCallback(func2m, obsStr, (results: string[]) => results[0])("", 10); } function toPromise() { diff --git a/rx/rx.async.d.ts b/rx/rx.async.d.ts index 9370c828b..783f31d52 100644 --- a/rx/rx.async.d.ts +++ b/rx/rx.async.d.ts @@ -8,33 +8,33 @@ declare module Rx { interface ObservableStatic { - start(func: () => T, scheduler?: IScheduler, context?: any): Observable; + start(func: () => T, context?: any, scheduler?: IScheduler): Observable; - toAsync(func: () => TResult, scheduler?: IScheduler, context?: any): () => Observable; - toAsync(func: (arg1: T1) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1) => Observable; - toAsync(func: (arg1?: T1) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1) => Observable; - toAsync(func: (...args: T1[]) => TResult, scheduler?: IScheduler, context?: any): (...args: T1[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2) => Observable; - toAsync(func: (arg1: T1, arg2?: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2) => Observable; - toAsync(func: (arg1: T1, ...args: T2[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, ...args: T2[]) => Observable; - toAsync(func: (arg1?: T1, ...args: T2[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, ...args: T2[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3) => Observable; - toAsync(func: (arg1: T1, arg2: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, ...args: T3[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, scheduler?: IScheduler, context?: any): (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; + toAsync(func: () => TResult, context?: any, scheduler?: IScheduler): () => Observable; + toAsync(func: (arg1: T1) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1) => Observable; + toAsync(func: (arg1?: T1) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1) => Observable; + toAsync(func: (...args: T1[]) => TResult, context?: any, scheduler?: IScheduler): (...args: T1[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2) => Observable; + toAsync(func: (arg1: T1, arg2?: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2) => Observable; + toAsync(func: (arg1: T1, ...args: T2[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, ...args: T2[]) => Observable; + toAsync(func: (arg1?: T1, ...args: T2[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, ...args: T2[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3) => Observable; + toAsync(func: (arg1: T1, arg2: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, ...args: T3[]) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, ...args: T3[]) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, ...args: T3[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => Observable; + toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => Observable; + toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; + toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; } } diff --git a/rx/rx.time-lite.d.ts b/rx/rx.time-lite.d.ts index a5b102827..7a7d8f46f 100644 --- a/rx/rx.time-lite.d.ts +++ b/rx/rx.time-lite.d.ts @@ -49,8 +49,8 @@ declare module Rx { interface ObservableStatic { interval(period: number, scheduler?: IScheduler): Observable; interval(dutTime: number, period: number, scheduler?: IScheduler): Observable; - timer(dueTime: number, period: number, scheduler: IScheduler): Observable; - timer(dueTime: number, scheduler: IScheduler): Observable; + timer(dueTime: number, period: number, scheduler?: IScheduler): Observable; + timer(dueTime: number, scheduler?: IScheduler): Observable; generateWithRelativeTime( initialState: TState, condition: (state: TState) => boolean, diff --git a/rx/rx.time.d.ts b/rx/rx.time.d.ts index 6efd7d9cf..2cdb1d56a 100644 --- a/rx/rx.time.d.ts +++ b/rx/rx.time.d.ts @@ -17,8 +17,8 @@ declare module Rx { } interface ObservableStatic { - timer(dueTime: Date, period: number, scheduler: IScheduler): Observable; - timer(dueTime: Date, scheduler: IScheduler): Observable; + timer(dueTime: Date, period: number, scheduler?: IScheduler): Observable; + timer(dueTime: Date, scheduler?: IScheduler): Observable; generateWithAbsoluteTime( initialState: TState,