import type { MiddlewareOptions, RateLimiter } from '../types'; export interface NextApiRequestLike { headers: Record; method?: string; url?: string; ip?: string; query?: Record; body?: any; [key: string]: any; } export interface NextApiResponseLike { status(code: number): this; json(body: any): this; setHeader(name: string, value: string | number): this; setHeader(name: string, value: readonly string[]): this; [key: string]: any; } export type NextMiddlewareNext = () => void | Promise; export declare function createNextMiddleware(rateLimiter: RateLimiter, options?: MiddlewareOptions): (req: NextApiRequestLike, res: NextApiResponseLike, next: NextMiddlewareNext) => Promise;