json-schema-to-typescript icon indicating copy to clipboard operation
json-schema-to-typescript copied to clipboard

Allow generating IDE-only .d.ts type hints by omitting all export statements

Open Darker opened this issue 8 months ago • 0 comments

Currently, when a .d.ts file is generated, it exports it's symbols. That's good for typescript usage, but when working in plain JavaScript, it is often more convenient to omit those in .d.ts files, which causes VS Code (and I am assuming other IDEs) to implicitly import these for the purposes of type checking only.

Since without transpiling, browsers and Node typically do not accept TypeScript, this makes this tool unusable for hinting in plain JS projects that do not use some kind of transpiler, such as webpack.

I would like to propose a simple additional parameter, such as --noExports that would generate .d.ts files purely for type hinting purposes.

Darker avatar Feb 01 '25 14:02 Darker