Is there support for XML documentation inside TypeScript?

Is there support for XML documentation inside TypeScript? It seems not, but maybe I'm missing something.

I would like something like this:

export class Point {
   /// <summary>This is a Point class.</summary>

    constructor (public x: number, public y: number) { 
        /// <summary>Creates a new Point object</summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
    }
}
+5
source share
3 answers

There is no mention of this in the language specification, so there is currently no support for this feature.

The only comment syntax that is used is to create a dependency on the source file:

/// <reference path="..."/>

offer such features on the project page - so that it may be added to the language in the future if the idea gets cravings.

+5
source

For what it's worth, samples from Microsoft include this comment style. From the Parallax example:

    constructor(scrollableContent: HTMLElement, perspective: number) {
        /// <param name="scrollableContent">The container that will be parallaxed.</param>
        /// <param name="perspective">The ratio of how much back content should be 
        /// scrolled relative to forward content.  For example, if this value is 
        /// 0.5, and there are 2 surfaces, the front-most surface would be scrolled 
        /// normally, and the surface behind it would be scrolled half as much.</param>
        this.perspective = perspective;
        this.surface = [];
        this.content = scrollableContent;

        $(scrollableContent).scroll((event: JQueryEventObject) => {
            this.onContainerScroll(event);
        });
    }
0

, JSDoc , , Visual Studio Code, , intellisense.

-1
source

All Articles