/** * utils.ts — Byte manipulation, MIME sniffing, and encoding helpers */ export declare function textEncode(str: string): Uint8Array; export declare function textDecode(bytes: Uint8Array): string; export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; /** Write a 64-bit unsigned integer as 8 bytes little-endian */ export declare function writeUint64LE(value: number): Uint8Array; /** Read a 64-bit unsigned integer from 8 bytes little-endian */ export declare function readUint64LE(bytes: Uint8Array, offset: number): number; /** Write a 32-bit unsigned integer as 4 bytes big-endian */ export declare function writeUint32BE(value: number): Uint8Array; /** Read a 32-bit unsigned integer from 4 bytes big-endian */ export declare function readUint32BE(bytes: Uint8Array, offset: number): number; /** Write a 32-bit unsigned integer as 4 bytes little-endian */ export declare function writeUint32LE(value: number): Uint8Array; /** Read a 32-bit unsigned integer from 4 bytes little-endian */ export declare function readUint32LE(bytes: Uint8Array, offset: number): number; export declare function blobToBytes(blob: Blob): Promise; export declare function bytesToBlob(bytes: Uint8Array, mimeType: string): Blob; /** * Detect MIME type from magic bytes. * Falls back to the blob's declared type, then "application/octet-stream". */ export declare function detectMimeType(bytes: Uint8Array, blobType?: string): string; /** * Append a Tier-2 trailer to arbitrary bytes. * Layout: [original][payload_utf8][payload_length: 8 bytes LE][magic: 8 bytes] */ export declare function appendTrailer(original: Uint8Array, signatureJson: string): Uint8Array; /** * Detect and extract a Tier-2 trailer. * Returns the signature JSON and the original bytes (without trailer), or null. */ export declare function extractTrailer(bytes: Uint8Array): { signatureJson: string; original: Uint8Array; } | null; export declare function bufferEqual(a: Uint8Array, b: Uint8Array): boolean; export declare function crc32(data: Uint8Array): number; export declare function toZippable(files: Record): Record, { mtime: Date; }]>;