在工具.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.ts 和 index.d.ts。只有在 tool.d.ts 中它才会保留 tsdoc。这对于这个库的用户来说会很不方便,因为他们在编程时看不到任何 tsdoc 注释。
如何自动将评论移动到 index.d.ts 中?