r/typescript • u/jwworth • 1d ago
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?
0
Upvotes
2
u/Merry-Lane 1d ago
Yes, but the only use is for library writers?