mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
* [promise.prototype.finally] add typings for the non-shim variant of promise.prototype.finally * [promise.prototype.finally] change indentation to 4 spaces * [promise.prototype.finally] fix lint error
19 lines
651 B
TypeScript
19 lines
651 B
TypeScript
// Type definitions for promise.prototype.finally 2.0
|
|
// Project: https://github.com/matthew-andrews/Promise.prototype.finally
|
|
// Definitions by: Slava Shpitalny <https://github.com/slavik57>
|
|
// BendingBender <https://github.com/BendingBender>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
declare global {
|
|
interface Promise<T> {
|
|
finally<U>(onFinally?: () => U | PromiseLike<U>): Promise<T>;
|
|
}
|
|
}
|
|
|
|
export = promiseFinally;
|
|
|
|
declare function promiseFinally<T, U>(promise: Promise<T>, onFinally?: () => U | PromiseLike<U>): Promise<T>;
|
|
declare namespace promiseFinally {
|
|
function shim(): void;
|
|
}
|