TypeScript内のXMLドキュメントのサポートはすでにサポートされていますか?

StackOverflow https://stackoverflow.com//questions/12687061

  •  12-12-2019
  •  | 
  •  

質問

Tysscript内の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 Popupsに表示されます。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top