import type { DurabilityMode } from '../types/graph.js'; /** * Writes one run's checkpoints under a durability mode. * * `sync` writes each one before returning. `async` chains writes behind each other, so they land in * order, and makes the run wait only when `maxPending` are already in flight. `exit` keeps only the * latest and writes it when the run stops. A write that fails is kept and thrown from the next call, * so a background failure still fails the run. */ export declare class CheckpointWriter { private readonly write; private readonly mode; private readonly maxPending; private chain; private readonly inFlight; private failure; private unwritten; constructor(write: (checkpoint: T) => Promise, mode: DurabilityMode, maxPending?: number); /** * Hands over a checkpoint. A `durable` one is persisted, with everything before it, before this * resolves, whatever the mode: a pause, a failure, the end of a run, or a recovery decision. */ persist(checkpoint: T, durable?: boolean): Promise; /** Waits for every write handed over so far, and writes what `exit` mode was holding. */ flush(): Promise; private throwFailure; }