Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate Typescript .d.ts file with original jsdoc comments?

Context : Typescript 1.5 beta Webstorm 10

I'm currently developping two separated projects in TS, one library and one project that will use that library.

When I am coding inside the library project, the written jsdoc is perfectly understood by Webstorm and CTRL+Q displays it correctly.

Then I compile the library (one single big output file), generate the .d.ts file along the way, and try to use it in the other project : no more documentation available when I'm invoking CTRL+Q.

After investigation, I see that the JSDOC is still present in the generated javascript, but it is not in the .d.ts file - so Webstorm consider there is none.

So my question is : how can I specify at .d.ts generation time that I want my jsdoc to be included in it ? Just spent several hours on the net running in circles...

--edit : my tsconfig file --

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "noImplicitAny": false,
    "removeComments": false,
    "declaration":true,
    "noLib": false,
    "out": "./dist/myLib.es5.js",
    "sourceMap": true
  }
}

== EDIT FINAL ==

Ok, the documentation finally appeared in the .d.ts ... A compiler bug, or maybe a chair-keyboard one ...

So it obviously should works when "removeComments" is set to false !

like image 692
M'λ' Avatar asked Jul 15 '15 09:07

M'λ'


1 Answers

compile with comments i.e. set removeComments compiler flag to false

like image 103
basarat Avatar answered Nov 15 '22 00:11

basarat