import type { SessionId } from '../../types/ids/index.js'; import { type LogMedium, SessionLogCore, type SessionLogCoreOptions } from './core.js'; import { type SessionLeaseStore } from './lease.js'; import { type SpillStore } from './spill.js'; /** * A session log held in process: the same bytes, chain, turn rules, lease and * spills as the disk log, so the conformance suite holds both to one * contract. An in-memory session keeps its whole log, lease and spills in * this process and loses them with it. */ /** A log's bytes in memory. Exposed so a test can tear or corrupt them. */ export declare class InMemoryLogMedium implements LogMedium { #private; size(): Promise; read(offset: number, length: number): Promise; stream(offset: number): AsyncIterable; append(bytes: Uint8Array, expectedOffset: number): Promise; truncate(size: number, expectedSize: number): Promise; /** A copy of the log's bytes. */ bytes(): Buffer; /** Replace the log's bytes wholesale (tests: tear a tail, flip a byte). */ overwrite(bytes: Uint8Array): void; } export interface InMemorySessionLogOptions extends Pick { readonly sessionId: SessionId; /** * Share storage with another instance, as a second process would see one * disk log. Each defaults to a fresh store. */ readonly medium?: InMemoryLogMedium; readonly leases?: SessionLeaseStore; readonly spills?: SpillStore; } export declare class InMemorySessionLog extends SessionLogCore { #private; readonly medium: InMemoryLogMedium; readonly leaseStore: SessionLeaseStore; readonly spillStore: SpillStore; constructor(options: InMemorySessionLogOptions); /** Another instance over the same log, lease and spills: what a second process would open. */ reopen(): InMemorySessionLog; } //# sourceMappingURL=memory.d.ts.map