-
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathvirtualized.ts
More file actions
25 lines (20 loc) · 799 Bytes
/
virtualized.ts
File metadata and controls
25 lines (20 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import * as React from 'react';
import { TableNode } from '@table-library/react-table-library/types/table';
import { TableOptions, RowOptions } from '@table-library/react-table-library/types/compact';
export type RowHeight = number | ((item: TableNode, index: number) => number);
export type ListOnRowsRenderedParams = {
overscanStartIndex: number;
overscanStopIndex: number;
visibleStartIndex: number;
visibleStopIndex: number;
}
export type OnItemsRendered = (props: ListOnRowsRenderedParams) => any;
export type VirtualizedProps<T extends TableNode> = {
tableList: T[];
rowHeight: RowHeight;
header: () => React.ReactNode;
body: (node: T, index: number) => React.ReactNode;
tableOptions?: TableOptions;
rowOptions?: RowOptions<T>;
onItemsRendered?: OnItemsRendered;
};