peterkhayes/rolling-rate-limiter

Incompatible with ioredis 5.x.x

SammyWhamy opened this issue · 3 comments

error TS2322: Type 'Redis' is not assignable to type 'RedisClient'.
  Types of property 'multi' are incompatible.
    Type '{ (options: { pipeline: false; }): Promise<"OK">; (): ChainableCommander; (options: { pipeline: true; }): ChainableCommander; (commands?: unknown[][] | undefined): ChainableCommander; }' is not assignable to type '() => RedisBatch'.

21     client: redis,
       ~~~~~~

  node_modules/rolling-rate-limiter/lib/index.d.ts:100:5
    100     client: RedisClient;
            ~~~~~~
    The expected type comes from property 'client' which is declared here on type 'RedisRateLimiterOptions'

Thanks for the heads up. Would appreciate a fix if you have time; probably just a type-level thing. If not I will get to this eventually.

Is it possible that they also have problems with version 4 of redis?

This is now fixed! Upgrade to 0.4 and the newest versions of redis and ioredis will both work!