Rename .ts files to .d.ts files #105
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the TypeScript declarations are stored in
.tsfiles, and we usetscto compile them into.d.tsfiles. This step is unnecessary, and we don't really want all those.jsand.js.mapfiles underdist/. We can simply place all TypeScript declarations directly in.d.tsfiles.This pull request includes the following changes:
.tsfiles to.d.tsfiles undersrc/.typesfield inpackage.jsonto point directly tosrc/index.d.ts.tsconfig.json:"noEmit": trueso that no./dist/**/*.d.tsfiles will be generated anymore."skipLibCheck": falseto ensure thattscstill verifies our code. More on that below."types": []to preventtscfrom accidentally pickingnode_modules/@types/node. This will also be the default behavior in the upcoming TypeScript 6.0: Change default oftypesto[]intsconfig.jsonmicrosoft/TypeScript#62195Please note that I did not remove the
"build": "tsc"script inpackage.json. We will need this script to check our.d.tsfiles undersrc/. I tested it using the following example: