import { ComponentPropsWithoutRef, ComponentPropsWithRef, ForwardedRef, PropsWithoutRef, ReactElement, RefAttributes, WeakValidationMap } from 'react'; import { VirtualItem, Virtualizer } from '@tanstack/react-virtual'; import { Theme } from '@leafygreen-ui/lib'; import { LeafyGreenTableRow, LGRowData } from '../useLeafyGreenTable'; export interface InternalRowBaseProps extends ComponentPropsWithoutRef<'tr'> { /** * Determines whether the row is disabled */ disabled?: boolean; } export interface InternalRowWithoutRTProps extends InternalRowBaseProps { } export interface InternalRowWithRTBaseProps extends InternalRowBaseProps { /** * Row object passed from the `useLeafyGreenTable` or `useLeafyGreenVirtualTable` hook. */ row: LeafyGreenTableRow; /** * Virtual row object passed from the `useLeafyGreenVirtualTable` hook */ virtualRow?: VirtualItem; } export interface InternalRowWithRTProps extends InternalRowWithRTBaseProps { /** * Determines whether alternating rows will have dark backgrounds. * @default false */ shouldAlternateRowColor: boolean; /** * Whether the theme is dark or light */ theme: Theme; /** * Function from TanStack Virtual that is called to dynamically measure the size of an item */ measureElement?: Virtualizer['measureElement']; /** * Whether the row is expanded */ isExpanded: boolean; /** * Whether the parent row is expanded */ isParentExpanded: boolean; /** * Whether the row is selected */ isSelected: boolean; /** * An internal prop used to pass a ref to the row */ rowRef?: React.MutableRefObject; /** * Whether the rows should be memoized. */ shouldMemoizeRows?: boolean; } export type RowProps = ComponentPropsWithRef<'tr'> & InternalRowBaseProps & Partial>; /** * Type definition for `Row` that works with generics. * row is optional */ export interface RowComponentType { (props: RowProps, ref: ForwardedRef): ReactElement | null; displayName?: string; propTypes?: WeakValidationMap & RefAttributes>> | undefined; } /** * Type definition for `InternalRowWithRT` that works with generics. * row is required */ export interface RowComponentWithRTType { (props: InternalRowWithRTProps, ref: ForwardedRef): ReactElement | null; displayName?: string; propTypes?: WeakValidationMap & RefAttributes>> | undefined; } //# sourceMappingURL=Row.types.d.ts.map