UNPKG

@d-fischer/rate-limiter

Version:
12 lines (11 loc) 391 B
import type { QueueEntryLimitReachedBehavior } from './QueueEntry'; export interface RateLimiterRequestOptions { limitReachedBehavior?: QueueEntryLimitReachedBehavior; } export interface RateLimiter<Req, Res> { request: (req: Req, options?: RateLimiterRequestOptions) => Promise<Res>; clear: () => void; pause: () => void; resume: () => void; destroy?: () => void; }