modulecompilationtypescriptdefinitions

Generating a single definition file from a external module typescript project


Having a multi file typescript project, using external modules.

If I compile with

tsc -d init.ts -m "commonjs"

Then all the files of the project get their own .d.ts file. But I would like to generate one single .d.ts file for the whole project. What's the best way to go about this?


Solution

  • But I would like to generate one single .d.ts file for the whole project. What's the best way to go about this?

    At the moment it is handled in a hacky way by : https://github.com/TypeStrong/grunt-dts-bundle

    More : https://github.com/Microsoft/TypeScript/issues/1236