/** * Inline Lua scripts for rate limiting operations. * * Scripts are stored as inline strings to avoid issues with file reading * after build (dist directory doesn't contain .lua files). */ /** * Fixed Window Lua script. * * State lives in a hash at the BARE key ({window, count}) instead of a * per-window subkey, so `reset()`'s DEL on the key actually clears the * counter (and stays single-key, i.e. cluster-safe without hash tags). * A stale window field means the window rolled over: the hash is dropped * and recreated for the current window. * * KEYS[1] = rate limit key * ARGV[1] = max points * ARGV[2] = window duration (seconds) * ARGV[3] = current timestamp * * Returns: {allowed, remaining, reset, current} */ export declare const FIXED_WINDOW_SCRIPT: string; /** * Sliding Window Log Lua script. * * KEYS[1] = rate limit key * ARGV[1] = max points * ARGV[2] = window duration (seconds) * ARGV[3] = current timestamp (ms) * ARGV[4] = unique request id * * Returns: {allowed, remaining, reset, current, retryAfter?} */ export declare const SLIDING_WINDOW_SCRIPT: string; /** * Token Bucket Lua script. * * KEYS[1] = rate limit key * ARGV[1] = bucket capacity * ARGV[2] = refill rate (tokens per second) * ARGV[3] = current timestamp (ms) * ARGV[4] = tokens to consume (default: 1) * * Returns: {allowed, remaining, reset, current, retryAfter?} */ export declare const TOKEN_BUCKET_SCRIPT: string; //# sourceMappingURL=lua-scripts.d.ts.map