@mui/x-charts
Version:
The community edition of MUI X Charts components.
22 lines • 1.43 kB
TypeScript
import type { PieChartPluginSignatures } from "../PieChart/PieChart.plugins.js";
import type { BarChartPluginsSignatures } from "../BarChart/BarChart.plugins.js";
import type { ScatterChartPluginsSignatures } from "../ScatterChart/ScatterChart.plugins.js";
import type { LineChartPluginsSignatures } from "../LineChart/LineChart.plugins.js";
import type { AllPluginSignatures, DefaultPluginSignatures } from "../internals/plugins/allPlugins.js";
import type { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
import type { ChartPublicAPI } from "../internals/plugins/models/index.js";
export type PluginsPerSeriesType = {
line: LineChartPluginsSignatures;
scatter: ScatterChartPluginsSignatures;
bar: BarChartPluginsSignatures;
pie: PieChartPluginSignatures;
composition: DefaultPluginSignatures;
};
/**
* The API of the chart `apiRef` object.
* The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type.
* @example ChartApi<'bar'>
* If the chart is being created using composition, the `composition` value can be used.
* @example ChartApi<'composition'>
*/
export type ChartApi<TSeries extends keyof PluginsPerSeriesType | undefined = undefined, TSignatures extends readonly ChartAnyPluginSignature[] = (TSeries extends keyof PluginsPerSeriesType ? PluginsPerSeriesType[TSeries] : AllPluginSignatures)> = ChartPublicAPI<TSignatures>;