import type { Clock } from '../stores'; import type { ContentHash } from '../blob'; import type { StorageReservation, TenantStorageUsage } from '../quota'; import type { TenantId } from '../tenant'; export interface ReservationRecord { readonly reservation: StorageReservation; readonly deduplicated: boolean; } /** Shared authority for reservations, object accounting and quota reads. */ export declare class InMemoryStorageLedger { #private; private readonly clock; constructor(clock: Clock); readReservation(key: string): ReservationRecord | undefined; writeReservation(key: string, record: ReservationRecord): void; deleteReservation(key: string): void; reservations(): IterableIterator<[string, ReservationRecord]>; readUsage(tenant: TenantId): TenantStorageUsage; writeUsage(tenant: TenantId, usage: TenantStorageUsage): void; isCounted(tenant: TenantId, hash: string): boolean; recordCommitted(tenant: TenantId, reservation: StorageReservation): void; hasReservedObject(tenant: TenantId, hash: ContentHash): boolean; reservedObjectHashes(tenant: TenantId): readonly string[]; prepareCollectedObjectRelease(tenant: TenantId, hash: ContentHash, byteSize: bigint, now: string): { readonly releasedBytes: bigint; readonly commit: () => void; }; releaseCollectedObject(tenant: TenantId, hash: ContentHash, byteSize: bigint, now: string): bigint; }