Where is the syntax for TypeScript comments documented?

前端 未结 5 800
执念已碎
执念已碎 2020-12-04 11:30

Is the syntax for TypeScript comments documented anywhere?

And by any chance, does it now support the C# /// system?

5条回答
  •  情深已故
    2020-12-04 12:27

    Update November 2020

    A website is now online with all the TSDoc syntax available (and that's awesome): https://tsdoc.org/


    For reference, old answer:

    The right syntax is now the one used by TSDoc. It will allow you to have your comments understood by Visual Studio Code or other documentation tools.

    A good overview of the syntax is available here and especially here. The precise spec should be "soon" written up.

    Another file worth checking out is this one where you will see useful standard tags.

    Note: you should not use JSDoc, as explained on TSDoc main page: Why can't JSDoc be the standard? Unfortunately, the JSDoc grammar is not rigorously specified but rather inferred from the behavior of a particular implementation. The majority of the standard JSDoc tags are preoccupied with providing type annotations for plain JavaScript, which is an irrelevant concern for a strongly-typed language such as TypeScript. TSDoc addresses these limitations while also tackling a more sophisticated set of goals.

提交回复
热议问题