import * as d3 from "d3";
import type { TChartJSON } from "../ChartsWithAxis/ChartsWithAxisTypes.types";
import { TVennSeries } from "../ChartsWithoutAxis/ChartsWithoutAxisTypes.types";
import { type TAnnotationObject, type TChartMargins, TData, type TDataPoint, type TDefaultChartFormatOptionsType, type TSeries, type TTextDimensions } from "./Common.types";
export declare const svgID = "scaling-svg-";
export declare function getRandomColor(): {
    color: string;
};
/**
 * Draws chart legends in the specified position with optional scroll behavior,
 * using layout and format options defined in the configuration.
 *
 * @param {number} height - The total height of the chart container.
 * @param {any} svg - The SVG element where the chart and legends are rendered.
 * @param {number[]} maxLegendDimensions - Array with the maximum dimensions [width, height] of the legends.
 * @param {number} chartTitleHeight - Height occupied by the chart title (used to offset legends).
 * @param {number} width - The total width of the chart container.
 * @param {number} legendMargin - Margin to be applied around the legend area.
 * @param {TDefaultChartFormatOptionsType} formatOptions - Formatting options for the chart including legend settings.
 * @param {TSeries[]} seriesData - Array of data series to be represented in the legend.
 * @param {string} chartId - A unique identifier for the chart, used to bind legend elements.
 * @param {string} legendShape - A shape for chart legends.
 *
 * @return {void} - This function does not return anything. It updates the SVG by rendering legends.
 */
export declare function drawLegends(height: number, svg: any, maxLegendDimensions: number[], chartTitleHeight: number, width: number, legendMargin: number, formatOptions: TDefaultChartFormatOptionsType, seriesData: TSeries[], chartId: string, dataTableHeight: number, margin: TChartMargins, legendShape: string, chartType?: string, addLocalFilterFromLib?: (clickedLegendData: any) => void): void;
/**
 * @param {string[]} list - Array of legend strings.
 * @param {TDefaultChartFormatOptionsType} formatOptions - Chart formatting options including legend font size and family.
 * @return {{width: number, height: number}} - The calculated width and height of the longest legend text.
 */
export declare function calculateMaxLegendWidth(list: string[], formatOptions: TDefaultChartFormatOptionsType): number[];
/**
 * Renders markers for line or area chart series on the provided D3 selection.
 * Binds marker shapes, sizes, colors, and handles visibility and interaction (tooltips).
 *
 * @param {d3.Selection<SVGGElement, unknown, null, undefined>} lines - The D3 selection (SVG group) where marker groups will be appended.
 * @param {TSeries[]} chartData - The data array representing chart series, each with data points and properties.
 * @param {string} type - The chart type (e.g., "CombiLine", "Area", "StackArea") affecting marker rendering logic.
 * @param {Function} xScale - D3 scale function for x-axis, used to position markers horizontally.
 * @param {Function} yScale - D3 scale function for y-axis, used to position markers vertically.
 * @param {Function} yScaleRight - D3 scale function for secodary y-axis, used to position markers vertically.
 * @param {Function} tooltipHandle - (Not used in current snippet but assumed) Function to manage tooltip display.
 * @param {TDefaultChartFormatOptionsType} formatOptions - Configuration object for chart formatting and visibility settings.
 * @param {TChartJSON} chartJSON - Object containing chart metadata, formatting info, and dimension mappings.
 * @param {number} secondaryCustomYaxisMaxValue - Maximum value for secondary Y axis scale, used for visibility logic.
 * @param {number} secondaryCustomYaxisMinValue - Minimum value for secondary Y axis scale, used for visibility logic.
 * @param {number} customYaxisMinValue - Minimum value for primary Y axis scale, used for visibility logic.
 * @param {number} customYaxisMaxValue - Maximum value for primary Y axis scale, used for visibility logic.
 * @param {boolean} isNormalizedChart - 100% chart type validation.
 *
 * @returns {void} This function does not return a value; it appends and updates SVG marker elements in the DOM.
 */
export declare function lineMarkers(lines: any, chartData: TSeries[], type: any, xScale: any, yScale: any, yScaleRight: any, tooltipHandle: any, formatOptions: TDefaultChartFormatOptionsType, chartJSON: TChartJSON, secondaryCustomYaxisMaxValue: number, secondaryCustomYaxisMinValue: number, customYaxisMinValue: number, customYaxisMaxValue: number, isNormalizedChart: boolean): void;
export declare function Markershapes(Shape: any): d3.SymbolType;
/**
 * Attaches hover interactions to the area chart elements to show markers and tooltips
 * when the user moves the mouse over the chart.
 *
 * @param {TDefaultChartFormatOptionsType} formatOptions - Configuration options for chart appearance and tooltip formatting.
 * @param {any} areas - D3 selection representing the area paths of the chart.
 * @param {any} focus - D3 selection representing the group or element used for showing the focus marker and tooltip.
 * @param {string[]} filteredDimension - Array of dimension values representing the x-axis categories.
 * @param {any[]} lineData - Array of data series objects containing values, marker properties, and metadata.
 * @param {any} xScale - D3 scale function for the x-axis.
 * @param {any} yScaleLeft - D3 scale function for the left y-axis.
 * @param {string} chartType - The type of area chart (e.g., "stackArea", "stackArea100").
 *
 * @return {void} This function modifies the chart's behavior by adding interactivity but does not return a value.
 */
export declare function onHoverMarkerForAreaChartFamily(formatOptions: TDefaultChartFormatOptionsType, areas: any, focus: any, filteredDimension: string[], lineData: any[], xScale: any, yScaleLeft: any, chartType: string, isStackChart?: boolean): void;
/**
* Function to calculate actual height, width of content primarily used for margin calculations
* @returns { width: 0, height: 0, rotatedWidth: 0, rotatedHeight: 0 }
*/
export declare function preCalculateTextDimensions(content: string, fontSize?: number, fontFamily?: string, rotationDegree?: number, fixedWidth?: number): TTextDimensions;
/**
* adds non defined properties from `defaults` to `target` to avoid further checks for undefined values
* @param defaults -> Object which contains default properties
* @param target -> Object which may contain some undefined properties
* @returns object with all properties from defaults
*/
export declare function addUndefinedDefaults(defaults: any, target: any): any;
/**
 * Number formating function
 * @returns function which takes number as input and return formatted number
 */
export declare function getNumberWithFormatFunction(displayUnits: any, numberFormat: any, decimalPrecision: any): (value: any) => any;
export declare function getAutoNumberWithFormat(value: any): any;
/**
 * @param elements -> array of key value pair which should be added to tooltip one after another;
 * @param chartFormatOptions -> rightpane format options;
 * @param event -> optional mouse event to track mouse;
 */
export declare function showTooltipOnMouseMove(elements: any, chartFormatOptions: TDefaultChartFormatOptionsType, event?: MouseEvent, prop?: any): void;
export declare function hideTooltipOnMouseOut(): void;
/**
 * Adds chart title to svg
 * @param chartSvg -> svgRef from use ref hook;
 * @param chartTitleHeight -> height of chart title;
 * @param chartTitleWidth -> width of chart title;
 * @param chartFormatOptions -> rightpane format options;
 */
export declare const drawChartTitle: (chartSvg: any, chartTitleHeight: number, chartTitleWidth: number, chartFormatOptions: TDefaultChartFormatOptionsType) => void;
/**
 * Finds the longest string from an array of strings or an array of objects.
 * @param {Array<string | Object>} data -> The input array containing strings or objects.
 * @param {string} [key] -> (Optional) If the array contains objects, specify the key to extract string values.
 * @returns {string} The longest string found in the array.
 */
