import type { FixedSizeListProps, ListChildComponentProps, VariableSizeListProps } from "react-window"; import type { ListProps } from "../List.js"; import type { ListItemProps } from "../ListItem.js"; export interface InfiniteListItemProps extends ListChildComponentProps, Omit { } export type InfiniteListProps> | React.ComponentType> = React.ComponentType>, L extends React.ComponentType = React.ComponentType> = Omit ? P : {}, "itemData" | "children" | "itemCount"> & { ref?: React.RefObject void; }>; /** * The virtualized list component to use * @default FixedSizeList */ component: C; /** * Row data */ data: ReadonlyArray; /** * Determines whether the item at the given index is loaded */ isItemLoaded: (index: number) => boolean; /** * A function used to render a single row */ renderItem: (props: InfiniteListItemProps) => React.ReactElement; /** * Callback to be invoked when the next page must be loaded. * It should return a Promise that is resolved once all data has finished loading. */ loadNextPage: () => Promise | void; /** * The number of rows per page */ pageSize: number; /** * Threshold at which to pre-fetch data. * A threshold of 5 means that data will start loading when a user scrolls within 5 rows. * @default 5 */ threshold?: number; slots?: { loader?: React.ComponentType; list?: L; }; slotProps?: { loader?: Partial; list?: Partial>; }; };