Persistence interface for custom adapters. Defines only the essential CRUD operations required for persistence. Custom adapters should implement this interface.
Architecture:
waitForInit: (initial: boolean) => Promise<void>
Initialize persistence directory and validate existing files. Uses singleshot to ensure one-time execution.
readValue: (entityId: EntityId) => Promise<Entity>
Read entity from persistence storage.
hasValue: (entityId: EntityId) => Promise<boolean>
Check if entity exists in storage.
writeValue: (entityId: EntityId, entity: Entity) => Promise<void>
Write entity to storage with atomic file writes.
keys: () => AsyncGenerator<EntityId, any, any>
Async generator yielding all entity IDs. Sorted alphanumerically. Used for iteration and validation.