import type { PondoknusaRequest } from './request.js'; import type { Middleware } from './types.js'; export interface ThrottleEntry { count: number; resetAt: number; } /** * Pluggable counter store for rate limiting. * * The default in-memory store is process-local: it resets on restart and does * not share state across workers or instances. Pass a shared store (e.g. Redis) * in multi-node deployments. */ export interface ThrottleStore { get(key: string): ThrottleEntry | undefined | Promise; set(key: string, entry: ThrottleEntry): void | Promise; } export interface ThrottleOptions { limit: number; windowMs: number; key?: (request: PondoknusaRequest) => string; /** Defaults to a process-local Map. */ store?: ThrottleStore; } export declare function createThrottleMiddleware(options: ThrottleOptions): Middleware; export declare function resetThrottleStore(): void; export interface ThrottlePresetMap { [preset: string]: ThrottleOptions; } export declare function throttleMiddlewareAlias(preset: string): string; export declare function registerThrottlePresets(register: (name: string, middleware: Middleware) => void, presets: ThrottlePresetMap): void; //# sourceMappingURL=throttle.d.ts.map