import { RatelimitRule } from "../rules"; import { RatelimitServicePlugin, TrafficShapingPlugin } from "../plugins"; import { Metadata } from "../metadata"; import { LocalRegistry } from "../registry"; import { LocalRatelimiterOptions, GlobalRatelimiterOptions } from "./ratelimiter"; import { Logger } from "../logging"; declare const kDefaultOptions: LocalRatelimiterOptions | GlobalRatelimiterOptions; export declare type RatelimitOptions = typeof kDefaultOptions; export declare type Quota = Promise<(() => Promise) | void>; export declare class Ratelimit { private readonly logger; private readonly registry; private readonly ratelimit; private readonly shaping; private readonly limiters; private readonly options; private disposed; constructor(logger: Logger, registry: LocalRegistry, ratelimit: RatelimitServicePlugin, shaping: TrafficShapingPlugin[], options?: Partial); dispose(): void; query(namespace: string, service: string, cluster: string | undefined, labels: Metadata, id?: string): Promise; acquire(namespace: string, service: string, amount: number, rule?: RatelimitRule): Quota[]; private allocation; private produce; } export {};