import { type SqliteDatabase, type StorageDescriptor } from "@bastani/atomic/storage"; import { type AppendOutcome, type JournalEntry, type Lease, type LeaseOutcome, type LeaseState, type RunEvent, type RunHeader, type RunJournal, type RunSummary } from "./types.js"; export { JOURNAL_READ_PAGE_SIZE } from "./internal.js"; export declare class SqlRunJournal implements RunJournal { private closed; private tail; private closePromise?; private readonly database; private readonly tables; private readonly legacy; private readonly appendGuard; private constructor(); static open(database: SqliteDatabase, options?: { readonly prefix?: string; }): Promise; get descriptor(): StorageDescriptor; get path(): string; private assertOpen; private operation; private snapshotJson; createRun(header: RunHeader): Promise<"created" | "exists">; getRun(runId: string): Promise; listRuns(filter?: { cwd?: string; }): Promise; /** * `data_version` moves when another connection commits and `total_changes()` when this one writes; the * table aggregates also catch run changes if the adapter does not serve every statement from one connection. */ private changeToken; private runVersions; /** * The latest snapshot event is found by walking the run's `(run_id, seq)` key back from its last event, so * only the events after it are visited and only its payload is read. */ private snapshotTail; private requireRun; /** Whether this run exists only in the legacy tables, whose events are then read in place. */ private isUnconvertedLegacyRun; private leaseRow; private grant; acquire(runId: string, holderId: string): Promise; takeover(runId: string, holderId: string, expectedHolder: string): Promise; leaseState(runId: string): Promise; takeoverExpired(runId: string, holderId: string, staleAfterMs: number): Promise; private checkLease; renew(lease: Lease): Promise; release(lease: Lease): Promise; private sequence; append(lease: Lease, event: RunEvent, options?: { key?: string; expectSeq?: number; }): Promise; read(runId: string, fromSeq?: number): AsyncIterable; readKey(runId: string, key: string): Promise; deleteRun(runId: string): Promise; deleteOwnedRun(lease: Lease, expectSeq?: number): Promise; private deleteRunData; close(): Promise; }