import type { DocxHistoryDocument, DocxHistoryView, DocxVersionMetadata, HistoryBlobReference, HistoryHead } from './history.js'; /** Persist the entire request before publication. Bytes are structured-cloneable, not JSON. */ export type HistoryCheckpointRequest = { id: string; documentId: string; metadata: DocxVersionMetadata; } & ({ kind: 'save'; head: HistoryHead | null; bytes: Uint8Array; } | { kind: 'restore'; head: HistoryHead; target: HistoryBlobReference; }); /** Host-owned durable outbox, scoped to one document. Methods resolve only after commit. * put must atomically return the existing request or insert and return the supplied one. * Existing inputs must never change, even for the same ID. remove must match the ID. * Share exclusion between tabs/clients. Never clear an uncertain publication to start another. */ export interface HistoryCheckpointJournal { read(): Promise; put(request: HistoryCheckpointRequest): Promise; remove(requestId: string): Promise; } /** Explicit checkpoint commands. No editor ownership, timers, automatic retries or subscriptions. * Keep this instance for the document's editing session; refresh only when the user requests it. */ export declare class HistoryCheckpoints { readonly document: DocxHistoryDocument; private readonly journal; private current; private request; private running; private stale; private constructor(); /** Pass an already captured view when opening its exact version in an editor (for example, after import). */ static open(document: DocxHistoryDocument, journal: HistoryCheckpointJournal, view?: DocxHistoryView | null): Promise; get view(): DocxHistoryView | null; get hasPending(): boolean; /** Snapshot of the exact request a retry will recover, including its original operation kind. */ get pendingRequest(): HistoryCheckpointRequest | null; get needsRefresh(): boolean; refresh(): Promise; save(bytes: Uint8Array, metadata: DocxVersionMetadata): Promise; restore(target: HistoryBlobReference, metadata: DocxVersionMetadata): Promise; retry(): Promise; private start; private publish; private exclusive; } //# sourceMappingURL=history-checkpoints.d.ts.map