///
import React from 'react';
export declare enum ImageActionKey {
/** 右旋转 */
ROTATE_RIGHT = "rotateRight",
/** 左旋转 */
ROTATE_LEFT = "rotateLeft",
/** 等比例放大 */
ZOOM_IN = "zoomIn",
/** 等比例缩小 */
ZOOM_OUT = "zoomOut",
/** 恢复原图缩放比例尺 */
SCALE_ORIGIN = "scaleOrigin"
}
export interface ImageToolbarAction {
key: ImageActionKey;
label?: string;
icon?: React.ReactNode;
iconClassName?: string;
disabled?: boolean;
onClick?: (context: ImageGallery) => void;
}
export interface ImageGalleryProps {
children?: React.ReactNode;
modalContainer?: () => HTMLElement;
translate?: any;
callback?: any;
/** 操作栏 */
actions?: ImageToolbarAction[];
}
export interface ImageGalleryState {
isOpened: boolean;
index: number;
items: Array<{
src: string;
originalSrc: string;
title?: string;
caption?: string;
}>;
/** 图片缩放比例尺 */
scale: number;
/** 图片旋转角度 */
rotate: number;
/** 是否开启操作栏 */
showToolbar?: boolean;
/** 工具栏配置 */
actions?: ImageToolbarAction[];
maxScale: number;
}
export declare class ImageGallery extends React.Component {
static defaultProps: Pick;
static contextType?: React.Context | undefined;
state: ImageGalleryState;
hasRendered: boolean;
componentDidMount(): void;
componentWillUnmount(): void;
handleImageEnlarge(info: {
src: string;
originalSrc: string;
list?: Array<{
src: string;
originalSrc: string;
title?: string;
caption?: string;
}>;
title?: string;
caption?: string;
index?: number;
showToolbar?: boolean;
toolbarActions?: ImageToolbarAction[];
}): void;
close(): void;
prev(): void;
next(): void;
handleItemClick(e: React.MouseEvent): void;
/**
* @memberof ImageGallery
*/
handleToolbarAction: import("lodash").DebouncedFuncLeading<(action: ImageToolbarAction) => void>;
/**
*
* @param actions
* @returns
*/
renderToolbar(actions: ImageToolbarAction[]): JSX.Element;
render(): JSX.Element;
}
declare type ImageType = typeof ImageGallery & {
preview: (conf: object) => void;
};
declare const Preview: ImageType;
export default Preview;