mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-18 04:24:30 +08:00
Merge pull request #9912 from slavik57/master
Add promise.prototype.finally definition file
This commit is contained in:
12
promise.prototype.finally/promise.prototype.finally-tests.ts
Normal file
12
promise.prototype.finally/promise.prototype.finally-tests.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/// <reference path="./promise.prototype.finally.d.ts"/>
|
||||
|
||||
var promise = new Promise<Boolean>((resolve, reject) => {
|
||||
resolve(true);
|
||||
});
|
||||
|
||||
promise.finally(() => {});
|
||||
promise.then(() => {}, () => {}).finally(() => {});
|
||||
promise.catch(() => {}).finally(() => {});
|
||||
|
||||
var allPromise = Promise.all([promise]);
|
||||
allPromise.finally(() => {});
|
||||
8
promise.prototype.finally/promise.prototype.finally.d.ts
vendored
Normal file
8
promise.prototype.finally/promise.prototype.finally.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Type definitions for promise.prototype.finally v1.0.1
|
||||
// Project: https://github.com/matthew-andrews/Promise.prototype.finally
|
||||
// Definitions by: Slava Shpitalny <https://github.com/slavik57>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare interface Promise<T> {
|
||||
finally<U>(onFinally?: () => U | Promise<U>): Promise<U>;
|
||||
}
|
||||
Reference in New Issue
Block a user