import { BarchartProps, BarchartBars, BarchartTooltipFn } from './Barchart.component';
import { TooltipContentProps } from 'recharts';
import { ChartColors } from '../../style/theme';
export declare const getRoundReferenceValue: (value: number) => number;
export declare const getMaxBarValue: (data: {
    [key: string]: string | number;
}[], stacked?: boolean) => number;
/**
 * Transforms time-based data into chart format
 */
export declare const transformTimeData: <T extends BarchartBars>(bars: T, type: {
    type: "time";
    timeRange: {
        startDate: Date;
        endDate: Date;
        interval: number;
    };
}, barDataKeys: string[]) => {
    [key: string]: string | number;
}[];
/**
 * Transforms category-based data into chart format
 */
export declare const transformCategoryData: <T extends BarchartBars>(bars: T, barDataKeys: string[]) => {
    [key: string]: string | number;
}[];
/**
 * Applies custom sorting to chart data
 */
export declare const applySortingToData: <T extends BarchartBars>(data: {
    [key: string]: string | number;
}[], barDataKeys: string[], defaultSort: BarchartProps<T>["defaultSort"]) => {
    [key: string]: string | number;
}[];
/**
 * Converts prometheus data to recharts data format
 * @param bars - The bars to convert
 * @param type - The chart type (category or time)
 * @returns Recharts data format
 */
export declare const formatPrometheusDataToRechartsDataAndBars: <T extends BarchartBars>(bars: T, type: BarchartProps<T>["type"], colorSet: Record<T[number]["label"], ChartColors | (string & {})>, stacked?: boolean, defaultSort?: BarchartProps<T>["defaultSort"]) => {
    data: {
        [key: string]: string | number;
    }[];
    rechartsBars: {
        dataKey: string;
        fill: string;
        stackId?: string;
    }[];
};
export type UnitRange = {
    threshold: number;
    label: string;
}[];
export declare const computeUnitLabelAndRoundReferenceValue: (data: any, maxValue: number, unitRange: UnitRange | undefined) => {
    unitLabel: string;
    roundReferenceValue: number;
    rechartsData: any;
};
/**
 * Return the unit label base on the current dataset, and the valueBase which is used to convert the data
 * @param {any} unitRange
 * @param {any} maxValue the maximum value among the data set
 * @returns {any}
 */
export declare function getUnitLabel(unitRange: {
    threshold: number;
    label: string;
}[], maxValue: number): {
    valueBase: number;
    unitLabel: string;
};
export declare const sortStackedBars: (rechartsBars: {
    dataKey: string;
    fill: string;
    stackId?: string;
}[], data: {
    [key: string]: string | number;
}[], stacked?: boolean) => {
    dataKey: string;
    fill: string;
    stackId?: string;
}[];
export declare const renderTooltipContent: <T extends BarchartBars>(props: TooltipContentProps<number, string>, tooltip: BarchartTooltipFn<T> | undefined, hoveredValue: string | undefined) => import("react").ReactNode;
export declare const useChartData: <T extends BarchartBars>(bars: T, type: BarchartProps<T>["type"], colorSet: Record<T[number]["label"], ChartColors | (string & {})>, stacked?: boolean, defaultSort?: BarchartProps<T>["defaultSort"], unitRange?: UnitRange) => {
    rechartsBars: {
        dataKey: string;
        fill: string;
        stackId?: string;
    }[];
    unitLabel: string;
    roundReferenceValue: number;
    rechartsData: any;
};
//# sourceMappingURL=utils.d.ts.map