some issues after shifting to version 2:
nodeData.group tells me now that “property ‘group’ does not exist on type ‘object’”
same for button.click - “click does not exist on type {}”
and new go.Map(“string”, go.Node) - “expected 0-1 arguments but got 2”
for the first one i tried (nodeData as go.Diagram.nodeData).group but that gives an error too
also, we are extending the portshiftingtool, and now I get this error:
“property ‘port’ is private and only accessible within class ‘PortShiftingTool’”
and last one, when trying to use an HTML context menu, we use nodeTemplate.contextMenu = …
and the error is “Type HTMLElement’ is not assignable to type ‘Adornment | HTMLInfo’. Type 'HTMLElement is not assignable to type ‘HTMLInfo’. property ‘mainElement’ is missing in type ‘HTMLElement’”
Yes, regarding your first point: In version 2 the List, Set and Map constructors no longer take type arguments. This is clearly documented in the release notes: GoJS Change Log.
This is to prepare us for future compatibility with ES6 Set and Map.
And regarding your last point: In version 2 one can no longer use an HTMLElement instead of an Adornment or an HTMLInfo. This is clearly documented in the release notes: GoJS Change Log.
I don’t know why the port property changed from public to private in the PortShiftingTool extensionsTS class. We’ll make it public again. You can do that yourself in your copy for now.
I don’t have any idea what you are talking about for the other cases – you need to debug those yourself.
regarding the type problems, I guess i need something like this: " (nodeData as go.Diagram.nodeData).group"
the question is which types should I use for nodeData and button?
“go.Diagram.nodeData” gives an error for nodeData so I guess it’s no the correct one.