import { TextEncodingLabel } from "byte-codec"; //#region src/svg/xml-encoding.d.ts /** * Maps a name from an XML encoding declaration onto the encoding byte-codec's decodeText would decode it under, matched case-insensitively against the WHATWG Encoding Standard's own label table (restricted to the six encodings decodeText supports). * @param label - The declaration's raw `encoding` value, exactly as written. * @returns The matching {@link TextEncodingLabel}, or `undefined` when the name is outside decodeText's own bounded set (ExaDev/documents.js#1361). */ declare function mapXmlEncodingLabel(label: string): TextEncodingLabel | undefined; /** * Reads the raw encoding label out of an `` declaration's own leading bytes, without decoding anything. * * Safe ahead of any real decode because the declaration's own grammar restricts every character in it to ASCII: XML mandates that a declaration, if present, start at the very first byte (a byte order mark aside), so bytes not beginning with the literal ASCII sequence `` declaration, or that declaration names no encoding. */ declare function readXmlEncodingDeclarationLabel(bytes: Uint8Array): string | undefined; /** How {@link detectSvgEncoding} settled the encoding: `resolved` when a byte order mark or a declaration named one decodeText can decode, `unsupported` when a declaration named something outside decodeText's own bounded set. */ type SvgEncodingDetection = { readonly kind: "resolved"; readonly encoding: TextEncodingLabel; } | { readonly kind: "unsupported"; readonly label: string; }; /** * Detects the encoding SVG's own XML prolog declares, per XML 1.0's own external-encoding-detection algorithm: a byte order mark first, since it needs no decoding to trust, then the `` declaration. * @param bytes - The document's own leading bytes. * @returns How the encoding was settled, or `undefined` when the leading bytes carry neither a byte order mark nor a declared encoding. XML's own default of UTF-8 applies in that case, left for the caller to decode strictly rather than through decodeText's own guessing. */ declare function detectSvgEncoding(bytes: Uint8Array): SvgEncodingDetection | undefined; //#endregion export { SvgEncodingDetection, detectSvgEncoding, mapXmlEncodingLabel, readXmlEncodingDeclarationLabel };