dcmjs-org / dcmjs

Javascript implementation of DICOM manipulation
https://dcmjs.netlify.com/
MIT License
293 stars 112 forks source link

Addition of typescript type declarations #165

Open hackermd opened 3 years ago

hackermd commented 3 years ago

Addresses #163

hackermd commented 3 years ago

@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).

pieper commented 3 years ago

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.

hackermd commented 3 years ago

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?

pieper commented 3 years ago

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

WoonchanCho commented 3 years ago

@hackermd, sure, I will try to do whatever remained and let @pieper to review. Thank you so much both for moving forward.

WoonchanCho commented 3 years ago

@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: 1) using a JsDoc to create an API doc. 2) 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

pieper commented 3 years ago

@WoonchanCho this looks great! 💯 It'll be a huge help and will encourage us to add more comments.

WoonchanCho commented 3 years ago

@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.

Joeycho commented 8 months ago

Any update with this PR?