import type { ReactNode } from "react"; import type { ColumnDefinition, DataConfiguration, GetItemId, PaginationConfiguration, Row, SelectMode, Sorting, Status } from "./types"; import type { DisplayMode } from "../../../Layout/Tables/Table"; type CanSelectItem = (item: Item, idx: number) => boolean; export type SortMode = "single" | "multi"; export type DataTableLocale = { selectAllButton?: string; noDataTitle?: string; noDataDescription?: string; loadingTitle?: string; loadingDescription?: string; errorTitle?: string; errorDescription?: string; }; interface BaseDataTableProps { /** The data which will be passed along to the table for rendering */ data: Item[]; /** Quite a few cases require you to specify the `itemID` which you can do using this prop */ itemId?: GetItemId; /** The columns define the layout of your table and the respective rows and cells */ columns: ColumnDefinition[]; /** Whether the table should have pagination. */ pagination?: PaginationConfiguration; /** The `onChange` callback is triggered when either sorting or paginating. */ onChange?(dataConfiguration: DataConfiguration): void; /** The display mode of the table. */ mode?: DisplayMode; /** Specify the global status of the table */ status?: Status; /** Allows for specifying a custom empty state */ noDataContent?: ReactNode; /** Allows for specifying a custom error state */ errorContent?: ReactNode; /** Whether the table can hover rows. */ canHoverRow?(row: Row): boolean; /** The callback triggered when the hovered row changes. */ onRowHoveredChanged?(row: Row | null): void; /** The current sorting configuration. */ sorting?: Sorting[]; /** The sort mode of the table. */ sortMode?: SortMode; /** The locale configuration for the table. */ locale?: DataTableLocale; } type DataTableWithSelectMode = { /** The selection mode of the table. */ selectMode: Exclude; /** The currently selected rows. */ selection?: string[]; /** The callback triggered when the selection changes. */ onSelectionChange?(rowId: string[]): void; /** Whether the table can select items. */ canSelectItem?: CanSelectItem; }; type DataTableWithoutSelectMode = { /** Whether the table has selection. */ selectMode?: Extract; /** The currently selected rows. */ selection?: never; /** The callback triggered when the selection changes. */ onSelectionChange?: never; /** Whether the table can select items. */ canSelectItem?: never; }; export type DataTableProps = BaseDataTableProps & (DataTableWithSelectMode | DataTableWithoutSelectMode); /** * The `DataTable` component displays tabular data in a grid layout. It allows users to view, sort, filter, and interact with data in a structured way. * * See the [Data Table documentation page](https://satellite.algolia.com/8261d6576/p/12e3b1-data-table) for more information. */ export declare const DataTable: ({ data, itemId, columns, onChange, mode, status, noDataContent, errorContent, sorting, sortMode, pagination, selectMode, selection, onSelectionChange, canSelectItem, canHoverRow, onRowHoveredChanged, locale: propsLocale, }: DataTableProps) => import("react/jsx-runtime").JSX.Element; export {};