shashwatak / satellite-js

Modular set of functions for SGP4 and SDP4 propagation of TLEs.
MIT License
917 stars 145 forks source link

jday not in index.d.ts #125

Open ajmas opened 1 year ago

ajmas commented 1 year ago

Is it normal that jday is not declared in index.d.ts?

I am in the process of converting a project from JS to TS, and Typescript throws the error:

Module '"satellite.js"' has no exported member 'jday'.ts(2305)

I do see it as an export in lib/index.js and in lib/indexUmd.js.

And my import:

import { jday, gstime } from 'satellite.js';

satellite.js version: 5.0.0

thkruz commented 1 year ago

Looking at the history of index.d.ts it just looks like it wasn't something the original author (Kyle Maxwell) added. I would assume that in his implementation it was only used internally so it didn't throw any errors for him.

Orbital Object Tool Kit was created to provide expanded functionality to satellite.js and to build it as a TypeScript first library. @ezze does an amazing job keeping this library very stable. I am focused on expanding functionality because I use it on my own projects.

I can take a look at updating index.d.ts, but it may be a week or so before I have time for it. There are probably some other missing functions.

ajmas commented 1 year ago

Sounds good. No rush. Thanks

BTW The project in question: https://github.com/ajmas/StuffInSpace , which is a fork of https://github.com/jeyoder/StuffInSpace . The function had previously been duplicated, but trying to avoid code duplication.

thkruz commented 10 months ago

@ajmas if someone else does a PR I am happy to merge it into this repo, but it doesn't make sense for me to spend brain power trying to maintain TypeScript support in this library, when I am actively working to write a TypeScript first library to replace it. I won't mark this as wontfix, but I personally will not be fixing it.