Error after updating gojs

i was previously using older go js api i just updated and it gave me errors
findTreeParetLink doesnot exists on part

and another one

and another one

The TypeScript compiler is telling you that you need to either check at runtime that the value is a Node, or that you should declare that it is a Node using a cast.

As the compiler is getting better and as TypeScript definitions files are getting better, the compiler is catching more potential bugs. We definitely improved our go.d.ts file a lot for version 2.0, partly due to our reimplementation of the GoJS library in TypeScript.

what about the shape when i cast it to shape it tells me i have 37 missing arguments

same for the selnode

I suggest that you fix your code as much as you can. Then if there are any errors left, you can ask again. Please show the whole code – your screenshots above hide important parts of your code. Show the error message text separately.

first error is on var shape : go.shape which is

second error is on the last ie var selnode :go.Node which is

Panel | GoJS API clearly returns a GraphObject, not a Shape.

So you either need to cast it to be a go.Shape, or you need to check it at runtime by using if (shape instanceof go.Shape) {

what about the node one the selnode?

and can u tell me about these 2 too

its an error that .member part doesnot exist on type node but it works fine in js

the second one is

addlinkdata doesnot exist on type model?

I think all of those cases are similar – code is assuming a value is of a narrower type than how it is declared.

I don’t understand how any of that code could have compiled, even back with GoJS version 1.4 when we first added a go.d.ts definitions file to support TypeScript. Did you just change the TypeScript configs?

nop i didnt change any thing

npm install gojs and good to go

can u help me with the last 2 the addlinkdata doesnot exist on type model? and
.member part doesnot exist on type node

If you search for those properties or methods at GoJS API you will find the class that they belong to. Thus you will know how to compile-time cast or run-time check.

When you have opened GoJS API, you can just start typing the name you are searching for.