Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typings): don't expose PromiseConstructor dependency #1276

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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