react-recycled-list
Version:
A React library for efficiently rendering large list with expensive component
31 lines (30 loc) • 1.4 kB
TypeScript
/// <reference types="react" />
import { ReactRecycledListState } from './TypeDef';
import FullWindowFixedList, { FullWindowFixedListProps } from './FullWindowFixedList';
interface FullWindowVariableListProps extends FullWindowFixedListProps {
/**
* An array of number definining the height of each row.
*
* The length of rowHeights must match the total number of rows computed from data.
*/
rowHeights: number[];
}
export default class FullWindowVariableList extends FullWindowFixedList<FullWindowVariableListProps, ReactRecycledListState> {
initializeProperties: (constructor?: boolean) => {
rowToDataIndexMap: import("./utils").RowToDataIndexMap;
rowPositions: number[];
totalRows: number;
initialArrayTemplate: any[];
fullHeight: number;
totalNumOfRenderedRows: number;
numOfInvisibleRowOnEachDirection: number;
rowHeights: number[];
windowHeight: number;
scrollListener: import("react").MutableRefObject<HTMLElement | null | undefined> | (Window & typeof globalThis) | undefined;
};
constructor(props: FullWindowVariableListProps);
getTopViewportRowIndex: (scrollTop: number) => number;
getBottomViewportRowIndex: (viewportBottom: number) => number;
shouldResetList: (prevProps: FullWindowVariableListProps) => boolean;
}
export {};