From a0d28a8fd523454e9d6fb51dbe410d79bb0d88e9 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Fri, 23 Dec 2016 14:29:06 -0800 Subject: [PATCH] fix(TypeScript): interfaces that accepted `Scheduler` now accept `IScheduler` interface this should be a non-breaking change. It just makes sense to accept a minimal interface here rather than a full-on class --- src/ReplaySubject.ts | 4 +- src/Scheduler.ts | 6 +- src/observable/ArrayLikeObservable.ts | 6 +- src/observable/ArrayObservable.ts | 30 ++++---- src/observable/BoundCallbackObservable.ts | 38 +++++----- src/observable/BoundNodeCallbackObservable.ts | 24 +++--- src/observable/EmptyObservable.ts | 8 +- src/observable/ErrorObservable.ts | 8 +- src/observable/FromObservable.ts | 10 +-- src/observable/GenerateObservable.ts | 24 +++--- src/observable/IntervalObservable.ts | 14 ++-- src/observable/IteratorObservable.ts | 6 +- src/observable/PairsObservable.ts | 10 +-- src/observable/PromiseObservable.ts | 8 +- src/observable/RangeObservable.ts | 14 ++-- src/observable/ScalarObservable.ts | 6 +- src/observable/SubscribeOnObservable.ts | 6 +- src/observable/TimerObservable.ts | 20 ++--- src/observable/combineLatest.ts | 46 ++++++------ src/operator/auditTime.ts | 12 +-- src/operator/bufferTime.ts | 16 ++-- src/operator/concat.ts | 48 ++++++------ src/operator/debounceTime.ts | 12 +-- src/operator/delay.ts | 12 +-- src/operator/expand.ts | 14 ++-- src/operator/merge.ts | 74 +++++++++---------- src/operator/observeOn.ts | 8 +- src/operator/publishReplay.ts | 4 +- src/operator/repeat.ts | 4 +- src/operator/repeatWhen.ts | 4 +- src/operator/retryWhen.ts | 4 +- src/operator/sampleTime.ts | 10 +-- src/operator/startWith.ts | 20 ++--- src/operator/subscribeOn.ts | 12 +-- src/operator/throttleTime.ts | 12 +-- src/operator/timeInterval.ts | 8 +- src/operator/timeout.ts | 8 +- src/operator/timeoutWith.ts | 12 +-- src/operator/timestamp.ts | 8 +- src/operator/windowTime.ts | 10 +-- 40 files changed, 302 insertions(+), 298 deletions(-) diff --git a/src/ReplaySubject.ts b/src/ReplaySubject.ts index 0ab64ee603..4161a6cfb7 100644 --- a/src/ReplaySubject.ts +++ b/src/ReplaySubject.ts @@ -1,5 +1,5 @@ import { Subject } from './Subject'; -import { Scheduler } from './Scheduler'; +import { IScheduler } from './Scheduler'; import { queue } from './scheduler/queue'; import { Subscriber } from './Subscriber'; import { Subscription } from './Subscription'; @@ -16,7 +16,7 @@ export class ReplaySubject extends Subject { constructor(bufferSize: number = Number.POSITIVE_INFINITY, windowTime: number = Number.POSITIVE_INFINITY, - private scheduler?: Scheduler) { + private scheduler?: IScheduler) { super(); this._bufferSize = bufferSize < 1 ? 1 : bufferSize; this._windowTime = windowTime < 1 ? 1 : windowTime; diff --git a/src/Scheduler.ts b/src/Scheduler.ts index e1e27ec73f..f5e40d3cb6 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -1,6 +1,10 @@ import { Action } from './scheduler/Action'; import { Subscription } from './Subscription'; +export interface IScheduler { + now(): number; + schedule(work: (this: Action, state?: T) => void, delay?: number, state?: T): Subscription; +} /** * An execution context and a data structure to order tasks and schedule their * execution. Provides a notion of (potentially virtual) time, through the @@ -17,7 +21,7 @@ import { Subscription } from './Subscription'; * * @class Scheduler */ -export class Scheduler { +export class Scheduler implements IScheduler { public static now: () => number = Date.now ? Date.now : () => +new Date(); diff --git a/src/observable/ArrayLikeObservable.ts b/src/observable/ArrayLikeObservable.ts index c0c46dc477..b613fea132 100644 --- a/src/observable/ArrayLikeObservable.ts +++ b/src/observable/ArrayLikeObservable.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { ScalarObservable } from './ScalarObservable'; import { EmptyObservable } from './EmptyObservable'; @@ -12,7 +12,7 @@ import { TeardownLogic } from '../Subscription'; */ export class ArrayLikeObservable extends Observable { - static create(arrayLike: ArrayLike, scheduler?: Scheduler): Observable { + static create(arrayLike: ArrayLike, scheduler?: IScheduler): Observable { const length = arrayLike.length; if (length === 0) { return new EmptyObservable(); @@ -45,7 +45,7 @@ export class ArrayLikeObservable extends Observable { // value used if Array has one value and _isScalar private value: any; - constructor(private arrayLike: ArrayLike, private scheduler?: Scheduler) { + constructor(private arrayLike: ArrayLike, private scheduler?: IScheduler) { super(); if (!scheduler && arrayLike.length === 1) { this._isScalar = true; diff --git a/src/observable/ArrayObservable.ts b/src/observable/ArrayObservable.ts index eff3621af5..aca120ee9e 100644 --- a/src/observable/ArrayObservable.ts +++ b/src/observable/ArrayObservable.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { ScalarObservable } from './ScalarObservable'; import { EmptyObservable } from './EmptyObservable'; @@ -13,17 +13,17 @@ import { TeardownLogic } from '../Subscription'; */ export class ArrayObservable extends Observable { - static create(array: T[], scheduler?: Scheduler): Observable { + static create(array: T[], scheduler?: IScheduler): Observable { return new ArrayObservable(array, scheduler); } - static of(item1: T, scheduler?: Scheduler): Observable; - static of(item1: T, item2: T, scheduler?: Scheduler): Observable; - static of(item1: T, item2: T, item3: T, scheduler?: Scheduler): Observable; - static of(item1: T, item2: T, item3: T, item4: T, scheduler?: Scheduler): Observable; - static of(item1: T, item2: T, item3: T, item4: T, item5: T, scheduler?: Scheduler): Observable; - static of(item1: T, item2: T, item3: T, item4: T, item5: T, item6: T, scheduler?: Scheduler): Observable; - static of(...array: Array): Observable; + static of(item1: T, scheduler?: IScheduler): Observable; + static of(item1: T, item2: T, scheduler?: IScheduler): Observable; + static of(item1: T, item2: T, item3: T, scheduler?: IScheduler): Observable; + static of(item1: T, item2: T, item3: T, item4: T, scheduler?: IScheduler): Observable; + static of(item1: T, item2: T, item3: T, item4: T, item5: T, scheduler?: IScheduler): Observable; + static of(item1: T, item2: T, item3: T, item4: T, item5: T, item6: T, scheduler?: IScheduler): Observable; + static of(...array: Array): Observable; /** * Creates an Observable that emits some values you specify as arguments, * immediately one after the other, and then emits a complete notification. @@ -36,8 +36,8 @@ export class ArrayObservable extends Observable { * This static operator is useful for creating a simple Observable that only * emits the arguments given, and the complete notification thereafter. It can * be used for composing with other Observables, such as with {@link concat}. - * By default, it uses a `null` Scheduler, which means the `next` - * notifications are sent synchronously, although with a different Scheduler + * By default, it uses a `null` IScheduler, which means the `next` + * notifications are sent synchronously, although with a different IScheduler * it is possible to determine when those notifications will be delivered. * * @example Emit 10, 20, 30, then 'a', 'b', 'c', then start ticking every second. @@ -53,15 +53,15 @@ export class ArrayObservable extends Observable { * @see {@link throw} * * @param {...T} values Arguments that represent `next` values to be emitted. - * @param {Scheduler} [scheduler] A {@link Scheduler} to use for scheduling + * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling * the emissions of the `next` notifications. * @return {Observable} An Observable that emits each given input value. * @static true * @name of * @owner Observable */ - static of(...array: Array): Observable { - let scheduler = array[array.length - 1]; + static of(...array: Array): Observable { + let scheduler = array[array.length - 1]; if (isScheduler(scheduler)) { array.pop(); } else { @@ -101,7 +101,7 @@ export class ArrayObservable extends Observable { // value used if Array has one value and _isScalar value: any; - constructor(private array: T[], private scheduler?: Scheduler) { + constructor(private array: T[], private scheduler?: IScheduler) { super(); if (!scheduler && array.length === 1) { this._isScalar = true; diff --git a/src/observable/BoundCallbackObservable.ts b/src/observable/BoundCallbackObservable.ts index c2e8c868dd..3f11a01867 100644 --- a/src/observable/BoundCallbackObservable.ts +++ b/src/observable/BoundCallbackObservable.ts @@ -1,7 +1,7 @@ import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { tryCatch } from '../util/tryCatch'; import { errorObject } from '../util/errorObject'; import { AsyncSubject } from '../AsyncSubject'; @@ -15,22 +15,22 @@ export class BoundCallbackObservable extends Observable { subject: AsyncSubject; /* tslint:disable:max-line-length */ - static create(callbackFunc: (callback: (result: R) => any) => any, selector?: void, scheduler?: Scheduler): () => Observable; - static create(callbackFunc: (v1: T, callback: (result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T) => Observable; - static create(callbackFunc: (v1: T, v2: T2, callback: (result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T, v2: T2) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3, v4: T4) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable; - static create(callbackFunc: (callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: Scheduler): () => Observable; - static create(callbackFunc: (v1: T, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: Scheduler): (v1: T) => Observable; - static create(callbackFunc: (v1: T, v2: T2, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: Scheduler): (v1: T, v2: T2) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3, v4: T4) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable; - static create(callbackFunc: Function, selector?: void, scheduler?: Scheduler): (...args: any[]) => Observable; - static create(callbackFunc: Function, selector?: (...args: any[]) => T, scheduler?: Scheduler): (...args: any[]) => Observable; + static create(callbackFunc: (callback: (result: R) => any) => any, selector?: void, scheduler?: IScheduler): () => Observable; + static create(callbackFunc: (v1: T, callback: (result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T) => Observable; + static create(callbackFunc: (v1: T, v2: T2, callback: (result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T, v2: T2) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3, v4: T4) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable; + static create(callbackFunc: (callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: IScheduler): () => Observable; + static create(callbackFunc: (v1: T, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: IScheduler): (v1: T) => Observable; + static create(callbackFunc: (v1: T, v2: T2, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: IScheduler): (v1: T, v2: T2) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3, v4: T4) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable; + static create(callbackFunc: Function, selector?: void, scheduler?: IScheduler): (...args: any[]) => Observable; + static create(callbackFunc: Function, selector?: (...args: any[]) => T, scheduler?: IScheduler): (...args: any[]) => Observable; /* tslint:enable:max-line-length */ /** @@ -71,7 +71,7 @@ export class BoundCallbackObservable extends Observable { */ static create(func: Function, selector: Function | void = undefined, - scheduler?: Scheduler): (...args: any[]) => Observable { + scheduler?: IScheduler): (...args: any[]) => Observable { return (...args: any[]): Observable => { return new BoundCallbackObservable(func, selector, args, scheduler); }; @@ -80,7 +80,7 @@ export class BoundCallbackObservable extends Observable { constructor(private callbackFunc: Function, private selector: Function, private args: any[], - private scheduler: Scheduler) { + private scheduler: IScheduler) { super(); } diff --git a/src/observable/BoundNodeCallbackObservable.ts b/src/observable/BoundNodeCallbackObservable.ts index 75c8d91a5e..63e00e2d74 100644 --- a/src/observable/BoundNodeCallbackObservable.ts +++ b/src/observable/BoundNodeCallbackObservable.ts @@ -1,7 +1,7 @@ import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Action } from '../scheduler/Action'; import { tryCatch } from '../util/tryCatch'; import { errorObject } from '../util/errorObject'; @@ -16,15 +16,15 @@ export class BoundNodeCallbackObservable extends Observable { subject: AsyncSubject; /* tslint:disable:max-line-length */ - static create(callbackFunc: (callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: Scheduler): () => Observable; - static create(callbackFunc: (v1: T, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T) => Observable; - static create(callbackFunc: (v1: T, v2: T2, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T, v2: T2) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3, v4: T4) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable; - static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: Scheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable; - static create(callbackFunc: Function, selector?: void, scheduler?: Scheduler): (...args: any[]) => Observable; - static create(callbackFunc: Function, selector?: (...args: any[]) => T, scheduler?: Scheduler): (...args: any[]) => Observable; + static create(callbackFunc: (callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: IScheduler): () => Observable; + static create(callbackFunc: (v1: T, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T) => Observable; + static create(callbackFunc: (v1: T, v2: T2, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T, v2: T2) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3, v4: T4) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable; + static create(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: IScheduler): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable; + static create(callbackFunc: Function, selector?: void, scheduler?: IScheduler): (...args: any[]) => Observable; + static create(callbackFunc: Function, selector?: (...args: any[]) => T, scheduler?: IScheduler): (...args: any[]) => Observable; /* tslint:enable:max-line-length */ /** @@ -68,7 +68,7 @@ export class BoundNodeCallbackObservable extends Observable { */ static create(func: Function, selector: Function | void = undefined, - scheduler?: Scheduler): (...args: any[]) => Observable { + scheduler?: IScheduler): (...args: any[]) => Observable { return (...args: any[]): Observable => { return new BoundNodeCallbackObservable(func, selector, args, scheduler); }; @@ -77,7 +77,7 @@ export class BoundNodeCallbackObservable extends Observable { constructor(private callbackFunc: Function, private selector: Function, private args: any[], - public scheduler: Scheduler) { + public scheduler: IScheduler) { super(); } diff --git a/src/observable/EmptyObservable.ts b/src/observable/EmptyObservable.ts index 9b70f5abae..2d819c6b52 100644 --- a/src/observable/EmptyObservable.ts +++ b/src/observable/EmptyObservable.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Subscriber } from '../Subscriber'; import { Observable } from '../Observable'; import { TeardownLogic } from '../Subscription'; @@ -49,7 +49,7 @@ export class EmptyObservable extends Observable { * @see {@link of} * @see {@link throw} * - * @param {Scheduler} [scheduler] A {@link Scheduler} to use for scheduling + * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling * the emission of the complete notification. * @return {Observable} An "empty" Observable: emits only the complete * notification. @@ -57,7 +57,7 @@ export class EmptyObservable extends Observable { * @name empty * @owner Observable */ - static create(scheduler?: Scheduler): Observable { + static create(scheduler?: IScheduler): Observable { return new EmptyObservable(scheduler); } @@ -66,7 +66,7 @@ export class EmptyObservable extends Observable { subscriber.complete(); } - constructor(private scheduler?: Scheduler) { + constructor(private scheduler?: IScheduler) { super(); } diff --git a/src/observable/ErrorObservable.ts b/src/observable/ErrorObservable.ts index 4d0b6ca4b7..c76bd85f38 100644 --- a/src/observable/ErrorObservable.ts +++ b/src/observable/ErrorObservable.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { TeardownLogic } from '../Subscription'; @@ -46,7 +46,7 @@ export class ErrorObservable extends Observable { * @see {@link of} * * @param {any} error The particular Error to pass to the error notification. - * @param {Scheduler} [scheduler] A {@link Scheduler} to use for scheduling + * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling * the emission of the error notification. * @return {Observable} An error Observable: emits only the error notification * using the given error argument. @@ -54,7 +54,7 @@ export class ErrorObservable extends Observable { * @name throw * @owner Observable */ - static create(error: T, scheduler?: Scheduler): ErrorObservable { + static create(error: T, scheduler?: IScheduler): ErrorObservable { return new ErrorObservable(error, scheduler); } @@ -63,7 +63,7 @@ export class ErrorObservable extends Observable { subscriber.error(error); } - constructor(public error: T, private scheduler?: Scheduler) { + constructor(public error: T, private scheduler?: IScheduler) { super(); } diff --git a/src/observable/FromObservable.ts b/src/observable/FromObservable.ts index efd02a9c0e..8e9159a43a 100644 --- a/src/observable/FromObservable.ts +++ b/src/observable/FromObservable.ts @@ -5,7 +5,7 @@ import { IteratorObservable } from'./IteratorObservable'; import { ArrayObservable } from './ArrayObservable'; import { ArrayLikeObservable } from './ArrayLikeObservable'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { $$iterator } from '../symbol/iterator'; import { Observable, ObservableInput } from '../Observable'; import { Subscriber } from '../Subscriber'; @@ -20,12 +20,12 @@ const isArrayLike = ((x: any): x is ArrayLike => x && typeof x.length === * @hide true */ export class FromObservable extends Observable { - constructor(private ish: ObservableInput, private scheduler?: Scheduler) { + constructor(private ish: ObservableInput, private scheduler?: IScheduler) { super(null); } - static create(ish: ObservableInput, scheduler?: Scheduler): Observable; - static create(ish: ArrayLike, scheduler?: Scheduler): Observable; + static create(ish: ObservableInput, scheduler?: IScheduler): Observable; + static create(ish: ArrayLike, scheduler?: IScheduler): Observable; /** * Creates an Observable from an Array, an array-like object, a Promise, an @@ -83,7 +83,7 @@ export class FromObservable extends Observable { * @name from * @owner Observable */ - static create(ish: ObservableInput, scheduler?: Scheduler): Observable { + static create(ish: ObservableInput, scheduler?: IScheduler): Observable { if (ish != null) { if (typeof ish[$$observable] === 'function') { if (ish instanceof Observable && !scheduler) { diff --git a/src/observable/GenerateObservable.ts b/src/observable/GenerateObservable.ts index 7024941970..3db21cb8a8 100644 --- a/src/observable/GenerateObservable.ts +++ b/src/observable/GenerateObservable.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Action } from '../scheduler/Action'; import { Observable } from '../Observable' ; import { Subscriber } from '../Subscriber'; @@ -36,10 +36,10 @@ export interface GenerateBaseOptions { */ iterate: IterateFunc; /** - * Scheduler to use for generation process. + * IScheduler to use for generation process. * By default, a generator starts immediately. */ - scheduler?: Scheduler; + scheduler?: IScheduler; } export interface GenerateOptions extends GenerateBaseOptions { @@ -59,7 +59,7 @@ export class GenerateObservable extends Observable { private condition: ConditionFunc, private iterate: IterateFunc, private resultSelector: ResultFunc, - private scheduler?: Scheduler) { + private scheduler?: IScheduler) { super(); } @@ -83,14 +83,14 @@ export class GenerateObservable extends Observable { * @param {function (state: S): boolean} condition Condition to terminate generation (upon returning false). * @param {function (state: S): S} iterate Iteration step function. * @param {function (state: S): T} resultSelector Selector function for results produced in the sequence. - * @param {Scheduler} [scheduler] A {@link Scheduler} on which to run the generator loop. If not provided, defaults to emit immediately. + * @param {Scheduler} [scheduler] A {@link IScheduler} on which to run the generator loop. If not provided, defaults to emit immediately. * @returns {Observable} The generated sequence. */ static create(initialState: S, condition: ConditionFunc, iterate: IterateFunc, resultSelector: ResultFunc, - scheduler?: Scheduler): Observable + scheduler?: IScheduler): Observable /** * Generates an observable sequence by running a state-driven loop @@ -112,13 +112,13 @@ export class GenerateObservable extends Observable { * @param {S} initialState Initial state. * @param {function (state: S): boolean} condition Condition to terminate generation (upon returning false). * @param {function (state: S): S} iterate Iteration step function. - * @param {Scheduler} [scheduler] A {@link Scheduler} on which to run the generator loop. If not provided, defaults to emit immediately. + * @param {Scheduler} [scheduler] A {@link IScheduler} on which to run the generator loop. If not provided, defaults to emit immediately. * @returns {Observable} The generated sequence. */ static create(initialState: S, condition: ConditionFunc, iterate: IterateFunc, - scheduler?: Scheduler): Observable + scheduler?: IScheduler): Observable /** * Generates an observable sequence by running a state-driven loop @@ -172,8 +172,8 @@ export class GenerateObservable extends Observable { static create(initialStateOrOptions: S | GenerateOptions, condition?: ConditionFunc, iterate?: IterateFunc, - resultSelectorOrObservable?: (ResultFunc) | Scheduler, - scheduler?: Scheduler): Observable { + resultSelectorOrObservable?: (ResultFunc) | IScheduler, + scheduler?: IScheduler): Observable { if (arguments.length == 1) { return new GenerateObservable( (>initialStateOrOptions).initialState, @@ -189,7 +189,7 @@ export class GenerateObservable extends Observable { condition, iterate, selfSelector, - resultSelectorOrObservable); + resultSelectorOrObservable); } return new GenerateObservable( @@ -197,7 +197,7 @@ export class GenerateObservable extends Observable { condition, iterate, >resultSelectorOrObservable, - scheduler); + scheduler); } protected _subscribe(subscriber: Subscriber): Subscription | Function | void { diff --git a/src/observable/IntervalObservable.ts b/src/observable/IntervalObservable.ts index 8abdd6962c..2984d2cac4 100644 --- a/src/observable/IntervalObservable.ts +++ b/src/observable/IntervalObservable.ts @@ -1,6 +1,6 @@ import { Subscriber } from '../Subscriber'; import { isNumeric } from '../util/isNumeric'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { async } from '../scheduler/async'; @@ -12,7 +12,7 @@ import { async } from '../scheduler/async'; export class IntervalObservable extends Observable { /** * Creates an Observable that emits sequential numbers every specified - * interval of time, on a specified Scheduler. + * interval of time, on a specified IScheduler. * * Emits incremental numbers periodically in time. * @@ -23,8 +23,8 @@ export class IntervalObservable extends Observable { * ascending integers, with a constant interval of time of your choosing * between those emissions. The first emission is not sent immediately, but * only after the first period has passed. By default, this operator uses the - * `async` Scheduler to provide a notion of time, but you may pass any - * Scheduler to it. + * `async` IScheduler to provide a notion of time, but you may pass any + * IScheduler to it. * * @example Emits ascending numbers, one every second (1000ms) * var numbers = Rx.Observable.interval(1000); @@ -35,7 +35,7 @@ export class IntervalObservable extends Observable { * * @param {number} [period=0] The interval size in milliseconds (by default) * or the time unit determined by the scheduler's clock. - * @param {Scheduler} [scheduler=async] The Scheduler to use for scheduling + * @param {Scheduler} [scheduler=async] The IScheduler to use for scheduling * the emission of values, and providing a notion of "time". * @return {Observable} An Observable that emits a sequential number each time * interval. @@ -44,7 +44,7 @@ export class IntervalObservable extends Observable { * @owner Observable */ static create(period: number = 0, - scheduler: Scheduler = async): Observable { + scheduler: IScheduler = async): Observable { return new IntervalObservable(period, scheduler); } @@ -63,7 +63,7 @@ export class IntervalObservable extends Observable { } constructor(private period: number = 0, - private scheduler: Scheduler = async) { + private scheduler: IScheduler = async) { super(); if (!isNumeric(period) || period < 0) { this.period = 0; diff --git a/src/observable/IteratorObservable.ts b/src/observable/IteratorObservable.ts index 95905a7a49..401d23a6a0 100644 --- a/src/observable/IteratorObservable.ts +++ b/src/observable/IteratorObservable.ts @@ -1,5 +1,5 @@ import { root } from '../util/root'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { $$iterator } from '../symbol/iterator'; import { TeardownLogic } from '../Subscription'; @@ -13,7 +13,7 @@ import { Subscriber } from '../Subscriber'; export class IteratorObservable extends Observable { private iterator: any; - static create(iterator: any, scheduler?: Scheduler): IteratorObservable { + static create(iterator: any, scheduler?: IScheduler): IteratorObservable { return new IteratorObservable(iterator, scheduler); } @@ -45,7 +45,7 @@ export class IteratorObservable extends Observable { ( this).schedule(state); } - constructor(iterator: any, private scheduler?: Scheduler) { + constructor(iterator: any, private scheduler?: IScheduler) { super(); if (iterator == null) { diff --git a/src/observable/PairsObservable.ts b/src/observable/PairsObservable.ts index d1698fee39..57656f5ad8 100644 --- a/src/observable/PairsObservable.ts +++ b/src/observable/PairsObservable.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Action } from '../scheduler/Action'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; @@ -38,7 +38,7 @@ export class PairsObservable extends Observable> { /** * Convert an object into an observable sequence of [key, value] pairs - * using an optional Scheduler to enumerate the object. + * using an optional IScheduler to enumerate the object. * * @example Converts a javascript object to an Observable * var obj = { @@ -62,16 +62,16 @@ export class PairsObservable extends Observable> { * * @param {Object} obj The object to inspect and turn into an * Observable sequence. - * @param {Scheduler} [scheduler] An optional Scheduler to run the + * @param {Scheduler} [scheduler] An optional IScheduler to run the * enumeration of the input sequence on. * @returns {(Observable>)} An observable sequence of * [key, value] pairs from the object. */ - static create(obj: Object, scheduler?: Scheduler): Observable> { + static create(obj: Object, scheduler?: IScheduler): Observable> { return new PairsObservable(obj, scheduler); } - constructor(private obj: Object, private scheduler?: Scheduler) { + constructor(private obj: Object, private scheduler?: IScheduler) { super(); this.keys = Object.keys(obj); } diff --git a/src/observable/PromiseObservable.ts b/src/observable/PromiseObservable.ts index 9693afaa91..6550430a3a 100644 --- a/src/observable/PromiseObservable.ts +++ b/src/observable/PromiseObservable.ts @@ -1,5 +1,5 @@ import { root } from '../util/root'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { TeardownLogic } from '../Subscription'; @@ -32,18 +32,18 @@ export class PromiseObservable extends Observable { * @see {@link from} * * @param {Promise} promise The promise to be converted. - * @param {Scheduler} [scheduler] An optional Scheduler to use for scheduling + * @param {Scheduler} [scheduler] An optional IScheduler to use for scheduling * the delivery of the resolved value (or the rejection). * @return {Observable} An Observable which wraps the Promise. * @static true * @name fromPromise * @owner Observable */ - static create(promise: Promise, scheduler?: Scheduler): Observable { + static create(promise: Promise, scheduler?: IScheduler): Observable { return new PromiseObservable(promise, scheduler); } - constructor(private promise: Promise, private scheduler?: Scheduler) { + constructor(private promise: Promise, private scheduler?: IScheduler) { super(); } diff --git a/src/observable/RangeObservable.ts b/src/observable/RangeObservable.ts index 3788c026d0..d608d86be9 100644 --- a/src/observable/RangeObservable.ts +++ b/src/observable/RangeObservable.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { TeardownLogic } from '../Subscription'; import { Subscriber } from '../Subscriber'; @@ -20,8 +20,8 @@ export class RangeObservable extends Observable { * * `range` operator emits a range of sequential integers, in order, where you * select the `start` of the range and its `length`. By default, uses no - * Scheduler and just delivers the notifications synchronously, but may use - * an optional Scheduler to regulate those deliveries. + * IScheduler and just delivers the notifications synchronously, but may use + * an optional IScheduler to regulate those deliveries. * * @example Emits the numbers 1 to 10 * var numbers = Rx.Observable.range(1, 10); @@ -32,7 +32,7 @@ export class RangeObservable extends Observable { * * @param {number} [start=0] The value of the first integer in the sequence. * @param {number} [count=0] The number of sequential integers to generate. - * @param {Scheduler} [scheduler] A {@link Scheduler} to use for scheduling + * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling * the emissions of the notifications. * @return {Observable} An Observable of numbers that emits a finite range of * sequential integers. @@ -42,7 +42,7 @@ export class RangeObservable extends Observable { */ static create(start: number = 0, count: number = 0, - scheduler?: Scheduler): Observable { + scheduler?: IScheduler): Observable { return new RangeObservable(start, count, scheduler); } @@ -69,11 +69,11 @@ export class RangeObservable extends Observable { private start: number; private _count: number; - private scheduler: Scheduler; + private scheduler: IScheduler; constructor(start: number, count: number, - scheduler?: Scheduler) { + scheduler?: IScheduler) { super(); this.start = start; this._count = count; diff --git a/src/observable/ScalarObservable.ts b/src/observable/ScalarObservable.ts index 88b8e3f02d..ea2488539f 100644 --- a/src/observable/ScalarObservable.ts +++ b/src/observable/ScalarObservable.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { TeardownLogic } from '../Subscription'; @@ -9,7 +9,7 @@ import { TeardownLogic } from '../Subscription'; * @hide true */ export class ScalarObservable extends Observable { - static create(value: T, scheduler?: Scheduler): ScalarObservable { + static create(value: T, scheduler?: IScheduler): ScalarObservable { return new ScalarObservable(value, scheduler); } @@ -32,7 +32,7 @@ export class ScalarObservable extends Observable { _isScalar: boolean = true; - constructor(public value: T, private scheduler?: Scheduler) { + constructor(public value: T, private scheduler?: IScheduler) { super(); if (scheduler) { this._isScalar = false; diff --git a/src/observable/SubscribeOnObservable.ts b/src/observable/SubscribeOnObservable.ts index 19f3539521..da187033c6 100644 --- a/src/observable/SubscribeOnObservable.ts +++ b/src/observable/SubscribeOnObservable.ts @@ -1,5 +1,5 @@ import { Action } from '../scheduler/Action'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; import { Observable } from '../Observable'; @@ -17,7 +17,7 @@ export interface DispatchArg { * @hide true */ export class SubscribeOnObservable extends Observable { - static create(source: Observable, delay: number = 0, scheduler: Scheduler = asap): Observable { + static create(source: Observable, delay: number = 0, scheduler: IScheduler = asap): Observable { return new SubscribeOnObservable(source, delay, scheduler); } @@ -28,7 +28,7 @@ export class SubscribeOnObservable extends Observable { constructor(public source: Observable, private delayTime: number = 0, - private scheduler: Scheduler = asap) { + private scheduler: IScheduler = asap) { super(); if (!isNumeric(delayTime) || delayTime < 0) { this.delayTime = 0; diff --git a/src/observable/TimerObservable.ts b/src/observable/TimerObservable.ts index 12b803ab2e..0fabd6fd26 100644 --- a/src/observable/TimerObservable.ts +++ b/src/observable/TimerObservable.ts @@ -1,5 +1,5 @@ import { isNumeric } from '../util/isNumeric'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { async } from '../scheduler/async'; import { isScheduler } from '../util/isScheduler'; @@ -27,8 +27,8 @@ export class TimerObservable extends Observable { * integers, with a constant interval of time, `period` of your choosing * between those emissions. The first emission happens after the specified * `initialDelay`. The initial delay may be a {@link Date}. By default, this - * operator uses the `async` Scheduler to provide a notion of time, but you - * may pass any Scheduler to it. If `period` is not specified, the output + * operator uses the `async` IScheduler to provide a notion of time, but you + * may pass any IScheduler to it. If `period` is not specified, the output * Observable emits only one value, `0`. Otherwise, it emits an infinite * sequence. * @@ -47,7 +47,7 @@ export class TimerObservable extends Observable { * emitting the first value of `0`. * @param {number} [period] The period of time between emissions of the * subsequent numbers. - * @param {Scheduler} [scheduler=async] The Scheduler to use for scheduling + * @param {Scheduler} [scheduler=async] The IScheduler to use for scheduling * the emission of values, and providing a notion of "time". * @return {Observable} An Observable that emits a `0` after the * `initialDelay` and ever increasing numbers after each `period` of time @@ -57,8 +57,8 @@ export class TimerObservable extends Observable { * @owner Observable */ static create(initialDelay: number | Date = 0, - period?: number | Scheduler, - scheduler?: Scheduler): Observable { + period?: number | IScheduler, + scheduler?: IScheduler): Observable { return new TimerObservable(initialDelay, period, scheduler); } @@ -81,17 +81,17 @@ export class TimerObservable extends Observable { private period: number = -1; private dueTime: number = 0; - private scheduler: Scheduler; + private scheduler: IScheduler; constructor(dueTime: number | Date = 0, - period?: number | Scheduler, - scheduler?: Scheduler) { + period?: number | IScheduler, + scheduler?: IScheduler) { super(); if (isNumeric(period)) { this.period = Number(period) < 1 && 1 || Number(period); } else if (isScheduler(period)) { - scheduler = period; + scheduler = period; } if (!isScheduler(scheduler)) { diff --git a/src/observable/combineLatest.ts b/src/observable/combineLatest.ts index ef9e8ac1c1..2f152c5d5f 100644 --- a/src/observable/combineLatest.ts +++ b/src/observable/combineLatest.ts @@ -1,31 +1,31 @@ import { Observable, ObservableInput } from '../Observable'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { isScheduler } from '../util/isScheduler'; import { isArray } from '../util/isArray'; import { ArrayObservable } from './ArrayObservable'; import { CombineLatestOperator } from '../operator/combineLatest'; /* tslint:disable:max-line-length */ -export function combineLatest(v1: ObservableInput, v2: ObservableInput, scheduler?: Scheduler): Observable<[T, T2]>; -export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, scheduler?: Scheduler): Observable<[T, T2, T3]>; -export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: Scheduler): Observable<[T, T2, T3, T4]>; -export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: Scheduler): Observable<[T, T2, T3, T4, T5]>; -export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: Scheduler): Observable<[T, T2, T3, T4, T5, T6]>; +export function combineLatest(v1: ObservableInput, v2: ObservableInput, scheduler?: IScheduler): Observable<[T, T2]>; +export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, scheduler?: IScheduler): Observable<[T, T2, T3]>; +export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: IScheduler): Observable<[T, T2, T3, T4]>; +export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: IScheduler): Observable<[T, T2, T3, T4, T5]>; +export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: IScheduler): Observable<[T, T2, T3, T4, T5, T6]>; -export function combineLatest(v1: ObservableInput, project: (v1: T) => R, scheduler?: Scheduler): Observable; -export function combineLatest(v1: ObservableInput, v2: ObservableInput, project: (v1: T, v2: T2) => R, scheduler?: Scheduler): Observable; -export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, project: (v1: T, v2: T2, v3: T3) => R, scheduler?: Scheduler): Observable; -export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4) => R, scheduler?: Scheduler): Observable; -export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => R, scheduler?: Scheduler): Observable; -export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => R, scheduler?: Scheduler): Observable; +export function combineLatest(v1: ObservableInput, project: (v1: T) => R, scheduler?: IScheduler): Observable; +export function combineLatest(v1: ObservableInput, v2: ObservableInput, project: (v1: T, v2: T2) => R, scheduler?: IScheduler): Observable; +export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, project: (v1: T, v2: T2, v3: T3) => R, scheduler?: IScheduler): Observable; +export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4) => R, scheduler?: IScheduler): Observable; +export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => R, scheduler?: IScheduler): Observable; +export function combineLatest(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => R, scheduler?: IScheduler): Observable; -export function combineLatest(array: ObservableInput[], scheduler?: Scheduler): Observable; -export function combineLatest(array: ObservableInput[], scheduler?: Scheduler): Observable; -export function combineLatest(array: ObservableInput[], project: (...values: Array) => R, scheduler?: Scheduler): Observable; -export function combineLatest(array: ObservableInput[], project: (...values: Array) => R, scheduler?: Scheduler): Observable; -export function combineLatest(...observables: Array | Scheduler>): Observable; -export function combineLatest(...observables: Array | ((...values: Array) => R) | Scheduler>): Observable; -export function combineLatest(...observables: Array | ((...values: Array) => R) | Scheduler>): Observable; +export function combineLatest(array: ObservableInput[], scheduler?: IScheduler): Observable; +export function combineLatest(array: ObservableInput[], scheduler?: IScheduler): Observable; +export function combineLatest(array: ObservableInput[], project: (...values: Array) => R, scheduler?: IScheduler): Observable; +export function combineLatest(array: ObservableInput[], project: (...values: Array) => R, scheduler?: IScheduler): Observable; +export function combineLatest(...observables: Array | IScheduler>): Observable; +export function combineLatest(...observables: Array | ((...values: Array) => R) | IScheduler>): Observable; +export function combineLatest(...observables: Array | ((...values: Array) => R) | IScheduler>): Observable; /* tslint:enable:max-line-length */ /** @@ -67,7 +67,7 @@ export function combineLatest(...observables: Array | (( * source Observable. More than one input Observables may be given as argument. * @param {function} [project] An optional function to project the values from * the combined latest values into a new value on the output Observable. - * @param {Scheduler} [scheduler=null] The Scheduler to use for subscribing to + * @param {Scheduler} [scheduler=null] The IScheduler to use for subscribing to * each input Observable. * @return {Observable} An Observable of projected values from the most recent * values from each input Observable, or an array of the most recent values from @@ -79,12 +79,12 @@ export function combineLatest(...observables: Array | (( export function combineLatest(...observables: Array | Array> | (((...values: Array) => R)) | - Scheduler>): Observable { + IScheduler>): Observable { let project: (...values: Array) => R = null; - let scheduler: Scheduler = null; + let scheduler: IScheduler = null; if (isScheduler(observables[observables.length - 1])) { - scheduler = observables.pop(); + scheduler = observables.pop(); } if (typeof observables[observables.length - 1] === 'function') { diff --git a/src/operator/auditTime.ts b/src/operator/auditTime.ts index 1ed9a54189..dfcf78f93d 100644 --- a/src/operator/auditTime.ts +++ b/src/operator/auditTime.ts @@ -1,6 +1,6 @@ import { async } from '../scheduler/async'; import { Operator } from '../Operator'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Subscriber } from '../Subscriber'; import { Observable } from '../Observable'; import { Subscription, TeardownLogic } from '../Subscription'; @@ -24,7 +24,7 @@ import { Subscription, TeardownLogic } from '../Subscription'; * the time unit determined internally by the optional `scheduler`) has passed, * the timer is disabled, then the most recent source value is emitted on the * output Observable, and this process repeats for the next source value. - * Optionally takes a {@link Scheduler} for managing timers. + * Optionally takes a {@link IScheduler} for managing timers. * * @example Emit clicks at a rate of at most one click per second * var clicks = Rx.Observable.fromEvent(document, 'click'); @@ -40,20 +40,20 @@ import { Subscription, TeardownLogic } from '../Subscription'; * @param {number} duration Time to wait before emitting the most recent source * value, measured in milliseconds or the time unit determined internally * by the optional `scheduler`. - * @param {Scheduler} [scheduler=async] The {@link Scheduler} to use for + * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for * managing the timers that handle the rate-limiting behavior. * @return {Observable} An Observable that performs rate-limiting of * emissions from the source Observable. * @method auditTime * @owner Observable */ -export function auditTime(this: Observable, duration: number, scheduler: Scheduler = async): Observable { +export function auditTime(this: Observable, duration: number, scheduler: IScheduler = async): Observable { return this.lift(new AuditTimeOperator(duration, scheduler)); } class AuditTimeOperator implements Operator { constructor(private duration: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { } call(subscriber: Subscriber, source: any): TeardownLogic { @@ -74,7 +74,7 @@ class AuditTimeSubscriber extends Subscriber { constructor(destination: Subscriber, private duration: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { super(destination); } diff --git a/src/operator/bufferTime.ts b/src/operator/bufferTime.ts index 3d57670d78..3488290376 100644 --- a/src/operator/bufferTime.ts +++ b/src/operator/bufferTime.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Action } from '../scheduler/Action'; import { Operator } from '../Operator'; import { async } from '../scheduler/async'; @@ -8,9 +8,9 @@ import { Subscription } from '../Subscription'; import { isScheduler } from '../util/isScheduler'; /* tslint:disable:max-line-length */ -export function bufferTime(this: Observable, bufferTimeSpan: number, scheduler?: Scheduler): Observable; -export function bufferTime(this: Observable, bufferTimeSpan: number, bufferCreationInterval: number, scheduler?: Scheduler): Observable; -export function bufferTime(this: Observable, bufferTimeSpan: number, bufferCreationInterval: number, maxBufferSize: number, scheduler?: Scheduler): Observable; +export function bufferTime(this: Observable, bufferTimeSpan: number, scheduler?: IScheduler): Observable; +export function bufferTime(this: Observable, bufferTimeSpan: number, bufferCreationInterval: number, scheduler?: IScheduler): Observable; +export function bufferTime(this: Observable, bufferTimeSpan: number, bufferCreationInterval: number, maxBufferSize: number, scheduler?: IScheduler): Observable; /* tslint:disable:max-line-length */ /** @@ -59,7 +59,7 @@ export function bufferTime(this: Observable, bufferTimeSpan: number, buffe export function bufferTime(this: Observable, bufferTimeSpan: number): Observable { let length: number = arguments.length; - let scheduler: Scheduler = async; + let scheduler: IScheduler = async; if (isScheduler(arguments[arguments.length - 1])) { scheduler = arguments[arguments.length - 1]; length--; @@ -82,7 +82,7 @@ class BufferTimeOperator implements Operator { constructor(private bufferTimeSpan: number, private bufferCreationInterval: number, private maxBufferSize: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { } call(subscriber: Subscriber, source: any): any { @@ -101,7 +101,7 @@ type CreationState = { bufferTimeSpan: number; bufferCreationInterval: number, subscriber: BufferTimeSubscriber; - scheduler: Scheduler; + scheduler: IScheduler; }; /** @@ -117,7 +117,7 @@ class BufferTimeSubscriber extends Subscriber { private bufferTimeSpan: number, private bufferCreationInterval: number, private maxBufferSize: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { super(destination); const context = this.openContext(); this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0; diff --git a/src/operator/concat.ts b/src/operator/concat.ts index d692332d1e..1e1a32313f 100644 --- a/src/operator/concat.ts +++ b/src/operator/concat.ts @@ -1,18 +1,18 @@ import { Observable, ObservableInput } from '../Observable'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { isScheduler } from '../util/isScheduler'; import { ArrayObservable } from '../observable/ArrayObservable'; import { MergeAllOperator } from './mergeAll'; /* tslint:disable:max-line-length */ -export function concat(this: Observable, scheduler?: Scheduler): Observable; -export function concat(this: Observable, v2: ObservableInput, scheduler?: Scheduler): Observable; -export function concat(this: Observable, v2: ObservableInput, v3: ObservableInput, scheduler?: Scheduler): Observable; -export function concat(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: Scheduler): Observable; -export function concat(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: Scheduler): Observable; -export function concat(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: Scheduler): Observable; -export function concat(this: Observable, ...observables: Array | Scheduler>): Observable; -export function concat(this: Observable, ...observables: Array | Scheduler>): Observable; +export function concat(this: Observable, scheduler?: IScheduler): Observable; +export function concat(this: Observable, v2: ObservableInput, scheduler?: IScheduler): Observable; +export function concat(this: Observable, v2: ObservableInput, v3: ObservableInput, scheduler?: IScheduler): Observable; +export function concat(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: IScheduler): Observable; +export function concat(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: IScheduler): Observable; +export function concat(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: IScheduler): Observable; +export function concat(this: Observable, ...observables: Array | IScheduler>): Observable; +export function concat(this: Observable, ...observables: Array | IScheduler>): Observable; /* tslint:disable:max-line-length */ /** @@ -44,7 +44,7 @@ export function concat(this: Observable, ...observables: Array console.log(x)); - * + * * // results in the following: * // (Prints to console sequentially) * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9 @@ -57,26 +57,26 @@ export function concat(this: Observable, ...observables: Array(this: Observable, ...observables: Array | Scheduler>): Observable { +export function concat(this: Observable, ...observables: Array | IScheduler>): Observable { return this.lift.call(concatStatic(this, ...observables)); } /* tslint:disable:max-line-length */ -export function concatStatic(v1: ObservableInput, scheduler?: Scheduler): Observable; -export function concatStatic(v1: ObservableInput, v2: ObservableInput, scheduler?: Scheduler): Observable; -export function concatStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, scheduler?: Scheduler): Observable; -export function concatStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: Scheduler): Observable; -export function concatStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: Scheduler): Observable; -export function concatStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: Scheduler): Observable; -export function concatStatic(...observables: (ObservableInput | Scheduler)[]): Observable; -export function concatStatic(...observables: (ObservableInput | Scheduler)[]): Observable; +export function concatStatic(v1: ObservableInput, scheduler?: IScheduler): Observable; +export function concatStatic(v1: ObservableInput, v2: ObservableInput, scheduler?: IScheduler): Observable; +export function concatStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, scheduler?: IScheduler): Observable; +export function concatStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: IScheduler): Observable; +export function concatStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: IScheduler): Observable; +export function concatStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: IScheduler): Observable; +export function concatStatic(...observables: (ObservableInput | IScheduler)[]): Observable; +export function concatStatic(...observables: (ObservableInput | IScheduler)[]): Observable; /* tslint:enable:max-line-length */ /** * Creates an output Observable which sequentially emits all values from every @@ -112,7 +112,7 @@ export function concatStatic(...observables: (ObservableInput | Sched * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9 * // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5 * // -500ms-> 0 -500ms-> 1 -500ms-> ... 9 - * + * * @see {@link concatAll} * @see {@link concatMap} * @see {@link concatMapTo} @@ -120,7 +120,7 @@ export function concatStatic(...observables: (ObservableInput | Sched * @param {Observable} input1 An input Observable to concatenate with others. * @param {Observable} input2 An input Observable to concatenate with others. * More than one input Observables may be given as argument. - * @param {Scheduler} [scheduler=null] An optional Scheduler to schedule each + * @param {Scheduler} [scheduler=null] An optional IScheduler to schedule each * Observable subscription on. * @return {Observable} All values of each passed Observable merged into a * single Observable, in order, in serial fashion. @@ -128,8 +128,8 @@ export function concatStatic(...observables: (ObservableInput | Sched * @name concat * @owner Observable */ -export function concatStatic(...observables: Array | Scheduler>): Observable { - let scheduler: Scheduler = null; +export function concatStatic(...observables: Array | IScheduler>): Observable { + let scheduler: IScheduler = null; let args = observables; if (isScheduler(args[observables.length - 1])) { scheduler = args.pop(); diff --git a/src/operator/debounceTime.ts b/src/operator/debounceTime.ts index 9d626da626..53fcc732fc 100644 --- a/src/operator/debounceTime.ts +++ b/src/operator/debounceTime.ts @@ -1,7 +1,7 @@ import { Operator } from '../Operator'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Subscription, TeardownLogic } from '../Subscription'; import { async } from '../scheduler/async'; @@ -25,7 +25,7 @@ import { async } from '../scheduler/async'; * This is a rate-limiting operator, because it is impossible for more than one * value to be emitted in any time window of duration `dueTime`, but it is also * a delay-like operator since output emissions do not occur at the same time as - * they did on the source Observable. Optionally takes a {@link Scheduler} for + * they did on the source Observable. Optionally takes a {@link IScheduler} for * managing timers. * * @example Emit the most recent click after a burst of clicks @@ -43,7 +43,7 @@ import { async } from '../scheduler/async'; * unit determined internally by the optional `scheduler`) for the window of * time required to wait for emission silence before emitting the most recent * source value. - * @param {Scheduler} [scheduler=async] The {@link Scheduler} to use for + * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for * managing the timers that handle the timeout for each value. * @return {Observable} An Observable that delays the emissions of the source * Observable by the specified `dueTime`, and may drop some values if they occur @@ -51,12 +51,12 @@ import { async } from '../scheduler/async'; * @method debounceTime * @owner Observable */ -export function debounceTime(this: Observable, dueTime: number, scheduler: Scheduler = async): Observable { +export function debounceTime(this: Observable, dueTime: number, scheduler: IScheduler = async): Observable { return this.lift(new DebounceTimeOperator(dueTime, scheduler)); } class DebounceTimeOperator implements Operator { - constructor(private dueTime: number, private scheduler: Scheduler) { + constructor(private dueTime: number, private scheduler: IScheduler) { } call(subscriber: Subscriber, source: any): TeardownLogic { @@ -76,7 +76,7 @@ class DebounceTimeSubscriber extends Subscriber { constructor(destination: Subscriber, private dueTime: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { super(destination); } diff --git a/src/operator/delay.ts b/src/operator/delay.ts index c3a7591e58..e2bfbdb41b 100644 --- a/src/operator/delay.ts +++ b/src/operator/delay.ts @@ -1,7 +1,7 @@ import { async } from '../scheduler/async'; import { isDate } from '../util/isDate'; import { Operator } from '../Operator'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Subscriber } from '../Subscriber'; import { Notification } from '../Notification'; import { Observable } from '../Observable'; @@ -39,7 +39,7 @@ import { TeardownLogic } from '../Subscription'; * * @param {number|Date} delay The delay duration in milliseconds (a `number`) or * a `Date` until which the emission of the source items is delayed. - * @param {Scheduler} [scheduler=async] The Scheduler to use for + * @param {Scheduler} [scheduler=async] The IScheduler to use for * managing the timers that handle the time-shift for each item. * @return {Observable} An Observable that delays the emissions of the source * Observable by the specified timeout or Date. @@ -47,7 +47,7 @@ import { TeardownLogic } from '../Subscription'; * @owner Observable */ export function delay(this: Observable, delay: number|Date, - scheduler: Scheduler = async): Observable { + scheduler: IScheduler = async): Observable { const absoluteDelay = isDate(delay); const delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay); return this.lift(new DelayOperator(delayFor, scheduler)); @@ -55,7 +55,7 @@ export function delay(this: Observable, delay: number|Date, class DelayOperator implements Operator { constructor(private delay: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { } call(subscriber: Subscriber, source: any): TeardownLogic { @@ -93,11 +93,11 @@ class DelaySubscriber extends Subscriber { constructor(destination: Subscriber, private delay: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { super(destination); } - private _schedule(scheduler: Scheduler): void { + private _schedule(scheduler: IScheduler): void { this.active = true; this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { source: this, destination: this.destination, scheduler: scheduler diff --git a/src/operator/expand.ts b/src/operator/expand.ts index ebc4a7a1a4..9e7f9f97ea 100644 --- a/src/operator/expand.ts +++ b/src/operator/expand.ts @@ -1,5 +1,5 @@ import { Observable } from '../Observable'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Operator } from '../Operator'; import { Subscriber } from '../Subscriber'; import { tryCatch } from '../util/tryCatch'; @@ -10,8 +10,8 @@ import { InnerSubscriber } from '../InnerSubscriber'; import { subscribeToResult } from '../util/subscribeToResult'; /* tslint:disable:max-line-length */ -export function expand(this: Observable, project: (value: T, index: number) => Observable, concurrent?: number, scheduler?: Scheduler): Observable; -export function expand(this: Observable, project: (value: T, index: number) => Observable, concurrent?: number, scheduler?: Scheduler): Observable; +export function expand(this: Observable, project: (value: T, index: number) => Observable, concurrent?: number, scheduler?: IScheduler): Observable; +export function expand(this: Observable, project: (value: T, index: number) => Observable, concurrent?: number, scheduler?: IScheduler): Observable; /* tslint:disable:max-line-length */ /** @@ -50,7 +50,7 @@ export function expand(this: Observable, project: (value: T, index: num * returns an Observable. * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input * Observables being subscribed to concurrently. - * @param {Scheduler} [scheduler=null] The Scheduler to use for subscribing to + * @param {Scheduler} [scheduler=null] The IScheduler to use for subscribing to * each projected inner Observable. * @return {Observable} An Observable that emits the source values and also * result of applying the projection function to each value emitted on the @@ -61,7 +61,7 @@ export function expand(this: Observable, project: (value: T, index: num */ export function expand(this: Observable, project: (value: T, index: number) => Observable, concurrent: number = Number.POSITIVE_INFINITY, - scheduler: Scheduler = undefined): Observable { + scheduler: IScheduler = undefined): Observable { concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent; return this.lift(new ExpandOperator(project, concurrent, scheduler)); @@ -70,7 +70,7 @@ export function expand(this: Observable, project: (value: T, index: num export class ExpandOperator implements Operator { constructor(private project: (value: T, index: number) => Observable, private concurrent: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { } call(subscriber: Subscriber, source: any): any { @@ -99,7 +99,7 @@ export class ExpandSubscriber extends OuterSubscriber { constructor(destination: Subscriber, private project: (value: T, index: number) => Observable, private concurrent: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { super(destination); if (concurrent < Number.POSITIVE_INFINITY) { this.buffer = []; diff --git a/src/operator/merge.ts b/src/operator/merge.ts index 54ea23f8eb..1a34d10db4 100644 --- a/src/operator/merge.ts +++ b/src/operator/merge.ts @@ -1,24 +1,24 @@ import { Observable, ObservableInput } from '../Observable'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { ArrayObservable } from '../observable/ArrayObservable'; import { MergeAllOperator } from './mergeAll'; import { isScheduler } from '../util/isScheduler'; /* tslint:disable:max-line-length */ -export function merge(this: Observable, scheduler?: Scheduler): Observable; -export function merge(this: Observable, concurrent?: number, scheduler?: Scheduler): Observable; -export function merge(this: Observable, v2: ObservableInput, scheduler?: Scheduler): Observable; -export function merge(this: Observable, v2: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, scheduler?: Scheduler): Observable; -export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: Scheduler): Observable; -export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: Scheduler): Observable; -export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: Scheduler): Observable; -export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function merge(this: Observable, ...observables: Array | Scheduler | number>): Observable; -export function merge(this: Observable, ...observables: Array | Scheduler | number>): Observable; +export function merge(this: Observable, scheduler?: IScheduler): Observable; +export function merge(this: Observable, concurrent?: number, scheduler?: IScheduler): Observable; +export function merge(this: Observable, v2: ObservableInput, scheduler?: IScheduler): Observable; +export function merge(this: Observable, v2: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, scheduler?: IScheduler): Observable; +export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: IScheduler): Observable; +export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: IScheduler): Observable; +export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: IScheduler): Observable; +export function merge(this: Observable, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function merge(this: Observable, ...observables: Array | IScheduler | number>): Observable; +export function merge(this: Observable, ...observables: Array | IScheduler | number>): Observable; /* tslint:disable:max-line-length */ /** @@ -60,32 +60,32 @@ export function merge(this: Observable, ...observables: Array(this: Observable, ...observables: Array | Scheduler | number>): Observable { +export function merge(this: Observable, ...observables: Array | IScheduler | number>): Observable { return this.lift.call(mergeStatic(this, ...observables)); } /* tslint:disable:max-line-length */ -export function mergeStatic(v1: ObservableInput, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, v2: ObservableInput, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, v2: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: Scheduler): Observable; -export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, concurrent?: number, scheduler?: Scheduler): Observable; -export function mergeStatic(...observables: (ObservableInput | Scheduler | number)[]): Observable; -export function mergeStatic(...observables: (ObservableInput | Scheduler | number)[]): Observable; +export function mergeStatic(v1: ObservableInput, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, v2: ObservableInput, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, v2: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, scheduler?: IScheduler): Observable; +export function mergeStatic(v1: ObservableInput, v2: ObservableInput, v3: ObservableInput, v4: ObservableInput, v5: ObservableInput, v6: ObservableInput, concurrent?: number, scheduler?: IScheduler): Observable; +export function mergeStatic(...observables: (ObservableInput | IScheduler | number)[]): Observable; +export function mergeStatic(...observables: (ObservableInput | IScheduler | number)[]): Observable; /* tslint:enable:max-line-length */ /** * Creates an output Observable which concurrently emits all values from every @@ -126,9 +126,9 @@ export function mergeStatic(...observables: (ObservableInput | Schedu * // - First timer1 and timer2 will run concurrently * // - timer1 will emit a value every 1000ms for 10 iterations * // - timer2 will emit a value every 2000ms for 6 iterations - * // - after timer1 hits it's max iteration, timer2 will + * // - after timer1 hits it's max iteration, timer2 will * // continue, and timer3 will start to run concurrently with timer2 - * // - when timer2 hits it's max iteration it terminates, and + * // - when timer2 hits it's max iteration it terminates, and * // timer3 will continue to emit a value every 500ms until it is complete * * @see {@link mergeAll} @@ -139,7 +139,7 @@ export function mergeStatic(...observables: (ObservableInput | Schedu * @param {...Observable} observables Input Observables to merge together. * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input * Observables being subscribed to concurrently. - * @param {Scheduler} [scheduler=null] The Scheduler to use for managing + * @param {Scheduler} [scheduler=null] The IScheduler to use for managing * concurrency of input Observables. * @return {Observable} an Observable that emits items that are the result of * every input Observable. @@ -147,12 +147,12 @@ export function mergeStatic(...observables: (ObservableInput | Schedu * @name merge * @owner Observable */ -export function mergeStatic(...observables: Array | Scheduler | number>): Observable { +export function mergeStatic(...observables: Array | IScheduler | number>): Observable { let concurrent = Number.POSITIVE_INFINITY; - let scheduler: Scheduler = null; + let scheduler: IScheduler = null; let last: any = observables[observables.length - 1]; if (isScheduler(last)) { - scheduler = observables.pop(); + scheduler = observables.pop(); if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { concurrent = observables.pop(); } diff --git a/src/operator/observeOn.ts b/src/operator/observeOn.ts index 88d070ed85..f8f6a3c4dd 100644 --- a/src/operator/observeOn.ts +++ b/src/operator/observeOn.ts @@ -1,5 +1,5 @@ import { Observable } from '../Observable'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Operator } from '../Operator'; import { PartialObserver } from '../Observer'; import { Subscriber } from '../Subscriber'; @@ -15,12 +15,12 @@ import { TeardownLogic } from '../Subscription'; * @method observeOn * @owner Observable */ -export function observeOn(this: Observable, scheduler: Scheduler, delay: number = 0): Observable { +export function observeOn(this: Observable, scheduler: IScheduler, delay: number = 0): Observable { return this.lift(new ObserveOnOperator(scheduler, delay)); } export class ObserveOnOperator implements Operator { - constructor(private scheduler: Scheduler, private delay: number = 0) { + constructor(private scheduler: IScheduler, private delay: number = 0) { } call(subscriber: Subscriber, source: any): TeardownLogic { @@ -40,7 +40,7 @@ export class ObserveOnSubscriber extends Subscriber { } constructor(destination: Subscriber, - private scheduler: Scheduler, + private scheduler: IScheduler, private delay: number = 0) { super(destination); } diff --git a/src/operator/publishReplay.ts b/src/operator/publishReplay.ts index 6c8d309d63..d9098b7a93 100644 --- a/src/operator/publishReplay.ts +++ b/src/operator/publishReplay.ts @@ -1,6 +1,6 @@ import { Observable } from '../Observable'; import { ReplaySubject } from '../ReplaySubject'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { multicast } from './multicast'; import { ConnectableObservable } from '../observable/ConnectableObservable'; @@ -14,6 +14,6 @@ import { ConnectableObservable } from '../observable/ConnectableObservable'; */ export function publishReplay(this: Observable, bufferSize: number = Number.POSITIVE_INFINITY, windowTime: number = Number.POSITIVE_INFINITY, - scheduler?: Scheduler): ConnectableObservable { + scheduler?: IScheduler): ConnectableObservable { return multicast.call(this, new ReplaySubject(bufferSize, windowTime, scheduler)); } diff --git a/src/operator/repeat.ts b/src/operator/repeat.ts index 4a318ab7ca..b3b7fb8b82 100644 --- a/src/operator/repeat.ts +++ b/src/operator/repeat.ts @@ -6,11 +6,11 @@ import { TeardownLogic } from '../Subscription'; /** * Returns an Observable that repeats the stream of items emitted by the source Observable at most count times, - * on a particular Scheduler. + * on a particular IScheduler. * * * - * @param {Scheduler} [scheduler] the Scheduler to emit the items on. + * @param {Scheduler} [scheduler] the IScheduler to emit the items on. * @param {number} [count] the number of times the source Observable items are repeated, a count of 0 will yield * an empty Observable. * @return {Observable} an Observable that repeats the stream of items emitted by the source Observable at most diff --git a/src/operator/repeatWhen.ts b/src/operator/repeatWhen.ts index 637b126ed6..a49639727e 100644 --- a/src/operator/repeatWhen.ts +++ b/src/operator/repeatWhen.ts @@ -15,13 +15,13 @@ import { subscribeToResult } from '../util/subscribeToResult'; * A `complete` will cause the emission of the Throwable that cause the complete to the Observable returned from * notificationHandler. If that Observable calls onComplete or `complete` then retry will call `complete` or `error` * on the child subscription. Otherwise, this Observable will resubscribe to the source observable, on a particular - * Scheduler. + * IScheduler. * * * * @param {notificationHandler} receives an Observable of notifications with which a user can `complete` or `error`, * aborting the retry. - * @param {scheduler} the Scheduler on which to subscribe to the source Observable. + * @param {scheduler} the IScheduler on which to subscribe to the source Observable. * @return {Observable} the source Observable modified with retry logic. * @method repeatWhen * @owner Observable diff --git a/src/operator/retryWhen.ts b/src/operator/retryWhen.ts index 884ccb9fb0..21633648d7 100644 --- a/src/operator/retryWhen.ts +++ b/src/operator/retryWhen.ts @@ -15,13 +15,13 @@ import { subscribeToResult } from '../util/subscribeToResult'; * An `error` will cause the emission of the Throwable that cause the error to the Observable returned from * notificationHandler. If that Observable calls onComplete or `error` then retry will call `complete` or `error` * on the child subscription. Otherwise, this Observable will resubscribe to the source observable, on a particular - * Scheduler. + * IScheduler. * * * * @param {notificationHandler} receives an Observable of notifications with which a user can `complete` or `error`, * aborting the retry. - * @param {scheduler} the Scheduler on which to subscribe to the source Observable. + * @param {scheduler} the IScheduler on which to subscribe to the source Observable. * @return {Observable} the source Observable modified with retry logic. * @method retryWhen * @owner Observable diff --git a/src/operator/sampleTime.ts b/src/operator/sampleTime.ts index f9d047168f..4137a92ea6 100644 --- a/src/operator/sampleTime.ts +++ b/src/operator/sampleTime.ts @@ -1,7 +1,7 @@ import { Observable } from '../Observable'; import { Operator } from '../Operator'; import { Subscriber } from '../Subscriber'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Action } from '../scheduler/Action'; import { async } from '../scheduler/async'; import { TeardownLogic } from '../Subscription'; @@ -35,20 +35,20 @@ import { TeardownLogic } from '../Subscription'; * * @param {number} period The sampling period expressed in milliseconds or the * time unit determined internally by the optional `scheduler`. - * @param {Scheduler} [scheduler=async] The {@link Scheduler} to use for + * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for * managing the timers that handle the sampling. * @return {Observable} An Observable that emits the results of sampling the * values emitted by the source Observable at the specified time interval. * @method sampleTime * @owner Observable */ -export function sampleTime(this: Observable, period: number, scheduler: Scheduler = async): Observable { +export function sampleTime(this: Observable, period: number, scheduler: IScheduler = async): Observable { return this.lift(new SampleTimeOperator(period, scheduler)); } class SampleTimeOperator implements Operator { constructor(private period: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { } call(subscriber: Subscriber, source: any): TeardownLogic { @@ -67,7 +67,7 @@ class SampleTimeSubscriber extends Subscriber { constructor(destination: Subscriber, private period: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { super(destination); this.add(scheduler.schedule(dispatchNotification, period, { subscriber: this, period })); } diff --git a/src/operator/startWith.ts b/src/operator/startWith.ts index 5678be24cc..f2c8555e33 100644 --- a/src/operator/startWith.ts +++ b/src/operator/startWith.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { ArrayObservable } from '../observable/ArrayObservable'; import { ScalarObservable } from '../observable/ScalarObservable'; @@ -7,13 +7,13 @@ import { concatStatic } from './concat'; import { isScheduler } from '../util/isScheduler'; /* tslint:disable:max-line-length */ -export function startWith(this: Observable, v1: T, scheduler?: Scheduler): Observable; -export function startWith(this: Observable, v1: T, v2: T, scheduler?: Scheduler): Observable; -export function startWith(this: Observable, v1: T, v2: T, v3: T, scheduler?: Scheduler): Observable; -export function startWith(this: Observable, v1: T, v2: T, v3: T, v4: T, scheduler?: Scheduler): Observable; -export function startWith(this: Observable, v1: T, v2: T, v3: T, v4: T, v5: T, scheduler?: Scheduler): Observable; -export function startWith(this: Observable, v1: T, v2: T, v3: T, v4: T, v5: T, v6: T, scheduler?: Scheduler): Observable; -export function startWith(this: Observable, ...array: Array): Observable; +export function startWith(this: Observable, v1: T, scheduler?: IScheduler): Observable; +export function startWith(this: Observable, v1: T, v2: T, scheduler?: IScheduler): Observable; +export function startWith(this: Observable, v1: T, v2: T, v3: T, scheduler?: IScheduler): Observable; +export function startWith(this: Observable, v1: T, v2: T, v3: T, v4: T, scheduler?: IScheduler): Observable; +export function startWith(this: Observable, v1: T, v2: T, v3: T, v4: T, v5: T, scheduler?: IScheduler): Observable; +export function startWith(this: Observable, v1: T, v2: T, v3: T, v4: T, v5: T, v6: T, scheduler?: IScheduler): Observable; +export function startWith(this: Observable, ...array: Array): Observable; /* tslint:disable:max-line-length */ /** @@ -28,8 +28,8 @@ export function startWith(this: Observable, ...array: Array * @method startWith * @owner Observable */ -export function startWith(this: Observable, ...array: Array): Observable { - let scheduler = array[array.length - 1]; +export function startWith(this: Observable, ...array: Array): Observable { + let scheduler = array[array.length - 1]; if (isScheduler(scheduler)) { array.pop(); } else { diff --git a/src/operator/subscribeOn.ts b/src/operator/subscribeOn.ts index 1f6c76a7e5..17a4b595f5 100644 --- a/src/operator/subscribeOn.ts +++ b/src/operator/subscribeOn.ts @@ -1,27 +1,27 @@ import { Operator } from '../Operator'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Subscriber } from '../Subscriber'; import { Observable } from '../Observable'; import { TeardownLogic } from '../Subscription'; import { SubscribeOnObservable } from '../observable/SubscribeOnObservable'; /** - * Asynchronously subscribes Observers to this Observable on the specified Scheduler. + * Asynchronously subscribes Observers to this Observable on the specified IScheduler. * * * - * @param {Scheduler} the Scheduler to perform subscription actions on. - * @return {Observable} the source Observable modified so that its subscriptions happen on the specified Scheduler + * @param {Scheduler} the IScheduler to perform subscription actions on. + * @return {Observable} the source Observable modified so that its subscriptions happen on the specified IScheduler . * @method subscribeOn * @owner Observable */ -export function subscribeOn(this: Observable, scheduler: Scheduler, delay: number = 0): Observable { +export function subscribeOn(this: Observable, scheduler: IScheduler, delay: number = 0): Observable { return this.lift(new SubscribeOnOperator(scheduler, delay)); } class SubscribeOnOperator implements Operator { - constructor(private scheduler: Scheduler, + constructor(private scheduler: IScheduler, private delay: number) { } call(subscriber: Subscriber, source: any): TeardownLogic { diff --git a/src/operator/throttleTime.ts b/src/operator/throttleTime.ts index 440c49b8fc..4b502fddd3 100644 --- a/src/operator/throttleTime.ts +++ b/src/operator/throttleTime.ts @@ -1,6 +1,6 @@ import { Operator } from '../Operator'; import { Subscriber } from '../Subscriber'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Subscription, TeardownLogic } from '../Subscription'; import { async } from '../scheduler/async'; import { Observable } from '../Observable'; @@ -21,7 +21,7 @@ import { Observable } from '../Observable'; * is enabled. After `duration` milliseconds (or the time unit determined * internally by the optional `scheduler`) has passed, the timer is disabled, * and this process repeats for the next source value. Optionally takes a - * {@link Scheduler} for managing timers. + * {@link IScheduler} for managing timers. * * @example Emit clicks at a rate of at most one click per second * var clicks = Rx.Observable.fromEvent(document, 'click'); @@ -37,20 +37,20 @@ import { Observable } from '../Observable'; * @param {number} duration Time to wait before emitting another value after * emitting the last value, measured in milliseconds or the time unit determined * internally by the optional `scheduler`. - * @param {Scheduler} [scheduler=async] The {@link Scheduler} to use for + * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for * managing the timers that handle the sampling. * @return {Observable} An Observable that performs the throttle operation to * limit the rate of emissions from the source. * @method throttleTime * @owner Observable */ -export function throttleTime(this: Observable, duration: number, scheduler: Scheduler = async): Observable { +export function throttleTime(this: Observable, duration: number, scheduler: IScheduler = async): Observable { return this.lift(new ThrottleTimeOperator(duration, scheduler)); } class ThrottleTimeOperator implements Operator { constructor(private duration: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { } call(subscriber: Subscriber, source: any): TeardownLogic { @@ -68,7 +68,7 @@ class ThrottleTimeSubscriber extends Subscriber { constructor(destination: Subscriber, private duration: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { super(destination); } diff --git a/src/operator/timeInterval.ts b/src/operator/timeInterval.ts index ee5c47e85d..760f0b4d31 100644 --- a/src/operator/timeInterval.ts +++ b/src/operator/timeInterval.ts @@ -1,7 +1,7 @@ import { Operator } from '../Operator'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { async } from '../scheduler/async'; /** @@ -10,7 +10,7 @@ import { async } from '../scheduler/async'; * @method timeInterval * @owner Observable */ -export function timeInterval(this: Observable, scheduler: Scheduler = async): Observable> { +export function timeInterval(this: Observable, scheduler: IScheduler = async): Observable> { return this.lift(new TimeIntervalOperator(scheduler)); } @@ -21,7 +21,7 @@ export class TimeInterval { }; class TimeIntervalOperator implements Operator> { - constructor(private scheduler: Scheduler) { + constructor(private scheduler: IScheduler) { } @@ -38,7 +38,7 @@ class TimeIntervalOperator implements Operator> { class TimeIntervalSubscriber extends Subscriber { private lastTime: number = 0; - constructor(destination: Subscriber>, private scheduler: Scheduler) { + constructor(destination: Subscriber>, private scheduler: IScheduler) { super(destination); this.lastTime = scheduler.now(); diff --git a/src/operator/timeout.ts b/src/operator/timeout.ts index fc91ed6ea3..9cdf160907 100644 --- a/src/operator/timeout.ts +++ b/src/operator/timeout.ts @@ -2,7 +2,7 @@ import { async } from '../scheduler/async'; import { isDate } from '../util/isDate'; import { Operator } from '../Operator'; import { Subscriber } from '../Subscriber'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Observable } from '../Observable'; import { TeardownLogic } from '../Subscription'; import { TimeoutError } from '../util/TimeoutError'; @@ -16,7 +16,7 @@ import { TimeoutError } from '../util/TimeoutError'; */ export function timeout(this: Observable, due: number | Date, - scheduler: Scheduler = async): Observable { + scheduler: IScheduler = async): Observable { const absoluteTimeout = isDate(due); const waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due); return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, scheduler, new TimeoutError())); @@ -25,7 +25,7 @@ export function timeout(this: Observable, class TimeoutOperator implements Operator { constructor(private waitFor: number, private absoluteTimeout: boolean, - private scheduler: Scheduler, + private scheduler: IScheduler, private errorInstance: TimeoutError) { } @@ -55,7 +55,7 @@ class TimeoutSubscriber extends Subscriber { constructor(destination: Subscriber, private absoluteTimeout: boolean, private waitFor: number, - private scheduler: Scheduler, + private scheduler: IScheduler, private errorInstance: TimeoutError) { super(destination); this.scheduleTimeout(); diff --git a/src/operator/timeoutWith.ts b/src/operator/timeoutWith.ts index 6962cec68d..3921f7e3ac 100644 --- a/src/operator/timeoutWith.ts +++ b/src/operator/timeoutWith.ts @@ -1,6 +1,6 @@ import { Operator } from '../Operator'; import { Subscriber } from '../Subscriber'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { async } from '../scheduler/async'; import { Subscription, TeardownLogic } from '../Subscription'; import { Observable, ObservableInput } from '../Observable'; @@ -9,8 +9,8 @@ import { OuterSubscriber } from '../OuterSubscriber'; import { subscribeToResult } from '../util/subscribeToResult'; /* tslint:disable:max-line-length */ -export function timeoutWith(this: Observable, due: number | Date, withObservable: ObservableInput, scheduler?: Scheduler): Observable; -export function timeoutWith(this: Observable, due: number | Date, withObservable: ObservableInput, scheduler?: Scheduler): Observable; +export function timeoutWith(this: Observable, due: number | Date, withObservable: ObservableInput, scheduler?: IScheduler): Observable; +export function timeoutWith(this: Observable, due: number | Date, withObservable: ObservableInput, scheduler?: IScheduler): Observable; /* tslint:disable:max-line-length */ /** @@ -23,7 +23,7 @@ export function timeoutWith(this: Observable, due: number | Date, withO */ export function timeoutWith(this: Observable, due: number | Date, withObservable: ObservableInput, - scheduler: Scheduler = async): Observable { + scheduler: IScheduler = async): Observable { let absoluteTimeout = isDate(due); let waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due); return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); @@ -33,7 +33,7 @@ class TimeoutWithOperator implements Operator { constructor(private waitFor: number, private absoluteTimeout: boolean, private withObservable: ObservableInput, - private scheduler: Scheduler) { + private scheduler: IScheduler) { } call(subscriber: Subscriber, source: any): TeardownLogic { @@ -64,7 +64,7 @@ class TimeoutWithSubscriber extends OuterSubscriber { private absoluteTimeout: boolean, private waitFor: number, private withObservable: ObservableInput, - private scheduler: Scheduler) { + private scheduler: IScheduler) { super(); destination.add(this); this.scheduleTimeout(); diff --git a/src/operator/timestamp.ts b/src/operator/timestamp.ts index 4ab690b60b..29676af316 100644 --- a/src/operator/timestamp.ts +++ b/src/operator/timestamp.ts @@ -1,7 +1,7 @@ import { Operator } from '../Operator'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { async } from '../scheduler/async'; /** @@ -10,7 +10,7 @@ import { async } from '../scheduler/async'; * @method timestamp * @owner Observable */ -export function timestamp(this: Observable, scheduler: Scheduler = async): Observable> { +export function timestamp(this: Observable, scheduler: IScheduler = async): Observable> { return this.lift(new TimestampOperator(scheduler)); } @@ -20,7 +20,7 @@ export class Timestamp { }; class TimestampOperator implements Operator> { - constructor(private scheduler: Scheduler) { + constructor(private scheduler: IScheduler) { } call(observer: Subscriber>, source: any): any { @@ -29,7 +29,7 @@ class TimestampOperator implements Operator> { } class TimestampSubscriber extends Subscriber { - constructor(destination: Subscriber>, private scheduler: Scheduler) { + constructor(destination: Subscriber>, private scheduler: IScheduler) { super(destination); } diff --git a/src/operator/windowTime.ts b/src/operator/windowTime.ts index f6b60a3d04..52c7b7dddb 100644 --- a/src/operator/windowTime.ts +++ b/src/operator/windowTime.ts @@ -1,4 +1,4 @@ -import { Scheduler } from '../Scheduler'; +import { IScheduler } from '../Scheduler'; import { Action } from '../scheduler/Action'; import { Subject } from '../Subject'; import { Operator } from '../Operator'; @@ -58,7 +58,7 @@ import { Subscription } from '../Subscription'; */ export function windowTime(this: Observable, windowTimeSpan: number, windowCreationInterval: number = null, - scheduler: Scheduler = async): Observable> { + scheduler: IScheduler = async): Observable> { return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler)); } @@ -66,7 +66,7 @@ class WindowTimeOperator implements Operator> { constructor(private windowTimeSpan: number, private windowCreationInterval: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { } call(subscriber: Subscriber>, source: any): any { @@ -80,7 +80,7 @@ interface CreationState { windowTimeSpan: number; windowCreationInterval: number; subscriber: WindowTimeSubscriber; - scheduler: Scheduler; + scheduler: IScheduler; } /** @@ -94,7 +94,7 @@ class WindowTimeSubscriber extends Subscriber { constructor(protected destination: Subscriber>, private windowTimeSpan: number, private windowCreationInterval: number, - private scheduler: Scheduler) { + private scheduler: IScheduler) { super(destination); if (windowCreationInterval !== null && windowCreationInterval >= 0) { let window = this.openWindow();