From 436ecfdb3bdb97ae882c89128c0560e6928a651c Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 15 Jul 2014 08:39:53 -0700 Subject: [PATCH 1/8] Added Rx.Observable.of. --- rx.js/rx-lite.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rx.js/rx-lite.d.ts b/rx.js/rx-lite.d.ts index ad30b6e949..5c20fd39d4 100644 --- a/rx.js/rx-lite.d.ts +++ b/rx.js/rx-lite.d.ts @@ -391,6 +391,24 @@ declare module Rx { fromItreable(iterable: {}, scheduler?: IScheduler): Observable; // todo: can't describe ES6 Iterable via TypeScript type system generate(initialState: TState, condition: (state: TState) => boolean, iterate: (state: TState) => TState, resultSelector: (state: TState) => TResult, scheduler?: IScheduler): Observable; never(): Observable; + + /** + * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. + * + * @example + * var res = Rx.Observable.of(1, 2, 3); + * @returns The observable sequence whose elements are pulled from the given arguments. + */ + of(...values: T[]): Observable; + + /** + * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. + * @example + * var res = Rx.Observable.ofWithScheduler(Rx.Scheduler.timeout, 1, 2, 3); + * @param [scheduler] A scheduler to use for scheduling the arguments. + * @returns The observable sequence whose elements are pulled from the given arguments. + */ + ofWithScheduler(scheduler?: IScheduler, ...values: T[]): Observable; range(start: number, count: number, scheduler?: IScheduler): Observable; repeat(value: T, repeatCount?: number, scheduler?: IScheduler): Observable; return(value: T, scheduler?: IScheduler): Observable; From b5c9860090ad5898d7e7a6d9473e3b97ff94ab97 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 15 Jul 2014 08:51:27 -0700 Subject: [PATCH 2/8] Added `exclusive` operator. --- rx.js/rx-lite.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rx.js/rx-lite.d.ts b/rx.js/rx-lite.d.ts index 5c20fd39d4..3e5fa2b783 100644 --- a/rx.js/rx-lite.d.ts +++ b/rx.js/rx-lite.d.ts @@ -352,6 +352,16 @@ declare module Rx { * @returns An ES6 compatible promise with the last value from the observable sequence. */ toPromise(promiseCtor?: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise; }): IPromise; + + // Experimental Flattening + + /** + * Performs a exclusive waiting for the first to finish before subscribing to another observable. + * Observables that come in between subscriptions will be dropped on the floor. + * Can be applied on `Observable>` or `Observable>`. + * @returns A exclusive observable with only the results that happen when subscribed. + */ + exclusive(): Observable; } interface ObservableStatic { From f3ed4c501ecca2304f98a58da7af321308598e7b Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 15 Jul 2014 09:04:49 -0700 Subject: [PATCH 3/8] Added `exclusiveMap` operator. --- rx.js/rx-lite.d.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rx.js/rx-lite.d.ts b/rx.js/rx-lite.d.ts index 3e5fa2b783..2e81da920d 100644 --- a/rx.js/rx-lite.d.ts +++ b/rx.js/rx-lite.d.ts @@ -361,7 +361,17 @@ declare module Rx { * Can be applied on `Observable>` or `Observable>`. * @returns A exclusive observable with only the results that happen when subscribed. */ - exclusive(): Observable; + exclusive(): Observable; + + /** + * Performs a exclusive map waiting for the first to finish before subscribing to another observable. + * Observables that come in between subscriptions will be dropped on the floor. + * Can be applied on `Observable>` or `Observable>`. + * @param selector Selector to invoke for every item in the current subscription. + * @param [thisArg] An optional context to invoke with the selector parameter. + * @returns {An exclusive observable with only the results that happen when subscribed. + */ + exclusiveMap(selector: (value: I, index: number, source: Observable) => R, thisArg?: any): Observable; } interface ObservableStatic { From 3399c7e738d4121fbe034514daf2d6ec09f99e92 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 15 Jul 2014 09:11:16 -0700 Subject: [PATCH 4/8] `shareReplay` moved to `rx.binding-lite.d.ts`. Removed `replayWhileObserved` from `rx.binding.d.ts` (replaced by `shareReplay`). --- rx.js/rx.binding-lite.d.ts | 1 + rx.js/rx.binding.d.ts | 6 ------ rx.js/rx.lite.d.ts | 4 ---- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/rx.js/rx.binding-lite.d.ts b/rx.js/rx.binding-lite.d.ts index e1120e1090..f896e260db 100644 --- a/rx.js/rx.binding-lite.d.ts +++ b/rx.js/rx.binding-lite.d.ts @@ -67,5 +67,6 @@ declare module Rx { shareValue(initialValue: T): Observable; replay(selector?: boolean, bufferSize?: number, window?: number, scheduler?: IScheduler): ConnectableObservable; // hack to catch first omitted parameter replay(selector: (source: ConnectableObservable) => Observable, bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; + shareReplay(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; } } diff --git a/rx.js/rx.binding.d.ts b/rx.js/rx.binding.d.ts index cf089e43f6..3adbcbe2b7 100644 --- a/rx.js/rx.binding.d.ts +++ b/rx.js/rx.binding.d.ts @@ -6,12 +6,6 @@ /// /// -declare module Rx { - export interface Observable { - replayWhileObserved(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; - } -} - declare module "rx.binding" { export = Rx; } \ No newline at end of file diff --git a/rx.js/rx.lite.d.ts b/rx.js/rx.lite.d.ts index ddffc4a164..da2ddde3b7 100644 --- a/rx.js/rx.lite.d.ts +++ b/rx.js/rx.lite.d.ts @@ -43,10 +43,6 @@ declare module Rx { schedulePeriodic(period: number, action: () => void): IDisposable; schedulePeriodicWithState(state: TState, period: number, action: (state: TState) => TState): IDisposable; } - - export interface Observable { - shareReplay(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; // same as replayWhileObserved in rx.binding.d.ts - } } declare module "rx.lite" { From cfbd50bddb1ff9c65c7c966e9fbbba13fed6efc7 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 15 Jul 2014 09:13:26 -0700 Subject: [PATCH 5/8] Added @since jsdoc attributes for new methods. --- rx.js/rx-lite.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rx.js/rx-lite.d.ts b/rx.js/rx-lite.d.ts index 2e81da920d..db46423722 100644 --- a/rx.js/rx-lite.d.ts +++ b/rx.js/rx-lite.d.ts @@ -359,6 +359,7 @@ declare module Rx { * Performs a exclusive waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * Can be applied on `Observable>` or `Observable>`. + * @since 2.2.28 * @returns A exclusive observable with only the results that happen when subscribed. */ exclusive(): Observable; @@ -367,6 +368,7 @@ declare module Rx { * Performs a exclusive map waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * Can be applied on `Observable>` or `Observable>`. + * @since 2.2.28 * @param selector Selector to invoke for every item in the current subscription. * @param [thisArg] An optional context to invoke with the selector parameter. * @returns {An exclusive observable with only the results that happen when subscribed. @@ -417,6 +419,7 @@ declare module Rx { * * @example * var res = Rx.Observable.of(1, 2, 3); + * @since 2.2.28 * @returns The observable sequence whose elements are pulled from the given arguments. */ of(...values: T[]): Observable; @@ -425,6 +428,7 @@ declare module Rx { * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @example * var res = Rx.Observable.ofWithScheduler(Rx.Scheduler.timeout, 1, 2, 3); + * @since 2.2.28 * @param [scheduler] A scheduler to use for scheduling the arguments. * @returns The observable sequence whose elements are pulled from the given arguments. */ From aa37a6d4be12e148386df01bdd7f1873f6fd8320 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 15 Jul 2014 09:17:13 -0700 Subject: [PATCH 6/8] Added alias `just` for `return`. --- rx.js/rx-lite.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/rx.js/rx-lite.d.ts b/rx.js/rx-lite.d.ts index db46423722..2c65d950ad 100644 --- a/rx.js/rx-lite.d.ts +++ b/rx.js/rx-lite.d.ts @@ -436,6 +436,7 @@ declare module Rx { range(start: number, count: number, scheduler?: IScheduler): Observable; repeat(value: T, repeatCount?: number, scheduler?: IScheduler): Observable; return(value: T, scheduler?: IScheduler): Observable; + just(value: T, scheduler?: IScheduler): Observable; // alias for return returnValue(value: T, scheduler?: IScheduler): Observable; // alias for return throw(exception: Error, scheduler?: IScheduler): Observable; throw(exception: any, scheduler?: IScheduler): Observable; From a1fe5ce51b15f76b90ab0bf671efa930f82a3a56 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 15 Jul 2014 09:29:06 -0700 Subject: [PATCH 7/8] Added `switchMap` alias for `selectSwitch`. --- rx.js/rx-lite.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rx.js/rx-lite.d.ts b/rx.js/rx-lite.d.ts index 2c65d950ad..c7a1481379 100644 --- a/rx.js/rx-lite.d.ts +++ b/rx.js/rx-lite.d.ts @@ -324,6 +324,16 @@ declare module Rx { * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ flatMapLatest(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for selectSwitch + /** + * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then + * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. + * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. + * @param [thisArg] Object to use as this when executing callback. + * @since 2.2.28 + * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences + * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ + switchMap(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for selectSwitch skip(count: number): Observable; skipWhile(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; @@ -436,6 +446,9 @@ declare module Rx { range(start: number, count: number, scheduler?: IScheduler): Observable; repeat(value: T, repeatCount?: number, scheduler?: IScheduler): Observable; return(value: T, scheduler?: IScheduler): Observable; + /** + * @since 2.2.28 + */ just(value: T, scheduler?: IScheduler): Observable; // alias for return returnValue(value: T, scheduler?: IScheduler): Observable; // alias for return throw(exception: Error, scheduler?: IScheduler): Observable; From 2f5fb6d9e458763c0b096c2378166e4189ca23f5 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 15 Jul 2014 09:33:03 -0700 Subject: [PATCH 8/8] Version bump to 2.2.28 --- rx.js/rx.aggregates.d.ts | 2 +- rx.js/rx.all.ts | 2 +- rx.js/rx.async.d.ts | 2 +- rx.js/rx.backpressure.d.ts | 2 +- rx.js/rx.binding.d.ts | 2 +- rx.js/rx.coincidence.d.ts | 2 +- rx.js/rx.d.ts | 2 +- rx.js/rx.experimental.d.ts | 2 +- rx.js/rx.joinpatterns.d.ts | 2 +- rx.js/rx.lite.d.ts | 2 +- rx.js/rx.testing.d.ts | 2 +- rx.js/rx.time.d.ts | 2 +- rx.js/rx.virtualtime.d.ts | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/rx.js/rx.aggregates.d.ts b/rx.js/rx.aggregates.d.ts index 4ab7355ed1..001d1b9932 100644 --- a/rx.js/rx.aggregates.d.ts +++ b/rx.js/rx.aggregates.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Aggregates v2.2.25 +// Type definitions for RxJS-Aggregates v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.all.ts b/rx.js/rx.all.ts index 608605fae5..c546477b80 100644 --- a/rx.js/rx.all.ts +++ b/rx.js/rx.all.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-All v2.2.25 +// Type definitions for RxJS-All v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.async.d.ts b/rx.js/rx.async.d.ts index 14823b948f..9370c828bf 100644 --- a/rx.js/rx.async.d.ts +++ b/rx.js/rx.async.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Async v2.2.25 +// Type definitions for RxJS-Async v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: zoetrope , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.backpressure.d.ts b/rx.js/rx.backpressure.d.ts index 5f5013fe13..9c5e8abd50 100644 --- a/rx.js/rx.backpressure.d.ts +++ b/rx.js/rx.backpressure.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-BackPressure v2.2.25 +// Type definitions for RxJS-BackPressure v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.binding.d.ts b/rx.js/rx.binding.d.ts index 3adbcbe2b7..b93411a528 100644 --- a/rx.js/rx.binding.d.ts +++ b/rx.js/rx.binding.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Binding v2.2.25 +// Type definitions for RxJS-Binding v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.coincidence.d.ts b/rx.js/rx.coincidence.d.ts index af7acd4de9..87fa6a55b5 100644 --- a/rx.js/rx.coincidence.d.ts +++ b/rx.js/rx.coincidence.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Coincidence v2.2.25 +// Type definitions for RxJS-Coincidence v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.d.ts b/rx.js/rx.d.ts index 967b5aefa4..1f26a94a9a 100644 --- a/rx.js/rx.d.ts +++ b/rx.js/rx.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS v2.2.25 +// Type definitions for RxJS v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: gsino , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.experimental.d.ts b/rx.js/rx.experimental.d.ts index 885630be25..60aec86e1a 100644 --- a/rx.js/rx.experimental.d.ts +++ b/rx.js/rx.experimental.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Experimental v2.2.25 +// Type definitions for RxJS-Experimental v2.2.28 // Project: https://github.com/Reactive-Extensions/RxJS/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.joinpatterns.d.ts b/rx.js/rx.joinpatterns.d.ts index 9d0d7244fe..929c66a6f1 100644 --- a/rx.js/rx.joinpatterns.d.ts +++ b/rx.js/rx.joinpatterns.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Join v2.2.25 +// Type definitions for RxJS-Join v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.lite.d.ts b/rx.js/rx.lite.d.ts index da2ddde3b7..046ef527d6 100644 --- a/rx.js/rx.lite.d.ts +++ b/rx.js/rx.lite.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Lite v2.2.25 +// Type definitions for RxJS-Lite v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: gsino , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.testing.d.ts b/rx.js/rx.testing.d.ts index 393061625d..0adc83e506 100644 --- a/rx.js/rx.testing.d.ts +++ b/rx.js/rx.testing.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Testing v2.2.25 +// Type definitions for RxJS-Testing v2.2.28 // Project: https://github.com/Reactive-Extensions/RxJS/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.time.d.ts b/rx.js/rx.time.d.ts index ae2408e850..6efd7d9cfc 100644 --- a/rx.js/rx.time.d.ts +++ b/rx.js/rx.time.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-Time v2.2.25 +// Type definitions for RxJS-Time v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: Carl de Billy , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.virtualtime.d.ts b/rx.js/rx.virtualtime.d.ts index 04de75e944..50a1bb39b7 100644 --- a/rx.js/rx.virtualtime.d.ts +++ b/rx.js/rx.virtualtime.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-VirtualTime v2.2.25 +// Type definitions for RxJS-VirtualTime v2.2.28 // Project: http://rx.codeplex.com/ // Definitions by: gsino , Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped