import type FeatureLayerView from "@arcgis/core/views/layers/FeatureLayerView.js";
import type { SupportedLayer } from "../../../interfaces.js";
import type { WebChart, WebGaugeChart } from "../../../spec/web-chart.js";

/**
 * Function that converts the chart config with older chart JSON Schema to the current version.
 *
 * **Note**:
 * - This function will convert and update the chart config to the current version if the version is older or unrecognized.
 * - This function will also call mandatory conversion functions that are not related to the spec version to ensure certain features are working properly.
 *
 * @param config - The chart config.
 * @param layerOrLayerView - The layer instance.
 * @param chartContainer
 * @returns The updated web chart config.
 */
export function convertChartSpec<T extends WebChart | WebGaugeChart>(config?: T, layerOrLayerView?: FeatureLayerView | SupportedLayer, chartContainer?: HTMLElement): Promise<T>;