Ten TypeScript declaration gaps for options and members that work at runtime
Expected behaviour
The snippets below compile in strict mode, since Highcharts supports each option and member at runtime.
Actual behaviour
Each snippet fails to compile with the error shown. Item 8 is the reverse: it compiles when it should not.
1. Axis title: null
const yAxis: Highcharts.YAxisOptions = { title: null };Type 'null' is not assignable to type 'YAxisTitleOptions | undefined'.The same applies to XAxisOptions. The API reference does not document null as a value for title either, so consider if the API reference docs need updating too.
2. fillOpacity and groupPadding in plotOptions.series
const series: Highcharts.PlotSeriesOptions = { fillOpacity: 0.5 };Object literal may only specify known properties, and 'fillOpacity' does not exist in type 'PlotSeriesOptions'.The same applies to groupPadding.
3. Arc diagram keys with array data
const series: Highcharts.SeriesArcdiagramOptions = {
type: 'arcdiagram',
keys: ['from', 'to', 'weight'],
data: [['A', 'B', 1]]
};Type '[string, string, number]' has no properties in common with type 'SeriesSankeyPointOptionsObject'.The same data compiles for SeriesSankeyOptions.
4. Bubble shadow
const series: Highcharts.SeriesBubbleOptions = { type: 'bubble', shadow: true };Object literal may only specify known properties, and 'shadow' does not exist in type 'SeriesBubbleOptions'.5. Tilemap colorByPoint
const series: Highcharts.SeriesTilemapOptions = { type: 'tilemap', colorByPoint: true };Object literal may only specify known properties, and 'colorByPoint' does not exist in type 'SeriesTilemapOptions'.The same applies to PlotTilemapOptions.
6. Packed bubble parentNodeOptions.bubblePadding
const parentNode: Highcharts.PlotPackedbubbleLayoutAlgorithmParentNodeOptions = { bubblePadding: 20 };Object literal may only specify known properties, and 'bubblePadding' does not exist in type 'PlotPackedbubbleLayoutAlgorithmParentNodeOptions'.7. Treegraph level colorByPoint and marker
const level: Highcharts.PlotTreegraphLevelsOptions = { level: 1, colorByPoint: true };Object literal may only specify known properties, and 'colorByPoint' does not exist in type 'PlotTreegraphLevelsOptions'.The same applies to marker.
8. dataMapping accepts anything
const series: Highcharts.SeriesLineOptions = {
type: 'line',
dataMapping: { y: { colunm: 'typo' } }
};This compiles with no error, because DataMappingOptionsObject is declared as an empty interface.
9. Treemap level colorByPoint and borderRadius
const level: Highcharts.PlotTreemapLevelsOptions = { level: 1, colorByPoint: true };Object literal may only specify known properties, and 'colorByPoint' does not exist in type 'PlotTreemapLevelsOptions'.The same applies to borderRadius.
10. Axis plot band and plot line methods
declare const axis: Highcharts.Axis;
axis.addPlotLine({ value: 1 });Property 'addPlotLine' does not exist on type 'Axis'.The same applies to addPlotBand, removePlotBand, removePlotLine, plotBands and plotLines.
Live demo with steps to reproduce
Compile the snippets with tsc --noEmit in a strict-mode TypeScript project with highcharts installed.
Product version
- Highcharts: 13.1.1
Affected browser(s)
Not applicable (type declarations only)
AI was used in the preparation of this bug report (Claude Opus 5.5).
Source: highcharts/highcharts