import { IncomingHttpEvent } from '../IncomingHttpEvent.js'; import { OutgoingHttpResponse } from '../OutgoingHttpResponse.js'; import { IBlueprint, NextMiddleware } from '@stone-js/core'; /** * Kernel middleware that rejects requests carrying too many headers or cookies. * * Defence-in-depth against denial-of-service. The Node HTTP server already bounds header * count/size, but that protection is unavailable on serverless runtimes (AWS Lambda, edge), * so this adapter-agnostic guard enforces the limits uniformly wherever an `IncomingHttpEvent` * is processed. Limits come from `stone.http.limits` (`0` disables a given check). * * @template TEvent - The incoming HTTP event type. * @template UResponse - The outgoing HTTP response type. */ export declare class RequestLimitsMiddleware { private readonly blueprint; /** * Create a RequestLimitsMiddleware. * * @param blueprint - The configuration blueprint. */ constructor({ blueprint }: { blueprint: IBlueprint; }); /** * Reject over-sized requests, otherwise continue the pipeline. * * @param event - The incoming HTTP event. * @param next - The next middleware. * @returns The outgoing HTTP response. * @throws {HttpError} 431 when the header or cookie count exceeds the configured limit. */ handle(event: IncomingHttpEvent, next: NextMiddleware): Promise; }