Missing method return type in typescript definition file

Hello,

I got this message from the angular2 compiler when trying to AOT compile my app:

npm : Error at C:/tfs-git-kdc/WebApp/mea/node_modules/gojs/release/go.d.ts:8503:9: 'updateResizeHandles', which lacks return-type annotation, implicitly has an 'any' return type.

It appears that ngc doesn’t like the missing void return type on the updateResizeHandles function declaration. I’ve modified line number 8503 to this:

updateResizeHandles(elt: GraphObject, angle: number):void; // undocumented

and all is well with ngc now. However I’m getting errors trying to rollup my app. Getting these:

app\cpm\gojs\gojs-cpm.component.js (24:19) ‘GraphObject’ is not exported by ‘node_modules\gojs\release\go.js’. See Troubleshooting · rollup/rollup Wiki · GitHub

Do i have to modify the d.ts file to export these individual classes? Anyone on here have success AOT compiling an Angular2 app that imports GoJs?

Thanks!

Thanks for pointing out the error in the declaration of that undocumented method. We’ll fix that in the next release, 1.7.3. Some day we’ll review that method more carefully and document it.

The GraphObject class is exported by both the go.d.ts file and by the go.js library.

Are you trying to do the following?

import { GraphObject } from "go";

This works:

import * as go from "go";

after which you can refer to go.GraphObject.

3 posts were split to a new topic: AOT and rollup