import type { FileStore } from '../../../services/ports/fileStore.js'; import type { FileDamage } from '../../../testing/MemoryFileStore.js'; export type Damage = Exclude; /** The store of files and the ways to stage one and to damage it. */ export interface FileStoreHarness { store: FileStore; /** Stages a file for a new job, in chunks of `chunkSize` bytes; gives the job. */ stage(content: string | Buffer, chunkSize?: number): Promise; /** A job whose upload is not complete: nothing is recorded about its file. */ stageIncomplete(): Promise; damage(jobId: number, how: Damage): Promise; /** A job that does not exist. */ readonly missingJob: number; } /** * What every `FileStore` must do (§ 4.5, point 6, § 8.4 Reader contract): give * back the file as it was uploaded, and fail with `FileDamagedError` **before * the first byte** when it is not that file. It runs against the double in the * unit tests and against PostgreSQL in the database tests. */ export declare function fileStoreContract(label: string, make: () => Promise): void;