/** * String ↔ bytes helpers. * * Codecs in ZipKit are byte-only by design. These helpers convert between * JavaScript strings and {@link Uint8Array} so text can flow through the same * API. UTF-8 is the default; Latin-1 (binary) is available for byte-exact * single-byte data. */ /** * Encode a string to bytes. * * @param str - The string to encode. * @param latin1 - When `true`, encode as Latin-1 (one byte per code unit, * code points 0–255). Defaults to UTF-8. */ export declare function strToU8(str: string, latin1?: boolean): Uint8Array; /** * Decode bytes to a string. * * @param data - The bytes to decode. * @param latin1 - When `true`, decode as Latin-1. Defaults to UTF-8. */ export declare function strFromU8(data: Uint8Array, latin1?: boolean): string; /** A streaming UTF-8 decoder: feed chunks, get text out, flush at the end. */ export declare class DecodeUTF8 { private decoder; /** Decode a chunk. Pass `stream: false` (or use {@link end}) on the last one. */ push(chunk: Uint8Array, stream?: boolean): string; /** Flush any buffered partial code point and finish decoding. */ end(chunk?: Uint8Array): string; } /** A streaming UTF-8 encoder: feed text chunks, get bytes out. */ export declare class EncodeUTF8 { private encoder; /** Encode a chunk of text to UTF-8 bytes. */ push(chunk: string): Uint8Array; } //# sourceMappingURL=string.d.ts.map