trees_are_great
trees_are_great

Reputation: 3911

How to write a typescript definition file for something written in typescript?

I was looking at creating a typescript definition file for jsPDF-AutoTable, see gitbug here. I started trying to write a typings file for this, but it didn't seem straight forward because it has been generated from typescript. The owner responded to me to say that he was having difficulties, because it has been generated from typescript. See issue.

I would have thought that there would be a way to automatically create a typings file for something build using typescript. Is this possible?

Upvotes: 1

Views: 300

Answers (1)

Fenton
Fenton

Reputation: 250822

You can generate type information when you compile the TypeScript file...

tsc --declaration app.ts

You can also set that in your tsconfig.json file - it will generate a .js and .d.ts file for you.

Upvotes: 2

Related Questions