Bigous / ng2-highcharts

Angular2 library to use Highcharts out of the box
59 stars 23 forks source link

Cannot find name 'HighchartsOptions' using 0.6.1 #51

Closed ASK83 closed 8 years ago

ASK83 commented 8 years ago

Hi, I have updated my package to use ng2Highcharts 0.6.1 but I get error in both my code and ng2-hichcharts when trying to find typescipt types like 'HighchartsOptions'. But the errors go for Highcharts and HighchartsDataPoint. I know these are typescript errors and my charts are showing correctly, but it is annoying to have these errors. Here is part of my package.json regarding highcharts: highcharts: 4.2.5 ng2-highcharts: 0.6.1 and devDependencies: @types/highcharts: 4.2.39

Why my package cannot find the local typings in my @types and give me these errors?

Thanks for your help!

Bigous commented 8 years ago

Hi, are you using typescript v2.0.x ?

ASK83 commented 8 years ago

Yes! Sorry forgot to put that there. I am using "typescript": "2.0.7"

Bigous commented 8 years ago

Could you post the steps to create a simple project in which I could see the issue occurring?

Bigous commented 8 years ago

Ok, I've found why you are receiving the error.

They've changed the exported itens from highcharts.d.ts and the interfaces are (sadly) no more exported.

I've updated the library so it does not depends on the interfaces from highcharts.d.ts anymore. v0.6.2 is good to go.

Thanks for your help.

ASK83 commented 8 years ago

Oh Thanks! I was trying to create an example but because of moving parts every time something went wrong. Thanks!

ASK83 commented 8 years ago

I just have a question. I see you have changed your types from HighchartsOptions to Object to make this work. I can do the same, but this way we will lose the advantage of having types and method suggestions. Is there anything I can do to take advantage of the highchart types in my code?

Thanks for your help!

Bigous commented 8 years ago

The problem is that with the definitions published at @types/highcharts, the interfaces are not exported anymore, so, using it is against the specification...