O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the dts-gen tool

This is an open sourced utility provided by Microsoft. We will use it to generate our typings for any project. Shoot up a Terminal as Admin or use sudo su - and enter the following:

npm install -g dts-gen
For all global modules, we will use the command prompt as Admin for Windows, and for Linux/Mac we will use the root user or sudo su -

We will use one globally available module and generate its typing. Install lusca and generate its typing using the following command:

dts-gen -m lusca

You should see output such as Wrote 83 Lines to lusca.d.ts, and when you check, you can see all method declarations there, just like an interface.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required