26 lines
1.9 KiB
TypeScript
26 lines
1.9 KiB
TypeScript
import * as React from 'react';
|
|
import { ChartStore } from "../plugins/utils/ChartStore.js";
|
|
import { ChartAnyPluginSignature, ChartInstance, ChartPublicAPI, ConvertSignaturesIntoPlugins } from "../plugins/models/index.js";
|
|
import { UseChartBaseProps } from "./useCharts.types.js";
|
|
import { UseChartInteractionState } from "../plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js";
|
|
import { ChartSeriesType } from "../../models/seriesType/config.js";
|
|
import { 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: ChartStore<readonly [import("../index.js").UseChartIdSignature, import("../plugins/corePlugins/useChartExperimentalFeature/index.js").UseChartExperimentalFeaturesSignature, import("../index.js").UseChartDimensionsSignature, import("../index.js").UseChartSeriesSignature, import("../plugins/corePlugins/useChartAnimation/index.js").UseChartAnimationSignature, import("../index.js").UseChartInteractionListenerSignature, ...TSignatures]> & UseChartInteractionState;
|
|
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>; |