import { ImageSizeSuffix } from '../../utils/setImageSuffix'; import { PreviewImageEmits, PreviewImageExposes, PreviewImageProps } from '../../composites/ImagePreview'; export type ImageValue = string; export declare const ImageSizeEnum: { small: number; default: number; large: number; tiny: number; }; export interface ImageProps { /** * 图片地址 */ src: string; alt?: string; /** * 设置宽高 */ size?: keyof typeof ImageSizeEnum; /** * 设置图片的质量大小,优先级比图片 src 自带的高 */ suffix?: ImageSizeSuffix; /** * 增加图片圆角 */ rounded?: boolean; /** * 确定图片如何适应容器框,同原生 object-fit */ fit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'; /** * 浏览器加载图像的策略,和 浏览器原生能力一致 */ loading?: 'eager' | 'lazy'; /** * 是否使用懒加载 */ lazy?: boolean; /** * 开启懒加载功能后,监听 scroll 事件的容器 默认情况下,开启懒加载功能后,监听 scroll 事件的容器 */ scrollContainer?: HTMLElement; /** * 预览当前图片 */ preview?: boolean; /** * 自定义图片预览的配置 */ previewProps?: Omit & Partial>; } export type ImageEmits = { /** * 图片加载成功事件 */ load: []; /** * 图片加载失败 */ error: []; } & PreviewImageEmits; export type ImageExposes = PreviewImageExposes; export type ImageSlots = { /** * 作用域插槽 */ error: () => any; placeholder: () => any; };