1 | import type { DialogProps as IDialogPropTypes } from 'rc-dialog';
|
2 | import React from 'react';
|
3 | import type { TransformAction, TransformType } from './hooks/useImageTransform';
|
4 | export type ToolbarRenderInfoType = {
|
5 | icons: {
|
6 | flipYIcon: React.ReactNode;
|
7 | flipXIcon: React.ReactNode;
|
8 | rotateLeftIcon: React.ReactNode;
|
9 | rotateRightIcon: React.ReactNode;
|
10 | zoomOutIcon: React.ReactNode;
|
11 | zoomInIcon: React.ReactNode;
|
12 | };
|
13 | actions: {
|
14 | onFlipY: () => void;
|
15 | onFlipX: () => void;
|
16 | onRotateLeft: () => void;
|
17 | onRotateRight: () => void;
|
18 | onZoomOut: () => void;
|
19 | onZoomIn: () => void;
|
20 | };
|
21 | transform: TransformType;
|
22 | current: number;
|
23 | total: number;
|
24 | };
|
25 | export interface PreviewProps extends Omit<IDialogPropTypes, 'onClose'> {
|
26 | imgCommonProps?: React.ImgHTMLAttributes<HTMLImageElement>;
|
27 | src?: string;
|
28 | alt?: string;
|
29 | fallback?: string;
|
30 | movable?: boolean;
|
31 | rootClassName?: string;
|
32 | icons?: {
|
33 | rotateLeft?: React.ReactNode;
|
34 | rotateRight?: React.ReactNode;
|
35 | zoomIn?: React.ReactNode;
|
36 | zoomOut?: React.ReactNode;
|
37 | close?: React.ReactNode;
|
38 | left?: React.ReactNode;
|
39 | right?: React.ReactNode;
|
40 | flipX?: React.ReactNode;
|
41 | flipY?: React.ReactNode;
|
42 | };
|
43 | current?: number;
|
44 | count?: number;
|
45 | closeIcon?: React.ReactNode;
|
46 | countRender?: (current: number, total: number) => React.ReactNode;
|
47 | scaleStep?: number;
|
48 | minScale?: number;
|
49 | maxScale?: number;
|
50 | imageRender?: (originalNode: React.ReactElement, info: {
|
51 | transform: TransformType;
|
52 | current?: number;
|
53 | }) => React.ReactNode;
|
54 | onClose?: () => void;
|
55 | onTransform?: (info: {
|
56 | transform: TransformType;
|
57 | action: TransformAction;
|
58 | }) => void;
|
59 | toolbarRender?: (originalNode: React.ReactElement, info: ToolbarRenderInfoType) => React.ReactNode;
|
60 | onChange?: (current: any, prev: any) => void;
|
61 | }
|
62 | declare const Preview: React.FC<PreviewProps>;
|
63 | export default Preview;
|