From e724e4852325bba9e5702f39580294fbbf9e10f4 Mon Sep 17 00:00:00 2001 From: kirthi_b Date: Sun, 12 Jul 2026 17:20:40 -0700 Subject: [PATCH] Export formatter callback param types from the package entry Re-export CallbackDataParams and TopLevelFormatterParams from the core export so tooltip.formatter and label.formatter callbacks can be typed with `import type { ... } from 'echarts'` instead of reaching into internal paths like 'echarts/types/dist/shared'. Closes #14277 --- src/export/core.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/export/core.ts b/src/export/core.ts index 7d42fe1abf..fb3034f3df 100644 --- a/src/export/core.ts +++ b/src/export/core.ts @@ -46,6 +46,16 @@ export { ToggleAxisBreakPayload, } from '../component/axis/axisAction'; +// Types of the `params` argument passed to formatter callbacks +// (for example `tooltip.formatter` and `label.formatter`), so that +// these callbacks can be typed without importing from internal paths. +export { + CallbackDataParams, +} from '../util/types'; +export { + TopLevelFormatterParams, +} from '../component/tooltip/TooltipModel'; + export { LinearGradientObject } from 'zrender/src/graphic/LinearGradient'; export { RadialGradientObject } from 'zrender/src/graphic/RadialGradient';