react-recycled-list
Version:
A React library for efficiently rendering large list with expensive component
46 lines (45 loc) • 1.62 kB
TypeScript
import React from 'react';
import { RowToDataIndexMap } from './utils';
import { ReactRecycledListProps, ReactRecycledListState } from './TypeDef';
import GeneralList from './AbstractList';
interface VariableListProps extends ReactRecycledListProps {
/**
* 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[];
/**
* The height of the list.
*/
height: number;
}
export default class VariableList extends GeneralList<VariableListProps, ReactRecycledListState> {
rowPositions: number[];
rowHeights: number[];
rowToDataIndexMap: RowToDataIndexMap;
fullHeight: number;
windowHeight: number;
initialArrayTemplate: null[];
totalNumOfRenderedRows: number;
numOfInvisibleRowOnEachDirection: number;
totalRows: number;
timeOut: any;
listWindowRef: React.RefObject<HTMLDivElement>;
initializeProperties: () => {
rowToDataIndexMap: RowToDataIndexMap;
rowPositions: number[];
totalRows: number;
initialArrayTemplate: any[];
fullHeight: number;
totalNumOfRenderedRows: number;
numOfInvisibleRowOnEachDirection: number;
rowHeights: number[];
windowHeight: number;
};
constructor(props: VariableListProps);
shouldResetList: (prevProps: VariableListProps) => boolean;
getTopViewportRowIndex: (scrollTop: number) => number;
getBottomViewportRowIndex: (viewportBottom: number) => number;
}
export {};