@hono-rate-limiter/cloudflare
Version:
Cloudflare stores and helper functions for hono-rate-limiter.
14 lines (13 loc) • 641 B
TypeScript
import type { Env, Input, MiddlewareHandler } from "hono";
import type { ConfigType } from "./types";
/**
*
* Create an instance of rate-limiting middleware for Hono.
*
* @param config {ConfigType} - Options to configure the rate limiter.
*
* @returns - The middleware that rate-limits clients based on your configuration.
*
* @public
*/
export declare function cloudflareRateLimiter<E extends Env = Env, P extends string = string, I extends Input = Input>(config: Pick<ConfigType<E, P, I>, "rateLimitBinding" | "keyGenerator"> & Partial<Omit<ConfigType<E, P, I>, "rateLimitBinding" | "keyGenerator">>): MiddlewareHandler<E, P, I>;