import path from 'node:path';
/**
 * Check if sharp is available (returns true only if sharp is installed).
 *
 * Note: image processing always works now via `ts-images`; this only reports
 * whether the optional sharp fast-path is present. Use {@link isImageBackendAvailable}
 * to gate "can we optimize at all" — the answer is always yes.
 */
export declare function isSharpAvailable(): Promise<boolean>;
/**
 * Whether any image-processing backend is available. Always true now that
 * `ts-images` is bundled as a hard dependency — kept as a function for
 * symmetry with `isSharpAvailable` and so callers can future-proof against
 * a hypothetical "headless" build that strips ts-images.
 */
export declare function isImageBackendAvailable(): Promise<boolean>;
/**
 * Process an image and generate responsive variants
 */
export declare function processImage(input: string | Buffer, options?: ImageOptions): Promise<ProcessedImage>;
/**
 * Get image metadata
 */
export declare function getImageMetadata(input: Buffer | string): Promise<ImageMetadata>;
/**
 * Resize and convert image.
 *
 * Tries sharp first if installed (faster on large images), falls back to
 * `ts-images` (pure-TS codecs, always available). `ts-images` is file-
 * oriented so we route the output through a temp file and read it back.
 */
export declare function resizeAndConvert(buffer: Buffer, options: {
    width: number
    height: number
    format: ImageFormat
    quality: number
    fit: string
  }): Promise<Buffer>;
/**
 * Generate srcset attribute from variants
 */
export declare function generateSrcSet(variants: ImageVariant[], format?: ImageFormat): string;
/**
 * Generate sizes attribute
 */
export declare function generateSizes(breakpoints?: Record<string, string>): string;
/**
 * Get best fallback variant (middle resolution JPEG)
 */
export declare function getFallbackVariant(variants: ImageVariant[]): ImageVariant | undefined;
/**
 * Group variants by format
 */
export declare function groupVariantsByFormat(variants: ImageVariant[]): Map<ImageFormat, ImageVariant[]>;
/**
 * Check if file is an image
 */
export declare function isImageFile(filePath: string): boolean;
/**
 * Get MIME type for format
 */
export declare function getMimeType(format: ImageFormat): string;
/**
 * Calculate total size of variants
 */
export declare function getTotalSize(variants: ImageVariant[]): number;
/**
 * Format file size for display
 */
export declare function formatSize(bytes: number): string;
/**
 * ============================================================================
// Constants
// ============================================================================
 * @defaultValue `[320, 640, 768, 1024, 1280, 1536, 1920]`
 */
export declare const DEFAULT_WIDTHS: number[];
export declare const DEFAULT_FORMATS: ImageFormat[];
export declare const DEFAULT_QUALITY: 80;
// ============================================================================
// Types
// ============================================================================
export declare interface ImageOptions {
  widths?: number[]
  formats?: ImageFormat[]
  quality?: number
  fit?: 'cover' | 'contain' | 'fill' | 'inside' | 'outside'
  placeholder?: 'blur' | 'dominant-color' | 'thumbhash' | 'none'
  outputDir?: string
  baseUrl?: string
}
export declare interface ProcessedImage {
  src: string
  variants: ImageVariant[]
  placeholder?: string
  width: number
  height: number
  aspectRatio: number
  hash: string
}
export declare interface ImageVariant {
  path: string
  url: string
  width: number
  height: number
  format: ImageFormat
  size: number
}
export declare interface ImageMetadata {
  width: number
  height: number
  format: string
  hasAlpha?: boolean
}
export type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png';
// ============================================================================
// Sharp Integration
// ============================================================================
declare type SharpInstance = {
  metadata(): Promise<ImageMetadata>
  resize(width: number, height?: number, options?: { fit?: string }): SharpInstance
  webp(options?: { quality?: number }): SharpInstance
  avif(options?: { quality?: number }): SharpInstance
  jpeg(options?: { quality?: number }): SharpInstance
  png(options?: { quality?: number }): SharpInstance
  toBuffer(): Promise<Buffer>
  blur(sigma: number): SharpInstance
  toFormat(format: string, options?: { quality?: number }): SharpInstance
}
declare type SharpModule = {
  (input: Buffer | string): SharpInstance
  default?: (input: Buffer | string) => SharpInstance
}
// ============================================================================
// Error Handling
// ============================================================================
export declare class ImageProcessingError extends Error {
  code: string;
  constructor(message: string, code: string);
}
