import type { ImageKeyDeps } from '../services/images/imageKey.js'; import { ImageError } from '../services/images/types.js'; import type { ImageFetcher, StoredImage } from '../services/images/types.js'; /** * TEST-ONLY. An `ImageFetcher` that answers from a table: URL → an image, or a * failure, optionally after a delay. It stores nothing; the URL it returns is * built from the same key as the real one (`/assets/catalog/<8 digits>/<8 digits>/`), * so the same URL always gives the same answer. */ export declare class FakeImageFetcher implements ImageFetcher { private readonly keyDeps; private readonly sleep; private readonly ownStorage; /** Every URL asked for with `fetchAndStore`, in order. */ readonly fetched: string[]; /** Every URL asked for with `probe`, in order. */ readonly probed: string[]; private readonly entries; private readonly delays; constructor(keyDeps: ImageKeyDeps, sleep?: (ms: number) => Promise, ownStorage?: readonly string[]); /** `url` is an image of `contentType`. */ hasImage(url: string, contentType?: string): this; /** `url` fails with `error` (a missing URL fails with `network`). */ fails(url: string, error: ImageError): this; /** The answer for `url` comes after `ms` on the `sleep` it was given. */ delayAnswer(url: string, ms: number): this; private answer; fetchAndStore(url: string): Promise; probe(url: string): Promise; }