Skip to content

Commit

Permalink
Merge pull request #348 from Lucretiel/patch-1
Browse files Browse the repository at this point in the history
Fixed type definition for `Promise.finally`
  • Loading branch information
stefanpenner committed Jun 6, 2019
2 parents a2bcc62 + 9aa2b3c commit a5abe50
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions es6-promise.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ export class Promise <R> implements Thenable <R> {
catch <U> (onRejected?: (error: any) => U | Thenable<U>): Promise<U>;

/**
* onSettled is invoked when/if the "promise" settles (either rejects or fulfills);
* onSettled is invoked when/if the "promise" settles (either rejects or fulfills).
* The returned promise is settled when the `Thenable` returned by `onFinally` settles;
* it is rejected if `onFinally` throws or rejects; otherwise it assumes the state of the
* original Promise.
*
* @param onFinally called when/if "promise" settles
*/
finally <U> (onFinally?: (callback: any) => U | Thenable<U>): Promise<U>;
finally (onFinally?: () => any | Thenable<any>): Promise<R>;

/**
* Make a new promise from the thenable.
Expand Down

0 comments on commit a5abe50

Please sign in to comment.