import { ReplicationStatus } from '../enumerations/replicationStatus'; import type { BlockId } from '../interfaces/branded/primitives/blockId'; import { IBlockMetadata } from '../interfaces/storage/blockMetadata'; import { IBlockMetadataStore } from '../interfaces/storage/blockMetadataStore'; /** * In-memory implementation of IBlockMetadataStore. * * This implementation stores block metadata in a Map for fast access. * It is suitable for testing, development, and browser environments. * * Note: Data is not persisted and will be lost when the store is destroyed. * * @see IBlockMetadataStore for the interface definition * @see DiskBlockMetadataStore for a persistent implementation */ export declare class MemoryBlockMetadataStore implements IBlockMetadataStore { private readonly metadata; /** * Create and store metadata for a new block. * @param metadata - The complete metadata record to store * @throws StoreError 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 StoreError 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 StoreError 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 StoreError if no metadata exists for this blockId */ recordAccess(blockId: BlockId): Promise; /** * Clear all metadata from the store. * Useful for testing. */ clear(): void; /** * Get the number of metadata records in the store. * @returns The number of metadata records */ size(): number; /** * Get all metadata entries for iteration (e.g., admin dashboard stats). * Returns a read-only iterator over all stored metadata records. */ values(): IterableIterator; /** * Check if metadata exists for a block. * @param blockId - The unique identifier of the block * @returns True if metadata exists */ has(blockId: BlockId | string): boolean; /** * Create a deep copy of metadata to prevent external mutations. * @param meta - The metadata to clone * @returns A deep copy of the metadata */ private cloneMetadata; } //# sourceMappingURL=memoryBlockMetadataStore.d.ts.map