dcmjs icon indicating copy to clipboard operation
dcmjs copied to clipboard

Addition of typescript type declarations

Open hackermd opened this issue 4 years ago • 9 comments

Addresses #163

hackermd avatar Feb 02 '21 19:02 hackermd

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

hackermd avatar Feb 02 '21 19:02 hackermd

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.

pieper avatar Feb 02 '21 20:02 pieper

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?

hackermd avatar Feb 02 '21 20:02 hackermd

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

pieper avatar Feb 02 '21 20:02 pieper

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

WoonchanCho avatar Feb 03 '21 05:02 WoonchanCho

@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

WoonchanCho avatar Feb 03 '21 07:02 WoonchanCho

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

pieper avatar Feb 03 '21 21:02 pieper

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

WoonchanCho avatar Feb 04 '21 20:02 WoonchanCho

Any update with this PR?

Joeycho avatar Dec 26 '23 20:12 Joeycho