是否存在类型的XML文档中的类型签字?似乎没有,但也许我忽略了一些东西。

我想要这样的东西:

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>
    }
}
.

有帮助吗?

解决方案

在语言规范中没有提及这一点,因此目前没有支持此功能。

使用中的唯一注释语法是在源文件上创建依赖项:

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

您可以建议项目页面中的功能,如此 - 所以它可以将来添加到未来的语言想法收益牵引。

其他提示

对于它的价值,来自微软的样本确实包括这种评论风格。来自视差样本:

    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);
        });
    }
.

显然,现在支持JSDoC,至少在Visual Studio代码中,因为我当前正在使用它,它在IntelliSense弹出窗口中显示。
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top