Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate one declaration file for TypeScript library

I developed a library, which also contains TypeScript files, in Visual Studio 2013. The files are compiling correctly to JS files (AMD).

What I want is to create a single declaration file for this lib, but this does not work:

tsc --declaration --module AMD --out out.d.ts [files.ts]

Can someone please lead me to the right path?

TypeScript 0.9.1.1 is used.

like image 443
bobschi Avatar asked Oct 30 '13 08:10

bobschi


1 Answers

Its because you are providing .d.ts to out which will overwrite the declaration file with js contents. Also, you need to remove module amd because that works on per file basis (not --out friendly, see http://www.youtube.com/watch?v=KDrWLMUY0R0&hd=1)

So, try:

tsc [files.ts] --declaration --out out.js

which will generate out.d.ts

like image 96
basarat Avatar answered Sep 30 '22 05:09

basarat