UNPKG

@daiso-tech/core

Version:

The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.

20 lines (19 loc) 1.08 kB
/** * @module RateLimiter */ import { type IReadableContext } from "../../../../execution-context/contracts/_module.js"; import { type IRateLimiterData, type IRateLimiterStorageAdapter, type IRateLimiterStorageAdapterTransaction } from "../../../../rate-limiter/contracts/_module.js"; import { type InvokableFn } from "../../../../utilities/_module.js"; /** * The `NoOpRateLimiterStorageAdapterTransaction` will do nothing and is used for easily mocking {@link IRateLimiterFactory | `IRateLimiterFactory`} for testing. * * IMPORT_PATH: `"@daiso-tech/core/rate-limiter/no-op-rate-limiter-storage-adapter"` * @group Adapters */ export declare class NoOpRateLimiterStorageAdapter<TType> implements IRateLimiterStorageAdapter<TType> { transaction<TValue>(_context: IReadableContext, fn: InvokableFn<[ transaction: IRateLimiterStorageAdapterTransaction<TType> ], Promise<TValue>>): Promise<TValue>; find(_context: IReadableContext, _key: string): Promise<IRateLimiterData<TType> | null>; remove(_context: IReadableContext, _key: string): Promise<void>; }