tsdoc 没有显示在 index.d.ts

问题描述 投票:0回答:0

在工具.ts中:

/** foo **/
export let foo = ()=>{}
/** bar **/
export let bar = ()=>{}

在 index.ts 中:

import {foo, bar} from "./tool.ts"
export default {foo, bar}

然后我用tsc编译它。结果,它将发出 2 个文件 tool.d.tsindex.d.ts。只有在 tool.d.ts 中它才会保留 tsdoc。这对于这个库的用户来说会很不方便,因为他们在编程时看不到任何 tsdoc 注释。

如何自动将评论移动到 index.d.ts 中?

typescript tsc tsdoc
© www.soinside.com 2019 - 2024. All rights reserved.