Generate declaration file with single module in TypeScript
问题 Given the following folder structure: src/ ├── foo.ts ├── bar.ts ├── baz.ts ├── index.ts Where foo.ts , bar.ts , and baz.ts each export a default class or thing: i.e. in the case of foo.ts : export default class Foo { x = 2; } Can we automatically generate a declaration file which declares one module my-module and exports foo.ts , bar.ts , and baz.ts as non-defaults ? I.e. I want tsc to generate the following: build/ ├── foo.js ├── bar.js ├── baz.js ├── index.js ├── index.d.ts Where index.d