3.0.0 • Published 2 years ago
@types/rate-limit-redis v3.0.0
Installation
npm install --save @types/rate-limit-redis
Summary
This package contains type definitions for rate-limit-redis (https://github.com/wyattjoh/rate-limit-redis#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rate-limit-redis.
index.d.ts
// 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>
// 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, StoreIncrementCallback } from 'express-rate-limit';
declare namespace RedisStore {
interface Options {
expiry?: number | undefined;
prefix?: string | undefined;
resetExpiryOnChange?: boolean | undefined;
client?: RedisClient | IORedis.Redis | undefined;
redisURL?: string | undefined;
}
}
declare class RedisStore implements Store {
constructor(options?: RedisStore.Options);
incr(key: string, cb: StoreIncrementCallback): void;
decrement(key: string): void;
resetKey(key: string): void;
// rate-limit-redis 1.7.0 doesn't actually implement resetAll() and
// express-rate-limit 5.1.1 doesn't actually call it, but it's required by
// the Store interface so it's included here.
resetAll(): void;
}
export = RedisStore;
Additional Details
- Last updated: Thu, 06 Jan 2022 23:01:29 GMT
- Dependencies: @types/redis, @types/ioredis, @types/express-rate-limit
- Global values: none
Credits
These definitions were written by Chris Suich, Connor Love, and Austin Beer.