/** * Aggregate operations for computing scalar values from entity collections. * * Implements count, sum, avg, min, max aggregations in a single pass. * All aggregates are computed simultaneously for efficiency. */ import type { AggregateResult, GroupedAggregateConfig, GroupedAggregateResult, ScalarAggregateConfig } from "../../types/aggregate-types.js"; /** * Compute scalar aggregates over an array of entities. * * Performs a single-pass reduction computing all requested aggregates simultaneously. * This is O(n * k) where n is entities and k is aggregate operations — effectively O(n). * * @param entities - Array of entities to aggregate * @param config - Aggregate configuration specifying which operations to perform * @returns AggregateResult with only the requested aggregations */ export declare const computeAggregates: (entities: ReadonlyArray>, config: ScalarAggregateConfig) => AggregateResult; /** * Compute grouped aggregates over an array of entities. * * Partitions entities into groups based on groupBy fields, then applies * computeAggregates within each group. Groups are ordered by first encounter. * * @param entities - Array of entities to aggregate * @param config - Grouped aggregate configuration specifying groupBy and operations * @returns GroupedAggregateResult array with group objects */ export declare const computeGroupedAggregates: (entities: ReadonlyArray>, config: GroupedAggregateConfig) => GroupedAggregateResult; //# sourceMappingURL=aggregate.d.ts.map