import { Buffer } from "node:buffer"; export type CharsetSource = "content-type" | "html-meta" | "default" | "fallback"; export interface DecodedText { text: string; /** Canonical encoding name reported by TextDecoder. */ charset: string; charsetSource: CharsetSource; /** Original unsupported label when UTF-8 fallback was required. */ unsupportedCharset?: string; } /** * Decode a textual HTTP body without silently corrupting legacy encodings. * Content-Type wins; HTML meta declarations are a fallback; UTF-8 is the * standards-compatible default. Invalid/unsupported labels fall back to * UTF-8 with replacement and are reported to the caller. */ export declare function decodeTextBody(body: Buffer | Uint8Array, contentType?: string): DecodedText;