Open yuanfeiz opened 8 years ago
Why did you close this? I have the same issue. The problem is, that all the HighStock typings are not imported in the index.d.ts in the package @types/highcharts.
@Icer2000 Could you provide some more code to reproduce the issue with v0.4.0 ?
I never created a Plunkr, but i can descripe the problem pretty well: packages.json :
dependencies: [
"angular2-highcharts": "0.4.1",
"highcharts": "^5.0.2"],
devDependencies: [
"@types/core-js": "^0.9.34",
"@types/highcharts": "^4.2.38"
]
If you now use a tsconfig.json file and compile your app with gulp-typescript using typescript 2.0.6 it will not find the Highstock Type definitions, because by default only the index.d.ts is picked up for typescript compilation.
You should include the Highstock typings in the index.d.ts file of the package @types/highcharts.
Hope this helped. :)
There are two files inside @types/highcharts:
To declare a property as some type of highcharts, for example to declare a chart
object as a ChartObject
of highstock is currently not available. I might be wrong, but there is not export
in the highstock.d.ts, which prevents it from giving out the typing information.
Found a fix for this DefinitelyTyped/DefinitelyTyped#13232
Version:
^0.3.4
I used to encounter the duplicated identifiers problem, after upgrading to the latest version, that issue was fixed while
Highstock
still seems to be not correctly imported.Related errors:
(54,12): error TS2304: Cannot find name 'HighstockOptions'.
(12,18): error TS2304: Cannot find name 'HighstockChartObject'.