import { b as SortableValue, o as ColumnDef } from "./types-Cqk1_BXq.js"; import { ReactNode } from "react"; //#region src/aggregate/aggregate.d.ts /** The aggregate functions available by name. */ type AggregateName = "sum" | "avg" | "count" | "min" | "max"; /** * A custom aggregator: the values found for one column across the rows being * aggregated, already narrowed to those that are present. * * Return whatever the cell should show — a number, a formatted string, a * node. Return `undefined` for "no cell here". * * The return type is `ReactNode` so the built mapper is directly assignable * to `summaryRow` and `groupAggregates`, which is the whole point of it. */ type Aggregator = (values: readonly TValue[]) => ReactNode; /** What to compute per column: a built-in name, or your own function. */ type AggregateSpec = Partial>; /** Options for {@link aggregate}. */ interface AggregateOptions { /** * Columns, so values resolve through `sortValue` exactly as sorting and * grouping do. Without them, values come from the key's data path. */ columns?: readonly ColumnDef[]; /** * Format a computed value for display. Receives the raw result and the * column key: `format: (v, key) => key === "budget" ? money.format(v) : v`. */ format?: (value: ReactNode, key: string) => ReactNode; } /** Every built-in aggregate name, for a UI that offers a choice. */ declare const AGGREGATE_NAMES: AggregateName[]; /** * Build a `summaryRow` / `groupAggregates` mapper from a declaration. * * @example * ```tsx * * ``` */ declare function aggregate(spec: AggregateSpec, options?: AggregateOptions): (rows: readonly TRow[]) => Partial>; //#endregion export { Aggregator as a, AggregateSpec as i, AggregateName as n, aggregate as o, AggregateOptions as r, AGGREGATE_NAMES as t }; //# sourceMappingURL=aggregate-C1nNljQr.d.ts.map