@@ -13,14 +13,7 @@ import { useSelector } from "../../internal/utils/async-store";
1313import { getChartSeries } from "../../internal/utils/chart-series" ;
1414import { ChartAPI } from "../chart-api" ;
1515import { getFormatter } from "../formatters" ;
16- import {
17- BaseI18nStrings ,
18- CoreTooltipContent ,
19- CoreTooltipOptions ,
20- GetTooltipContent ,
21- GetTooltipContentProps ,
22- TooltipSlotProps ,
23- } from "../interfaces" ;
16+ import { BaseI18nStrings , CoreChartProps } from "../interfaces" ;
2417import { getPointColor , getSeriesColor , getSeriesId , getSeriesMarkerType , isXThreshold } from "../utils" ;
2518
2619import styles from "../styles.css.js" ;
@@ -51,9 +44,9 @@ export function ChartTooltip({
5144 getTooltipContent : getTooltipContentOverrides ,
5245 api,
5346 i18nStrings,
54- } : CoreTooltipOptions & {
47+ } : CoreChartProps . TooltipOptions & {
5548 i18nStrings ?: BaseI18nStrings ;
56- getTooltipContent ?: GetTooltipContent ;
49+ getTooltipContent ?: CoreChartProps . GetTooltipContent ;
5750 api : ChartAPI ;
5851} ) {
5952 const [ expandedSeries , setExpandedSeries ] = useState < ExpandedSeriesState > ( { } ) ;
@@ -122,7 +115,9 @@ function getTrackKey(point: null | Highcharts.Point, group: readonly Highcharts.
122115
123116function getTooltipContent (
124117 api : ChartAPI ,
125- props : GetTooltipContentProps & { renderers ?: CoreTooltipContent } & ExpandedSeriesStateProps ,
118+ props : CoreChartProps . GetTooltipContentProps & {
119+ renderers ?: CoreChartProps . TooltipContentRenderer ;
120+ } & ExpandedSeriesStateProps ,
126121) : null | RenderedTooltipContent {
127122 if ( props . point && props . point . series . type === "pie" ) {
128123 return getTooltipContentPie ( api , { ...props , point : props . point } ) ;
@@ -141,7 +136,9 @@ function getTooltipContentCartesian(
141136 expandedSeries,
142137 renderers = { } ,
143138 setExpandedSeries,
144- } : GetTooltipContentProps & { renderers ?: CoreTooltipContent } & ExpandedSeriesStateProps ,
139+ } : CoreChartProps . GetTooltipContentProps & {
140+ renderers ?: CoreChartProps . TooltipContentRenderer ;
141+ } & ExpandedSeriesStateProps ,
145142) : RenderedTooltipContent {
146143 // The cartesian tooltip might or might not have a selected point, but it always has a non-empty group.
147144 // By design, every point of the group has the same x value.
@@ -179,7 +176,7 @@ function getTooltipContentCartesian(
179176 } ) ;
180177 // We only support cartesian charts with a single x axis.
181178 const titleFormatter = getFormatter ( chart . xAxis [ 0 ] ) ;
182- const slotRenderProps : TooltipSlotProps = { x, items : matchedItems } ;
179+ const slotRenderProps : CoreChartProps . TooltipSlotProps = { x, items : matchedItems } ;
183180 return {
184181 header : renderers . header ?.( slotRenderProps ) ?? titleFormatter ( x ) ,
185182 body : renderers . body ?.( slotRenderProps ) ?? (
@@ -205,9 +202,9 @@ function getTooltipContentCartesian(
205202
206203function getTooltipContentPie (
207204 api : ChartAPI ,
208- { point, renderers = { } } : { point : Highcharts . Point } & { renderers ?: CoreTooltipContent } ,
205+ { point, renderers = { } } : { point : Highcharts . Point } & { renderers ?: CoreChartProps . TooltipContentRenderer } ,
209206) : RenderedTooltipContent {
210- const tooltipDetails : TooltipSlotProps = { x : point . x , items : [ { point, errorRanges : [ ] } ] } ;
207+ const tooltipDetails : CoreChartProps . TooltipSlotProps = { x : point . x , items : [ { point, errorRanges : [ ] } ] } ;
211208 return {
212209 header : renderers . header ?.( tooltipDetails ) ?? (
213210 < div className = { styles [ "tooltip-default-header" ] } >
0 commit comments