UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

25 lines 1.93 kB
import * as React from 'react'; import { Store } from '@mui/x-internals/store'; import { type ChartAnyPluginSignature, type ChartInstance, type ChartPublicAPI, type ChartState, type ConvertSignaturesIntoPlugins } from "../plugins/models/index.js"; import { type UseChartBaseProps } from "./useCharts.types.js"; import { type ChartSeriesType } from "../../models/seriesType/config.js"; import { type ChartSeriesConfig } from "../plugins/models/seriesConfig/index.js"; /** * This is the main hook that setups the plugin system for the chart. * * It manages the data used to create the charts. * * @param inPlugins All the plugins that will be used in the chart. * @param props The props passed to the chart. * @param seriesConfig The set of helpers used for series-specific computation. */ export declare function useCharts<TSeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]>(inPlugins: ConvertSignaturesIntoPlugins<TSignatures>, props: Partial<UseChartBaseProps<TSignatures>>, seriesConfig: ChartSeriesConfig<TSeriesType>): { contextValue: { store: Store<ChartState<readonly [import("../index.js").UseChartIdSignature, import("../plugins/corePlugins/useChartExperimentalFeature/index.js").UseChartExperimentalFeaturesSignature, import("../index.js").UseChartDimensionsSignature, import("../index.js").UseChartSeriesSignature<keyof import("../index.js").ChartsSeriesConfig>, import("../plugins/corePlugins/useChartAnimation/index.js").UseChartAnimationSignature, import("../index.js").UseChartInteractionListenerSignature, ...TSignatures]>>; publicAPI: ChartPublicAPI<TSignatures>; instance: ChartInstance<TSignatures>; svgRef: React.RefObject<SVGSVGElement | null>; chartRootRef: React.RefObject<HTMLDivElement | null>; }; }; export declare function useChartApiInitialization<T>(inputApiRef: React.RefObject<T | undefined> | undefined): React.RefObject<T>;