import type { ReadyQueryResultsPage } from '../index';
import { DimensionType, type ItemsMap } from '../types/field';
import { type MetricQuery } from '../types/metricQuery';
import { type PivotConfig, type PivotData } from '../types/pivot';
import { type ResultRow } from '../types/results';
import { TimeFrames } from '../types/timeFrames';
type FieldFunction = (fieldId: string) => ItemsMap[string] | undefined;
type FieldLabelFunction = (fieldId: string) => string | undefined;
type PivotQueryResultsArgs = {
    pivotConfig: PivotConfig;
    metricQuery: Pick<MetricQuery, 'dimensions' | 'metrics' | 'tableCalculations' | 'additionalMetrics' | 'customDimensions'>;
    rows: ResultRow[];
    groupedSubtotals?: Record<string, Record<string, number>[]>;
    options: {
        maxColumns: number;
    };
    getField: FieldFunction;
    getFieldLabel: FieldLabelFunction;
};
export declare const pivotQueryResults: ({ pivotConfig, metricQuery, rows, options, getField, getFieldLabel, groupedSubtotals, }: PivotQueryResultsArgs) => PivotData;
/**
 * Converts SQL-pivoted results to PivotData format
 * This handles results that are already pivoted at the SQL level (e.g., payments_total_revenue_any_bank_transfer)
 * and transforms them into the same PivotData structure as pivotQueryResults
 */
export declare const convertSqlPivotedRowsToPivotData: ({ rows, pivotDetails, pivotConfig, getField, getFieldLabel, groupedSubtotals, columnLimit, }: {
    rows: ResultRow[];
    pivotDetails: NonNullable<ReadyQueryResultsPage["pivotDetails"]>;
    pivotConfig: Pick<PivotConfig, "rowTotals" | "columnTotals" | "metricsAsRows" | "hiddenMetricFieldIds" | "visibleMetricFieldIds" | "columnOrder">;
    getField: FieldFunction;
    getFieldLabel: FieldLabelFunction;
    groupedSubtotals: PivotQueryResultsArgs["groupedSubtotals"];
    columnLimit?: number;
}) => PivotData;
export type PivotResultsDataCell = {
    raw: unknown;
    formatted: string;
    fieldId: string;
};
export type PivotResultsData = {
    headers: string[][];
    dataRows: Array<Array<PivotResultsDataCell>>;
    fieldIds: string[];
    hasIndex: boolean;
};
export declare function timeIntervalToExcelNumFmt(timeInterval: TimeFrames | undefined, dimensionType: DimensionType): string | null;
type PivotResultsParams = {
    pivotConfig: PivotConfig;
    pivotDetails: ReadyQueryResultsPage['pivotDetails'];
    rows: ResultRow[];
    itemMap: ItemsMap;
    metricQuery: MetricQuery;
    customLabels: Record<string, string> | undefined;
    onlyRaw: boolean;
    maxColumnLimit: number;
    undefinedCharacter?: string;
    timezone?: string;
    formatTemporalsForSpreadsheet?: boolean;
};
export declare const pivotResultsAsData: ({ pivotConfig, rows, itemMap, metricQuery, customLabels, onlyRaw, maxColumnLimit, undefinedCharacter, pivotDetails, timezone, formatTemporalsForSpreadsheet, }: PivotResultsParams) => PivotResultsData;
export declare const pivotResultsAsCsv: (params: PivotResultsParams) => string[][];
export {};
//# sourceMappingURL=pivotQueryResults.d.ts.map