import { VirtualizerOptions } from "@tanstack/react-virtual"; import React from "react"; import type { Awaitable } from "../../types/utils"; import { TableProps } from "../Table"; type VirtualizerProps = Pick, "initialRect"> & { overscanBy?: number; }; type VirtualizedTablePaginationProps = { hasNext: boolean; loadNext: () => Awaitable; /** * The threshold at which to pre-fetch data. A threshold X means that new data * should start loading when a user scrolls within X cells of the end of the * `items` array. * * @defaultValue `DEFAULT_PAGINATION_THRESHOLD` */ paginationThreshold?: number; paginationError?: boolean; }; type VirtualizedTableBaseProps = { /** * Determines whether to use window or direct table scrolling. In `window` * mode, scrolling the browser window will cause the table to scroll even when * the user is not hovering over the table html element directly. In `table` * mode, only scrolling on top of the table will cause the table to scroll. * * * @defaultValue `"window"` */ scrollMode?: "window" | "table"; /** * Ref to the container that should be scrolled. This is required when using table mode if a height is not set. */ scrollContainerRef?: React.RefObject; tableBodyRef?: React.RefObject; setTableBodyRef?: (ref: HTMLDivElement | null) => void; id?: string; /** * Override the default size of the table. */ overrides?: { size?: { gap?: number; height?: number; }; }; } & Pick, "items" | "className" | "contentClassName" | "style" | "contentStyle" | "itemKey" | "header" | "renderRow" | "context" | "size" | "headerBorderOnScroll" | "dividers"> & VirtualizerProps & Partial; export type VirtualizedTableModeProps = VirtualizedTableBaseProps & { scrollMode: "table"; }; export type VirtualizedTableWindowModeProps = VirtualizedTableBaseProps & { scrollMode?: "window"; }; export type VirtualizedTableProps = VirtualizedTableModeProps | VirtualizedTableWindowModeProps; /** * A table that automatically virtualizes its rows to improve performance. * Rows that are out of the viewport are not rendered. */ export declare const VirtualizedTable: (({ items, ...props }: VirtualizedTableProps) => React.JSX.Element) & { Header: React.ForwardRefExoticComponent> & { Cell: ({ children, sort, className, ...cellProps }: { role?: "cell" | "columnheader"; stickyLeft?: number; } & import("tailwind-variants").VariantProps>> & Omit, "height" | "width"> & import("../..").TextColorVariantProps & { sort?: (import("../Table/TableHeaderCell").TableColumnSort & { onSort: (newSort: import("../Table/TableHeaderCell").TableColumnSort) => void; }) | undefined; }) => React.JSX.Element; }; Row: React.ForwardRefExoticComponent<{ className?: string; children: React.ReactNode; onClick?: React.MouseEventHandler; } & Omit & import("tailwind-variants").VariantProps>> & React.RefAttributes> & { Cell: React.ForwardRefExoticComponent<{ role?: "cell" | "columnheader"; stickyLeft?: number; } & import("tailwind-variants").VariantProps>> & Omit, "height" | "width"> & import("../..").TextColorVariantProps & React.RefAttributes>; }; }; export {}; //# sourceMappingURL=VirtualizedTable.d.ts.map