import type { HttpLayer } from "../layer/index.js"; import type { HttpService } from "../service/index.js"; /** * A layer that decompresses request bodies. * * @example * ```ts * import { RequestDecompressionLayer } from "@taxum/core/middleware/decompression"; * import { m, Router } from "@taxum/core/routing"; * * const router = new Router() * .route("/", m.get(() => "Hello World)) * .layer(new RequestDecompressionLayer()); * ``` */ export declare class RequestDecompressionLayer implements HttpLayer { private readonly accept; private passThroughUnaccepted_; /** * Creates a new {@link RequestDecompressionLayer}. * * By default, all encodings are accepted and unaccepted encodings are * **not** passed through. */ constructor(); /** * Sets whether to support gzip encoding. */ gzip(enable: boolean): this; /** * Sets whether to support Deflate encoding. */ deflate(enable: boolean): this; /** * Sets whether to support Brotli encoding. */ br(enable: boolean): this; /** * Sets whether to support Zstd encoding. */ zstd(enable: boolean): this; /** * Disabled support for gzip encoding. */ noGzip(): this; /** * Disables support for Deflate encoding. */ noDeflate(): this; /** * Disables support for Brotli encoding. */ noBr(): this; /** * Disables support for Zstd encoding. */ noZstd(): this; /** * Sets whether to pass through the request even when the encoding is not * supported. */ passThroughUnaccepted(enabled: boolean): this; layer(inner: HttpService): HttpService; }