3.0.0 • Published 2 years ago

@types/rate-limit-redis v3.0.0

Weekly downloads
11,048
License
MIT
Repository
-
Last release
2 years ago

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

Credits

These definitions were written by Chris Suich, Connor Love, and Austin Beer.

3.0.0

2 years ago

1.7.4

2 years ago

1.7.3

2 years ago

1.7.2

3 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

5 years ago