-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
mathjs/number missing typescript definitions. #2506
Comments
Good point, thanks Nicklas. Anyone able to help writing the TypeScript definitions? Help would be welcome. |
I am happy to take a stab at getting the ball rolling by filtering the existing index.d.ts in the types directory if someone can tell me what the path for the number typescript definition file should be. |
Thanks! I do have no idea either. It would make sense to me to to use the same directory structure and put it in |
Right but I am not even sure how to "try typescript" in the context of a cloned version of the repo -- just how to use |
To test this from a TypeScript project should more or less look like:
The following getting started looks helpful to me: https://www.jonthenerd.com/2021/10/24/getting-started-with-node.js-and-typescript/ |
It's this step I don't understand. I only know how to install mathjs in another project from npm, not from my cloned source repo... |
If you have the updated version of mathjs built locally on your computer at say |
OK, it appears from my experiments that |
Oh, and as far as I can tell the same declaration file also needs to be in |
Sounds good!
Yes indeed. You can verify yourself locally by first running
O, I wasn't aware of that. So far the package has been published with the type definitions only in |
Well the exports in the package.json seem to want to support both |
argh. I can give it a try, see if I can make TypeScript happy. Please let me know if I can help as soon as you have a first version of the PR ready. |
Ok i will file a WIP PR for this with the copy in place and then you can see if you can clean up my mess ;-) |
😂👍 |
Hm look like it still doesn't work after #2569
|
Yes, this latest report from @thien-do agrees with my experiments that I needed the number.d.ts file in two different places for it to always be picked up by different ways of importing the library. And incidentally, PR #2569 also set the type declaration file for the number version of mathjs to be the same as for the full version of mathjs, which is definitely not right -- it needs to be a separate version filtered to only support numbers. I think both of these points will need to be addressed by another PR. |
There is still no "mathjs/number" typescript definition.
results in typescript error
There was an issue on this before (#1665). It got closed with reference to #1539. #1539 got closed with a comment asking us to open new issues if there is some issue with the current types. So here I am.
The text was updated successfully, but these errors were encountered: