import type { ProviderOperations, ProviderOptions } from "./providers/types.js"; export type { ProviderOperations, ProviderOptions }; /** * Options to transform an image URL */ export interface UrlTransformerOptions extends Pick { /** The image URL to transform */ url: string | URL; /** Specify a provider rather than auto-detecting */ provider?: TCDN; /** @deprecated Use `provider` */ cdn?: TCDN; /** Provider to use if none matches */ fallback?: TCDN; } /** * @deprecated Use `ProviderOptions` instead */ export type CdnOptions = ProviderOptions; export interface UrlGeneratorOptions> { base: string | URL; width?: number; height?: number; format?: string; params?: TParams; } export type ImageCdn = "contentful" | "builder.io" | "cloudimage" | "cloudinary" | "cloudflare" | "imgix" | "shopify" | "wordpress" | "bunny" | "storyblok" | "kontent.ai" | "vercel" | "nextjs" | "scene7" | "keycdn" | "directus" | "imageengine" | "contentstack" | "cloudflare_images" | "ipx" | "astro" | "netlify" | "imagekit" | "uploadcare" | "supabase" | "hygraph" | "appwrite" | "wsrv"; export declare const SupportedProviders: Record; export type OperationFormatter = (operations: T) => string; export type OperationParser = (url: string | URL) => T; export interface OperationMap { width?: keyof TOperations | false; height?: keyof TOperations | false; format?: keyof TOperations | false; quality?: keyof TOperations | false; } export interface FormatMap { [key: string]: ImageFormat | (string & {}); } export type ImageFormat = "jpeg" | "jpg" | "png" | "webp" | "avif"; export interface Operations { width?: number | string; height?: number | string; format?: ImageFormat | TImageFormat; quality?: number | string; } export interface ProviderConfig { /** * Maps standard operation names to their equivalent with this provider. * Keys are any of width, height, format, quality. Only include those * that are different from the standard. */ keyMap?: OperationMap; /** * Defaults that should always be applied to operations unless overridden. */ defaults?: Partial; /** * Maps standard format names to their equivalent with this provider. * Only include those that are different from the standard. */ formatMap?: FormatMap; /** * Separator between keys and values in the URL. Defaults to "=". */ kvSeparator?: string; /** * Parameter separator in the URL. Defaults to "&". */ paramSeparator?: string; /** * If provided, the src URL will be extracted from this parameter. */ srcParam?: string; } export type URLGenerator = ProviderOptions[TCDN] extends undefined ? (src: string | URL, operations: ProviderOperations[TCDN]) => string : (src: string | URL, operations: ProviderOperations[TCDN], options?: ProviderOptions[TCDN]) => string; export type URLTransformer = ProviderOptions[TCDN] extends undefined ? (src: string | URL, operations: ProviderOperations[TCDN]) => string : (src: string | URL, operations: ProviderOperations[TCDN], options?: ProviderOptions[TCDN]) => string; export type TransformerFunction = TOptions extends undefined ? (src: string | URL, operations: TOperations) => string : (src: string | URL, operations: TOperations, options?: TOptions) => string; export type URLExtractor = (url: string | URL, options?: ProviderOptions[TCDN]) => (ProviderOptions[TCDN] extends undefined ? { operations: ProviderOperations[TCDN]; src: string; } : { operations: ProviderOperations[TCDN]; src: string; options: ProviderOptions[TCDN]; }) | null; export type ExtractedURL = ReturnType>; export type ParseURLResult = (ExtractedURL & { cdn?: TCDN; }) | undefined; //# sourceMappingURL=types.d.ts.map