import { ReplicationStatus } from '../../enumerations/replicationStatus'; import type { BlockId } from '../branded/primitives/blockId'; import { IBlockMetadata } from './blockMetadata'; /** * Interface for block metadata storage operations. * * This interface provides CRUD operations for block metadata, as well as * query methods for finding blocks by expiration status and replication status. * * Implementations: * - MemoryBlockMetadataStore (brightchain-lib): In-memory storage using Map * - DiskBlockMetadataStore (brightchain-api-lib): Disk-based storage using JSON files * * @see IBlockMetadata for the metadata structure * @see ReplicationStatus for replication status values */ export interface IBlockMetadataStore { /** * Create and store metadata for a new block. * @param metadata - The complete metadata record to store * @throws Error if metadata for this blockId already exists */ create(metadata: IBlockMetadata): Promise; /** * Get metadata for a block by its ID. * @param blockId - The unique identifier of the block * @returns The block's metadata, or null if not found */ get(blockId: BlockId): Promise; /** * Update metadata for an existing block. * @param blockId - The unique identifier of the block * @param updates - Partial metadata updates to apply * @throws Error if no metadata exists for this blockId */ update(blockId: BlockId, updates: Partial): Promise; /** * Delete metadata for a block. * @param blockId - The unique identifier of the block * @throws Error if no metadata exists for this blockId */ delete(blockId: BlockId): Promise; /** * Find all blocks that have expired (expiresAt is in the past). * @returns Array of metadata for expired blocks */ findExpired(): Promise; /** * Find all blocks with a specific replication status. * @param status - The replication status to filter by * @returns Array of metadata for blocks with the specified status */ findByReplicationStatus(status: ReplicationStatus): Promise; /** * Record an access to a block, updating accessCount and lastAccessedAt. * @param blockId - The unique identifier of the block * @throws Error if no metadata exists for this blockId */ recordAccess(blockId: BlockId): Promise; } //# sourceMappingURL=blockMetadataStore.d.ts.map