UNPKG

2.09 kBTypeScriptView Raw
1import type { CSSProperties, TeleportProps, ComponentPublicInstance } from 'vue';
2import type { Interceptor } from '../utils';
3import type { SwipeToOptions } from '../swipe';
4import type { PopupCloseIconPosition } from '../popup';
5import type { ImagePreviewProps } from './ImagePreview';
6import type { ImagePreviewItemProps } from './ImagePreviewItem';
7export type ImagePreviewOptions = {
8 loop?: boolean;
9 images: string[];
10 maxZoom?: number;
11 minZoom?: number;
12 vertical?: boolean;
13 teleport?: TeleportProps['to'];
14 className?: unknown;
15 showIndex?: boolean;
16 closeable?: boolean;
17 closeIcon?: string;
18 transition?: string;
19 beforeClose?: Interceptor;
20 doubleScale?: boolean;
21 overlayStyle?: CSSProperties;
22 overlayClass?: unknown;
23 swipeDuration?: number;
24 startPosition?: number;
25 showIndicators?: boolean;
26 closeOnPopstate?: boolean;
27 closeIconPosition?: PopupCloseIconPosition;
28 closeOnClickImage?: boolean;
29 closeOnClickOverlay?: boolean;
30 onClose?(): void;
31 onScale?(args: {
32 scale: number;
33 index: number;
34 }): void;
35 onChange?(index: number): void;
36};
37export type ImagePreviewScaleEventParams = {
38 scale: number;
39 index: number;
40};
41type ImagePreviewItemExpose = {
42 resetScale: () => void;
43};
44export type ImagePreviewItemInstance = ComponentPublicInstance<ImagePreviewItemProps, ImagePreviewItemExpose>;
45export type ImagePreviewExpose = {
46 resetScale: () => void;
47 swipeTo: (index: number, options?: SwipeToOptions) => void;
48};
49export type ImagePreviewInstance = ComponentPublicInstance<ImagePreviewProps, ImagePreviewExpose>;
50export type ImagePreviewThemeVars = {
51 imagePreviewIndexTextColor?: string;
52 imagePreviewIndexFontSize?: string;
53 imagePreviewIndexLineHeight?: number | string;
54 imagePreviewIndexTextShadow?: string;
55 imagePreviewOverlayBackground?: string;
56 imagePreviewCloseIconSize?: string;
57 imagePreviewCloseIconColor?: string;
58 imagePreviewCloseIconMargin?: string;
59 imagePreviewCloseIconZIndex?: number | string;
60};
61export {};