TypeScript Intellisense works differently if I define Object in Different Ways - intellisense

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?

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

Related

Adding globally defined objects for Intellisense and linting to Monaco Editor in javascript/typescript

I have a working Monaco editor in a React app that correctly underlines out javascript errors.
I am trying to register an object called data that I have defined as a JSON schema, so that:
Typing the letter 'd' in the code editor would prompt intellisense to suggest data
Intellisense would correctly suggest all the properties of the data object, and the properties of all of its child properties according to the JSON schema
The editor does not show an undefined variable error when data is used.
I have tried to use monarch to register data as a keyword but am only managing to handle the coloring and error handling, not the properties suggestion.
I also looked at registerDocumentSymbolProvider. registerCompletionItemProvider and registerDeclarationProvider (I think the last one will help with intellisense but not with getting rid of the undefined error) but I don't understand what the purpose of each are and the documentation only defines their usage with sentences like "registers a document symbol provider" which I haven't so far found very helpful.
Would appreciate any help with this. I am excited to use the more advanced features of this great tool but the steep learning curve and my inability to find information has left me pretty disheartened so far!

What is the origin of $generalUtil in my atlassian-plugin.xml?

I'm studying the code of a custom Confluence plugin, which contains an atlassian-plugin.xml file that includes references to two variables $generalUtil and $helper, but I find no definitions of them whatsoever in the entire project. They simply work and it appears to me that they are magically instantiated out of thin air.
<web-item key="configtab" name="configtab" section="system.space.tools/addons">
<label key="myplugin.space.tools.addons.tab.label" />
<link>/spaces/myplugin-config.action?spaceKey=$generalUtil.urlEncode($helper.spaceKey)</link>
</web-item>
The $generalUtil must be an instance of com.atlassian.confluence.util.GeneralUtil, which also has a method urlEncode(). But where does this variable originate from?
What puzzles me even more is the $helper, which has a spaceKey field/method that I find in the code, but without any relationship to any kind of Helper class. The $helper also appears in a velocity template, but also without any definition of it. Any ideas where this stuff is documented?
generalUtil is documented here: https://docs.atlassian.com/ConfluenceServer/javadoc/7.11.6/
I think helper is https://docs.atlassian.com/ConfluenceServer/javadoc/7.11.6/com/atlassian/confluence/themes/GlobalHelper.html
They are injected into the Velocity context used to render that link.

Does the Highcharts-Vue wrapper support 'gauge' and 'heatmap' chart types?

https://github.com/highcharts/highcharts-vue
I don't see examples of these in the demo and there is nothing mentioned in the docs. I'm wondering if it is simply not possible or just not demoed because of their more complicated nature.
I will also need to use Charts appendData prototype to make a line chart real-time. Is this possible using the wrapper? I'm thrown by the following in the docs but not sure it it's directly related;
You can access the Chart object instance if necessary (e.g when need
to get some data or use any of Chart.prototype functions), by calling
specific Vue component instance chart field, but it is not supported
to update the chart using its built-in functions
Indeed, the highcharts-vue package supports all official modules included in Highcharts, so it's not necessary to produce every demo from demos site using Vue wrapper. I made the examples with gauge and heatmapseries specially for you, so please take a look on them.
I will also need to use Charts appendData prototype to make a line chart real-time. Is this possible using the wrapper?
A component is watching for changes on provided chart configuration, so if you will update your data (e.g by pushing new points into a series.data), then highcharts-vue will detect it, and automatically update the chart. That's the most recommended way of implementation. If you would like to use some Chart's or Series prototype functions, of course you can do that, but please note that causes inconsistency between the chart data and the data defined within component. Just need to access chart's reference like it is described in Chart object reference section.
Live examples:
https://codesandbox.io/s/vue-template-uqu1p (Gauge),
https://codesandbox.io/s/vue-template-8z2f5 (Heatmap)

What 'expression:' property in QML Item

I've inherited a collection of mostly undocumented QML code. I'm new to QML, and I'm struggling to understand this code. In particular, the construct
expression: "connected == false"
occurs frequently in various items, but I can't find any documentation on what this property does. It does not seem to be defined anywhere in the existing code collection, so I'm assuming it's part of QML, but I'm having no luck turning it up anywhere.
It looks as though all items using this construct are backed by C++ classes. However, "expression" is not defined as a QPROPERTY anywhere in the C++ code.
Nope, there's no such property in QML. You'll have to look into the QML file for the type that it's used in, or the C++ if it's declared there.

dynamic data display chart plotter in MVVM

I am trying to use d3 chart plotter in MVVM.
I am trying to use the code given by Ravi ( https://dynamicdatadisplay.codeplex.com/discussions/63633 ) in my project, but not quite sure how to use it properly.
It says "the property Linegraphs is not found in type ChartPlotter" when I try to use it in the XAML code.
What I did is add the LinegraphViewModel.cs to my project and make it the same namespace as my new project.
Anyone can advice me on what should I do in order to use the plotter successfully in my MVVM application?
Thank you so much!
Dynamic Data Display is a complex library with many different components. It not enough to pull a single class into your project. You need to reference the d3 .dll to your project to be able to use it's functionality, as well as using the dynamic data namespace in your xaml.
After adding a reference to the library to your project, you can set up the Dynamic Data Display namespace like this :
xmlns:dynamicDataDisplay="http://research.microsoft.com/DynamicDataDisplay/1.0"