peterkhayes/rolling-rate-limiter

Updating @types/ioredis to v4.19.1 causes compilation errors

ColeWalker-AgencySpotter opened this issue · 2 comments

Initializing a RedisRateLimiter using an ioredis client will cause a typescript error.

Type 'Redis' is not assignable to type 'RedisClient'.
  The types of 'multi(...).zadd' are incompatible between these types.
    Type '{ (key: KeyType, score: number, member: string): Pipeline; (key: KeyType, score: number, member: string, score2: number, member2: string): Pipeline; (key: KeyType, score: number, member: string, score2: number, member2: string, score3: number, member3: string): Pipeline; (key: KeyType, score: number, member: string,...' is not assignable to type '(key: string, score: string, value: string) => void'.
      Types of parameters 'score' and 'score' are incompatible.
        Type 'string' is not assignable to type 'number'.ts(2322)
index.d.ts(94, 5): The expected type comes from property 'client' which is declared here on type 'RedisRateLimiterOptions'

Thanks, I can reproduce this as well. I've pushed a fix and will publish it if CI is working (was getting some errors mocking github actions locally)

This should be working now with 0.2.10