import { Bucket, RateLimiterConfig } from './constants';
export declare class RateLimiter {
    private readonly buckets;
    private config;
    constructor(config?: RateLimiterConfig);
    log(...args: unknown[]): void;
    getOrCreateBucket(bucketId: string, appKey: string, appInstanceId: string): Bucket;
    refill(bucket: Bucket): void;
    startRefillTimer(bucketId: string, bucket: Bucket): void;
    drainQueue(bucket: Bucket): void;
    cleanupIdleIfNeeded(bucketId: string, bucket: Bucket): void;
    destroyBucket(bucket: Bucket): void;
    /**
     * Resolves when a token is available for `bucketId`.
     * If the bucket is empty the request is queued; a console warning is printed
     * and the promise resolves once a token is refilled.
     * Rejects if the queue timeout elapses before a token is available.
     */
    acquire(appKey: string, appInstanceId: string | number): Promise<void>;
    updateConfig(config?: RateLimiterConfig): void;
    /** Clear all timers and reject all queued requests. */
    destroy(): void;
}
export declare const apiRequestsRateLimiter: RateLimiter;
//# sourceMappingURL=rateLimiter.d.ts.map