import { SadBotBase, SadBotBaseParams } from './SadBotBase';
export declare const enum ThrottlingTimeSpan {
    Seconds = 1,
    Minutes = 60,
    Hours = 3600,
    Days = 86400
}
export interface ThrottlingConstraint {
    constraint: () => string;
    maxRequests: number;
    timeValue: number;
    timeSpan: ThrottlingTimeSpan;
}
export declare class ThrottlingConstraintBuilder {
    private constraint;
    private maxRequests;
    private timeValue;
    private timeSpan;
    by: (fn: () => string) => this;
    limitRequestsTo: (totalRequests: number) => this;
    duration: (perValue: number) => this;
    seconds: () => this;
    second: () => this;
    minutes: () => this;
    minute: () => this;
    hours: () => this;
    hour: () => this;
    days: () => this;
    day: () => this;
    build: () => {
        constraint: () => string;
        maxRequests: number;
        timeSpan: ThrottlingTimeSpan;
        timeValue: number;
    };
}
export declare class RequestLimitExceeded extends Error {
    constructor(resourceId: string, currentRate: number);
}
export declare class Throttling extends SadBotBase {
    prefix: string;
    maxKeys: number;
    private configure;
    constructor(params: SadBotBaseParams | undefined, fn: (conf: ThrottlingConstraintBuilder) => ThrottlingConstraintBuilder);
    hashedResourceId: (resourceId: string) => string;
    hashedPrefix: (resourceId: string) => string;
    touchInputRequest: (resourceId: string, expiration?: number) => Promise<string | null>;
    rate: (resourceId: string) => Promise<number>;
    throttleBy: (fn: () => string) => Promise<void>;
    throttle: () => Promise<void>;
}
