TypeScript Intellisense works differently if I define Object in Different Ways

纵然是瞬间 提交于 2019-12-11 08:28:45

问题


I am trying to convert some existing JavaScript code by using TypeScript, One example I am using is to create Highcharts classes, the Highcharts definition is from https://github.com/borisyankov/DefinitelyTyped/blob/master/highcharts/highcharts.d.ts

We all know HighchartsOptions has a property title.

If I define the object in this way, I have intellisense

But if I define object this way

I don't have the intellisense.

Any specific reason why Visual Studio behaves differently?


回答1:


It's just a bug. See this issue on CodePlex to track when it gets fixed.



来源:https://stackoverflow.com/questions/14992232/typescript-intellisense-works-differently-if-i-define-object-in-different-ways

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!