/** * Token bucket rate limiter with lazy refill on acquire. */ export declare class RateLimiter { private readonly rateDelta; private readonly rateLimit; private readonly now; private static readonly defaultNow; /** Remaining tokens in the current rate-limit window. */ private tokens; /** Timestamp (ms) of the last token refill. */ private lastRefill; /** Resolvers waiting for a token when the bucket is empty. */ private waiters; /** Creates a rate limiter with the given burst size and window duration. */ constructor(rateDelta: number, rateLimit: number, now?: () => number); /** Wait until a token is available, then consume one. */ acquire(): Promise; /** Wake waiters after the clock advances (for testing). */ notify(): void; /** Refills tokens based on elapsed time and wakes waiting acquirers. */ private refill; }