import { IBaseBlockMetadata } from '../interfaces/blocks/metadata/blockMetadata'; import { PoolId } from '../interfaces/storage/pooledBlockStore'; import { Checksum } from '../types/checksum'; import { BaseBlock } from './base'; import { BlockHandle } from './handle'; import { RawDataBlock } from './rawData'; /** * Interface for stores that can store blocks */ interface IBlockStore { setData(block: RawDataBlock): Promise; get(checksum: Checksum): BlockHandle; } /** * A tuple of block handles that can be XORed together. * Used for whitening and reconstruction operations. * * @typeParam T - The block type for handles in this tuple. Defaults to BaseBlock. * * @remarks * - All handles in a tuple must have the same block size * - The tuple size is fixed at TUPLE.SIZE (typically 3) * - XOR operations produce a new RawDataBlock * * @example * ```typescript * // Create a tuple of RawDataBlock handles * const tuple = new BlockHandleTuple(handles); * * // XOR all blocks and store the result * const result = await tuple.xor(blockStore, metadata); * * // Verify all blocks in the tuple * const isValid = await tuple.verify(); * ``` * * @see {@link BlockHandle} - The handle type used in tuples * @see Requirements 3.1, 3.2 */ export declare class BlockHandleTuple { private readonly _handles; private readonly _poolId?; /** * Create a new BlockHandleTuple. * * @param handles - Array of block handles. Must have exactly TUPLE.SIZE elements. * @param poolId - Optional pool identifier. When provided, validates all handles belong to this pool. * @throws {HandleTupleError} If the number of handles is not TUPLE.SIZE * @throws {HandleTupleError} If handles have different block sizes * @throws {HandleTupleError} If poolId is provided and any handle belongs to a different pool */ constructor(handles: BlockHandle[], poolId?: PoolId); /** * The pool this tuple is scoped to, if any. */ get poolId(): PoolId | undefined; /** * The handles in this tuple */ get handles(): BlockHandle[]; /** * The block IDs as a concatenated buffer */ get blockIdsBuffer(): Uint8Array; /** * The block IDs in this tuple */ get blockIds(): Checksum[]; /** * XOR all blocks in the tuple and store the result * @param blockStore - The store to write the result to * @param destBlockMetadata - Metadata for the resulting block * @returns A handle to the resulting block */ xor(blockStore: IBlockStore, destBlockMetadata: IBaseBlockMetadata): Promise>; /** * Verify all blocks in the tuple */ verify(): Promise; } export {}; //# sourceMappingURL=handleTuple.d.ts.map