nestjs-throttler-storage-mongo
Version:
Mongo storage provider for nestjs/throttler
14 lines (13 loc) • 724 B
TypeScript
import { OnApplicationShutdown } from '@nestjs/common';
import { MongoClient, MongoClientOptions } from 'mongodb';
import { ThrottlerStorageMongo } from './throttler-storage-mongo.interface';
import { ThrottlerStorageRecord } from '@nestjs/throttler/dist/throttler-storage-record.interface';
export declare class ThrottlerStorageMongoService implements ThrottlerStorageMongo, OnApplicationShutdown {
mongoClient: MongoClient;
private _storage;
get storage(): Record<string, ThrottlerStorageRecord>;
constructor(url: string, mongoOptions?: MongoClientOptions);
private createTTLIndex;
increment(key: string, ttl: number): Promise<ThrottlerStorageRecord>;
onApplicationShutdown(): Promise<void>;
}