I started a new project where I'd like to use TypeScript instead of pure Javascript. I am struggling with the use of Bluebird in conjunction with third party libraries.
See the following example:
import * as Promise from 'bluebird'
private requestPlayerProfile(playerTag:string):Promise<IPlayerProfile> {
const requestOptions = Object.create(this.options)
return this.limiter.schedule(request, requestOptions)
}
The problem: limiter
is an instance of a third party library and limiter.schedule returns a native promise apparently, while I am using the Bluebird promises in the rest of my application. How would I properly handle such cases?
[ts] Type 'Promise' is not assignable to type 'Bluebird'. Types of property 'then' are incompatible.