import { default as React } from 'react'; import { ColDef, GridApi, GridOptions, RowClassParams, Theme } from 'ag-grid-community'; import { IReadonlyDataService, IDataService, SelectColumn } from '@datavysta/vysta-client'; import { default as Condition } from '../Models/Condition'; import { EditableFieldConfig } from './types'; export interface DataGridStyles { root?: React.CSSProperties; container?: React.CSSProperties; toolbar?: React.CSSProperties; titleSection?: React.CSSProperties; title?: React.CSSProperties; badge?: React.CSSProperties; actions?: React.CSSProperties; searchInput?: React.CSSProperties; grid?: React.CSSProperties; createButton?: React.CSSProperties; downloadButton?: React.CSSProperties; deleteButton?: React.CSSProperties; aggregateFooter?: React.CSSProperties; } export interface DataGridProps { title: string; noun: string; repository: IReadonlyDataService; columnDefs: ColDef[]; gridOptions?: GridOptions; supportRegularDownload?: boolean; supportInsert?: boolean; supportDelete?: boolean; deleteButton?: (onDelete: () => void) => React.ReactNode; filters?: { [K in keyof T]?: Record; }; conditions?: Condition[]; inputProperties?: { [key: string]: string; }; wildcardSearch?: string; toolbarItems?: React.ReactNode; onDataFirstLoaded?: (gridApi: GridApi) => void; /** * Called every time data is loaded, including filter changes and initial load * Not called for infinite scroll loads */ onDataLoaded?: (gridApi: GridApi, data: U[]) => void; getRowClass?: ((params: RowClassParams) => string | string[] | undefined); getRowId: (data: T) => string; theme?: Theme | 'legacy'; tick?: number; styles?: DataGridStyles; editService?: IDataService; editableFields?: { [K in keyof U]?: EditableFieldConfig; }; noRowsComponent?: React.ComponentType>; loadingComponent?: React.ComponentType>; /** * Columns to aggregate and show as a summary/footer row below the grid. * Uses Vysta aggregate queries (AVG, SUM, etc). See SelectColumn in @datavysta/vysta-client. */ aggregateSelect?: SelectColumn[]; /** * Optional custom render for the aggregate summary row. If not provided, a default row is rendered. */ renderAggregateFooter?: (summary: Record) => React.ReactNode; /** * Called whenever the row count changes due to filter updates, data changes, etc. * Receives the current row count. */ onRowCountChange?: (count: number) => void; /** * Enable caching for this DataGrid's queries. Defaults to false. */ useCache?: boolean; /** * Called after a cell edit is successfully saved. * @param params Object containing the field, old value, new value, row data, and row ID */ onSaveComplete?: (params: { field: string; oldValue: unknown; newValue: unknown; rowId: string; rowData: U; gridApi: GridApi; }) => void; } export declare function DataGrid({ title, noun, repository, columnDefs, gridOptions, supportRegularDownload, supportInsert, supportDelete, deleteButton, filters, conditions, inputProperties, wildcardSearch, toolbarItems, onDataFirstLoaded, onDataLoaded, getRowId, theme, tick, styles, editService, editableFields, noRowsComponent, loadingComponent, aggregateSelect, renderAggregateFooter, onRowCountChange, useCache, onSaveComplete, }: DataGridProps): import("react/jsx-runtime").JSX.Element;