dcmjs
dcmjs copied to clipboard
Addition of typescript type declarations
Addresses #163
@WoonchanCho The sr
namespace should be relatively completely. The data
namespace is partially complete. All other parts of the package are still missing. Feel free to add additional type declarations via a pull request into the feature/types
branch and publish the pull request (currently in draft status).
Thanks for working on this 👍
Let's be sure to give the final PR commit line a semantic versioning prefix like feat(typescript)
so it'll auto deploy to npm.
Let's be sure to give the final PR commit line a semantic versioning prefix like feat(typescript) so it'll auto deploy to npm.
Cool, I was not aware of this feature. All we would need to do is include this in the commit message?
Yes, Danny set it up and I used it for the first time the other day:
https://github.com/dcmjs-org/dcmjs/issues/159#issuecomment-767717261
@hackermd, sure, I will try to do whatever remained and let @pieper to review. Thank you so much both for moving forward.
@pieper and @hackermd , I've completed an initial environment setup. You can see the progress at the feature/types branch of the forked repo at https://github.com/WoonchanCho/dcmjs/tree/feature/types
As I said earlier, I'm trying to pursue two goals simultaneously:
- using a JsDoc to create an API doc.
- Automatically creating Typescript declaration files using the JsDoc comments.
This strategy would be great because this makes sure to keep sync among sources, docs, and TypeScript declarations, leading to the single source of truth .
My repo now has two new folders: docs: the result produced by running "npm run build:doc" types: the result produced by running "rpm run build:type"
You will peek the docs files by opening docs/index.html in the browser. Once you open it, you can see the README file and you can click one of classes in the right side. there are only three classes there (BufferStream...) now. I temporarily set it to the README file for the main source repo but if you want, you can make a separate README file for the API doc site too.
I will continue to work when I have available time
Thank you
@WoonchanCho this looks great! 💯 It'll be a huge help and will encourage us to add more comments.
@hackermd, I'm getting error after merging your recent change: [!] Error: 'VolumeSurface' is not exported by src/sr/contentItems.js, imported by src/sr/templates.js
It looks VolumeSurface you deleted is being used in src/sr/templates.js. Kindly check this.
Thank you.
Any update with this PR?