typescript doc comments?
See original GitHub issueHi, I am working on integrating zod into one of my current projects. In the past I have used a combination of declared typescript types and manual validation. Zod is obviously a lot nicer to use on the validation side, but there is one piece from declaring types that I cannot find a replacement for in zod. That is doc comments
E.g. if I have the following struct defined:
interface Media {
/**
* The location of the media file
*/
filepath: string
}
what would the equivalent comment look like in zod? These are important for my project, which relies on deno’s documentation generation for user docs (see here https://doc.deno.land/https/raw.githubusercontent.com/andykais/ffmpeg-templates/main/lib/template_input.ts#Template)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:20 (3 by maintainers)
Top Results From Across the Web
Doc Comments - TypeDoc
Doc Comments. TypeDoc implements a minimal parser for your comments which extracts TSDoc/JSDoc tags and recognizes code blocks to ignore decorators.
Read more >JSDoc Reference - TypeScript: Documentation
The list below outlines which constructs are currently supported when using JSDoc annotations to provide type information in JavaScript files.
Read more >Where is the syntax for TypeScript comments documented?
The right syntax is now the one used by TSDoc. It will allow you to have your comments understood by Visual Studio Code...
Read more >microsoft/tsdoc: A doc comment standard for TypeScript - GitHub
A doc comment standard for TypeScript. Contribute to microsoft/tsdoc development by creating an account on GitHub.
Read more >TSDoc
A doc comment standard for TypeScript. ... TSDoc is a proposal to standardize the doc comments used in TypeScript code, so that different...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well the whole point of this issue is that documentation tools using zod as the source of truth are insufficient. I understand that this is a limitation of the language though.
@ptboyer thanks for sharing. I ended up going with an existing library https://github.com/DetachHead/ts-helpers/issues/97. If thats missing some use cases then let them know! Until ts-helpers publishes to deno.land https://github.com/DetachHead/ts-helpers/issues/107, the imports look like this: