Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何删除私有成员并在自动生成的typescript定义文件中保留注释_Typescript - Fatal编程技术网

如何删除私有成员并在自动生成的typescript定义文件中保留注释

如何删除私有成员并在自动生成的typescript定义文件中保留注释,typescript,Typescript,关于typesript编译器,我有两个问题 我使用typescript编译器的自动生成定义功能。结果包括私有符号: export declare class WorkerController { static LIBRARY_ROOT_PATH: string; private _worker; private _entryPoint; private _externalScripts; constructor(entryPoint: string, ex

关于typesript编译器,我有两个问题

我使用typescript编译器的自动生成定义功能。结果包括私有符号:

export declare class WorkerController {
    static LIBRARY_ROOT_PATH: string;
    private _worker;
    private _entryPoint;
    private _externalScripts;
    constructor(entryPoint: string, externalScript?: Array<string>);
    spawn(): void;
    private _test();
}
导出声明类WorkerController{
静态库\根\路径:字符串;
私人工人;
私人入口点;
私有外部脚本;
构造函数(入口点:字符串,外部脚本?:数组);
spawn():void;
私有测试();
}
有可能不包括这些吗

我还想包括我对代码的文档注释。是否有一个特殊的关键字来保存这些内容


thx

无法停止为私有变量和函数发出声明

假设您有一个tsconfig.json或类似的方式来配置tsc,您可以将removeComments选项设置为false

如果设置为false,文档注释将保留在源代码中。文档注释必须以/**开头,而不是以/*或//开头

您可以找到有关配置tsc的更多信息