import * as React from 'react'; import IReactComponentProps from '../../../common/structures/IReactComponentProps'; import { DOMRect } from 'react-resize-observer'; import { VirtualListHelper, IVirtualListHelperCalculations } from './helpers/VirtualListHelper'; import { ReactElement } from 'react'; export interface IVirtualListProps extends IReactComponentProps { containerRenderer?(children: React.ReactNode, customRendererStyles: { minHeight: number; }): ReactElement | null; /** list data passed to the list item renderer */ data: any[] | undefined | null; /** whether to disable the resize listener used to adjust calculated height (if true, it's highly recommended to set 'wrapperSizePx') */ disableResizeObserver?: boolean; /** whether to disable virtualized renderersFactory and draw all list items or not (if true) */ disableVirtualization?: boolean; /** the height of an individual list item (must be predictble, exact, and consistent) */ itemHeight: number; /** * item render function * note: the element returned by this factory function *must* be able to have its 'style' attribute set */ itemRenderer(listItemData: any, listItemIndex: number, customRendererStyles: { transform: string; }, extraData: any): React.ReactNode; /** this is any extra data that needs to be passed to 'itemRenderer' */ itemRendererExtraData?: any; /** callback function for when list items are calculated but not necessarily rendered */ onCalculate?(calculations: IVirtualListHelperCalculations): void; /** callback function for when list items are rendered */ onRender?(calculations: IVirtualListHelperCalculations): void; /** the height (in pixels) for both before and after overscan areas */ overscan?: number | 'auto'; /** Whether to show alternating row stripes. */ striped?: boolean; /** manually set wrapper size in pixels (note: this will be overridden if disableResizeObserver is 'false', but should be used if 'disableResizeObserver' is set to 'true') */ wrapperSizePx?: number; /** wrapper render function used to generate the scrolling element */ wrapperRenderer?(children: React.ReactNode): ReactElement; } export interface IVirtualListState { containerSizePx: number; itemsRenderedList: ReturnType[]; lastDataLen: number; } export declare class VirtualList extends React.Component { static defaultProps: Partial; protected _calcs: IVirtualListHelperCalculations; protected _helper: VirtualListHelper; protected _scrollTop: number; protected _wrapperRef: HTMLDivElement | null; protected _wrapperSizePx: number; constructor(props: IVirtualListProps); setWrapperRef: (element: HTMLDivElement | null) => void; componentDidMount(): void; componentWillUnmount(): void; componentDidUpdate(prevProps: IVirtualListProps, prevState: IVirtualListState): void; UNSAFE_componentWillReceiveProps(nextProps: IVirtualListProps): void; protected _calculateItemsAndRenderIfChanged(props: IVirtualListProps, forceReRender: boolean): void; protected _onDidMountOrUpdate(): void; protected _onScroll: (event: UIEvent) => void; protected _onResize: (rect: DOMRect) => void; protected _renderContainer(): React.JSX.Element; protected _renderWrapper(): React.JSX.Element; render(): React.JSX.Element; } //# sourceMappingURL=VirtualList.d.ts.map