Reputation: 27811
I basically want to replace the Promise
definition in Typescript (v2.0.10) with Bluebird. I read a lot about this but came out confused -- is it possible or not?
I really don't want to have to do this at the top of every TS file:
import * as Promise from "bluebird";
I tried to do this in my _stubs.d.ts
to no avail:
import * as Bluebird from "bluebird";
declare var Promise: typeof Bluebird;
Upvotes: 10
Views: 7152
Reputation: 666
npm install --save-dev @types/bluebird-global
Edit your tsconfig.json
to list bluebird-global
in the types
array:
{
"compilerOptions": {
"types": [
"bluebird-global"
],
// the rest of the options
}
}
Edit:
Step 2 is not necessary if you don't use the compilerOptions.types
in your tsconfig.json
.
Upvotes: 5