import * as echarts from 'echarts' ; interface CommonData { name : string ; value : number ; } export namespace Tooltip { type FormatterCallback < T > = ( params : T ) => string ; type FormatterCallbackParams < T > = Omit < echarts . DefaultLabelFormatterCallbackParams , 'data' > & { data : T ; } ; export const item = < T = CommonData > ( formatter ) => ( { trigger : 'item' , formatter , } as echarts . TooltipComponentOption ) ; export const axis = < T = CommonData > ( formatter ) => ( { trigger : 'axis' , axisPointer : { type : 'cross' , } , formatter , } as echarts . TooltipComponentOption ) ; }