In #12 I added some type tests. The biggest issue that they seem to reveal is that we don't see JS builtins. For example, suppose someone uses Object:
from js import Object
Object.fromEntries([("a", 1), ("b", 2)])
This sort of code is pretty common in practice and ideally we'd want to be able to typecheck this. Since it's not in the webidl we'd need to get the info from some other source. Unfortunately that seems like a lot of work...
Some thoughts:
- Maybe there are typescript type definitions that we can use?
- But then maybe those also cover everything in the webidl?
- So maybe what is actually needed is a tool for converting from typescript to mypy?
In #12 I added some type tests. The biggest issue that they seem to reveal is that we don't see JS builtins. For example, suppose someone uses
Object:This sort of code is pretty common in practice and ideally we'd want to be able to typecheck this. Since it's not in the webidl we'd need to get the info from some other source. Unfortunately that seems like a lot of work...
Some thoughts: