google-photo.d.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import React from 'react';
  2. interface GooglePhotoProps {
  3. /**
  4. * Control if GooglePhoto is open or not.
  5. */
  6. open: boolean;
  7. /**
  8. * An array containing valid images
  9. */
  10. src: {
  11. /**
  12. * Url of the media.
  13. */
  14. src: string;
  15. /**
  16. * Height of the media.
  17. */
  18. height: number;
  19. /**
  20. * Width of the media.
  21. */
  22. width: number;
  23. /**
  24. * Alt of the media.
  25. */
  26. alt?: string;
  27. }[];
  28. /**
  29. * Index of source to display.
  30. */
  31. srcIndex?: number;
  32. /**
  33. * Should open on fullscreen mode.
  34. * Default to false.
  35. */
  36. fullscreen?: boolean;
  37. /**
  38. * Enable left and right arrow navigation.
  39. * Default to true.
  40. */
  41. keyboardNavigation?: boolean;
  42. /**
  43. * Should close when user press esc key.
  44. * Default to true.
  45. */
  46. closeOnEsc?: boolean;
  47. /**
  48. * Timeout before hidding the actions buttons when mouse do not move (milliseconds).
  49. * Default to 5000.
  50. */
  51. mouseIdleTimeout?: number;
  52. /**
  53. * Animation duration in milliseconds.
  54. * Default to 250.
  55. */
  56. animationDuration?: number;
  57. /**
  58. * An object containing classNames to style the lightbox.
  59. */
  60. classNames?: {
  61. overlay?: string;
  62. image?: string;
  63. animationIn?: string;
  64. animationOut?: string;
  65. };
  66. /**
  67. * Function called when GooglePhoto is requested to be closed.
  68. */
  69. onClose: () => void;
  70. /**
  71. * Function called when the index of the displayed image is changing.
  72. */
  73. onChangeIndex?: (index: number) => void;
  74. }
  75. export declare const GooglePhoto: ({ open, src, srcIndex: srcIndexProp, fullscreen, keyboardNavigation, closeOnEsc, mouseIdleTimeout, animationDuration, classNames, onClose, onChangeIndex, }: GooglePhotoProps) => React.ReactPortal | null;
  76. export {};