/** License Copyright 2022 Beijing Volcano Engine Technology Ltd. All Rights Reserved. The @volcengine/imagex-react was developed by Copyright 2022 Beijing Volcano Engine Technology Ltd. (hereinafter “Volcano Engine”). Any copyright or patent right is owned by and proprietary material of the Volcano Engine. @volcengine/imagex-react is available under the Volcano Engine veImageX and licensed under the commercial license. Customers can contact service@volcengine.com for commercial licensing options. Here is also a link to subscription services agreement: https://www.volcengine.com/docs/508/66427 . Without Volcano Engine's prior written permission, any use of @volcengine/imagex-react, in particular any use for commercial purposes, is prohibited. This includes, without limitation, incorporation in a commercial product, use in a commercial service, or production of other artefacts for commercial purposes. Without Volcano Engine's prior written permission, the @volcengine/imagex-react may not be reproduced, modified and/or made available in any form to any third party. */ import { LayoutValues, ValidFormat, DynamicFormat } from './constants'; import { ReactNode } from 'react'; interface StaticImageData { src: string; height: number; width: number; } interface StaticRequire { default: StaticImageData; } export type StaticImport = StaticRequire | StaticImageData; export type ProtocolType = 'http:' | 'https:'; export type ImageLoaderProps = { src: string; width: number; quality: number; format: string; extra: { domain?: string; protocol?: ProtocolType; template?: string; templateWithoutParams?: string; params?: string[]; suffix?: string; search?: string; origin: string; }; }; export type ImageLoader = (props: ImageLoaderProps) => string; export type LayoutType = typeof LayoutValues[number]; export type ImgElementStyle = NonNullable; export type ImgElementWithDataProp = HTMLImageElement & { 'loaded-src'?: string; }; export type PlaceholderValue = 'skeleton' | 'empty' | string; export type OnLoadingComplete = (result: { naturalWidth: number; naturalHeight: number; }) => void; export type ViewerProps = Omit & { width?: number; height?: number; src: string | StaticImport; layout?: LayoutType; loader?: ImageLoader; loading?: 'lazy' | 'eager'; placeholder?: PlaceholderValue; quality?: number; formats?: typeof ValidFormat[number][]; imageSizes?: number[]; unoptimized?: boolean; lazyRoot?: React.RefObject | null; lazyBoundary?: string; errorDataURL?: string; error?: ReactNode; ssr?: boolean; ua?: string; objectFit?: ImgElementStyle['objectFit']; objectPosition?: ImgElementStyle['objectPosition']; onLoadingComplete?: OnLoadingComplete; }; export type ImageElementProps = Omit & { src: string; srcString: string; loader: ImageLoader; imageSizes: number[]; placeholderStyle: ImgElementStyle; isVisible: boolean; setPlaceholderComplete: (b: boolean) => void; setTarget: (img: HTMLImageElement | null) => void; imgStyle: JSX.IntrinsicElements['img']['style']; onLoadingCompleteRef: React.MutableRefObject; loadedImageURLsRef: React.MutableRefObject>; wrapperElement: React.RefObject; supportWebP: boolean | undefined; supportAVIF: boolean | undefined; }; export type ImgSourceParams = { src: string; srcSet?: string; sizes?: string; }; export type GenImgSourceProps = { src: string; unoptimized?: boolean; layout?: LayoutType; loader: ImageLoader; imageSizes: number[]; quality: number; width: number | undefined; height: number | undefined; sizes?: string; format?: typeof DynamicFormat[number] | 'jpeg' | 'png'; wrapperElement: React.RefObject; ssr?: boolean; }; export {};