import { RateLimiterOptions } from "./types.js";
import { NextFunction, Request, Response } from "express";
/**
 * Creates an Express-compatible rate limiter middleware using Upstash Redis.
 *
 * @param options Configuration for rate limiting behavior.
 *
 * @param options.redisUrl - (Required) The REST URL of your Upstash Redis database.
 * @param options.redisToken - (Required) The access token for Upstash Redis.
 * @param options.maxRequests - (Required) The maximum number of requests allowed per time window.
 * @param options.windowInSeconds - (Required) The duration of the rate-limiting window, in seconds.
 * @param options.keyFn - (Optional) A custom function to generate a unique key per requester (default: `req.ip`).
 * @param options.onLimitReached - (Optional) A callback that runs when the rate limit is exceeded.
 * @param options.onError - (Optional) A function to run when Redis fails (e.g., for logging).
 * @param options.debug - (Optional) If true, logs key usage info for debugging.
 *
 * @returns Express middleware function that enforces the rate limit.
 */
export declare function createRateLimiter(options: RateLimiterOptions): (req: Request, res: Response, next: NextFunction) => Promise<void | Response<any, Record<string, any>>>;
