/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * @file Reads and writes corpus-source manifests. */ import { type SourceManifest } from "#tools/fetch/download/network"; /** * Read a MANIFEST.json; `null` when missing or corrupt (callers re-fetch from scratch). */ export declare function readManifest(path: string): Promise; /** * Load manifest entries into a map so untouched keys survive a partial re-fetch. */ export declare function loadManifestEntries(path: string, key: (entry: T) => string): Promise>; /** * Write a MANIFEST.json in the house shape: pretty-printed, trailing newline. */ export declare function writeManifest(path: string, manifest: unknown): Promise; /** * The sibling `MANIFEST.json` shape for a source that is a COLLECTION of files behind one portal (a monthly register * published per region, per industry, or per first letter). It carries what a trained artifact has to be able to cite * later: the license the portal labels the data with, the attribution wording it requires, and one * {@link SourceManifest} per file. */ export interface SourceCollectionManifest { source: string; source_url: string; license: string; attribution: string; downloaded_at: string; files: SourceManifest[]; } /** * Pipe a response body to `dest` and answer the byte count. The one primitive the portal fetchers share when the * request is not a bare GET — a session cookie, a CSRF header, or a form POST stands between the listing and the file, * so {@link streamDownload}'s URL-only contract does not fit and each module builds its own `Response` first. Writes a * `.tmp` sibling and renames, so an interrupted transfer never lands at the final path looking complete. */ export declare function streamBodyToFile(res: Response, dest: string): Promise; /** * The per-file entries of a {@link SourceCollectionManifest} keyed by file name, or an empty map when the manifest is * missing or not in the collection shape, so a re-run after an interruption fetches only what is missing. The * single-file modules' `loadManifestEntries` reads a bare array and is not this. */ export declare function loadCollectionFiles(path: string): Promise>; //# sourceMappingURL=manifest.d.ts.map