/**
 * Pivot Table Engine
 *
 * Transforms flat data into pivoted format with dynamic columns based on unique values
 * Supports aggregation functions: sum, count, avg, min, max, custom
 */
export type AggregatorType = 'sum' | 'count' | 'avg' | 'min' | 'max';
export interface PivotConfig {
    /** Column whose unique values become new columns */
    pivotColumn: string;
    /** Column to aggregate values from */
    valueColumn: string;
    /** Column to group rows by (becomes first column) */
    rowGroupColumn: string;
    /** Aggregation function to apply */
    aggregator: AggregatorType | ((values: number[]) => number);
    /** Show totals row at bottom */
    showTotals?: boolean;
    /** Show grand total column */
    showGrandTotal?: boolean;
}
export interface PivotColumn {
    field: string;
    headerName: string;
    width?: number;
    sortable?: boolean;
    filterable?: boolean;
    isPivotColumn?: boolean;
    isTotalColumn?: boolean;
}
export interface PivotResult {
    columns: PivotColumn[];
    rows: Record<string, any>[];
    pivotValues: string[];
    totalsRow?: Record<string, any>;
}
/**
 * Build pivot table from flat data
 *
 * Complexity: O(n) where n is number of rows
 * Memory: O(n * m) where m is number of unique pivot values
 *
 * @param data - Source data array
 * @param config - Pivot configuration
 * @returns Pivoted dataset with dynamic columns
 */
export declare function buildPivot(data: any[], config: PivotConfig): PivotResult;
/**
 * Export pivoted data to CSV
 */
export declare function exportPivotToCSV(pivotResult: PivotResult): string;
/**
 * Download CSV file
 */
export declare function downloadCSV(csvContent: string, filename?: string): void;
