import type { MediaSafetyFinding } from '../types/images.js'; /** Base class for image errors, each with a stable `code`. */ export declare class ImageError extends Error { /** Stable code, such as `IMAGE_VALIDATION_ERROR`. */ readonly code: string; /** The underlying error. */ readonly cause?: unknown | undefined; constructor(message: string, /** Stable code, such as `IMAGE_VALIDATION_ERROR`. */ code: string, /** The underlying error. */ cause?: unknown | undefined); } /** Raised when a request or an input is invalid before anything is sent. */ export declare class ImageValidationError extends ImageError { constructor(message: string, cause?: unknown); } /** Raised when an image provider fails. */ export declare class ImageProviderError extends ImageError { /** The provider. */ readonly provider?: string | undefined; constructor(message: string, /** The provider. */ provider?: string | undefined, cause?: unknown); } /** Raised when no provider, or no provider by the requested name, is registered. */ export declare class ImageProviderNotFoundError extends ImageProviderError { constructor(provider?: string); } /** Raised when a request asks for something the provider does not support. */ export declare class ImageCapabilityError extends ImageProviderError { /** The unsupported option, such as `size` or `mask`. */ readonly option: string; /** The value requested. */ readonly requestedValue?: unknown | undefined; /** Always `IMAGE_CAPABILITY_ERROR`. */ readonly code = "IMAGE_CAPABILITY_ERROR"; constructor(provider: string, /** The unsupported option, such as `size` or `mask`. */ option: string, /** The value requested. */ requestedValue?: unknown | undefined, detail?: string); } /** Raised when a provider's response does not have the shape the adapter expects. */ export declare class ImageProviderResponseError extends ImageProviderError { /** Always `IMAGE_PROVIDER_RESPONSE_ERROR`. */ readonly code = "IMAGE_PROVIDER_RESPONSE_ERROR"; constructor(provider: string, message: string, cause?: unknown); } /** Raised when work continues on a cancelled image operation. */ export declare class ImageOperationCancelledError extends ImageError { /** The operation. */ readonly operationId: string; /** Why it was cancelled. */ readonly reason?: string | undefined; constructor( /** The operation. */ operationId: string, /** Why it was cancelled. */ reason?: string | undefined); } /** Raised when moderation refuses a prompt, an input, or an output. */ export declare class ImageSafetyError extends ImageError { /** What moderation found. */ readonly findings: readonly MediaSafetyFinding[]; constructor(message: string, /** What moderation found. */ findings?: readonly MediaSafetyFinding[], cause?: unknown); }