Skip to content

Commit

Permalink
Allow bluebird to be assignable to ES2016 promise (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Strate authored and blakeembrey committed Sep 6, 2016
1 parent 120a62f commit ba2d139
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bluebird.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ declare class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R
constructor(callback: (resolve: (thenableOrResult?: R | Bluebird.Thenable<R>) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void);

/**
* Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
* Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `onFulfill`, `onReject` and the state of this promise.
*/
then<U>(onFulfill: (value: R) => U | Bluebird.Thenable<U>, onReject?: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U>;
then<U>(onFulfill: (value: R) => U | Bluebird.Thenable<U>, onReject?: (error: any) => void | Bluebird.Thenable<void>): Bluebird<U>;
then<U1, U2>(onFulfill: (value: R) => U1 | Bluebird.Thenable<U1>, onReject: (error: any) => U2 | Bluebird.Thenable<U2>): Bluebird<U1 | U2>;
then<U>(onFulfill: (value: R) => U | Bluebird.Thenable<U>, onReject: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U>;
then<U>(onFulfill: (value: R) => U | Bluebird.Thenable<U>): Bluebird<U>;
then(): Bluebird<R>;

/**
* This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler.
Expand Down

0 comments on commit ba2d139

Please sign in to comment.