mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Accept PromiseLike object
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
declare global {
|
||||
interface Promise<T> {
|
||||
finally<U>(onFinally?: () => U | Promise<U>): Promise<T>;
|
||||
finally<U>(onFinally?: () => U | PromiseLike<U>): Promise<T>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ var promise = new Promise<Boolean>((resolve, reject) => {
|
||||
});
|
||||
|
||||
promise.finally(() => {});
|
||||
promise.finally(() => <PromiseLike<void>>Promise.resolve());
|
||||
promise.then(() => {}, () => {}).finally(() => {});
|
||||
promise.catch(() => {}).finally(() => {});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user