import type { DocxHistoryReader, DocxHistoryView } from './history.js'; import type { HistoryCheckpoints, HistoryCheckpointRequest } from './history-checkpoints.js'; export interface HistoryControlsOptions { reader: DocxHistoryReader; /** Omit for a read-only archive. Must belong to reader. */ checkpoints?: HistoryCheckpoints; /** Capture the open draft on Save only. The panel never replaces editor content. */ capture?: () => Uint8Array | Promise; author?: string; documentName?: string; /** Render in a separate preview; reject on failure, preserving the previous document. */ preview: (bytes: Uint8Array, title: string) => void | Promise; /** Defaults to a browser download. */ download?: (bytes: Uint8Array, filename: string) => void | Promise; /** Called after acknowledgement. A retry includes its original request and may return an older view. */ onCheckpoint?: (view: DocxHistoryView, action: 'save' | 'restore' | 'retry', retriedRequest?: HistoryCheckpointRequest) => void | Promise; /** Hosts that replace the draft on restore provide a matching confirmation and acknowledgement. */ confirmRestore?: (title: string) => boolean | Promise; restoreUpdatesDraft?: boolean; pageSize?: number; } export interface HistoryControls { readonly element: HTMLElement; /** Initial metadata load. No document export or checkpoint is implicit. */ readonly ready: Promise; refresh(): Promise; /** Removes controls and awaits their active call. The host may then close its reader/client. */ destroy(): Promise; } /** Mount explicit document-history controls. Persistence and preview/editor ownership stay with the host. */ export declare function mountHistoryControls(container: HTMLElement, options: HistoryControlsOptions): HistoryControls; export declare function historyControlError(error: unknown, pending?: boolean): string; //# sourceMappingURL=history-controls.d.ts.map