|
1 | 1 | import * as React from "react"; |
2 | 2 |
|
3 | | -export interface ModalImageProps extends React.ImgHTMLAttributes<HTMLImageElement> { |
4 | | - /* The small image to display */ |
| 3 | +export interface ModalImageProps { |
| 4 | + /** Optional. `class` for the small preview image. */ |
| 5 | + className?: string | undefined; |
| 6 | + |
| 7 | + /** Optional. `alt` for the small image and the heading text in Lightbox. */ |
| 8 | + alt?: string | undefined; |
| 9 | + |
| 10 | + /** `src` for the small preview image. */ |
5 | 11 | small: string; |
6 | 12 |
|
7 | | - /* The srcset attribute for the small image */ |
8 | | - smallSrcSet?: string; |
| 13 | + /** Optional. `srcSet` for the small preview image. */ |
| 14 | + smallSrcSet?: string | undefined; |
| 15 | + |
| 16 | + /** Optional if `large` is defined. Image shown when zoomed out in Lightbox. */ |
| 17 | + medium?: string | undefined; |
| 18 | + |
| 19 | + /** Optional if `medium` is defined. Image shown when zoomed in Lightbox. Downloadable. */ |
| 20 | + large?: string | undefined; |
| 21 | + |
| 22 | + /** Optional. Set to `true` to hide download-button from the Lightbox. */ |
| 23 | + hideDownload?: boolean | undefined; |
| 24 | + |
| 25 | + /** Optional. Set to `true` to hide zoom-button from the Lightbox. */ |
| 26 | + hideZoom?: boolean | undefined; |
| 27 | + |
| 28 | + /** Optional. Set to `true` to show rotate-button within the Lightbox. */ |
| 29 | + showRotate?: boolean | undefined; |
| 30 | + |
| 31 | + /** Optional. Background color of the image shown in Lightbox. Defaults to black. Handy for transparent images. */ |
| 32 | + imageBackgroundColor?: string | undefined; |
| 33 | +} |
9 | 34 |
|
10 | | - /* The medium image to display */ |
11 | | - medium?: string; |
| 35 | +export interface LightboxProps { |
| 36 | + /** Optional if `large` is defined. Image shown when zoomed out in Lightbox. */ |
| 37 | + medium?: string | undefined; |
12 | 38 |
|
13 | | - /* The large image to display */ |
14 | | - large?: string; |
| 39 | + /** Optional if `medium` is defined. Image shown when zoomed in Lightbox. Downloadable. */ |
| 40 | + large?: string | undefined; |
15 | 41 |
|
16 | | - /* The alt tag for the image */ |
17 | | - alt?: string; |
| 42 | + /** Optional. `alt` for the small image and the heading text in Lightbox. */ |
| 43 | + alt?: string | undefined; |
18 | 44 |
|
19 | | - /* Should the download button be hidden? */ |
20 | | - hideDownload?: boolean; |
| 45 | + /** Will be invoked when the Lightbox requests to be closed. */ |
| 46 | + onClose?: (() => void) | undefined; |
21 | 47 |
|
22 | | - /* Should the zoom button be hidden? */ |
23 | | - hideZoom?: boolean; |
| 48 | + /** Optional. Set to `true` to hide download-button from the Lightbox. */ |
| 49 | + hideDownload?: boolean | undefined; |
24 | 50 |
|
25 | | - /* Should the rotate button be shown? */ |
26 | | - showRotate?: boolean; |
| 51 | + /** Optional. Set to `true` to hide zoom-button from the Lightbox. */ |
| 52 | + hideZoom?: boolean | undefined; |
27 | 53 |
|
28 | | - /* The color to display in the background. */ |
29 | | - imageBackgroundColor?: string; |
| 54 | + /** Optional. Set to `true` to show rotate-button within the Lightbox. */ |
| 55 | + showRotate?: boolean | undefined; |
30 | 56 |
|
31 | | - /* The class name for the modal */ |
32 | | - className?: string; |
| 57 | + /** Optional. Background color of the image shown in Lightbox. Defaults to black. Handy for transparent images. */ |
| 58 | + imageBackgroundColor?: string | undefined; |
33 | 59 | } |
34 | 60 |
|
35 | 61 | declare class ModalImage extends React.Component<ModalImageProps> {} |
36 | | -declare class Lightbox extends React.Component<ModalImageProps> {} |
| 62 | +declare class Lightbox extends React.Component<LightboxProps> {} |
37 | 63 |
|
38 | 64 | export default ModalImage; |
39 | 65 | export { Lightbox }; |
0 commit comments