Reputation: 575
I am unable to make Redis api to promisifyAll in typescript.
import * as redis from 'redis';
import {RedisClient} from 'redis';
import * as Promise from 'bluebird';
Promise.promisifyAll(redis);
const client: RedisClient = redis.createClient(CacheConfig);
I am getting the following typescript error.
Upvotes: 1
Views: 1442
Reputation: 275799
getting the following (tslint)error.
Stuff that mutates objects at runtime is not well supported by the TypeScript's (static) type system. PromisifyAll
magically inserts new functions, but these new magic functions do not become a part of the existing interfaces (in this case RedisClient
). You need to extend the RedisClient
interface manually.
PS:
Not a tslint
error. Its a typescript
error.
Upvotes: 2