Ioredis: HGETALL and HINCRBY functions not declared in typescript types

Created on 6 Apr 2020  路  2Comments  路  Source: luin/ioredis

Though HGETALL and HINCRBY are implemented in Cluster class but in the types node module package its not defined. I had to do a hack to fix it by extending and just declaring the methods. Please fix it. The hack I did was:

interface MyCluster extends Cluster {
    hgetall(key: IORedis.KeyType): Promise<Record<string, string>>;
    hincrby(key: IORedis.KeyType, field: string, increment: number): Promise<number>;
}

Most helpful comment

I've opened a PR to add these and many other missing command definitions. The PR changes Cluster such that it inherits commands from a common Commands interface, which should hopefully make these definition gaps a thing of the past.

All 2 comments

I've opened a PR to add these and many other missing command definitions. The PR changes Cluster such that it inherits commands from a common Commands interface, which should hopefully make these definition gaps a thing of the past.

Should be fixed now with @types/ioredis 4.16.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

snig-b picture snig-b  路  5Comments

haoxins picture haoxins  路  5Comments

pensierinmusica picture pensierinmusica  路  5Comments

pavanratnakar picture pavanratnakar  路  4Comments

No1Jie picture No1Jie  路  5Comments