import { Readable } from 'stream'; import type { Pool } from 'pg'; import type { FileStore } from '../services/ports/fileStore.js'; /** * The uploaded file, read from its chunks in `import_job_file` (ยง 8.4, Reader * contract). The upload writes the chunks and records the final size, chunk * count and SHA-256 on the job in the swap; this reads them back and **asserts** * what was recorded before it gives the first byte: * * - the sequence numbers are contiguous from 0, so a missing chunk is never * taken for the end of the file; * - the count, the total size and the SHA-256 are the recorded ones, so a * changed byte is never read as data. * * That takes one pass over the chunks to check and a second to give them, one * chunk at a time, so memory stays at about two chunks for a file of any size. * A job whose upload is not complete (no recorded SHA-256) has no file yet. */ export declare class PgFileStore implements FileStore { private readonly pool; constructor(pool: Pool); open(jobId: number): Readable; /** The chunk at `seq`, or null when there is none. */ private chunk; private read; }