import { PropsWithChildren } from 'react'; import { DarkModeProps } from '@leafygreen-ui/lib'; import { TableProps } from '../Table/Table.types'; import { LGRowData } from '../useLeafyGreenTable'; import { LeafyGreenVirtualTable } from '../useLeafyGreenVirtualTable'; import { GetLgIdsReturnType } from '../utils'; interface BaseTableContextValue { /** * Whether the table is using virtual scrolling */ isVirtual?: boolean; /** * Whether rows in the table are selectable */ isSelectable?: boolean; /** * Available [properties and methods](https://tanstack.com/virtual/latest/docs/api/virtualizer#virtualizer-instance) returned from the Virtualizer instance. */ virtualTable?: LeafyGreenVirtualTable['virtual']; /** * LGIDs for table components */ lgIds: GetLgIdsReturnType; /** * Whether the rows should be memoized. */ shouldMemoizeRows?: boolean; } type PartialTableProps = Pick< TableProps, 'shouldAlternateRowColor' | 'shouldTruncate' | 'verticalAlignment' >; export type TableProviderProps = PropsWithChildren< PartialTableProps > & DarkModeProps & BaseTableContextValue;