Search code examples
javascripttypescriptnpmsummarytypedoc

Is there a way to describe a field in typedoc?


The code is:

/**
* Class description
*/

export class SomeClass {
  /**
   * The field description
   */
  message: string;
}

I'm checking it on the TSDoc playground and see, that there is the summary for class, but there is no summary for its field

Is there a way to describe a field in typedoc?


Solution

  • The TSDoc playground is extremely limited - it will only parse and display the first doc comment it finds. There is an open issue with others also being confused by its scope.

    TypeDoc is not the same thing as TSDoc. TSDoc is a doc comment standard that will eventually be adopted by TypeDoc, whereas TypeDoc is a documentation generator. If you give TypeDoc that class (assuming it is exported), then it will properly document it as a class with a property message having the provided description.