/** * @fileoverview Utility functions for working with TCBL attachments * in the context of BrightTrust proposals. * * Provides a unified way to enumerate entries from an attachment * that may be either a plain CBL or a TCBL archive. This allows * proposal consumers to handle both formats transparently. * * @see Requirement 9.2 — enumerate entries from TCBL attachments * @see Requirement 9.3 — handle plain CBL attachments as single-entry */ import { PlatformID } from '@digitaldefiance/ecies-lib'; import { ICBLServices } from '../../interfaces/services/cblServices'; import { IBlockStore } from '../../interfaces/storage/blockStore'; import { ITcblEntryDescriptor } from '../../interfaces/tcbl/tcblEntryDescriptor'; import { Checksum } from '../../types/checksum'; /** * Enumerate the entries contained in a proposal attachment. * * If the attachment is a TCBL archive, this function retrieves the * payload, parses the manifest, and returns all entry descriptors. * * If the attachment is a plain CBL, this function returns a single-entry * list with a generic descriptor (fileName: 'attachment', mimeType: * 'application/octet-stream'). * * @typeParam TID - Platform ID type for frontend/backend DTO compatibility * @param attachmentCblId - The CBL/TCBL checksum identifying the attachment * @param blockStore - The block store to retrieve block data from * @param services - Optional CBL services for dependency injection * @returns Array of entry descriptors for the attachment contents * * @example * ```typescript * const entries = await enumerateAttachmentEntries( * proposal.attachmentCblId, * blockStore, * ); * for (const entry of entries) { * console.log(`${entry.fileName} (${entry.mimeType}, ${entry.originalDataLength} bytes)`); * } * ``` * * @see Requirement 9.1 — attachmentCblId accepts both CBL and TCBL * @see Requirement 9.2 — TCBL attachments enumerate all entries * @see Requirement 9.3 — plain CBL attachments return single entry */ export declare function enumerateAttachmentEntries(attachmentCblId: Checksum, blockStore: IBlockStore, services?: ICBLServices): Promise; //# sourceMappingURL=tcblAttachmentUtils.d.ts.map