A tool for creating documentation from JSDoc on TypeScript interfaces

I have a .d.ts file with interfaces that describe my library. It has JSDoc comments that will be displayed via intellisense in Visual Studio when people reference .d.ts in their code:

/** Description of JSNLogAppender */ interface JSNLogAppender { /* Description of setOptions */ setOptions(options: JSNLogAppenderOptions): void; /* Description of log */ log(logItem: JSNLogItem): void; } ... etc ... 

I need to create documentation based on the JSDoc and TypeScript interfaces. The problem is that the generators I found all work with JavaScript, and the interfaces are not compiled for JavaScript. I could put JSDoc on the actual classes and functions that implement the interfaces, but I would lose intellisense when people reference the .d.ts file.

Is there a tool that generates html documentation from JSDoc comments and a TypeScript interface definition in a .d.ts file?

+5
source share
4 answers

I found the npm module that claims to have done this, although I have not tried it yet: https://www.npmjs.org/package/tsdoc

+1
source

Not yet. Could not find any related function request here: http://typescript.codeplex.com/workitem/list/basic

All we have at the moment is TypeScript understanding of the JSDoc language service: http://typescript.codeplex.com/workitem/178

+1
source

I wrote this little tool that may be useful to you: typescript-docs

You will need to install the Haskell platform to create it.

It has basic jsdoc-style comment support and generates HTML with hyperlinks between types, possibly through modules.

+1
source

You can use http://typedoc.org/

It supports jsdoc for things that it cannot do http://typedoc.org/guides/doccomments/

And any jsdoc handle that it does not recognize will still be output, which is lucky.

0
source

Source: https://habr.com/ru/post/1481639/


All Articles