/** * @fileoverview TCBL Archive Builder. * * Constructs a TCBL (Tarball CBL) archive from a set of input entries. * Each entry's data is stored as a raw block in the block store, and a * manifest is built from the entry metadata. The final TCBL is assembled * as a CBL with a `StructuredBlockType.TarballCBL` header. * * Optional bzip2 compression can be applied to the entire payload. * * @typeParam TID - Platform ID type for frontend/backend DTO compatibility * * @see Requirement 4 (TCBL Construction) * @see Requirement 7 (Whole-Archive Compression) */ import { Member, type PlatformID } from '@digitaldefiance/ecies-lib'; import { BlockSize } from '../../enumerations/blockSize'; import { ICBLServices } from '../../interfaces/services/cblServices'; import { IBlockStore } from '../../interfaces/storage/blockStore'; import { ITcblArchiveOptions } from '../../interfaces/tcbl/tcblArchiveOptions'; import { ITcblEntryInput } from '../../interfaces/tcbl/tcblEntryInput'; import { TarballConstituentBlockListBlock } from './tcbl'; /** * Builder for constructing TCBL (Tarball CBL) archives. * * Usage: * ```typescript * const builder = new TcblBuilder(creator, blockSize, blockStore); * await builder.addEntry({ fileName: 'file.txt', mimeType: 'text/plain', data }); * const tcbl = await builder.build(); * ``` * * @typeParam TID - Platform ID type (defaults to `Uint8Array`) * * @see Requirement 4 */ export declare class TcblBuilder { /** The creator of the archive. */ private readonly creator; /** Block size for entry data blocks. */ private readonly blockSize; /** Block store for persisting entry data and the final TCBL. */ private readonly blockStore; /** Optional CBL services for dependency injection. */ private readonly services?; /** Whether to bzip2-compress the archive payload. */ private readonly compress; /** Collected entry descriptors (populated by addEntry). */ private readonly entryDescriptors; /** * Create a new TCBL builder. * * @param creator - The member creating the archive * @param blockSize - Block size for storing entry data * @param blockStore - Block store for persisting blocks * @param services - Optional CBL services for dependency injection * @param options - Optional archive options (compression) * * @see Requirement 4.8, 4.9 */ constructor(creator: Member, blockSize: BlockSize, blockStore: IBlockStore, services?: ICBLServices, options?: ITcblArchiveOptions); /** * Add an entry to the archive. * * Validates the input, stores the entry data as a raw block in the * block store, and records the entry descriptor for the manifest. * * @param input - The entry input (fileName, mimeType, data) * * @throws {TcblError} if validation fails (file name too long, * path traversal, MIME type too long) * * @see Requirement 4.1, 4.2 */ addEntry(input: ITcblEntryInput): Promise; /** * Build the TCBL archive. * * Constructs the manifest from collected entries, serializes it, * optionally compresses the payload, creates a CBL header with * `StructuredBlockType.TarballCBL`, and returns the final TCBL block. * * @returns The constructed TCBL block * * @see Requirement 4.3, 4.4, 4.5, 4.7, 4.10, 7.1, 7.3 */ build(): Promise>; } //# sourceMappingURL=tcblBuilder.d.ts.map