diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index fba0f8ab452..fb0c64f8495 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -3572,14 +3572,14 @@ declare module Reflect { function setPrototypeOf(target: any, proto: any): boolean; } -interface IPromise { +interface PromiseLike { /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: (value: T) => TResult | IPromise, onrejected?: (reason: any) => TResult | IPromise): IPromise; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; } /** @@ -3592,14 +3592,14 @@ interface Promise { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled?: (value: T) => TResult | IPromise, onrejected?: (reason: any) => TResult | IPromise): Promise; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; /** * Attaches a callback for only the rejection of the Promise. * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of the callback. */ - catch(onrejected?: (reason: any) => T | IPromise): Promise; + catch(onrejected?: (reason: any) => T | PromiseLike): Promise; [Symbol.toStringTag]: string; } @@ -3616,7 +3616,7 @@ interface PromiseConstructor { * a resolve callback used resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ - new (executor: (resolve: (value?: T | IPromise) => void, reject: (reason?: any) => void) => void): Promise; + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -3624,7 +3624,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: Iterable>): Promise; + all(values: Iterable>): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved @@ -3632,7 +3632,7 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - race(values: Iterable>): Promise; + race(values: Iterable>): Promise; /** * Creates a new rejected promise for the provided reason. @@ -3653,7 +3653,7 @@ interface PromiseConstructor { * @param value A promise. * @returns A promise whose internal state matches the provided promise. */ - resolve(value: T | IPromise): Promise; + resolve(value: T | PromiseLike): Promise; /** * Creates a new resolved promise .