/** * @fileoverview TCBL Manifest Serializer. * * Provides deterministic binary serialization and deserialization of TCBL manifests. * The binary format is: * - version: uint16 (2 bytes, big-endian) * - entryCount: uint32 (4 bytes, big-endian) * - For each entry: * - fileNameLength: uint16 (2 bytes, big-endian) * - fileName: UTF-8 bytes (variable) * - mimeTypeLength: uint8 (1 byte) * - mimeType: UTF-8 bytes (variable) * - originalDataLength: uint48 (6 bytes, big-endian) * - cblAddress: fixed-size checksum bytes (64 bytes for SHA3-512) * - checksum: 64 bytes (SHA3-512 of all preceding data) * * @see Requirements 3.1, 3.2, 3.3, 3.4, 3.5 * @see Requirement 2.5 */ import { ITcblManifest } from '../../interfaces/tcbl/tcblManifest'; import { Checksum } from '../../types/checksum'; /** * Static utility class for deterministic binary serialization and * deserialization of TCBL manifests. * * @see Requirement 3 */ export declare class TcblManifestSerializer { /** * Serialize a TCBL manifest into a deterministic binary `Uint8Array`. * * The checksum field on the manifest is ignored during serialization; * a fresh checksum is computed over the entry data and appended. * * @param manifest - The manifest to serialize * @returns The serialized binary representation * * @see Requirements 3.1, 3.5 */ static serialize(manifest: ITcblManifest): Uint8Array; /** * Deserialize a binary `Uint8Array` back into a TCBL manifest object. * * @param data - The binary data to deserialize * @returns The deserialized manifest * @throws {TcblError} with `ManifestTruncated` if data is too short * @throws {TcblError} with `ManifestCorrupted` if data is structurally invalid * * @see Requirements 3.2, 3.4 */ static deserialize(data: Uint8Array): ITcblManifest; /** * Compute the manifest checksum over the serialized entry data * (version + entryCount + entries), excluding the checksum itself. * * @param manifest - The manifest to compute the checksum for * @returns The computed checksum * * @see Requirement 2.5 */ static computeChecksum(manifest: ITcblManifest): Checksum; /** * Write a uint48 value (6 bytes, big-endian) into a DataView. * * @param view - The DataView to write to * @param offset - The byte offset to write at * @param value - The value to write (must be <= 2^48 - 1) */ private static writeUint48; /** * Read a uint48 value (6 bytes, big-endian) from a DataView. * * @param view - The DataView to read from * @param offset - The byte offset to read at * @returns The uint48 value as a number */ private static readUint48; } //# sourceMappingURL=manifestSerializer.d.ts.map