/** * ImagePreview - 可配置的图片预览工具 * 支持淡入淡出、3D翻转等过渡动画,支持丰富的配置项 */ /** 过渡动画类型 */ export type ImageTransition = "fade" | "slide" | "zoom" | "flip3d" | "none"; /** 图片预览配置 */ export interface ImagePreviewOptions { /** 过渡动画类型,默认 fade */ transition?: ImageTransition; /** 过渡动画时长(ms),默认 300 */ transitionDuration?: number; /** 背景色,默认 rgba(0,0,0,0.85) */ overlayBackground?: string; /** 是否显示工具栏,默认 true */ showToolbar?: boolean; /** 是否显示缩略图栏,默认 true(多图时) */ showThumbnails?: boolean; /** 是否显示左右箭头,默认 true(多图时) */ showArrows?: boolean; /** 是否启用键盘导航,默认 true */ keyboardNavigation?: boolean; /** 是否启用鼠标滚轮缩放,默认 true */ wheelZoom?: boolean; /** 是否启用拖拽平移,默认 true */ draggable?: boolean; /** 初始索引,默认 0 */ initialIndex?: number; /** 缩略图高度(px),默认 48 */ thumbnailSize?: number; /** 箭头大小(px),默认 52 */ arrowSize?: number; /** 关闭回调 */ onClose?: () => void; /** 切换回调 */ onSwitch?: (index: number) => void; } export declare class ImagePreview { private images; private options; private currentIndex; private scale; private rotation; private translateX; private translateY; private isDragging; private dragStartX; private dragStartY; private isTransitioning; private overlay; private imgWrap; private img; private imgBack; private toolbar; private thumbBar; private counter; private arrowLeft; private arrowRight; private prevBtn; private nextBtn; private thumbs; private boundOnMouseMove; private boundOnMouseUp; private boundOnKeydown; constructor(images: string | string[], options?: ImagePreviewOptions); /** 关闭预览 */ close(): void; /** 切换到指定索引 */ goTo(index: number): void; /** 上一张 */ prev(): void; /** 下一张 */ next(): void; private build; private buildToolbar; private buildThumbnails; private buildArrows; private loadImage; /** 淡入淡出 */ private transitionFade; /** 滑动切换 */ private transitionSlide; /** 缩放切换 */ private transitionZoom; /** 3D翻转 */ private transitionFlip3d; private bindEvents; private onMouseMove; private onMouseUp; private onKeydown; private resetTransform; private updateImgTransform; private updateUI; private updateThumbActive; private downloadImage; private cleanup; private el; private createBtn; } /** * 兼容旧接口 - 图片预览 * @param images 图片URL数组或单个URL * @param options 预览配置 */ export declare function imagesPreview(images: Array | string, options?: ImagePreviewOptions): ImagePreview;