import type { ServerRateLimitConfig as RateLimitConfig, ServerRateLimitResult as RateLimitResult } from '@donotdev/core';
export type { RateLimitConfig, RateLimitResult };
/**
 * Check rate limit for a given key using in-memory storage
 * For production, this should be replaced with Redis or Firestore
 *
 * @version 0.1.0
 * @since 0.0.1
 * @author AMBROISE PARK Consulting
 */
export declare function checkRateLimit(key: string, config: RateLimitConfig): Promise<RateLimitResult>;
/**
 * Check rate limit using Firestore for persistent storage.
 * This is the recommended approach for production.
 *
 * **Architecture decision — Firestore transaction for rate limiting:**
 * The read-modify-write cycle is wrapped in a Firestore transaction to
 * eliminate TOCTOU races. While transactions add some latency, rate limiting
 * is a best-effort abuse-prevention mechanism, not a hard security boundary.
 * The window-based approach (maxAttempts per windowMs) tolerates minor
 * timing variations. If transaction contention becomes an issue under extreme
 * load, the catch block fails open (allows the request) to avoid blocking
 * legitimate traffic — this is an intentional trade-off favoring availability
 * over strict enforcement.
 *
 * For stricter rate limiting (e.g. payment endpoints), consumers can use
 * Redis-backed rate limiters or API gateway-level throttling.
 *
 * @version 0.1.0
 * @since 0.0.1
 * @author AMBROISE PARK Consulting
 */
export declare function checkRateLimitWithFirestore(key: string, config: RateLimitConfig): Promise<RateLimitResult>;
/**
 * Reset rate limit for a given key
 *
 * @version 0.1.0
 * @since 0.0.1
 * @author AMBROISE PARK Consulting
 */
export declare function resetRateLimit(key: string): void;
/**
 * Reset rate limit in Firestore
 *
 * @version 0.1.0
 * @since 0.0.1
 * @author AMBROISE PARK Consulting
 */
export declare function resetRateLimitInFirestore(key: string): Promise<void>;
/**
 * Get rate limit status without consuming an attempt
 *
 * @version 0.1.0
 * @since 0.0.1
 * @author AMBROISE PARK Consulting
 */
export declare function getRateLimitStatus(key: string, config: RateLimitConfig): RateLimitResult;
/**
 * Default rate limit configurations for common operations
 */
export declare const DEFAULT_RATE_LIMITS: {
    readonly checkout: {
        readonly maxAttempts: 5;
        readonly windowMs: number;
        readonly blockDurationMs: number;
    };
    readonly webhook: {
        readonly maxAttempts: 100;
        readonly windowMs: number;
        readonly blockDurationMs: number;
    };
    readonly auth: {
        readonly maxAttempts: 10;
        readonly windowMs: number;
        readonly blockDurationMs: number;
    };
    readonly api: {
        readonly maxAttempts: 100;
        readonly windowMs: number;
        readonly blockDurationMs: number;
    };
};
