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.

16 lines (15 loc) 790 B
/** * @module RateLimiter */ import { type BackoffPolicy } from "../../../../backoff-policies/_module.js"; import { type AllRateLimiterState, type RateLimiterPolicy } from "../../../../rate-limiter/implementations/adapters/database-rate-limiter-adapter/rate-limiter-policy.js"; /** * @internal */ export declare class RateLimiterStateManager<TMetrics = unknown> { private readonly rateLimiterPolicy; private readonly backoffPolicy; constructor(rateLimiterPolicy: RateLimiterPolicy<TMetrics>, backoffPolicy: BackoffPolicy); updateState: (limit: number, currentDate: Date) => (currentState: AllRateLimiterState<TMetrics>) => AllRateLimiterState<TMetrics>; track: (currentDate: Date) => (currentState: AllRateLimiterState<TMetrics>) => AllRateLimiterState<TMetrics>; }