import { Usage } from "../contracts/result/usage.type.mjs"; import { GeneratedImage, ImageGenerationOptions, ImageGenerationResponse, ImageModelContract, ImageModelPricing } from "../contracts/image-model.contract.mjs"; //#region ../ai/src/mock/mock-image-model.d.ts /** One scripted response for a {@link MockImageModel}. */ type MockImageResponse = { /** Images to return; defaults to a single 1×1 transparent PNG. */images?: GeneratedImage[]; /** Token usage to report; defaults to all-zero (per-image-metered). */ usage?: Usage; /** Throw this instead of returning — drives the never-throws/error path. */ error?: Error; /** Simulate latency before resolving/rejecting (ms). */ delay?: number; }; /** One recorded `generate()` invocation, for test assertions. */ type MockImageCall = { prompt: string; options: ImageGenerationOptions | undefined; }; /** * Deterministic {@link ImageModelContract} double for tests — no HTTP. * Scripts responses in sequence (the last repeats once exhausted), * records every call, and can be primed with pricing to exercise the * cost rollup. Mirrors {@link MockModel} for the image path. * * @example * const model = new MockImageModel("mock-image", [{ usage: { input: 0, output: 0, total: 0 } }], { * perImage: 0.04, * }); * const { data, usage } = await ai.image({ model, prompt: "a cat" }); */ declare class MockImageModel implements ImageModelContract { readonly name: string; private readonly responses; readonly pricing?: ImageModelPricing | undefined; readonly provider = "mock"; readonly calls: MockImageCall[]; private callIndex; constructor(name: string, responses: MockImageResponse[], pricing?: ImageModelPricing | undefined); generate(prompt: string, options?: ImageGenerationOptions): Promise; } //#endregion export { MockImageCall, MockImageModel, MockImageResponse }; //# sourceMappingURL=mock-image-model.d.mts.map