mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add IORedis and redisURL to rate-limit-redis (#43070)
* Update to support IORedis and redisURL to match rate-limit-redis 1.7.0 * Fix lint issue
This commit is contained in:
parent
a806d97668
commit
6e2941256d
9
types/rate-limit-redis/index.d.ts
vendored
9
types/rate-limit-redis/index.d.ts
vendored
@ -1,18 +1,21 @@
|
||||
// Type definitions for rate-limit-redis 1.6
|
||||
// Type definitions for rate-limit-redis 1.7
|
||||
// Project: https://github.com/wyattjoh/rate-limit-redis#readme
|
||||
// Definitions by: Chris Suich <https://github.com/csuich2>
|
||||
// Connor love <https://github.com/dotconnor>
|
||||
// Connor Love <https://github.com/dotconnor>
|
||||
// Austin Beer <https://github.com/austin-beer>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
import { RedisClient } from 'redis';
|
||||
import IORedis = require('ioredis');
|
||||
import { Store } from 'express-rate-limit';
|
||||
|
||||
interface RedisStoreOptions {
|
||||
expiry?: number;
|
||||
prefix?: string;
|
||||
resetExpiryOnChange?: boolean;
|
||||
client?: RedisClient;
|
||||
client?: RedisClient | IORedis.Redis;
|
||||
redisURL?: string;
|
||||
}
|
||||
|
||||
declare var RedisStore: {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { RedisClient } from 'redis';
|
||||
import IORedis = require('ioredis');
|
||||
import RedisStore from 'rate-limit-redis';
|
||||
import { Store } from 'express-rate-limit';
|
||||
|
||||
@ -26,3 +27,13 @@ store = new RedisStore({
|
||||
store = new RedisStore({
|
||||
client: new RedisClient({}),
|
||||
});
|
||||
|
||||
// $ExpectType Store
|
||||
store = new RedisStore({
|
||||
client: new IORedis({}),
|
||||
});
|
||||
|
||||
// $ExpectType Store
|
||||
store = new RedisStore({
|
||||
redisURL: 'redis://localhost:6379',
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user