I recently came across a ES6 Promise compatible finally implementation called promise.prototype.finally that I was using in a Node application. Now, I want to convert this application to TypeScript but unfortunately, I couldn't find any typings available for this package on DefinitelyTyped. In situations like these, I have created my own impromptu type definitions for the functionality that I require. However, given that this library modifies the prototype of the Promise object, I am unsure about how to represent it conventionally in TypeScript. Any suggestions or ideas?
Possibly related:
- https://github.com/Microsoft/TypeScript/issues/280
- https://github.com/Microsoft/TypeScript/issues/7015
- https://github.com/Microsoft/TypeScript/issues/6722
- Declaration merging with ES6 style modules