Add missing TypeScript interfaces and properties #737
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.
Hey! I started adopting
deno docfor date-fns documentation generation. Thank you a lot for the outstanding tool!After running
deno doc --jsonagainst date-fns and then type checking the resulting JSON, I found that some TypeScript interfaces and properties were missing, so I added them.I confirmed that the type changes fix all the problems for date-fns by manually updating
node_modules/@deno/doc/types.d.ts.Here's the script I used to generate and type check the docs JSON:
buildDocs.sh.You can see the TypeScript errors I get:
logs.txt.Here's the source code I got as the result:
docs.ts(I apologize for a OneDrive link. GitHub Gist was throwing500on an attempt to upload ~200K LoC file).You can also reproduce the problem if you clone the date-fns repo and run:
You will find the
docs.jsonatsubmodules/docs/tmp/docs.jsonand the TypeScript code atsubmodules/docs/tmp/docs.ts.You can also rerun the
tsc(after running thebuildDocs.shfirst):cd submodules/docs pnpm tsc --noEmit --skipLibCheck --module NodeNext --moduleResolution NodeNext tmp/docs.tsI made missing properties optional to avoid breaking any libraries that depend on it. I also couldn't figure out the proper
constructorsinterface, so I made itunknown[].Furthermore, I also added the
Docsinterface to represent the root data structure of the JSON.