/**
 * Image recovery for the data-processing pipeline.
 *
 * Loads sidecar `.image-archive.jsonl` files to build an archive-ID → URL
 * index, then downloads original images from the archive to restore
 * placeholder PNGs back to full base64 data.
 *
 * Downloads use `tosutil` CLI for fast batch-parallel transfers.  The caller
 * must invoke {@link prefetchImages} once before processing records so that
 * all archived images are available locally.
 */
export interface ArchiveEntry {
    url: string;
    mediaType: string;
}
export interface ImageCache {
    cacheDir: string;
    /** Directory where deduplicated images are written for the final output. */
    imagesDir: string;
    /** Archive IDs already copied to imagesDir (prevents duplicate writes). */
    written: Set<string>;
}
/**
 * Batch-download all archived images to a local cache directory using
 * `tosutil cp -r`.  Returns an {@link ImageCache} handle that
 * {@link recoverImagesInContent} uses to read images from disk.
 */
export declare function prefetchImages(sidecarIndex: Map<string, ArchiveEntry>, cacheDir: string, imagesDir: string, tosutilPath?: string, bucket?: string): ImageCache;
export declare function loadSidecarIndex(transcriptDir: string): Promise<Map<string, ArchiveEntry>>;
export interface RecoveryStats {
    totalPlaceholders: number;
    recovered: number;
    failed: number;
    noSidecarEntry: number;
}
export declare function emptyRecoveryStats(): RecoveryStats;
export declare function mergeRecoveryStats(a: RecoveryStats, b: RecoveryStats): RecoveryStats;
export declare function recoverImagesInContent(content: unknown, sidecarIndex: Map<string, ArchiveEntry>, stats: RecoveryStats, cache?: ImageCache): Promise<unknown>;
//# sourceMappingURL=image-recovery.d.ts.map