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 TS typings #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add TS typings #16

wants to merge 1 commit into from

Conversation

bisubus
Copy link

@bisubus bisubus commented Jun 24, 2020

Closes #5
Typings closely follow jsdocs and so are quite accurate.

@janrg
Copy link
Owner

janrg commented Jul 1, 2020

Thanks for this. I will actually be releasing v3.0 in the next few months which uses luxon instead of moment and is written entirely in typescript but I guess it's useful to have the typings on 2.x as well. Before I accept the PR, could you

  • Restrict the type for the moon phase from number to 0 | 1 | 2 | 3
  • move the types file from index.d.ts to dist/meeussunmoon.d.ts
  • reference the new file location as "types" in package.json
    ?
    Thanks!

@brettz9
Copy link
Contributor

brettz9 commented Aug 16, 2020

I guess this and #5 can be closed now?

@janrg
Copy link
Owner

janrg commented Aug 16, 2020

I think not everyone will be able or willing to switch to Luxon, e.g. if they have to support obsolete browsers like IE. So I think having typings on a 2.x branch may still be useful, so I won't close this for now.

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 this pull request may close these issues.

Add typings
3 participants