Merge pull request #3483 from Igorbek/promises-a-plus

Improved Promises A+ definitions (for TS 1.4)
This commit is contained in:
Igor Oleinikov 2015-01-18 13:37:06 -08:00
commit 56068d3354

View File

@ -12,10 +12,7 @@ declare module PromisesAPlus {
new <T>(resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): Thenable<T>;
}
interface Thenable<R> {
then<U>(onFulfill: (value: R) => Thenable<U>, onReject: (error: any) => Thenable<U>): Thenable<U>;
then<U>(onFulfill: (value: R) => Thenable<U>, onReject?: (error: any) => U): Thenable<U>;
then<U>(onFulfill: (value: R) => U, onReject: (error: any) => Thenable<U>): Thenable<U>;
then<U>(onFulfill?: (value: R) => U, onReject?: (error: any) => U): Thenable<U>;
interface Thenable<T> {
then<R>(onFulfill?: (value: T) => Thenable<R>|R, onReject?: (error: any) => Thenable<R>|R): Thenable<R>;
}
}