Skip to content

Commit f1f3241

Browse files
committed
feat(typing): add back root type hints in the pyi file
I have absolutely no idea why they were deleted. The changes are hidden in commit d946421 and 1f42778
1 parent 89afe29 commit f1f3241

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

python/pythonmonkey/pythonmonkey.pyi

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""
2+
stub file for type hints & documentations for the native module
23
@see https://typing.readthedocs.io/en/latest/source/stubs.html
34
"""
45

@@ -55,6 +56,14 @@ def collect() -> None:
5556
"""
5657

5758

59+
def internalBinding(namespace: str) -> JSObjectProxy:
60+
"""
61+
INTERNAL USE ONLY
62+
63+
See function declarations in ./builtin_modules/internal-binding.d.ts
64+
"""
65+
66+
5867
class JSFunctionProxy():
5968
"""
6069
JavaScript Function proxy
@@ -87,6 +96,26 @@ class JSMethodProxy(JSFunctionProxy, object):
8796
"""
8897

8998

99+
class JSObjectProxy(dict):
100+
"""
101+
JavaScript Object proxy dict
102+
"""
103+
104+
def __init__(self) -> None: ...
105+
106+
107+
class bigint(int):
108+
"""
109+
Representing JavaScript BigInt in Python
110+
"""
111+
112+
113+
class SpiderMonkeyError(Exception):
114+
"""
115+
Representing a corresponding JS Error in Python
116+
"""
117+
118+
90119
null = _typing.Annotated[
91120
_typing.NewType("pythonmonkey.null", object),
92121
"Representing the JS null type in Python using a singleton object",

0 commit comments

Comments
 (0)