import type { FetchImpl, Model, Usage } from "@oh-my-pi/pi-catalog/types"; import type { ApiKey } from "../auth-retry.js"; import * as AIError from "../error/index.js"; import type { GeneratedImage } from "./types.js"; export declare class ImageApiError extends AIError.ProviderHttpError { readonly name = "ImageApiError"; } export declare function emptyUsage(input?: number, output?: number, cost?: number): Usage; export declare function usageFromWire(value: unknown): Usage; export declare function imageBaseUrl(model: Model): string; export declare function modelHeaders(model: Model, signal?: AbortSignal): Promise>; export declare function errorMessage(rawText: string): string; /** Request URL, or a builder for routes that depend on the bearer (xAI's `XAI_BASE_URL` rule). */ type ImageRequestUrl = string | ((bearer: string) => string); export declare function postJson(options: { model: Model; url: ImageRequestUrl; body: unknown; apiKey: ApiKey; fetch: FetchImpl; signal?: AbortSignal; }): Promise; export declare function postMultipart(options: { model: Model; url: ImageRequestUrl; body: FormData; apiKey: ApiKey; fetch: FetchImpl; signal?: AbortSignal; }): Promise; export declare function decodeImageResponse(value: unknown, fetch: FetchImpl, signal?: AbortSignal): Promise<{ images: GeneratedImage[]; usage: Usage; }>; export declare function toDataUrl(image: GeneratedImage): string; export declare function resolveOpenAIImageSize(aspectRatio?: string, imageSize?: string): string | undefined; export {};