import { NumericalValues, PlainObject } from "../../models.mjs"; //#region src/internal/math/aggregate.d.ts type Aggregation = { count: number; value: number; }; type AggregationType = 'average' | 'max' | 'min' | 'sum'; type NonAverageAggregationType = 'max' | 'min' | 'sum'; declare function aggregate(type: AggregationType, array: unknown[], key: unknown): Aggregation; declare function getAggregateCallback(key: unknown): Function | undefined; /** * Get the maximum value from a list of items * * @example * ```typescript * max( * [{id: 1, value: 10}, {id: 2, value: 20}], * item => item.value, * ); // => 20 * * max([], item => item.value); // => Number.NaN * ``` * * @param items List of items * @param callback Callback to get an item's value * @returns Maximum value, or `Number.NaN` if no maximum can be found */ declare function max(items: Item[], callback: (item: Item, index: number, array: Item[]) => number): number; /** * Get the maximum value from a list of items * * @example * ```typescript * max( * [{id: 1, value: 10}, {id: 2, value: 20}], * 'value', * ); // => 20 * * max([], 'value'); // => Number.NaN * ``` * * @param items List of items * @param key Key to use for value * @returns Maximum value, or `Number.NaN` if no maximum can be found */ declare function max>(items: Item[], key: ItemKey): number; /** * Get the maximum value from a list of numbers * * @example * ```typescript * max([10, 20]); // => 20 * max([]); // => Number.NaN * ``` * * @param values List of numbers * @returns Maximum value, or `Number.NaN` if no maximum can be found */ declare function max(values: number[]): number; declare function getAggregated(type: NonAverageAggregationType, array: unknown[], key?: unknown): number; declare const AGGREGATION_AVERAGE: AggregationType; declare const AGGREGATION_MAX = "max"; declare const AGGREGATION_MIN = "min"; declare const AGGREGATION_SUM = "sum"; //#endregion export { AGGREGATION_AVERAGE, AGGREGATION_MAX, AGGREGATION_MIN, AGGREGATION_SUM, AggregationType, aggregate, getAggregateCallback, getAggregated, max };