react-photo-view
Advanced tools
Comparing version 0.5.1 to 0.5.2
import React from 'react'; | ||
import './Photo.less'; | ||
import { brokenElementDataType } from './types'; | ||
export interface IPhotoProps extends React.HTMLAttributes<any> { | ||
src: string; | ||
intro?: React.ReactNode; | ||
loaded: boolean; | ||
@@ -13,5 +15,5 @@ broken: boolean; | ||
loadingElement?: JSX.Element; | ||
brokenElement?: JSX.Element; | ||
brokenElement?: JSX.Element | ((photoProps: brokenElementDataType) => JSX.Element); | ||
} | ||
declare const Photo: React.FC<IPhotoProps>; | ||
export default Photo; |
import React from 'react'; | ||
import { TapFuncType } from './utils/withContinuousTap'; | ||
import { ReachMoveFunction, ReachFunction, PhotoTapFunction, ReachTypeEnum, ShowAnimateEnum, OriginRectType } from './types'; | ||
import { ReachMoveFunction, ReachFunction, PhotoTapFunction, ReachTypeEnum, ShowAnimateEnum, OriginRectType, brokenElementDataType } from './types'; | ||
import './PhotoView.less'; | ||
export interface IPhotoViewProps { | ||
src: string; | ||
intro?: React.ReactNode; | ||
viewClassName?: string; | ||
@@ -11,3 +12,3 @@ className?: string; | ||
loadingElement?: JSX.Element; | ||
brokenElement?: JSX.Element; | ||
brokenElement?: JSX.Element | ((photoProps: brokenElementDataType) => JSX.Element); | ||
rotate: number; | ||
@@ -14,0 +15,0 @@ onPhotoTap: PhotoTapFunction; |
@@ -11,2 +11,6 @@ import React from 'react'; | ||
}; | ||
/** | ||
* brokenElement函数使用参数 | ||
*/ | ||
export declare type brokenElementDataType = Pick<dataType, 'src' | 'intro'>; | ||
export declare type overlayRenderProps = { | ||
@@ -34,3 +38,3 @@ images: dataType[]; | ||
loadingElement?: JSX.Element; | ||
brokenElement?: JSX.Element; | ||
brokenElement?: JSX.Element | ((photoProps: brokenElementDataType) => JSX.Element); | ||
} | ||
@@ -37,0 +41,0 @@ export declare type ReachMoveFunction = (reachState: ReachTypeEnum, clientX: number, clientY: number, scale?: number) => void; |
{ | ||
"name": "react-photo-view", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "一款精致的 React 的图片预览组件", | ||
@@ -5,0 +5,0 @@ "author": "MinJieLiu", |
@@ -86,3 +86,3 @@ # react-photo-view | ||
| loadingElement | JSX.Element | 否 | 自定义 loading | | ||
| brokenElement | JSX.Element | 否 | 加载失败 Element | | ||
| brokenElement | JSX.Element | ((photoProps: brokenElementDataType) => JSX.Element) | 否 | 加载失败 Element | | ||
@@ -89,0 +89,0 @@ #### PhotoConsumer |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
424018
36
4246