import { type ImageBlock, type ImageContent, type ImageContentView } from "@prismicio/types-internal/lib/content"; import type { Image, ImageConstraint } from "@prismicio/types-internal/lib/customtypes"; import type { MediaAsset, MediaAssetOrExternalImage } from "./MediaLibrary/hooks/mediaLibraryData"; /** * A thumbnail is an abstraction of the prismic models for the image fields * We use it to flatten the main image and its thumbnails into a single array. */ export interface Thumbnail { /** Thumbnail name or MAIN_THUMBNAIL_NAME */ name: string; /** Width constraint for the current thumbnail */ width?: number | null; /** Height constraint for the current thumbnail */ height?: number | null; } export declare const MAIN_THUMBNAIL_NAME = "__MAIN_THUMBNAIL__"; export interface CropperImage { thumbnail: Thumbnail; contentView?: ImageContentView; labels: ImageLabel; } type ImageLabel = [thumbnailName: string | undefined, size: string | undefined]; export declare function getImageLabel(thumbnail: Thumbnail, content: ImageContent | ImageBlockData | undefined, contentView: ImageContentView | undefined): ImageLabel; export declare function getImageThumbnails(field: Image): readonly Thumbnail[]; export declare function getImageContentViews(field: Image, content: ImageContent): readonly [ImageContentView, ...(ImageContentView | undefined)[]]; export declare function updateImageContentAlt(thumbnailName: string, content: ContentType, contentView: ImageContentView, value: string): ContentType; export declare function getConstraints(extImage: { width: number; height: number; }, constraints?: ImageConstraint): [number, number]; export declare function buildImageUrl(originUrl: string, rect: { x: number; y: number; width: number; height: number; }, outputWidth: number, outputHeight: number, hasConstraints: boolean): string; export declare function getPreviewImage(fromUrl: string, options?: { width?: number; height?: number; }): string; export declare function getSearchTileImage(fromUrl: string): string; export declare function replaceImage(thumbnailName: string, field: Image, content: ImageContent | undefined, extImage: MediaAssetOrExternalImage): ImageContent; export declare function isMediaAsset(image: MediaAssetOrExternalImage): image is MediaAsset; export declare function createContentView(image: MediaAssetOrExternalImage, constraints?: ImageConstraint): ImageContentView; export declare function fitImage(extImage: { width: number; height: number; }, constraints?: ImageConstraint): { width: number; height: number; rect: { x: number; y: number; width: number; height: number; }; }; export declare function getMediaUrlExtension(url: string): string | undefined; export declare function getTitleWithoutExtension(selectedMedia?: MediaAsset): string; export type ImageBlockData = ImageBlock["data"]; export {};