import { DeepMap } from './deepMap'; export type GroupKeyType = T; export type GroupBy = { field: keyof DataType; toKey?: (value: any, data: DataType) => GroupKeyType; }; export type GroupParams = { groupBy: GroupBy[]; defaultToKey?: (value: any, item: DataType) => GroupKeyType; reducers?: Record>; }; export type DataSourceAggregationReducer = { name?: string; field?: keyof T; initialValue?: AggregationResultType; getter?: (data: T) => any; reducer: string | ((accumulator: any, value: any, data: T) => AggregationResultType | any); done?: (accumulatedValue: AggregationResultType | any, array: T[]) => AggregationResultType; }; export type DataGroupResult = { deepMap: DeepMap, DeepMapGroupValueType>; groupParams: GroupParams; initialData: DataType[]; reducerResults?: Record; }; export type DeepMapGroupValueType = { items: DataType[]; commonData?: Partial; reducerResults: Record; }; export type AggregationReducerResult = { value: AggregationResultType; id: string; }; export declare function group(groupParams: GroupParams, data: DataType[]): DataGroupResult;