import type FeatureLayer from "@arcgis/core/layers/FeatureLayer.js";
import type { WebChartConfigFields } from "./interfaces.js";
import type { IFeatureLayer } from "../../../spec/rest-js-types.js";
import type { WebChartDataTypes } from "../../../spec/data-source.js";
import type { WebChart } from "../../../spec/web-chart.js";

/**
 * Creates a chart renderer based on the provided config fields and inline data.
 *
 * @param props - The category field, the numeric fields, the config fields and the data to convert.
 */
export function convertConfigFieldsToChartRenderer(props: {
    categoryField: string;
    numericFields: string[];
    configFields?: WebChartConfigFields;
    inlineData: WebChartDataTypes;
}): WebChart["chartRenderer"];

/**
 * Converts an array of inline data to a feature set and returns an `IFeatureLayer`.
 *
 * @param props - The category field, the category type, the numeric fields and the inline data to convert.
 */
export function convertInlineDataToLayerDefinition(props: {
    categoryField: string;
    categoryType: "date" | "dateOnly" | "number" | "string" | "timeStampOffset";
    numericFields: string[];
    inlineData: WebChartDataTypes;
}): IFeatureLayer | undefined;

/**
 * Converts an array of inline data into a feature collection. Also returns a `chartRenderer` if the `configFields` are provided.
 *
 * @param props - The category field, the category type, the numeric fields, the config fields and the inline data to convert.
 */
export function convertInlineConfigToLayerConfig(props: {
    categoryField: string;
    categoryType: "date" | "dateOnly" | "number" | "string" | "timeStampOffset";
    numericFields: string[];
    configFields?: WebChartConfigFields;
    inlineData: WebChartDataTypes;
}): Promise<{
    chartRenderer?: WebChart["chartRenderer"];
    iLayer?: IFeatureLayer;
    layer?: FeatureLayer;
}>;