/** * Leaky-bucket rate limiter. * * The bucket accumulates requests up to `capacity`. Water leaks out at a * constant `leakRate` requests/second — the effective steady-state rate. * When the bucket is full, incoming requests are rejected. Unlike * token-bucket, there is **no burst tolerance**: outgoing rate is * strictly bounded by `leakRate`. * * Use for traffic shaping and protecting downstream services with a hard * throughput ceiling (SMTP relays, upstream APIs with quota-per-second). * For user-facing endpoints, prefer `sliding` or `tokenBucket`. * * State encoding matches token-bucket: `"|"`. * Writes go through the store's optional atomic `compareAndSet` when * available (bundled memory + Redis stores both provide it) so * concurrent requests can't race the level; stores without it fall * back to last-writer-wins `set`. * * @param {import('../index.js').BucketLimiterConfig} config * @returns {import('../index.js').Limiter} */ export function leakyBucket(config: import("../index.js").BucketLimiterConfig): import("../index.js").Limiter;