import type { ImageFetcher } from '../../../services/images/types.js'; /** * What every `ImageFetcher` must do (ยง 4.5, point 6). It runs against the fake * in the unit tests and against the real one on a local server, so a fake that * behaves differently from the real thing cannot pass. */ export interface ContractContext { fetcher: ImageFetcher; urls: { /** An image (a PNG). */ ok: string; /** The server answers 404. */ notFound: string; /** The server answers 200 with a page, not an image. */ notImage: string; /** An image over the size limit for its type. */ tooLarge: string; /** A private address. */ blocked: string; /** Nothing listens there. */ unreachable: string; }; /** The real fetcher is told whether private addresses are allowed. */ setPrivateAllowed(allowed: boolean): void; } export declare function imageFetcherContract(name: string, setup: () => Promise<{ context: ContractContext; cleanup: () => Promise; }>): void;