python2ts 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -80,10 +80,15 @@ interface TransformContext {
|
|
|
80
80
|
definedClasses: Set<string>;
|
|
81
81
|
/** Whether currently processing an abstract class (ABC) */
|
|
82
82
|
isAbstractClass?: boolean;
|
|
83
|
+
/** Depth counter for function bodies (0 = module level, 1+ = inside function) */
|
|
84
|
+
insideFunctionBody: number;
|
|
85
|
+
/** Imports found inside function bodies that need to be hoisted to module level */
|
|
86
|
+
hoistedImports: string[];
|
|
83
87
|
}
|
|
84
88
|
interface TransformResult {
|
|
85
89
|
code: string;
|
|
86
90
|
usesRuntime: Set<string>;
|
|
91
|
+
hoistedImports: string[];
|
|
87
92
|
}
|
|
88
93
|
declare function transform(input: string | ParseResult): TransformResult;
|
|
89
94
|
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "python2ts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "AST-based Python to TypeScript transpiler. Convert Python code to clean, idiomatic TypeScript with full type preservation.",
|
|
5
5
|
"homepage": "https://sebastian-software.github.io/python2ts/",
|
|
6
6
|
"repository": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@lezer/common": "^1.5.0",
|
|
51
51
|
"@lezer/python": "^1.1.18",
|
|
52
52
|
"prettier": "^3.8.0",
|
|
53
|
-
"pythonlib": "1.0.
|
|
53
|
+
"pythonlib": "1.0.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"tsup": "^8.5.1",
|