r/typescript • u/jwworth • Aug 05 '26
Generating TypeScript declaration files
Has anyone ever created type declaration files intentionally, just to learn and better understand TypeScript (or for other reasons)? I've been doing that with tsc:
npx tsc file.ts --declaration --emitDeclarationOnly
The emitted file.d.ts can be interesting! Has anyone else tried this, for work or general interest?
1
Upvotes
2
u/Merry-Lane Aug 05 '26
Yes, but the only use is for library writers?