VirtualCell.d.ts 997 B

1234567891011121314151617181920212223242526
  1. import * as React from 'react';
  2. import type useRowInfo from '../hooks/useRowInfo';
  3. import type { ColumnType, CustomizeComponent } from '../interface';
  4. export interface VirtualCellProps<RecordType> {
  5. rowInfo: ReturnType<typeof useRowInfo<RecordType>>;
  6. column: ColumnType<RecordType>;
  7. colIndex: number;
  8. indent: number;
  9. index: number;
  10. component?: CustomizeComponent;
  11. /** Used for `column.render` */
  12. renderIndex: number;
  13. record: RecordType;
  14. style?: React.CSSProperties;
  15. className?: string;
  16. /** Render cell only when it has `rowSpan > 1` */
  17. inverse?: boolean;
  18. getHeight?: (rowSpan: number) => number;
  19. }
  20. /**
  21. * Return the width of the column by `colSpan`.
  22. * When `colSpan` is `0` will be trade as `1`.
  23. */
  24. export declare function getColumnWidth(colIndex: number, colSpan: number, columnsOffset: number[]): number;
  25. declare function VirtualCell<RecordType = any>(props: VirtualCellProps<RecordType>): React.JSX.Element;
  26. export default VirtualCell;