1 |
|
2 | declare const VALID_LOADING_VALUES: readonly ["lazy", "eager", undefined];
|
3 | declare type LoadingValue = typeof VALID_LOADING_VALUES[number];
|
4 | export declare type ImageLoader = (resolverProps: ImageLoaderProps) => string;
|
5 | export declare type ImageLoaderProps = {
|
6 | src: string;
|
7 | width: number;
|
8 | quality?: number;
|
9 | };
|
10 | declare const VALID_LAYOUT_VALUES: readonly ["fill", "fixed", "intrinsic", "responsive", undefined];
|
11 | declare type LayoutValue = typeof VALID_LAYOUT_VALUES[number];
|
12 | declare type PlaceholderValue = 'blur' | 'empty';
|
13 | declare type ImgElementStyle = NonNullable<JSX.IntrinsicElements['img']['style']>;
|
14 | interface StaticImageData {
|
15 | src: string;
|
16 | height: number;
|
17 | width: number;
|
18 | blurDataURL?: string;
|
19 | }
|
20 | interface StaticRequire {
|
21 | default: StaticImageData;
|
22 | }
|
23 | declare type StaticImport = StaticRequire | StaticImageData;
|
24 | declare type StringImageProps = {
|
25 | src: string;
|
26 | } & ({
|
27 | width?: never;
|
28 | height?: never;
|
29 | layout: 'fill';
|
30 | } | {
|
31 | width: number | string;
|
32 | height: number | string;
|
33 | layout?: Exclude<LayoutValue, 'fill'>;
|
34 | }) & ({
|
35 | placeholder?: Exclude<PlaceholderValue, 'blur'>;
|
36 | blurDataURL?: never;
|
37 | } | {
|
38 | placeholder: 'blur';
|
39 | blurDataURL: string;
|
40 | });
|
41 | declare type ObjectImageProps = {
|
42 | src: StaticImport;
|
43 | width?: number | string;
|
44 | height?: number | string;
|
45 | layout?: LayoutValue;
|
46 | placeholder?: PlaceholderValue;
|
47 | blurDataURL?: never;
|
48 | };
|
49 | export declare type ImageProps = Omit<JSX.IntrinsicElements['img'], 'src' | 'srcSet' | 'ref' | 'width' | 'height' | 'loading' | 'style'> & {
|
50 | loader?: ImageLoader;
|
51 | quality?: number | string;
|
52 | priority?: boolean;
|
53 | loading?: LoadingValue;
|
54 | unoptimized?: boolean;
|
55 | objectFit?: ImgElementStyle['objectFit'];
|
56 | objectPosition?: ImgElementStyle['objectPosition'];
|
57 | } & (StringImageProps | ObjectImageProps);
|
58 | export default function Image({ src, sizes, unoptimized, priority, loading, className, quality, width, height, objectFit, objectPosition, loader, placeholder, blurDataURL, ...all }: ImageProps): JSX.Element;
|
59 | export {};
|