import { ComponentPropsWithRef } from 'react'; import { CellContext, ColumnDef, ColumnSort, OnChangeFn, Row, SortingState } from '@tanstack/react-table'; import { CellSize } from '../shared/types'; export type TableProps = ComponentPropsWithRef<'table'> & { defaultData: readonly T[]; /** Pulls in our spacing tokens for easy margin setting (e.g., `ccMargin="0 m xl"`). */ ccMargin?: string; columns: readonly Readonly>[]; /** Make sure this matches the number of `columns` */ columnSizes: readonly CellSize[]; /** Array of columns to sort by default, provided column id and whether or not sort should be descending */ defaultSortedColumns?: readonly Readonly<{ id: string; desc: boolean; }>[]; /** Enables/Disables the ability to remove sorting for the table. * * If true then changing sort order will circle like: 'none' -> 'desc' -> 'asc' -> 'none' -> ... * * If false then changing sort order will circle like: 'none' -> 'desc' -> 'asc' -> 'desc' -> 'asc' -> ... */ enableSortingRemoval?: boolean; /** Table header row sticks to the top of the window when the entire page is scrolled. * * Only enabled when the desktop sidebar nav is showing because otherwise the fixed position mobile nav blocks it. * */ enableStickyHeaders?: boolean; /** Enables manual pagination. * * If this option is set to true, the table will not automatically paginate rows using getPaginationRowModel() and instead will expect you to manually paginate the rows before passing them to the table. * * This is useful if you are doing server-side pagination and aggregation. */ manualPagination?: boolean; /** When manually controlling pagination, you should supply a total pageCount value to the table if you know it. * * If you do not know how many pages there are, you can set this to -1 */ pageCount?: number; /** Controlled sorting state. When provided, the table will use this sorting state instead of managing it internally. * * When this prop is provided, manual sorting is automatically enabled (useful for server-side sorting scenarios). * The table will not automatically sort rows and expects you to manually sort the rows before passing them to the table. */ sorting?: readonly Readonly[]; /** Callback for when the sorting changes */ onSortingChange?: (newSorting: readonly Readonly[]) => void; }; export type { CellContext, ColumnDef, ColumnSort, OnChangeFn, Row, SortingState, }; export declare const Table: ({ defaultSortedColumns, defaultData, ccMargin, columns, columnSizes, enableSortingRemoval, enableStickyHeaders, manualPagination, pageCount, sorting: externalSorting, onSortingChange, ...props }: TableProps) => import("react/jsx-runtime").JSX.Element;