/**
 * In-Memory Rate Limit Adapter
 *
 * Provides a rate limiting implementation that runs entirely in memory,
 * suitable for development, testing, or single-instance deployments.
 *
 * Features:
 * - Sliding window algorithm using timestamps
 * - Per-key rate limiting
 * - Automatic cleanup of expired entries
 *
 * Note: In-memory rate limits are NOT shared across instances.
 * Use Redis-backed rate limiting for multi-instance deployments.
 *
 * @packageDocumentation
 */
import type { IRateLimitAdapter, RateLimitResult } from './types.js';
/**
 * Configuration options for the memory rate limiter
 */
export interface MemoryRateLimitOptions {
    /** Cleanup interval in milliseconds (default: 1 minute) */
    cleanupIntervalMs?: number;
}
/**
 * In-memory rate limit adapter implementation
 */
export declare class MemoryRateLimitAdapter implements IRateLimitAdapter {
    private entries;
    private cleanupTimer;
    private readonly options;
    constructor(options?: MemoryRateLimitOptions);
    /**
     * Check and consume rate limit
     */
    checkLimit(key: string, limit: number, windowSeconds: number): Promise<RateLimitResult>;
    /**
     * Get current rate limit status without consuming
     */
    getStatus(key: string, limit: number, windowSeconds: number): Promise<RateLimitResult>;
    /**
     * Reset rate limit for a key
     */
    reset(key: string): Promise<void>;
    /**
     * Get the number of tracked keys
     */
    get size(): number;
    /**
     * Stop the background cleanup timer
     */
    stop(): void;
    /**
     * Calculate when the rate limit window resets
     */
    private calculateResetAt;
    /**
     * Start background cleanup of stale entries
     */
    private startCleanup;
    /**
     * Remove entries with no recent timestamps
     */
    private cleanupStale;
}
/**
 * Get the default memory rate limit adapter instance
 */
export declare function getMemoryRateLimitAdapter(options?: MemoryRateLimitOptions): IRateLimitAdapter;
/**
 * Create a new memory rate limit adapter instance (for testing)
 */
export declare function createMemoryRateLimitAdapter(options?: MemoryRateLimitOptions): MemoryRateLimitAdapter;
/**
 * Reset the default instance (for testing)
 */
export declare function resetMemoryRateLimitAdapter(): void;
//# sourceMappingURL=memory-ratelimit.d.ts.map