使用 TypeLite 生成文档

Generating documentation using TypeLite

是否可以配置 TypeLite 以将文档从源复制到目标 class,以便工具提示文档在 Visual Studio 中可用?

这是一个基本示例(按照 TypeLite quickstart 中的描述进行配置):

public class Poco
{
    /// <summary>
    /// Documentation.
    /// </summary>
    /// <remarks>
    /// Remarks.
    /// </remarks>
    public string Name { get; set; }
}

生成以下内容:

interface Poco {
    Name: string;
}

但我想要:

interface Poco {
    /**
     * Documentation.
     * 
     * Remarks.
     */
    Name: string;
}

TypeLite 支持从 C# 类 中的 Xml 注释生成 JDoc 注释。您需要调用WithJSDoc() fluent 配置方法

<#
    var ts = TypeScript.Definitions()
        .WithReference("Enums.ts")
        .WithJSDoc();
#>

它需要 XML 个包含文档的文件与您的二进制文件一起生成。

.NET 可移植项目不支持此功能。