/** * Aggregation helpers — return AggregationSpec objects used in metric definitions. * * @example * ```ts * import { sum, count, countDistinct, avg } from '@hypequery/serve'; * * const totalRevenue = Orders.metric("totalRevenue", { * value: sum("amount"), * }); * * const orderCount = Orders.metric("orderCount", { * value: count("id"), * }); * ``` */ import type { AggregationSpec } from './types.js'; export declare function sum(field: string): AggregationSpec; export declare function count(field: string): AggregationSpec; export declare function countDistinct(field: string): AggregationSpec; export declare function avg(field: string): AggregationSpec; export declare function min(field: string): AggregationSpec; export declare function max(field: string): AggregationSpec; /** Approximate percentile of a numeric field at `level` in [0, 1]. */ export declare function percentile(field: string, level: number): AggregationSpec; /** Median — sugar for `percentile(field, 0.5)`. */ export declare function median(field: string): AggregationSpec; /** Value of `field` on the row where `by` is greatest. */ export declare function argMax(field: string, by: string): AggregationSpec; /** Value of `field` on the row where `by` is smallest. */ export declare function argMin(field: string, by: string): AggregationSpec; /** Sample standard deviation. */ export declare function stddev(field: string): AggregationSpec; /** Sample variance. */ export declare function variance(field: string): AggregationSpec; //# sourceMappingURL=aggregations.d.ts.map