Setting the file. One moment.
Subchapter 27.3
references/typescript.mdMarkdown3 KBView on GitHub
/** ... */ to document public APIs for users (JSDoc/TSDoc).// for implementation details relevant only to developers reading the source code./* ... */ for multi-line comments. Use multiple // lines instead./**
* Computes the weight based on three factors.
*
* @param itemsSent The number of items sent.
* @param itemsReceived The number of items received.
*/
function computeWeight(itemsSent: number, itemsReceived: number): number {
// This is an implementation comment explaining the formula.
// It uses multiple lines of // comments.
return itemsSent * 2 + itemsReceived;
}/** This is a short description. *//**
* Multiple lines of JSDoc text are written here,
* wrapped normally.
*
* @param arg A number to do something to.
*/Write JSDoc comments using Markdown.
/**
* Computes weight based on three factors:
*
* - items sent
* - items received
* - last timestamp
*/@param on its own line, followed by the parameter name and its description.@return on its own line.Document all top-level exports of modules (classes, interfaces, functions, constants).
@NgModule classes) if their purpose is obvious.Provide enough information/context for the reader to know how and when to use the class.
@param name The name is useless).