-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add Typescript definitions #350
Comments
I‘d love to see them too. Ideally we would rewrite the library to TS to avoid outdated types if forgotten to be updated. Do you have any intention or see an ability of opening a PR for this yourself? |
If the API doesn't change often, then a rewrite only to keep TS definitions in sync, is probably not the best use of anyone's time 😅, right? |
In a way no. In another it's quite risky. I've had experience with thinking exactly that in the past in libraries. Then outdated types are frustrating. |
TypeScript 3.7+ supports generating type definitions from JSDocs. I could try that out and open a PR if it works well. Would that be useful? |
That sounds like a good compromise. Thanks! |
I did a proof of concept for generating the declarations based on https://voxpelli.com/2019/10/use-type-script-3-7-to-generate/ The result is in this branch: nlochschmidt/promster@master...nlochschmidt:typescript-definitions To generate the type declarations (and run the typechecker) you need to run The declarations look a bit ugly though. TS creates a lot of *.d.ts files and merging them using the |
Funny enough there seems to be a problem with the
could it be that those should be defaultOptions according to:promster/packages/metrics/modules/create-request-recorder/create-request-recorder.js Line 125 in 575cca7
|
This to me also looks wrong. Odd that it never surfaced as a bug. Will have a look and fix independently quickly if needed. Thanks.
You mean one |
I released a fix for the mentioned option defaulting across packages Successfully published:
- @promster/[email protected]
- @promster/[email protected]
- @promster/[email protected]
- @promster/[email protected]
- @promster/[email protected]
- @promster/[email protected] |
Here is a PR rewriting the library entirely to TypeScript. Little Saturday lockdown activity 😄. Not 100% perfect yet but pretty good as a start I think. THe hapi plugin is notoriously hard to type as it mitigates a breaking hapi version. |
Thanks a lot for your work 👍 |
While trying to integrate promster with our service written in TypeScript I noticed that there don't seem to be typings for @promster/express. So needless to say, I'd love to see Typescript support for this.
The text was updated successfully, but these errors were encountered: