1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import React from 'react';
- declare const VALID_LOADING_VALUES: readonly ["lazy", "eager", undefined];
- declare type LoadingValue = typeof VALID_LOADING_VALUES[number];
- export declare type ImageLoader = (resolverProps: ImageLoaderProps) => string;
- export declare type ImageLoaderProps = {
- src: string;
- width: number;
- quality?: number;
- };
- declare const VALID_LAYOUT_VALUES: readonly ["fill", "fixed", "intrinsic", "responsive", undefined];
- declare type LayoutValue = typeof VALID_LAYOUT_VALUES[number];
- declare type PlaceholderValue = 'blur' | 'empty';
- declare type OnLoadingComplete = (result: {
- naturalWidth: number;
- naturalHeight: number;
- }) => void;
- declare type ImgElementStyle = NonNullable<JSX.IntrinsicElements['img']['style']>;
- export interface StaticImageData {
- src: string;
- height: number;
- width: number;
- blurDataURL?: string;
- }
- interface StaticRequire {
- default: StaticImageData;
- }
- declare type StaticImport = StaticRequire | StaticImageData;
- export declare type ImageProps = Omit<JSX.IntrinsicElements['img'], 'src' | 'srcSet' | 'ref' | 'width' | 'height' | 'loading'> & {
- src: string | StaticImport;
- width?: number | string;
- height?: number | string;
- layout?: LayoutValue;
- loader?: ImageLoader;
- quality?: number | string;
- priority?: boolean;
- loading?: LoadingValue;
- lazyRoot?: React.RefObject<HTMLElement> | null;
- lazyBoundary?: string;
- placeholder?: PlaceholderValue;
- blurDataURL?: string;
- unoptimized?: boolean;
- objectFit?: ImgElementStyle['objectFit'];
- objectPosition?: ImgElementStyle['objectPosition'];
- onLoadingComplete?: OnLoadingComplete;
- };
- export default function Image({ src, sizes, unoptimized, priority, loading, lazyRoot, lazyBoundary, className, quality, width, height, style, objectFit, objectPosition, onLoadingComplete, placeholder, blurDataURL, ...all }: ImageProps): JSX.Element;
- export {};
|