import { AckCommitsEvent, Commit, CommitsEvent, RemoteSyncInfo, CommitAck, CommitRepository, } from '../types'; import { MemoryStore } from './MemoryStore'; export class MemoryCommitRepository implements CommitRepository { constructor( private readonly store: MemoryStore, ) {} addCommits( commits: Commit[], remoteSyncId?: string, ): Promise> { return this.store.addCommits(commits, remoteSyncId); } async acknowledgeRemoteCommits( refs: readonly CommitAck[], remoteSyncId: string, ): Promise { await this.store.acknowledgeCommits(refs, remoteSyncId); } async *getLocalCommits(): AsyncIterableIterator< CommitsEvent > { yield await this.store.getLocalCommitsEvent(); } getCommitsForRemote(): AsyncIterableIterator< CommitsEvent > { return this.store.getCommitsForRemote(); } getRemoteSyncInfo(): Promise { return this.store.getRemoteSyncInfo(); } async shutdown(): Promise { // noop } }