import type { ImageContent } from "../../ai/index.js"; export interface ImageResizeOptions { maxWidth?: number; maxHeight?: number; maxBytes?: number; jpegQuality?: number; } export interface ResizedImage { data: string; mimeType: string; originalWidth: number; originalHeight: number; width: number; height: number; wasResized: boolean; } /** Why a resize attempt produced no image. */ export type ImageResizeFailureReason = "no-data" | "pipeline-unavailable" | "too-large"; /** * Outcome of a resize attempt: either a ready-to-send image, or the reason * none was produced. Callers use the reason to emit an accurate omission * message instead of blaming the size limit for every failure. */ export type ImageResizeOutcome = { ok: true; image: ResizedImage; } | { ok: false; reason: ImageResizeFailureReason; }; /** * Resize an image to fit within the specified max dimensions and encoded file size. * Returns a failure reason when no image can be produced (see ImageResizeOutcome). */ export declare function resizeImageOutcome(img: ImageContent, options?: ImageResizeOptions): Promise; /** * Format a dimension note for resized images. * This helps the model understand the coordinate mapping. */ export declare function formatDimensionNote(result: ResizedImage): string | undefined; /** * Resize an image to fit within the specified max dimensions and encoded file size. * Returns null if the image cannot be resized below maxBytes. * * Backward-compatible wrapper around resizeImageOutcome for callers that only * care about the image (or nothing). Prefer resizeImageOutcome when the failure * reason must be observable. */ export declare function resizeImage(img: ImageContent, options?: ImageResizeOptions): Promise; //# sourceMappingURL=image-resize.d.ts.map