// THIS FILE IS TEMPORARY UNTIL WE CAN HAVE A TYPESCRIPT VERSION THAT INCLUDE THE BASE64 <-> UINT8ARRAY CONVERSION STUFF declare global { interface Uint8Array { /** * Converts this `Uint8Array` to a Base64 or Base64URL encoded string. * * @param options Optional configuration: * - `alphabet`: Selects between `"base64"` (default) and `"base64url"` alphabets. * - `omitPadding`: If true, omits the trailing `=` padding characters. * * @returns The Base64-encoded representation of the byte array. * * @example * ```ts * const bytes = new Uint8Array([72, 101, 108, 108, 111]); * console.log(bytes.toBase64()); // "SGVsbG8=" * ``` */ toBase64(options?: { alphabet?: "base64" | "base64url"; omitPadding?: boolean }): string; } interface Uint8ArrayConstructor { /** * Creates a `Uint8Array` from a Base64 or Base64URL encoded string. * * @param base64 The input string to decode. * @param options Optional configuration: * - `alphabet`: Selects between `"base64"` (default) and `"base64url"` alphabets. * - `lastChunkHandling`: Controls how to handle incomplete input: * - `"strict"` (default): Throws an error if input is not valid Base64. * - `"loose"`: Tolerates missing padding or invalid trailing characters. * - `"stop-before-partial"`: Ignores an incomplete trailing chunk. * * @returns A new `Uint8Array` containing the decoded bytes. * * @example * ```ts * const bytes = Uint8Array.fromBase64("SGVsbG8="); * console.log(new TextDecoder().decode(bytes)); // "Hello" * ``` */ fromBase64( base64: string, options?: { alphabet?: "base64" | "base64url"; lastChunkHandling?: "loose" | "strict" | "stop-before-partial"; }, ): Uint8Array; } } export {};