-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build typescript .d.ts files #61
Conversation
api.js changes: - make most options to api.DICOMwebClient optional. - add progressCallback arg to retrieveSeries
Should these be two different topics? |
@PaulHax thanks for your PR. Could you kindly provide some context for these changes and elaboration on why you think they would be needed? |
Hi @hackermd
The Typescript build tool can use the extensive JS Docs comments to generate types. The couple changes the JS Docs I made bring the generated TS types closer to the JavaScript behavior. |
Ah, some nice work in Slim with the essential Dataset, Study, MetadataElement, etc types. Copying the Slim types in and closing this PR sounds good. |
Could you help us get #42 over the finish line? It appears you have experience in configuration a JavaScript library for TypeScript and I am wondering whether we may be able to reuse (parts of) the configuration file that's included in this PR. |
I would also like to include your improvements/fixes of the documentation. |
I would like to help with this. Would be nice to keep using the JS Docs for the source maps, doc helper pop-ups, and future maintenance. I pushed up another commit that mixes in Slim's
But the docs would get better with TS folks forced to maintain them? |
Hi @hackermd Have any thoughts on keeping the JS Docs the source of type truth? |
I have limited experience with mixing JavaScript and TypeScript. Based on my understanding, there are two options:
The first option has the advantage that the type declarations can be specified in the In addition, I tend argue that it would make the transition to TypeScript ( What would be the downsides of that approach? |
Thanks @PaulHax! Looks mostly good to me. Unfortunately, our pipelines are currently broken (#65), so we'll have to ignore the failures. Moving forward it would be great to make the documentation available online. Do you know how to generate the HTML files with JSDoc together with the typescript type declaration files? |
Great 👍
That is something I have not done before. |
Okay, we can figure that out later. |
Adds a
tsc
step in thenpm run build
script.api.js changes: