Vizzuality/landgriffon

View on GitHub
client/src/components/table/column.ts

Summary

Maintainability
A
0 mins
Test Coverage
import type { ColumnMeta, RowData, ColumnDef } from '@tanstack/react-table';
import type { HTMLAttributes } from 'react';
import type { TableProps } from './component';

declare module '@tanstack/table-core' {
  interface TableMeta<TData extends RowData> {
    theme: TableProps<TData>['theme'];
  }

  interface ColumnMeta<TData extends RowData, TValue> {
    isSticky?: boolean | 'left' | 'right';
    align?: 'left' | 'right' | 'center';
  }
}

export type ColumnDefinition<T> = ColumnDef<T> &
  ColumnMeta<T, T> &
  Pick<HTMLAttributes<HTMLDivElement>, 'className'>;