Skip to content

Commit

Permalink
fix(typings): don't expose PromiseConstructor dependency
Browse files Browse the repository at this point in the history
closes #1270
  • Loading branch information
alexeagle authored and kwonoj committed Feb 1, 2016
1 parent 446ae95 commit f59225b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/CoreOperators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export interface CoreOperators<T> {
timeout?: (due: number | Date, errorToSend?: any, scheduler?: Scheduler) => Observable<T>;
timeoutWith?: <R>(due: number | Date, withObservable: Observable<R>, scheduler?: Scheduler) => Observable<T> | Observable<R>;
toArray?: () => Observable<T[]>;
toPromise?: (PromiseCtor: PromiseConstructor) => Promise<T>;
toPromise?: (PromiseCtor: typeof Promise) => Promise<T>;
window?: (closingNotifier: Observable<any>) => Observable<Observable<T>>;
windowCount?: (windowSize: number, startWindowEvery: number) => Observable<Observable<T>>;
windowTime?: (windowTimeSpan: number, windowCreationInterval?: number, scheduler?: Scheduler) => Observable<Observable<T>>;
Expand Down
4 changes: 2 additions & 2 deletions src/Observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class Observable<T> implements CoreOperators<T> {
* @returns {Promise} a promise that either resolves on observable completion or
* rejects with the handled error
*/
forEach(next: (value: T) => void, thisArg: any, PromiseCtor?: PromiseConstructor): Promise<void> {
forEach(next: (value: T) => void, thisArg: any, PromiseCtor?: typeof Promise): Promise<void> {
if (!PromiseCtor) {
if (root.Rx && root.Rx.config && root.Rx.config.Promise) {
PromiseCtor = root.Rx.config.Promise;
Expand Down Expand Up @@ -269,7 +269,7 @@ export class Observable<T> implements CoreOperators<T> {
timeout: (due: number | Date, errorToSend?: any, scheduler?: Scheduler) => Observable<T>;
timeoutWith: <R>(due: number | Date, withObservable: Observable<R>, scheduler?: Scheduler) => Observable<T> | Observable<R>;
toArray: () => Observable<T[]>;
toPromise: (PromiseCtor?: PromiseConstructor) => Promise<T>;
toPromise: (PromiseCtor?: typeof Promise) => Promise<T>;
window: (closingNotifier: Observable<any>) => Observable<Observable<T>>;
windowCount: (windowSize: number, startWindowEvery: number) => Observable<Observable<T>>;
windowTime: (windowTimeSpan: number, windowCreationInterval?: number, scheduler?: Scheduler) => Observable<Observable<T>>;
Expand Down
2 changes: 1 addition & 1 deletion src/operator/toPromise.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {root} from '../util/root';

export function toPromise<T>(PromiseCtor?: PromiseConstructor): Promise<T> {
export function toPromise<T>(PromiseCtor?: typeof Promise): Promise<T> {
if (!PromiseCtor) {
if (root.Rx && root.Rx.config && root.Rx.config.Promise) {
PromiseCtor = root.Rx.config.Promise;
Expand Down

0 comments on commit f59225b

Please sign in to comment.