/** * Cross-environment base64 helpers for `Uint8Array` payloads. * * @module * * @remarks * Used by {@link @nhtio/adk!Media}'s `asBase64()` and by the in-memory reader handle path * (`describe()`/resolver), which inlines its buffer as base64 because it owns no external locator. Both * directions prefer Node's `Buffer` when present and fall back to `btoa`/`atob` with a chunked window so * large buffers do not overflow the call stack. */ /** * Encode a `Uint8Array` as a base64 string. * * @remarks * Prefers `Buffer.from(bytes).toString('base64')` when `globalThis.Buffer` exists; otherwise * chunk-encodes through `btoa` with a `0x8000`-byte window to avoid `Maximum call stack size exceeded` * on large buffers. * * @param bytes - The buffer to encode. * @returns The base64 representation. */ export declare const encodeBase64: (bytes: Uint8Array) => string; /** * Decode a base64 string back into a `Uint8Array`. * * @remarks * Inverse of {@link encodeBase64}. Prefers `Buffer.from(b64, 'base64')` when `globalThis.Buffer` exists; * otherwise decodes through `atob` byte-by-byte. * * @param b64 - The base64 string to decode. * @returns The decoded bytes. */ export declare const decodeBase64: (b64: string) => Uint8Array;