12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- import React from 'react';
- import { TapFuncType } from './utils/withContinuousTap';
- import { ReachMoveFunction, ReachFunction, PhotoTapFunction, ReachTypeEnum, ShowAnimateEnum, OriginRectType, brokenElementDataType } from './types';
- import './PhotoView.less';
- export interface IPhotoViewProps {
- src: string;
- intro?: React.ReactNode;
- viewClassName?: string;
- className?: string;
- style?: object;
- loadingElement?: JSX.Element;
- brokenElement?: JSX.Element | ((photoProps: brokenElementDataType) => JSX.Element);
- rotate: number;
- onPhotoTap: PhotoTapFunction;
- onMaskTap: PhotoTapFunction;
- onReachMove: ReachMoveFunction;
- onReachUp: ReachFunction;
- onPhotoResize?: () => void;
- isActive: boolean;
- showAnimateType?: ShowAnimateEnum;
- originRect?: OriginRectType;
- }
- declare const initialState: {
- naturalWidth: number;
- naturalHeight: number;
- width: number;
- height: number;
- loaded: boolean;
- broken: boolean;
- x: number;
- y: number;
- scale: number;
- touched: boolean;
- maskTouched: boolean;
- clientX: number;
- clientY: number;
- lastX: number;
- lastY: number;
- lastMoveClientX: number;
- lastMoveClientY: number;
- touchedTime: number;
- lastTouchLength: number;
- reachState: ReachTypeEnum;
- };
- export default class PhotoView extends React.Component<IPhotoViewProps, typeof initialState> {
- static displayName: string;
- readonly state: {
- naturalWidth: number;
- naturalHeight: number;
- width: number;
- height: number;
- loaded: boolean;
- broken: boolean;
- x: number;
- y: number;
- scale: number;
- touched: boolean;
- maskTouched: boolean;
- clientX: number;
- clientY: number;
- lastX: number;
- lastY: number;
- lastMoveClientX: number;
- lastMoveClientY: number;
- touchedTime: number;
- lastTouchLength: number;
- reachState: ReachTypeEnum;
- };
- private initialTouchState;
- private readonly handlePhotoTap;
- constructor(props: IPhotoViewProps);
- componentDidMount(): void;
- componentDidUpdate(prevProps: Readonly<IPhotoViewProps>): void;
- componentWillUnmount(): void;
- handleImageLoad: (imageParams: any) => void;
- handleResize: () => void;
- handleStart: (clientX: number, clientY: number, touchLength?: number) => void;
- onMove: (newClientX: number, newClientY: number, touchLength?: number) => void;
- onPhotoTap: (clientX: number, clientY: number) => void;
- onDoubleTap: TapFuncType<number>;
- handleWheel: (e: any) => void;
- handleMaskStart: (clientX: number, clientY: number) => void;
- handleMaskMouseDown: (e: any) => void;
- handleMaskTouchStart: (e: any) => void;
- handleTouchStart: (e: any) => void;
- handleMouseDown: (e: any) => void;
- handleTouchMove: (e: any) => void;
- handleMouseMove: (e: any) => void;
- handleUp: (newClientX: number, newClientY: number) => void;
- handleTouchEnd: (e: any) => void;
- handleMouseUp: (e: any) => void;
- render(): JSX.Element;
- }
- export {};
|