/** * Byte/string codecs shared across the auth core — JWT (auth.ts), CSRF, * WebAuthn, TOTP, Web Push. One canonical copy: this encoding logic is * security-relevant (it feeds signatures and key material), and before this * module it existed 3-5× in parallel with the dependency arrows pointing the * wrong way (CSRF and the passkey stack imported base64url from the Web-Push * module). Everything here is Web-API-only (no `Buffer`). */ /** Bytes → unpadded base64url. */ export declare function base64UrlEncode(data: Uint8Array): string; /** * base64url → bytes. Tolerant on input (read side): missing padding is * restored and the standard alphabet (`+/`) is accepted alongside `-_`. * Throws on undecodable input. */ export declare function base64UrlDecode(str: string): Uint8Array; /** UTF-8 string → unpadded base64url — the JWT-segment form. */ export declare function base64UrlEncodeString(text: string): string; /** base64url → UTF-8 string — the JWT-segment form. */ export declare function base64UrlDecodeString(str: string): string; /** Concatenate byte arrays into one. */ export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; /** * Coerce a Uint8Array (possibly a subarray view) to a plain ArrayBuffer for * the Web Crypto API, whose lib types reject the generic * `Uint8Array`. Slices by byteOffset/byteLength so views * yield exactly their own bytes, never the whole backing buffer. */ export declare function toArrayBuffer(data: Uint8Array): ArrayBuffer;