import type ISagaRepository from "./SagaRepository"; import type { SagaStateSnapshot } from "./SagaState"; /** * In-memory implementation of the saga repository. * Useful for testing and development. * * Note: This implementation does not persist data across process restarts. * For production use, implement ISagaRepository with a persistent store. */ export default class InMemorySagaRepository implements ISagaRepository { private readonly sagas; private readonly correlationIndex; save(snapshot: SagaStateSnapshot): Promise; load(sagaId: string): Promise; findByCorrelationId(correlationId: string): Promise; findByEventType(eventType: string, correlationId?: string): Promise; delete(sagaId: string): Promise; /** * Clear all stored sagas. * Useful for testing. */ clear(): void; /** * Get the number of stored sagas. * Useful for testing. */ count(): number; }