import type { HttpLayer } from "../layer/index.js"; import type { HttpService } from "../service/index.js"; import { ClientError } from "../util/index.js"; /** * A middleware that intercepts requests with body lengths greater than the * configured limit and converts them into `413 Payload Too Large` responses. * * @example * ```ts * import { RequestBodyLimitLayer } from "@taxum/core/middleware/limit"; * import { m, Router } from "@taxum/core/routing"; * * const router = new Router() * .route("/", m.get(() => "Hello World)) * .middleware(new RequestBodyLimitLayer(1024 * 1024)); * ``` */ export declare class RequestBodyLimitLayer implements HttpLayer { private readonly limit; /** * Creates a new {@link RequestBodyLimitLayer}. * * @param limit - maximum size in bytes. */ constructor(limit: number); layer(inner: HttpService): HttpService; } export declare class ContentTooLargeError extends ClientError { constructor(limit: number); }