Skip to content

Commit 35119c8

Browse files
committed
Add the actual typing fix
1 parent eea6c97 commit 35119c8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

es6-promise/es6-promise.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
// Definitions: https://github.com/borisyankov/DefinitelyTyped
55

66
interface Thenable<R> {
7-
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
7+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
8+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
89
}
910

1011
declare class Promise<R> implements Thenable<R> {
@@ -27,7 +28,8 @@ declare class Promise<R> implements Thenable<R> {
2728
* @param onFulfilled called when/if "promise" resolves
2829
* @param onRejected called when/if "promise" rejects
2930
*/
30-
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
31+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
32+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Promise<U>;
3133

3234
/**
3335
* Sugar for promise.then(undefined, onRejected)

0 commit comments

Comments
 (0)