Closed khawarizmus closed 3 years ago
This is a great suggestion. This is definitely an oversight on our part. The only thing that shouldn't be exposed is methodAdjustments
as that is meant to be an internal value used by the pre-defined methods. Custom methods would simply use the adjustments param.
It seems the TypeScript definition is also missing the qibla definition (as you noted in your other issue) and also the tehran calculation method. Perhaps we can bundle all these changes into one PR to update the typescript definition.
Pr added #39
Assalam alykoum
Shouldn't the following constructor signature in the type definitions that is found here use optional arguments?
Basically changing this:
To this:
Currently, all arguments are required except for
methodName
that is implied fromundefined
andnull
type that was added. but looking at the code onlyfajrAngle
andishaAngle
seem required to me.Also for library authors who use this library as a base (for example allow users to use a custom method). it would be useful to expose all params.
Currently
methodAdjustments
,maghribAngle
, andpolarCircleResolution
are missing from the type definitions making the library throw an error when for example trying to assign custom method adjustments or any one of the three params mentioned above.This small change would bring better type checking and intelisence as well as prevent few type errors. and I can help PR the changes.