import { NextRequest, NextResponse } from 'next/server';
export interface RateLimitResult {
    allowed: boolean;
    remaining: number;
    resetTime: number;
    limit: number;
}
/**
 * Verifica el rate limit para un identificador específico
 */
export declare function checkRateLimit(identifier: string, limit?: number, windowMs?: number): RateLimitResult;
/**
 * Aplica rate limiting a una request API
 */
export declare function applyRateLimit(request: NextRequest, keyId: string, scopes: string[]): NextResponse | null;
/**
 * Agrega headers de rate limiting a una respuesta
 */
export declare function addRateLimitHeaders(response: NextResponse, keyId: string, scopes: string[]): NextResponse;
/**
 * Middleware helper para aplicar rate limiting automáticamente
 */
export declare function withRateLimit<T extends unknown[]>(handler: (request: NextRequest, ...args: T) => Promise<NextResponse>): (request: NextRequest, ...args: T) => Promise<NextResponse>;
/**
 * Obtiene estadísticas de rate limiting para un keyId
 */
export declare function getRateLimitStats(keyId: string): {
    currentUsage: number;
    resetTime: number;
    isNearLimit: boolean;
} | null;
/**
 * Limpia manualmente el rate limit para un keyId (útil para testing)
 */
export declare function clearRateLimit(keyId: string): void;
/**
 * Obtiene todas las estadísticas de rate limiting (útil para monitoring)
 */
export declare function getAllRateLimitStats(): Array<{
    keyId: string;
    count: number;
    resetTime: number;
}>;
/**
 * Obtiene estadísticas del cache de rate limiting
 */
export declare function getRateLimitCacheStats(): {
    total: number;
    active: number;
    expired: number;
    maxSize: number;
};
//# sourceMappingURL=rate-limit.d.ts.map