import * as React from "react"; import { IImageLoadTrackerProps } from "../ImageLoadTracker"; import { IImageProps } from "../Image"; export interface IGalleryProps { /** * The list of images that will be virtualized. Eventually, if this is empty * we will use the emptyContent property in ReactVirtualized */ images: IImageProps[]; /** * If provided, the will scroll the view such * that the active image is visible. */ activeImageIndex?: number; /** * Use this for paginating a */ loadMoreRows?: ({ startIndex, stopIndex }: { startIndex: number; stopIndex: number; }) => Promise; /** * If using paginated loading, use this to tell the how many total images it wil eventually need * to fetch */ totalImageCount?: number; /** * By default, the IImageProp from the images array is spread to an * component. However, if this property is provided it will be called instead. * It is expected that it returns an component * * @param remainder - If `maxRowCount` is set, there could be items that are cut off. The number of * cut off items is the "remainder". The remainder will only be passed to the last * element rendered before elements are cut off. */ renderImage?: (image: IImageProps, index: number, remainder?: number) => JSX.Element; /** * If provided, a load tracker will be displayed */ imageLoadTracker?: IImageLoadTrackerProps; /** * If provided, each item will maintain a certain width. This will make * the number of items in a row dynamic */ itemWidth?: number; itemHeight?: number; /** * If provided, the row count will never exceed this number. Calculations for * the row count will still be done as normal */ maxRowCount?: number; /** * If true, whenever the size of the is recomputed, the parent * element's height will be set to the total height of the gallery. */ snapParentHeightToGalleryHeight?: boolean; onSnapParentHeightToGalleryHeight?: () => void; snapParentWidthToGalleryWidth?: boolean; onSnapParentWidthToGalleryWidth?: () => void; /** * Disable the virtualization of elements above the current scroll. Essentially, * prevent unmounting and remount of elements that have already been revealed */ preventBackwardsVirtualization?: boolean; className?: string; windowScrolling?: boolean; } interface IGalleryState { /** * The `imageLoadTracker` is of type ImageLoadTrackerType.Detailed. Therefore, it * can be on an "open" or "closed" state given that its underlying element is an * . We need to account for both states when calculating the s top * offsets */ imageLoadTrackerIsDetailOpen: boolean; } export declare class Gallery extends React.Component { ref: React.RefObject; state: IGalleryState; constructor(props: any); shouldComponentUpdate(nextProps: IGalleryProps, nextState: IGalleryState): boolean; componentDidMount(): void; componentDidUpdate(prevProps: IGalleryProps, prevState: IGalleryState): void; render(): JSX.Element; private cellRangeRenderer; private infiniteLoaderChildFunction; private renderAutosizedGrid; private onSectionRendered; private onRowsRendered; private recomputeGridSize; private getTotalRowsHeight; private getTotalColumnsWidth; /** * Setting `overscanRowCount` on did not seem to change the * range that was rendered. However, using this override did. */ private overscanIndicesGetter; private loadMoreRows; private isRowLoaded; private getTotalRowCount; private isIndexInBounds; private withVirtualGridNode; private withGalleryNode; private withGalleryImageLoadTrackerNode; /** * If the `itemWidth` property is provided, the number of * columns per row is calculated by dividing the provided width * by the `itemWidth` */ private getColumnCount; private getColumnWidth; private getLimitedTotalColumnsWidth; private getHeight; private getRowHeight; private getRemainder; private getTopOffsetForCell; private getGalleryImageLoadTrackerHeight; private snapParentHeightToGalleryHeight; private snapParentWidthToGalleryWidth; private getContainerHeight; } export {};