mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add typings for rate-limit-redis * Limit rate-limit-redis to TS 2.3 b/c of express-rate-limit requirement * Bump rate-limit-redis to TS 2.7
29 lines
479 B
TypeScript
29 lines
479 B
TypeScript
import { RedisClient } from 'redis';
|
|
import RedisStore from 'rate-limit-redis';
|
|
import { Store } from 'express-rate-limit';
|
|
|
|
let store: Store;
|
|
|
|
// $ExpectType Store
|
|
store = RedisStore();
|
|
|
|
// $ExpectType Store
|
|
store = RedisStore({
|
|
expiry: 1000,
|
|
});
|
|
|
|
// $ExpectType Store
|
|
store = RedisStore({
|
|
prefix: 'types',
|
|
});
|
|
|
|
// $ExpectType Store
|
|
store = RedisStore({
|
|
resetExpiryOnChange: false,
|
|
});
|
|
|
|
// $ExpectType Store
|
|
store = RedisStore({
|
|
client: new RedisClient({}),
|
|
});
|