import type { OperationRecord, OperationStore } from '../types/operations.js'; import { assertSerializableRecord } from './serialization.js'; export { assertSerializableRecord }; /** Options for the in-memory operation store. */ export interface MemoryOperationStoreOptions { /** Oldest terminal records are evicted past this count. Defaults to 1000. */ maxRecords?: number; } /** * In-process operation storage. * * The default, and the right choice for a single process that wants leases, retries, and recovery * semantics without a Redis dependency. It does not survive a restart; use `RedisOperationStore` * when it must. */ export declare class MemoryOperationStore implements OperationStore { private readonly records; private readonly byIdempotencyKey; private readonly maxRecords; constructor(options?: MemoryOperationStoreOptions); /** Stores a new record. Refuses records carrying raw bytes. */ create(record: OperationRecord): void; /** Reads a record. */ read(id: string): OperationRecord | undefined; /** * Writes a record when its stored sequence still equals `expectedSequence`. Returns false when * another writer got there first. */ update(record: OperationRecord, expectedSequence: number): boolean; /** Deletes a record. Returns true when it existed. */ delete(id: string): boolean; /** * Records whose lease has expired, or running records without one, up to `limit`, for another * worker to take over. */ claimExpired(now: string, limit: number): Array>; /** Finds the record that claimed an idempotency key. */ findByIdempotencyKey(key: string): OperationRecord | undefined; /** Every record. */ list(): Array>; /** Removes every record. */ clear(): void; private evict; }