export declare const findStringWithLongestLength: (data: (string | Record<string, any>)[], key?: string) => string;
/**
 * Renders chart legends within an SVG element with scroll support when needed.
 * @param {SVGElement} svg - The D3 or SVG selection where the legends will be appended.
 * @param {TSeries[]} seriesData - Array of data series passed to chart as props.
 * @param {number} x - The x-coordinate for placing the legends container.
 * @param {number} y - The y-coordinate for placing the legends container.
 * @param {number} width - The width of the legend container.
 * @param {number} height - The height of the legend container.
 * @param {string} legendPosition - The position of the legend (e.g., 'top', 'bottom', 'left', 'right').
 * @param {string} alignment - Alignment of the legends within the container ('start', 'center', 'end', 'Top','Mid','Bottom').
 * @param {string} legendShape - Shape of the legend symbol (e.g., 'circle', 'rect', 'line', 'hollow circle').
 * @param {TDefaultChartFormatOptionsType} chartFormatOptions - Configuration object for formatting styles and settings.
 * @param {string} chartId - Unique ID for the chart, used to identify elements within the SVG.
 */
export declare const legendsWithScroll: (svg: any, seriesData: TSeries[] | TVennSeries[], x: number, y: number, width: number, height: number, legendPosition: string, alignment: string, legendShape: string, chartFormatOptions: TDefaultChartFormatOptionsType, chartId: string, isVennChart?: boolean, addLocalFilterFromLib?: (clickedLegendData: any) => void) => void;
/**
 *
 * Appends a filled circle shape to the given legend container.
 * @param d - The data object containing legend properties (like color, size).
 * @param innerDiv - The D3 selection where the shape will be appended.
 */
export declare function getCircleShape(d: any, innerDiv: any): void;
/**
 * Appends a hollow (outlined) circle shape to the given legend container.
 * @param d - The data object containing legend properties.
 * @param innerDiv - The D3 selection where the shape will be appended.
 */
export declare function getHollowCircleShape(d: any, innerDiv: any): void;
/**
 * @param {Object} d - Data object containing properties such as lineStyle, color, markerShape, and markerColor.
 * @param {Object} innerDiv - A D3 selection of a container element to append the line shape.
 * @param {TDefaultChartFormatOptionsType} formatOptions - Formatting options including marker visibility.
 * @return {void}
 */
export declare function getLineShape(d: any, innerDiv: any, formatOptions: TDefaultChartFormatOptionsType): void;
/**
 * @param {Object} d - Data object containing color, markerShape array, and properties including markerColor.
 * @param {Object} innerDiv - A D3 selection of a container element to append the area shape.
 * @param {TDefaultChartFormatOptionsType} formatOptions - Formatting options including marker visibility.
 * @return {void}
 */
export declare function getAreaShape(d: any, innerDiv: any, formatOptions: TDefaultChartFormatOptionsType): void;
/**
 * Appends a rectangle shape to the given legend container.
 * @param d - The data object that includes styling for the rectangle (like color, border).
 * @param innerDiv - The D3 selection where the shape will be inserted.
 */
export declare function getReactShape(d: any, innerDiv: any): void;
export declare function drawAnnotations(oldAnnotationList: TAnnotationObject[], newAnnotationList: TAnnotationObject[], chartFormatOptions: TDefaultChartFormatOptionsType): void;
/**
 * Initializes the SVG element with the specified dimensions and chart format options.
 * @param svgRef - The reference to the SVG element.
 * @param width - The width of the SVG element.
 * @param height - The height of the SVG element.
 * @param chartFormatOptions - The format options for the chart, which may include properties like background color and border.
*/
export declare const initSvg: (svgRef: React.MutableRefObject<SVGSVGElement>, width: number, height: number, chartFormatOptions: TDefaultChartFormatOptionsType) => void;
/**
 * Initializes the chart area within the SVG element, applying margins and setting a default font color.
 * @param svg - The D3 selection of the SVG element.
 * @param margins - The margins to apply to the chart area.
 * @return {d3.Selection<SVGGElement, any, any, any>} - The D3 selection of the chart area group element.
 */
