Skip to content

Add TypeScript declaration files for ES Modules #17952

@nunoarruda

Description

@nunoarruda

Description of the feature

Please add TypeScript declaration files for Highcharts ES Modules. Without them, we can't use Highcharts ES Modules on TypeScript projects, or at least not with the default settings in Angular projects (which I'm using in my use case):

Screenshot 2022-11-08 at 14 03 57

As a workaround, I'm re-using the Highcharts UMD namespace as a type and creating the declaration file myself at src/index.d.ts:

declare module 'highcharts/es-modules/masters/*' {
  var G: typeof Highcharts; // Re-uses UMD namespace as a type
  export default G;
}

Library related to the feature

All

Proof of Concept/Live example for the feature

As far as my knowledge goes, I believe you guys have 2 options:

  1. Create declaration files for ES Modules by re-using the Highcharts UMD namespace as shown above
  2. Copy/paste your existing declaration files for UMD/CommonJS/AMD into highcharts/es-modules/masters/* and replace export as namespace x with export default x.

You can vote for this feature by adding a thumbs-up reaction to this post.

Metadata

Metadata

Assignees

Labels

Type: Feature RequestUsed when a new feature is requested either directly or indirectly

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions