/** * Data Grid Summary Row Module * Provides footer summary row functionality with aggregate calculations */ import type { IdsDataGridColumn } from './ids-data-grid-column'; export type AggregateFunction = 'sum' | 'avg' | 'count' | 'min' | 'max' | 'custom'; export type SummaryValue = number | string | null; export type SummaryFieldValue = number | string | null | undefined; export type CustomAggregateFunction = (values: SummaryFieldValue[]) => SummaryValue; export interface IdsDataGridSummaryConfig { /** Field to aggregate */ field: string; /** Aggregate function to apply */ function: AggregateFunction; /** Custom aggregate function if function is 'custom' */ customFunction?: CustomAggregateFunction; /** Format the aggregated value */ label?: string; } export interface IdsDataGridSummaryRowData { isSummaryRow: true; aggregates: Record; } /** * Calculate an aggregate value for a set of rows * @param {SummaryFieldValue[]} values The values to aggregate * @param {AggregateFunction} fn The aggregate function to use * @param {CustomAggregateFunction} customFn Custom function if fn is 'custom' * @returns {SummaryValue} The aggregated value */ export declare function calculateAggregate(values: SummaryFieldValue[], fn: AggregateFunction, customFn?: CustomAggregateFunction): SummaryValue; /** * Generate summary row data from full dataset * @param {Array>} data The data to summarize * @param {Array} summaryConfig Summary configuration * @returns {IdsDataGridSummaryRowData} The summary row data */ export declare function generateSummaryRow(data: Array>, summaryConfig: Array): IdsDataGridSummaryRowData; /** * Type for a data grid cell formatter function */ export type SummaryCellFormatter = (row: Record, col: IdsDataGridColumn, idx: number, grid: Record) => string; /** * Options for formatting a summary cell's content */ export interface SummaryCellFormatOptions { /** The column field key */ fieldKey: string; /** The calculated aggregate value */ aggregateValue: SummaryValue; /** The column configuration */ column: IdsDataGridColumn; /** Available formatters (keyed by name) */ formatters: Record; /** The parent data grid instance (Record to avoid circular import) */ grid: Record; /** The escapeHTML function */ escapeHTML: (value?: string) => string; } /** * Generate the HTML content for a summary cell given an aggregate value and column config * @param {SummaryCellFormatOptions} options Formatting options * @returns {string} The formatted HTML content for the cell */ export declare function formatSummaryCellContent(options: SummaryCellFormatOptions): string;