import 'ag-grid-community/styles/ag-grid.css'; import 'ag-grid-community/styles/agGridQuartzFont.css'; import '../../tokens/ag-grid-theme.css'; import { type ComponentType, type ReactNode } from 'react'; import { type VariantProps } from 'class-variance-authority'; import { type ColDef, type ColGroupDef, type FilterChangedEvent, type GridApi, type GridOptions, type RowClassParams, type SortChangedEvent } from 'ag-grid-community'; declare const dataTableVariants: (props?: ({ density?: "default" | "compact" | "expanded" | null | undefined; bordered?: boolean | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; export interface DataTableSortEntry { colId: string; sort: 'asc' | 'desc'; } /** * Curated handle exposed via `forwardRef`. Replaces the legacy raw `GridApi` * forwarding — see `src/docs/26-agent-readiness.mdx` §15. Consumers needing * the unwrapped ag-grid API call `getRawApi()`. */ export interface DataTableHandle { getSelection: () => string[]; setSelection: (ids: string[]) => void; selectRange: (fromId: string, toId: string) => void; clearSelection: () => void; getFilter: () => Record; setFilter: (model: Record) => void; /** * Columns whose visibility the user set by hand (ColumnToggle, column menu, * drag). Persisted with the column state under `gridId`; a responsive * baseline must leave them alone. */ getUserTouchedColumns: () => string[]; /** * Record columns as user-set — for programmatic writes that stand in for the * user (a saved view), so they persist and stop being auto-managed. */ markColumnsUserTouched: (colIds: readonly string[]) => void; getSort: () => DataTableSortEntry[]; setSort: (model: DataTableSortEntry[]) => void; getCurrentPage: () => number; goToPage: (page: number) => void; /** Id of the row whose detail is open (`expandedRowId`), or `null`. */ getExpandedRowId: () => string | null; getRawApi: () => GridApi | undefined; } export interface DataTableProps extends Omit, 'density'> { /** * Column definitions — accepts a mix of leaf `ColDef`s and header * `ColGroupDef`s (for two-row grouped headers via `children: [...]`). */ columnDefs: (ColDef | ColGroupDef)[]; rowData?: TData[]; rowSelection?: 'single' | 'multiple'; pagination?: boolean; paginationPageSize?: number; /** * Page-size dropdown options shown in the AG Grid pagination panel. * Pass `false` to hide the dropdown entirely. Default: `[10, 25, 50, 100]`. */ paginationPageSizeSelector?: number[] | false; gridId?: string; onSelectionChanged?: (rows: TData[]) => void; onSortChanged?: (event: SortChangedEvent) => void; onFilterChanged?: (event: FilterChangedEvent) => void; noRowsOverlay?: ComponentType; loadingOverlay?: ComponentType; gridOptions?: GridOptions; /** Grid height as a Tailwind height class, e.g. `"h-[500px]"` or `"h-[var(--data-table-height)]"` */ heightClass?: string; className?: string; /** Row height preset. `expanded` adds headroom for complex cells (balances, tag lists). */ density?: 'compact' | 'default' | 'expanded'; /** Map row → class name. Use together with `data-table-row-success/warning/error` for tinted rows. */ getRowClass?: (params: RowClassParams) => string | undefined; /** Rows pinned at the bottom of the grid. Use `useTotalRow()` to compute a totals row. */ pinnedBottomRowData?: TData[]; /** Print-optimised mode — hides toolbar, disables pagination, renders every row. */ printMode?: boolean; /** * Controlled: the id (per `gridOptions.getRowId`) of the ONE row whose * detail is open. Requires `gridOptions.getRowId`. Not supported together * with `rowSelection="multiple"` in v1. */ expandedRowId?: string | null; /** * Rendered as a full-width row directly beneath the expanded row. Must * derive everything from the row — the grid may unmount it when scrolled * out of view, so the content has to be stateless. */ renderExpandedRow?: (row: TData) => ReactNode; /** * The detail asked to close (Escape inside it, or the consumer's own close * control). The consumer owns the state and the focus return. */ onExpandedRowChange?: (id: string | null) => void; /** Composable toolbar — renders `…` above the grid. */ children?: ReactNode; } export declare const DataTable: ((props: DataTableProps & { ref?: React.Ref>; }) => React.ReactElement) & { Toolbar: import("react").ForwardRefExoticComponent> & { FilterBar: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; Actions: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; ExportCsv: import("react").ForwardRefExoticComponent>; ExportPdf: import("react").ForwardRefExoticComponent>; Print: import("react").ForwardRefExoticComponent & { label?: string; } & import("react").RefAttributes>; ColumnToggle: import("react").ForwardRefExoticComponent>; BulkAction: import("react").ForwardRefExoticComponent>; QuickSearch: { ({ placeholder, debounceMs }: import("./toolbar").QuickSearchProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; Refresh: import("react").ForwardRefExoticComponent>; FilterChips: { (): import("react/jsx-runtime").JSX.Element | null; displayName: string; }; FacetFilter: ({ field, options, label, }: import("./toolbar").FacetFilterProps) => import("react/jsx-runtime").JSX.Element; ExportMenu: import("react").ForwardRefExoticComponent> & { Item: { ({ format, label, onClick, fileName, }: import("./toolbar").ExportMenuItemProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; }; }; }; export {}; //# sourceMappingURL=data-table.d.ts.map