MeeusSunMoon icon indicating copy to clipboard operation
MeeusSunMoon copied to clipboard

Add TS typings

Open bisubus opened this issue 4 years ago • 3 comments

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

bisubus avatar Jun 24 '20 20:06 bisubus

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!

janrg avatar Jul 01 '20 15:07 janrg

I guess this and #5 can be closed now?

brettz9 avatar Aug 16 '20 02:08 brettz9

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.

janrg avatar Aug 16 '20 08:08 janrg