mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-01-02 20:50:28 -05:00
Instead of declaring all the "body" parameters in the TypeScript/JavaScript code to be strings, I created a string-valued enumerated type called Body. The same string values can still be passed in from JavaScript code, or callers can use syntax like Astronomy.Body.Moon. This improves the type checking inside the TypeScript source, plus it adds better documentation for each of the parameters. In the generated Markdown documentation, the user can click on the Body type and see all the supported bodies. The other three supported languages (C, C#, Python) already use enumerated types for bodies, so this brings the JavaScript version more in sync with them.
2.0 KiB
2.0 KiB