DefinitelyTyped/types/rate-limit-redis/rate-limit-redis-tests.ts
Chris e72d59512c Add typings for rate-limit-redis (#39036)
* 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
2019-10-14 16:47:14 -07:00

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({}),
});