export type RateLimitRuleKey = {
    type: 'ip';
} | {
    type: 'userId';
} | {
    type: 'role';
    value: string;
};
export type RateLimitRuleInterval = 'second' | 'minute' | 'hour' | 'day';
/**
 * Represents a single rate limiting rule that applies to a specific
 * type of client, using a token bucket algorithm.
 */
export interface RateLimitRuleSchema {
    /**
     * A human-readable description of what this rule is for.
     * e.g., "Limit anonymous users to 60 requests per hour."
     */
    description?: string;
    /**
     * Defines how to group requests for rate limiting. This determines
     * who the limit applies to.
     *
     * - 'ip': Keys on the client's IP address. Best for anonymous traffic.
     * - 'userId': Keys on the authenticated user's ID. Best for logged-in users.
     * - 'role': Applies a shared limit to all users of a specific role.
     */
    key?: RateLimitRuleKey;
    /**
     * The number of requests allowed over the defined interval.
     * This is the rate at which tokens are added to the bucket.
     */
    rate?: number;
    /**
     * The time interval for the rate.
     */
    interval?: RateLimitRuleInterval;
    /**
     * The maximum number of requests that can be made in a burst.
     * This represents the "bucket size." A larger burst allows for
     * more requests to be made in a short period before throttling begins.
     */
    burst?: number;
}
/**
 * Represents a single rate limiting rule that applies to a specific
 * type of client, using a token bucket algorithm.
 */
export declare class RateLimitRule extends EventTarget implements RateLimitRuleSchema {
    accessor description: string | undefined;
    accessor key: RateLimitRuleKey | undefined;
    accessor rate: number | undefined;
    accessor interval: RateLimitRuleInterval | undefined;
    accessor burst: number | undefined;
    constructor(state?: Partial<RateLimitRuleSchema>);
    toJSON(): RateLimitRuleSchema;
    notifyChange(): void;
    static isRateLimitRuleInterval(value: unknown): value is RateLimitRuleInterval;
    static isRateLimitRuleKey(value: unknown): value is RateLimitRuleKey;
}
//# sourceMappingURL=RateLimitRule.d.ts.map