UNPKG

@ai-growth/nextjs

Version:

Seamlessly integrate Sanity CMS with Next.js applications for automated blog routing and rendering

48 lines 1.58 kB
/** * @fileoverview Image Processing Utilities for SEO * * This module provides functions for processing Sanity images * and preparing them for SEO meta tags and structured data. */ import { SanityImage } from '../../types/sanity'; import { SEOImageResult } from '../../types/seo'; /** * Process a Sanity image or string URL for SEO use * * @param image - Sanity image object or string URL * @param baseUrl - Base URL for relative paths * @returns Processed image data for SEO */ export declare function processImage(image: SanityImage | string | undefined, baseUrl: string): SEOImageResult; /** * Build a Sanity image URL with transformations * * @param imageRef - Sanity image reference * @param options - Image transformation options * @returns Transformed image URL */ export declare function buildSanityImageUrl(imageRef: string, options?: { width?: number; height?: number; fit?: 'crop' | 'fill' | 'fillmax' | 'max' | 'scale' | 'clip' | 'min'; format?: 'jpg' | 'png' | 'webp' | 'auto'; quality?: number; }): string; /** * Get image MIME type from URL extension * * @param url - Image URL * @returns MIME type */ export declare function getImageTypeFromUrl(url: string): string; /** * Generate optimized image dimensions for different use cases * * @param useCase - The intended use case for the image * @returns Optimal dimensions */ export declare function getOptimalImageDimensions(useCase: 'og' | 'twitter' | 'thumbnail' | 'hero'): { width: number; height: number; }; //# sourceMappingURL=image-processing.d.ts.map