import { IOutboxRepository, MessagePriority, MessageStatus, IOutboxMessage } from '../../../messaging/src/index.ts'; export interface InMemoryOutboxRepositoryOptions { /** * Time source (epoch ms). Inject a controllable clock to make * `processAfter` and `resetStaleProcessing` age checks deterministic without * global fake timers. Defaults to `Date.now`. */ clock?: () => number; } /** * In-memory {@link IOutboxRepository} for tests. Implements every abstract * method plus `scheduleRetry` and `resetStaleProcessing`, so it can drive a * real `OutboxProcessor` end-to-end without a database. * * Returned messages are shallow copies — mutating them does not corrupt the * repository's internal state. Use {@link clear} between tests for isolation. */ export declare class InMemoryOutboxRepository extends IOutboxRepository { private readonly messages; /** When each message last entered PROCESSING — drives stale detection. */ private readonly processingSince; private readonly clock; private sequence; constructor(options?: InMemoryOutboxRepositoryOptions); /** Snapshot of every stored message (copies). */ getAll(): IOutboxMessage[]; /** Number of messages currently stored. */ size(): number; /** Removes all messages — call between tests for isolation. */ clear(): void; saveMessage(message: IOutboxMessage): Promise; saveBatch(messages: IOutboxMessage[]): Promise; getUnprocessedMessages(limit?: number, priorityOrder?: MessagePriority[], messageTypes?: string[]): Promise; getById(id: string): Promise; updateStatus(id: string, status: MessageStatus, error?: Error): Promise; updateStatusBatch(ids: string[], status: MessageStatus): Promise; incrementAttempt(id: string): Promise; deleteByStatusAndAge(olderThan: Date, status: MessageStatus): Promise; scheduleMessage(message: IOutboxMessage, processAfter: Date): Promise; scheduleRetry(id: string, processAfter: Date): Promise; resetStaleProcessing(olderThan: Date): Promise; }