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

Does the package has types? #47

Open
JooZef315 opened this issue Oct 1, 2024 · 3 comments
Open

Does the package has types? #47

JooZef315 opened this issue Oct 1, 2024 · 3 comments

Comments

@JooZef315
Copy link

I am trying to use it but it seems that it doesn't has types, or I am missing something?

ERROR: Could not find a declaration file for module 'node-moving-things-tracker'. 'node_modules/node-moving-things-tracker/main.js' implicitly has an 'any' type.

@vsaw
Copy link
Collaborator

vsaw commented Oct 5, 2024

That is correct. It is written in plain JS without type declarations. If you happen to add type declarations I'm happy to merge them upstream :)

@JooZef315
Copy link
Author

Hi, I did added types for example methods for now, but before continue working on it i want to ask you about if I could get many instances of the tracker instead of being a singleton? if you could guide me with main steps to do so I could add this as well, or is it possible already with current structure?

@vsaw
Copy link
Collaborator

vsaw commented Oct 11, 2024

It is not possible with the current code base.

Implementing it should be fairly straightforward though.

At the moment all methods are exported directly and all variables to track state are global.

To allow for multiple instances of the tracker all you need to do is wrap everything into an object and then export the entire object. That should allow you to create multiple instances.

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

No branches or pull requests

2 participants