import { type HTMLAttributes, type ReactNode } from "react";
export type DataTableAlign = "left" | "center" | "right";
export type DataTableDensity = "compact" | "default" | "comfortable";
export type DataTableSortDir = "asc" | "desc";
export interface DataTableColumn<T = any> {
    /** Unique key — also used as the field accessor unless `accessor` is provided. */
    key: string;
    /** Header cell content. */
    header: ReactNode;
    /** Accessor — function or property name. Defaults to row[key]. */
    accessor?: ((row: T) => any) | keyof T;
    /** Custom render. Receives `(value, row, index)`. */
    render?: (value: any, row: T, index: number) => ReactNode;
    /** Sortable column. */
    sortable?: boolean;
    /** Header + cell alignment. Numeric cells should be right-aligned. */
    align?: DataTableAlign;
    /** Mono / tabular numerics. Auto-enables for numeric/id/duration/cost types. */
    numeric?: boolean;
    /** Default visibility (true). Use the column-settings menu to toggle at runtime. */
    visible?: boolean;
    /** Fixed width in px or any CSS length. */
    width?: string | number;
    /** Min-width for resize / shrink behavior. */
    minWidth?: number;
    /** Make the column user-resizable — adds a drag handle at the right edge
     * of the header cell. Resized widths are tracked in component state and
     * emitted through `onColumnResize`. */
    resizable?: boolean;
    /** Max-width clamp during user resize. */
    maxWidth?: number;
    /** Optional cell-level className. */
    cellClassName?: string;
}
export interface DataTableFilter<T = any> {
    key: string;
    label: ReactNode;
    options: {
        value: string;
        label: ReactNode;
    }[];
    /** Apply the filter on a row. Defaults to row[key] === value. */
    apply?: (row: T, value: string) => boolean;
}
export interface DataTableRowAction<T = any> {
    label: ReactNode;
    icon?: ReactNode;
    danger?: boolean;
    disabled?: (row: T) => boolean;
    onClick: (row: T, index: number) => void;
}
export interface DataTableBulkAction<T = any> {
    label: ReactNode;
    icon?: ReactNode;
    danger?: boolean;
    onClick: (selectedRows: T[], selectedIndexes: number[]) => void;
}
export interface DataTablePagination {
    pageSize?: number;
    pageSizes?: number[];
    /** Controlled page (1-indexed). If omitted, internal state. */
    page?: number;
    onPageChange?: (page: number) => void;
    /** When false, server-side pagination (don't slice client data). */
    clientSide?: boolean;
    /** Total rows when server-side. */
    totalRows?: number;
}
export interface DataTableProps<T extends Record<string, any> = Record<string, any>> extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "onChange" | "onSelect" | "children"> {
    /** Title rendered in the toolbar. */
    title?: ReactNode;
    /** Subtitle / description shown under the title. */
    description?: ReactNode;
    /** Show row count in the toolbar. */
    showCount?: boolean;
    /** Column definitions. */
    columns: DataTableColumn<T>[];
    /** Row data. */
    data: T[];
    /** Stable id getter for each row. Defaults to array index. */
    getRowId?: (row: T, index: number) => string;
    search?: boolean;
    searchPlaceholder?: string;
    /** Custom search predicate. Defaults to substring across all visible columns. */
    searchPredicate?: (row: T, query: string) => boolean;
    /** Controlled search value. */
    searchValue?: string;
    onSearchChange?: (q: string) => void;
    sortKey?: string;
    sortDirection?: DataTableSortDir;
    onSortChange?: (key: string, direction: DataTableSortDir) => void;
    filters?: DataTableFilter<T>[];
    selectable?: boolean;
    selectedIds?: Set<string>;
    onSelectionChange?: (selected: Set<string>) => void;
    bulkActions?: DataTableBulkAction<T>[];
    rowActions?: DataTableRowAction<T>[];
    expandable?: boolean;
    renderExpanded?: (row: T, index: number) => ReactNode;
    pagination?: DataTablePagination | true;
    density?: DataTableDensity;
    showDensityToggle?: boolean;
    showColumnSettings?: boolean;
    loading?: boolean;
    error?: ReactNode;
    emptyTitle?: ReactNode;
    emptyDescription?: ReactNode;
    emptyAction?: ReactNode;
    /** @deprecated Use `toolbarEnd` / `primaryAction` / `secondaryActions`
     * for structured slots. Still rendered for back-compat. */
    toolbarActions?: ReactNode;
    /** Content rendered BEFORE the filter section (left edge of actions). */
    toolbarStart?: ReactNode;
    /** Content rendered AFTER every built-in section (right edge of actions). */
    toolbarEnd?: ReactNode;
    /** Accent-coloured CTA (e.g. "+ New") — pinned far right of the toolbar. */
    primaryAction?: ReactNode;
    /** Ghost-button cluster sitting just before the primary CTA. */
    secondaryActions?: ReactNode;
    /** Show a Refresh button next to the view controls. */
    showRefresh?: boolean;
    /** Click handler for the Refresh button. */
    onRefresh?: () => void;
    /** When true, the Refresh button shows a spinner + becomes non-interactive. */
    refreshing?: boolean;
    /** Show an Export menu with CSV / JSON options. */
    showExport?: boolean;
    /** Click handler for the export options. */
    onExport?: (format: "csv" | "json") => void;
    /** Render an "Active filters" chip cluster below the toolbar when any
     * filter has a value. Defaults to true. */
    showActiveFilterChips?: boolean;
    /** Per-column resize change handler. Fires while the user is dragging
     * with the new pixel width. The column's stored width updates internally;
     * use this to persist widths across reloads. */
    onColumnResize?: (key: string, width: number) => void;
    onRowClick?: (row: T, index: number) => void;
    /** Make rows look interactive (hover bg + cursor pointer). */
    rowClickable?: boolean;
    className?: string;
}
export declare function DataTable<T extends Record<string, any> = Record<string, any>>(props: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=DataTable.d.ts.map