UNPKG

nestjs-throttler-storage-mongo

Version:
14 lines (13 loc) 724 B
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>; }