export declare const initChartArea: (svg: any, margins: any) => any;
/**
    * all common functions to do before draw chart .
    * @param svgRef - The reference to the SVG element.
    * @param formatOptions - The format options for the chart which may contains some undefined values.
    * @returns { chartFormatOptions: TDefaultChartFormatOptionsType } - The chart format options with defaults applied.
    * @returns { svg: d3.Selection<SVGSVGElement, any, any, any> } - The D3 selection of the SVG element.
    *
    *
 */
export declare const firstFunctionBeforeRender: (svgRef: React.MutableRefObject<SVGSVGElement>, formatOptions: TDefaultChartFormatOptionsType) => {
    chartFormatOptions: TDefaultChartFormatOptionsType;
    svg: d3.Selection<SVGSVGElement, any, any, any>;
    width: number;
    height: number;
};
export declare const marginCalculationsForChartsWithoutAxis: (chartFormatOptions: TDefaultChartFormatOptionsType, width: number, height: number, maxLegendDimensions: number[], margins: TChartMargins, isVennChart?: boolean) => {
    margins: TChartMargins;
    innerHeight: number;
    innerWidth: number;
    legendListWidth: number;
    chartTitleHeight: number;
};
/**
 * Initializes the legend list with total value allowance and appends to svg.
 * @param chartFormatOptions - The format options for the chart.
 * @param svg - The D3 selection of the SVG element.
 * @param seriesData - The data series to be displayed in the legend.
 * @param width - The width of the SVG element.
 * @param height - The height of the SVG element.
 * @param legendListWidth - The width allocated for the legend list.
 * @param chartTitleHeight - The height of the chart title.
 * @param chartId - The unique identifier for the chart.
 * @param margins - The margins for the chart area.
 */
export declare const initLegendListWithTotalValueAllowance: (chartFormatOptions: TDefaultChartFormatOptionsType, svg: d3.Selection<SVGGElement, any, any, any>, seriesData: TSeries[], width: number, height: number, legendListWidth: number, chartTitleHeight: number, chartId: string, margins: TChartMargins, staticLegendShape: string, shouldAllowTotalValueMargin?: boolean, addLocalFilterFromLib?: any) => void;
/**
 * Calculates the maximum possible width and height for the legends based on the longest legend string.
 * @param chartFormatOptions - The format options for the chart.
 * @param seriesData - The data series to be displayed in the legend.
 * @returns The maximum possible width and height for the legends.
 */
export declare const calculateLegendsMaxPossibleWidth: (chartFormatOptions: TDefaultChartFormatOptionsType, seriesData: TSeries[], key?: string) => number[];
/**
 * Calculates the margins and inner dimensions for the charts without legends.
 * @param chartFormatOptions - The format options for the chart.
 * @param height - The height of the chart area.
 * @param width - The width of the chart area.
 * @param shouldShowColorScale - Only allow treemap to show color scale.
 * @returns The calculated margins and inner dimensions for the chart.
 */
export declare const marginCalculationsForChartsWithoutLegends: (chartFormatOptions: TDefaultChartFormatOptionsType, height: number, width: number, shouldShowColorScale?: boolean) => {
    margins: {
        top: number;
        bottom: number;
        left: number;
        right: number;
    };
    chartTitleHeight: number;
    innerHeight: number;
    innerWidth: number;
};
export declare const convertStringToNumber: (value: any) => any;
export declare function generalizedChartData(chartData: any, dimensionList?: any, isTornadoChart?: boolean): any;
export declare const getJQuerySelector: (strSeletor?: string) => string;
export declare const connectorNumberFormat: (numerator: any, denominator: any, decimalValues: any, numberFormat: any, x: any, y: any, formatOptions: TDefaultChartFormatOptionsType) => any;
export declare const getHoverId: (inputText: string) => string;
export declare function modifySeriesDataForTornadoChart(seriesData: TSeries[], data: TData, isAdvanceAnalyticsChart: boolean): TSeries[] | {
    properties: any;
    legendUniqueId: any;
    Type: any;
    Axis: any;
    AxisDataList: any;
    legend: string;
    data: TDataPoint[];
}[];
