import type { Pool } from "pg"; import type { CandidateLifecycleState, CorrectionCandidate, CorrectionCandidateStore } from "../correction.js"; /** * Durable, cross-process `CorrectionCandidateStore` backed by * `remem.correction_candidates` (migration 0007). `update` uses * `SELECT ... FOR UPDATE` inside a transaction, so a concurrent `update` on * the same id blocks until this one commits or rolls back -- the same * atomicity guarantee `InMemoryCorrectionCandidateStore` gets for free from * JS's single-threaded execution, extended across processes. */ export declare class PostgresCorrectionCandidateStore implements CorrectionCandidateStore { private readonly pool; private readonly providerId; constructor(pool: Pool, providerId: string); insert(candidate: CorrectionCandidate): Promise; get(candidateId: string): Promise; list(filter?: { state?: CandidateLifecycleState; }): Promise; update(candidateId: string, mutate: (candidate: CorrectionCandidate) => CorrectionCandidate): Promise; }