PhotoSlider.d.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import React from 'react';
  2. import { dataType, IPhotoProviderBase, ReachTypeEnum } from './types';
  3. import './PhotoSlider.less';
  4. export interface IPhotoSliderProps extends IPhotoProviderBase {
  5. images: dataType[];
  6. index?: number;
  7. visible: boolean;
  8. onClose: (evt?: React.MouseEvent | React.TouchEvent) => void;
  9. onIndexChange?: Function;
  10. }
  11. declare type PhotoSliderState = {
  12. translateX: number;
  13. photoIndex: number;
  14. touched: boolean;
  15. shouldTransition: boolean;
  16. lastClientX: number | undefined;
  17. lastClientY: number | undefined;
  18. backdropOpacity: number;
  19. lastBackdropOpacity: number;
  20. overlayVisible: boolean;
  21. canPullClose: boolean;
  22. rotatingMap: Map<number, number>;
  23. };
  24. export default class PhotoSlider extends React.Component<IPhotoSliderProps, PhotoSliderState> {
  25. static displayName: string;
  26. static defaultProps: {
  27. maskClosable: boolean;
  28. photoClosable: boolean;
  29. bannerVisible: boolean;
  30. introVisible: boolean;
  31. };
  32. static getDerivedStateFromProps(nextProps: any, prevState: any): {
  33. photoIndex: any;
  34. translateX: number;
  35. } | null;
  36. constructor(props: any);
  37. componentDidMount(): void;
  38. componentWillUnmount(): void;
  39. handleClose: (evt?: React.MouseEvent<Element, MouseEvent> | React.TouchEvent<Element> | undefined) => void;
  40. handlePhotoTap: () => void;
  41. handlePhotoMaskTap: () => void;
  42. handleResize: () => void;
  43. handleRotate: (rotating: number) => void;
  44. handleKeyDown: (evt: KeyboardEvent) => void;
  45. handleBack: (evt: KeyboardEvent) => void;
  46. handleReachVerticalMove: (clientY: any, scale: any) => void;
  47. handleReachHorizontalMove: (clientX: any) => void;
  48. handleIndexChange: (photoIndex: number, shouldTransition?: boolean) => void;
  49. handlePrevious: (shouldTransition?: boolean | undefined) => void;
  50. handleNext: (shouldTransition?: boolean | undefined) => void;
  51. handleReachMove: (reachState: ReachTypeEnum, clientX: number, clientY: number, scale?: number | undefined) => void;
  52. handleReachUp: (clientX: number, clientY: number) => void;
  53. render(): JSX.Element;
  54. }
  55. export {};