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

DefinitelyTyped for goja and goja-node? #608

Open
benallfree opened this issue Sep 12, 2024 · 3 comments
Open

DefinitelyTyped for goja and goja-node? #608

benallfree opened this issue Sep 12, 2024 · 3 comments

Comments

@benallfree
Copy link

Over at pocketbase/pocketbase#5512 we are having a discussion about the PocketBase JSVM typings, and I recognize that goja's core and node typings underly PocketBase's extensions.

Do you know if there has been any discussion or attempts at creating something like @types/goja and @types/goja-node? It would be hugely useful for anyone using TS to target a Goja environment.

@dop251
Copy link
Owner

dop251 commented Sep 12, 2024

There hasn't been any discussion as far as I'm aware, but neither goja, nor goja_nodejs define any types of their own (except maybe for GoError).

@benallfree
Copy link
Author

For example, @types/node introduces many typings and modules that are not available in the goja environment. It seems that es2020 is fairly suitable for defining the basic goja types. Can you help me understand if there might be suitable typings existing already?

@dop251
Copy link
Owner

dop251 commented Sep 25, 2024

There is a long-standing issue about listing all ECMAScript features and their status. Unfortunately, I haven't had time for it so far. Having said that, most of the features are there, so taking es2020 as a basis is not a bad shot.

As for node, very few modules have been implemented, and most of those that are implemented are incomplete, so no, I don't think there are suitable typings available.

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