Skip to content
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 typings #5

Open
muuvmuuv opened this issue Sep 29, 2018 · 4 comments · May be fixed by #16
Open

Add typings #5

muuvmuuv opened this issue Sep 29, 2018 · 4 comments · May be fixed by #16

Comments

@muuvmuuv
Copy link

Could you provide Typescript typings so we can take advantage of intellisense from our editors?

@janrg
Copy link
Owner

janrg commented Sep 30, 2018

I'm unclear as to the degree of benefit given the very limited interface of the library in which all outputs are moment objects and all inputs either moment objects or numbers. Could you elaborate where you think this would significantly increase convenience?

@muuvmuuv
Copy link
Author

muuvmuuv commented Oct 1, 2018

In my case, I could not use your project because I always get a typing error.

@janrg
Copy link
Owner

janrg commented Oct 1, 2018

You get an error that prevents you from using the library because typing information is not provided? That seems very strange to me. Could you provide some more details so I can see if I can reproduce what's going on there?

@muuvmuuv
Copy link
Author

muuvmuuv commented Oct 2, 2018

Sure! So this is the complete error I get from VS Code:

[ts]
Could not find a declaration file for module 'meeussunmoon'. '/Users/marvinheilemann/Documents/Projects/VSCode/vscode-sundial/node_modules/meeussunmoon/dist/meeussunmoon.min.js' implicitly has an 'any' type.
  Try `npm install @types/meeussunmoon` if it exists or add a new declaration (.d.ts) file containing `declare module 'meeussunmoon';`

This is the test code:

import MeeusSunMoon from 'meeussunmoon';

MeeusSunMoon.options({
  roundToNearestMinute: true, // default: false
  returnTimeForPNMS: true, // default: false
  dateFormatKeys: {'**': '‡', '--': '†'} // default {'**': '‡', '--': '†'};
});

I have no declaration.d.ts file or anything else. The project where I tested this is: VS Code Sundial

@bisubus bisubus linked a pull request Jun 24, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants