Best approach to include unlimited domain goJS library in TypeScript project


we are using the unlimited domain goJS package, therefore I need to download the goJS libraries from the website and cannot use npm.

Currently we have the downloaded goJS library in a scripts folder in our project, which is under source control.
Additionally, we’ve manually downloaded the go.d.ts and also put it into source control.
In the modules, we then import goJS with the following command: import * as go from "../../scripts/go";

Is this the best approach to use the unlimited domain package in TypeScript? Any chance I can avoid downloading the go.d.ts file manually and instead install it via npm? I’ve had a look at the @types/go package, but it seems to be outdated?

Best regards,

You should want to use the definition file that goes with the same version of the library, so downloading it once and copying it into your scripts directory should not be a burden.

Or am I missing what the problem is?

We stopped using DefinitelyTyped after we realized that they preferred and recommended that library producers provide their own definition files.

Hi @walter,
not a huge problem, but whenever I want to upgrade the goJS version I need to:

  1. Request new generated library files via a link
  2. Download the library files into my project
  3. Search for the link where to download the .d.ts file for the proper version
  4. Download the .d.ts file into my project

Of course I want to automate as much as possible, therefore I was wondering if there is a way to at least get the .d.ts files automatically. Having the .d.ts files on DefinitelyTyped would help in this case. Or maybe you could put a link to the corresponding .d.ts file into the e-mail with the library links?

Actually I just wanted to get feedback if I’m doing it the best way possible in this situation or if further improvement/automation is possible.

I suppose you could just get

If you need it for older versions, those are available by replacing “latest” with the three-part version number. However, older versions have more bugs in them than newer versions, because until version 2 comes out, they are all hand written.

okay thanks!