import { R as RowData, f as Row, m as AggregationFn, d as ColumnDef, c as Table, am as RowModel } from './types-CwNe64f5.cjs'; declare const aggregationFns: { readonly sum: (columnId: string, leafRows: Row[], _childRows: Row[]) => number; readonly min: (columnId: string, leafRows: Row[], _childRows: Row[]) => number; readonly max: (columnId: string, leafRows: Row[], _childRows: Row[]) => number; readonly extent: (columnId: string, leafRows: Row[], _childRows: Row[]) => [number, number]; readonly mean: (columnId: string, leafRows: Row[], _childRows: Row[]) => number; readonly median: (columnId: string, leafRows: Row[], _childRows: Row[]) => number; readonly unique: (columnId: string, leafRows: Row[], _childRows: Row[]) => unknown[]; readonly uniqueCount: (columnId: string, leafRows: Row[], _childRows: Row[]) => number; readonly count: (_columnId: string, leafRows: Row[], _childRows: Row[]) => number; }; type BuiltInAggregationFn = keyof typeof aggregationFns; interface PivotFieldConfig { /** The column/field id */ field: string; /** Optional label override for display */ label?: string; } interface PivotValueConfig { /** The column/field id to aggregate */ field: string; /** Aggregation function name or custom function */ aggregation: keyof typeof aggregationFns | AggregationFn; /** Optional label override */ label?: string; } interface PivotConfig { /** Fields to use as row groups (left-side grouping) */ rowFields: PivotFieldConfig[]; /** Fields to use as column groups (generate dynamic columns) */ columnFields: PivotFieldConfig[]; /** Fields to aggregate as values in the cross-tab cells */ valueFields: PivotValueConfig[]; /** Whether to show row subtotals */ showRowSubtotals?: boolean; /** Whether to show column subtotals */ showColumnSubtotals?: boolean; /** Whether to show grand total row */ showGrandTotal?: boolean; } interface PivotState { /** Whether pivot mode is active */ enabled: boolean; /** Pivot configuration */ config: PivotConfig; /** Expanded row groups (by path key) */ expandedRowGroups: Record; /** Expanded column groups (by path key) */ expandedColumnGroups: Record; } interface PivotColumn { /** Unique column id */ id: string; /** Display header */ header: string; /** Path of column group values */ path: string[]; /** Which value field this column represents */ valueField: string; /** Aggregation function for this column */ aggregation: keyof typeof aggregationFns | AggregationFn; /** Whether this is a subtotal column */ isSubtotal?: boolean; } interface PivotRow { /** Unique row id */ id: string; /** Row group path */ path: string[]; /** Display label for the row group */ label: string; /** Depth in the row grouping hierarchy */ depth: number; /** Whether this row has children (more specific groupings) */ hasChildren: boolean; /** Whether this is a subtotal row */ isSubtotal?: boolean; /** Whether this is the grand total row */ isGrandTotal?: boolean; /** Aggregated values keyed by pivot column id */ values: Record; /** Original data rows that feed into this pivot row */ sourceRows: unknown[]; } declare class PivotEngine { private config; private data; private getValueFn; constructor(data: TData[], config: PivotConfig, getValueFn: (row: TData, field: string) => unknown); generateColumns(): PivotColumn[]; generateRows(): PivotRow[]; private getUniqueColumnPaths; private buildRowGroups; private filterByColumnPath; private aggregate; } /** * Generate a RowModel from pivot configuration. * Replaces the normal pipeline when pivot mode is active. */ declare function getPivotRowModel(table: Table, data: TData[], config: PivotConfig): { rowModel: RowModel; columns: PivotColumn[]; }; /** * Generate ColumnDef array from PivotColumns for rendering. * Includes a row label column plus all generated value columns. */ declare function generatePivotColumnDefs(config: PivotConfig, pivotColumns: PivotColumn[]): ColumnDef[]; declare function getInitialPivotState(): PivotState; export { type BuiltInAggregationFn as B, type PivotColumn as P, PivotEngine as a, type PivotFieldConfig as b, type PivotRow as c, type PivotValueConfig as d, aggregationFns as e, getInitialPivotState as f, generatePivotColumnDefs as g, getPivotRowModel as h, type PivotConfig as i, type PivotState as j };