@idlizer/arktscgen 2.1.10-arktscgen-3a → 2.1.10-arktscgen-5

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.
Files changed (284) hide show
  1. package/build/libarkts-copy/native/meson.build +1 -1
  2. package/build/libarkts-copy/native/src/bridges.cc +72 -115
  3. package/build/libarkts-copy/native/src/common.cc +225 -84
  4. package/build/libarkts-copy/native/src/common.h +22 -22
  5. package/build/libarkts-copy/native/src/memoryTracker.cc +30 -37
  6. package/build/libarkts-copy/native/src/memoryTracker.h +5 -5
  7. package/build/libarkts-copy/package.json +23 -19
  8. package/build/libarkts-copy/src/Es2pandaNativeModule.ts +176 -100
  9. package/build/libarkts-copy/src/InteropNativeModule.ts +18 -15
  10. package/build/libarkts-copy/src/arkts-api/AbstractVisitor.ts +17 -18
  11. package/build/libarkts-copy/src/arkts-api/ImportStorage.ts +31 -30
  12. package/build/libarkts-copy/src/arkts-api/ProgramProvider.ts +20 -17
  13. package/build/libarkts-copy/src/arkts-api/class-by-peer.ts +12 -12
  14. package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +44 -29
  15. package/build/libarkts-copy/src/arkts-api/index.ts +24 -24
  16. package/build/libarkts-copy/src/arkts-api/node-cache.ts +12 -12
  17. package/build/libarkts-copy/src/arkts-api/node-utilities/ArkTsConfig.ts +8 -8
  18. package/build/libarkts-copy/src/arkts-api/node-utilities/ArrayExpression.ts +9 -21
  19. package/build/libarkts-copy/src/arkts-api/node-utilities/AssignmentExpression.ts +12 -14
  20. package/build/libarkts-copy/src/arkts-api/node-utilities/BlockStatement.ts +5 -5
  21. package/build/libarkts-copy/src/arkts-api/node-utilities/CallExpression.ts +47 -13
  22. package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDefinition.ts +62 -32
  23. package/build/libarkts-copy/src/arkts-api/node-utilities/ClassProperty.ts +14 -13
  24. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSFunctionType.ts +24 -21
  25. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSImportDeclaration.ts +10 -12
  26. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSModule.ts +14 -18
  27. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSParameterExpression.ts +15 -16
  28. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSStructDeclaration.ts +5 -8
  29. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSTuple.ts +6 -12
  30. package/build/libarkts-copy/src/arkts-api/node-utilities/MemberExpression.ts +12 -11
  31. package/build/libarkts-copy/src/arkts-api/node-utilities/MethodDefinition.ts +14 -33
  32. package/build/libarkts-copy/src/arkts-api/node-utilities/NumberLiteral.ts +12 -23
  33. package/build/libarkts-copy/src/arkts-api/node-utilities/ObjectExpression.ts +17 -21
  34. package/build/libarkts-copy/src/arkts-api/node-utilities/OpaqueTypeNode.ts +9 -8
  35. package/build/libarkts-copy/src/arkts-api/node-utilities/Program.ts +21 -16
  36. package/build/libarkts-copy/src/arkts-api/node-utilities/ScriptFunction.ts +80 -35
  37. package/build/libarkts-copy/src/arkts-api/node-utilities/TSInterfaceDeclaration.ts +22 -32
  38. package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeParameter.ts +12 -14
  39. package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeReferencePart.ts +10 -12
  40. package/build/libarkts-copy/src/arkts-api/node-utilities/TryStatement.ts +10 -9
  41. package/build/libarkts-copy/src/arkts-api/node-utilities/VariableDeclarator.ts +10 -12
  42. package/build/libarkts-copy/src/arkts-api/peers/ArktsObject.ts +8 -8
  43. package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +53 -49
  44. package/build/libarkts-copy/src/arkts-api/peers/Config.ts +17 -24
  45. package/build/libarkts-copy/src/arkts-api/peers/Context.ts +29 -37
  46. package/build/libarkts-copy/src/arkts-api/peers/DiagnosticKind.ts +5 -6
  47. package/build/libarkts-copy/src/arkts-api/peers/ExternalSource.ts +9 -9
  48. package/build/libarkts-copy/src/arkts-api/peers/ImportPathManager.ts +6 -8
  49. package/build/libarkts-copy/src/arkts-api/peers/Options.ts +8 -8
  50. package/build/libarkts-copy/src/arkts-api/plugins.ts +98 -30
  51. package/build/libarkts-copy/src/arkts-api/static/global.ts +35 -36
  52. package/build/libarkts-copy/src/arkts-api/static/globalUtils.ts +5 -5
  53. package/build/libarkts-copy/src/arkts-api/static/profiler.ts +107 -91
  54. package/build/libarkts-copy/src/arkts-api/utilities/extensions.ts +54 -37
  55. package/build/libarkts-copy/src/arkts-api/utilities/nativePtrDecoder.ts +86 -69
  56. package/build/libarkts-copy/src/arkts-api/utilities/performance.ts +39 -23
  57. package/build/libarkts-copy/src/arkts-api/utilities/private.ts +73 -61
  58. package/build/libarkts-copy/src/arkts-api/utilities/public.ts +220 -173
  59. package/build/libarkts-copy/src/arkts-api/visitor.ts +606 -742
  60. package/build/libarkts-copy/src/arkts-api/wrapper-compat.ts +8 -8
  61. package/build/libarkts-copy/src/checkSdk.ts +15 -18
  62. package/build/libarkts-copy/src/index.ts +29 -29
  63. package/build/libarkts-copy/src/plugin-utils.ts +52 -40
  64. package/build/libarkts-copy/src/reexport-for-generated.ts +11 -10
  65. package/build/libarkts-copy/src/tracer.ts +75 -69
  66. package/build/libarkts-copy/src/ts-api/factory/nodeFactory.ts +134 -274
  67. package/build/libarkts-copy/src/ts-api/factory/nodeTests.ts +23 -23
  68. package/build/libarkts-copy/src/ts-api/index.ts +27 -35
  69. package/build/libarkts-copy/src/ts-api/static/enums.ts +3 -3
  70. package/build/libarkts-copy/src/ts-api/types.ts +535 -395
  71. package/build/libarkts-copy/src/ts-api/utilities/private.ts +115 -112
  72. package/build/libarkts-copy/src/ts-api/utilities/public.ts +18 -18
  73. package/build/libarkts-copy/src/ts-api/visitor/visitor.ts +33 -49
  74. package/build/libarkts-copy/src/utils.ts +97 -70
  75. package/build/libarkts-copy/tsconfig.json +3 -2
  76. package/lib/index.js +428 -159
  77. package/package.json +51 -53
  78. package/templates/Es2pandaNativeModule.ts +1 -0
  79. package/templates/factory.ts +1 -1
  80. package/templates/peer.ts +2 -1
  81. package/build/libarkts-copy/native/src/generated/bridges.cc +0 -16382
  82. package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +0 -1350
  83. package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +0 -5195
  84. package/build/libarkts-copy/src/generated/factory.ts +0 -1286
  85. package/build/libarkts-copy/src/generated/index.ts +0 -222
  86. package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +0 -44
  87. package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +0 -54
  88. package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +0 -45
  89. package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +0 -165
  90. package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +0 -84
  91. package/build/libarkts-copy/src/generated/peers/ArkTsConfig.ts +0 -73
  92. package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +0 -109
  93. package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +0 -119
  94. package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +0 -65
  95. package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +0 -111
  96. package/build/libarkts-copy/src/generated/peers/AstDumper.ts +0 -49
  97. package/build/libarkts-copy/src/generated/peers/AstVerifier.ts +0 -40
  98. package/build/libarkts-copy/src/generated/peers/AstVisitor.ts +0 -40
  99. package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +0 -61
  100. package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +0 -61
  101. package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +0 -110
  102. package/build/libarkts-copy/src/generated/peers/BindingProps.ts +0 -40
  103. package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +0 -72
  104. package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +0 -94
  105. package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +0 -61
  106. package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +0 -78
  107. package/build/libarkts-copy/src/generated/peers/CallExpression.ts +0 -129
  108. package/build/libarkts-copy/src/generated/peers/CatchClause.ts +0 -74
  109. package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +0 -68
  110. package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +0 -58
  111. package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +0 -76
  112. package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +0 -365
  113. package/build/libarkts-copy/src/generated/peers/ClassElement.ts +0 -76
  114. package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +0 -62
  115. package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +0 -137
  116. package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +0 -66
  117. package/build/libarkts-copy/src/generated/peers/CodeGen.ts +0 -40
  118. package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +0 -82
  119. package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +0 -78
  120. package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +0 -58
  121. package/build/libarkts-copy/src/generated/peers/Declaration.ts +0 -40
  122. package/build/libarkts-copy/src/generated/peers/Decorator.ts +0 -62
  123. package/build/libarkts-copy/src/generated/peers/DiagnosticInfo.ts +0 -40
  124. package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +0 -60
  125. package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +0 -66
  126. package/build/libarkts-copy/src/generated/peers/DynamicImportData.ts +0 -40
  127. package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +0 -62
  128. package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +0 -102
  129. package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +0 -90
  130. package/build/libarkts-copy/src/generated/peers/ETSIntrinsicNode.ts +0 -75
  131. package/build/libarkts-copy/src/generated/peers/ETSKeyofType.ts +0 -61
  132. package/build/libarkts-copy/src/generated/peers/ETSModule.ts +0 -129
  133. package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +0 -75
  134. package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +0 -79
  135. package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +0 -75
  136. package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +0 -58
  137. package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +0 -59
  138. package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +0 -189
  139. package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +0 -62
  140. package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +0 -55
  141. package/build/libarkts-copy/src/generated/peers/ETSStringLiteralType.ts +0 -58
  142. package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +0 -59
  143. package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +0 -89
  144. package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +0 -66
  145. package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +0 -78
  146. package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +0 -58
  147. package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +0 -75
  148. package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +0 -63
  149. package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +0 -66
  150. package/build/libarkts-copy/src/generated/peers/ErrorLogger.ts +0 -40
  151. package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +0 -66
  152. package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +0 -64
  153. package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +0 -94
  154. package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +0 -82
  155. package/build/libarkts-copy/src/generated/peers/Expression.ts +0 -84
  156. package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +0 -67
  157. package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +0 -69
  158. package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +0 -72
  159. package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +0 -67
  160. package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +0 -106
  161. package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +0 -74
  162. package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +0 -70
  163. package/build/libarkts-copy/src/generated/peers/IRNode.ts +0 -40
  164. package/build/libarkts-copy/src/generated/peers/Identifier.ts +0 -162
  165. package/build/libarkts-copy/src/generated/peers/IfStatement.ts +0 -78
  166. package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +0 -87
  167. package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +0 -62
  168. package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +0 -61
  169. package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +0 -62
  170. package/build/libarkts-copy/src/generated/peers/ImportSource.ts +0 -40
  171. package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +0 -73
  172. package/build/libarkts-copy/src/generated/peers/IndexInfo.ts +0 -40
  173. package/build/libarkts-copy/src/generated/peers/LabelPair.ts +0 -40
  174. package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +0 -68
  175. package/build/libarkts-copy/src/generated/peers/Literal.ts +0 -53
  176. package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +0 -45
  177. package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +0 -53
  178. package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +0 -115
  179. package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +0 -62
  180. package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +0 -152
  181. package/build/libarkts-copy/src/generated/peers/NamedType.ts +0 -84
  182. package/build/libarkts-copy/src/generated/peers/NewExpression.ts +0 -64
  183. package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +0 -58
  184. package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +0 -78
  185. package/build/libarkts-copy/src/generated/peers/ObjectDescriptor.ts +0 -40
  186. package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +0 -94
  187. package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +0 -58
  188. package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +0 -58
  189. package/build/libarkts-copy/src/generated/peers/OverloadDeclaration.ts +0 -101
  190. package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +0 -65
  191. package/build/libarkts-copy/src/generated/peers/Program.ts +0 -206
  192. package/build/libarkts-copy/src/generated/peers/Property.ts +0 -92
  193. package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +0 -65
  194. package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +0 -75
  195. package/build/libarkts-copy/src/generated/peers/ScopeFindResult.ts +0 -40
  196. package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +0 -310
  197. package/build/libarkts-copy/src/generated/peers/ScriptFunctionData.ts +0 -40
  198. package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +0 -61
  199. package/build/libarkts-copy/src/generated/peers/SignatureInfo.ts +0 -40
  200. package/build/libarkts-copy/src/generated/peers/SourcePosition.ts +0 -48
  201. package/build/libarkts-copy/src/generated/peers/SourceRange.ts +0 -40
  202. package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +0 -83
  203. package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +0 -120
  204. package/build/libarkts-copy/src/generated/peers/Statement.ts +0 -44
  205. package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +0 -66
  206. package/build/libarkts-copy/src/generated/peers/SuggestionInfo.ts +0 -40
  207. package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +0 -58
  208. package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +0 -70
  209. package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +0 -71
  210. package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +0 -58
  211. package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +0 -61
  212. package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +0 -84
  213. package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +0 -58
  214. package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +0 -58
  215. package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +0 -70
  216. package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +0 -71
  217. package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +0 -73
  218. package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +0 -112
  219. package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +0 -76
  220. package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +0 -61
  221. package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +0 -75
  222. package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +0 -69
  223. package/build/libarkts-copy/src/generated/peers/TSImportType.ts +0 -72
  224. package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +0 -73
  225. package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +0 -64
  226. package/build/libarkts-copy/src/generated/peers/TSInferType.ts +0 -62
  227. package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +0 -61
  228. package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +0 -160
  229. package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +0 -62
  230. package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +0 -62
  231. package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +0 -62
  232. package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +0 -72
  233. package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +0 -79
  234. package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +0 -61
  235. package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +0 -71
  236. package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +0 -68
  237. package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +0 -58
  238. package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +0 -66
  239. package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +0 -58
  240. package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +0 -58
  241. package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +0 -58
  242. package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +0 -74
  243. package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +0 -62
  244. package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +0 -80
  245. package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +0 -71
  246. package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +0 -75
  247. package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +0 -58
  248. package/build/libarkts-copy/src/generated/peers/TSThisType.ts +0 -58
  249. package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +0 -61
  250. package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +0 -151
  251. package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +0 -71
  252. package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +0 -61
  253. package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +0 -71
  254. package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +0 -121
  255. package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +0 -75
  256. package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +0 -62
  257. package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +0 -68
  258. package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +0 -62
  259. package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +0 -70
  260. package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +0 -58
  261. package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +0 -61
  262. package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +0 -58
  263. package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +0 -58
  264. package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +0 -69
  265. package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +0 -69
  266. package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +0 -68
  267. package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +0 -58
  268. package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +0 -62
  269. package/build/libarkts-copy/src/generated/peers/TryStatement.ts +0 -89
  270. package/build/libarkts-copy/src/generated/peers/TypeNode.ts +0 -81
  271. package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +0 -44
  272. package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +0 -45
  273. package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +0 -61
  274. package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +0 -70
  275. package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +0 -58
  276. package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +0 -68
  277. package/build/libarkts-copy/src/generated/peers/VReg.ts +0 -40
  278. package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +0 -50
  279. package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +0 -113
  280. package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +0 -79
  281. package/build/libarkts-copy/src/generated/peers/VerificationContext.ts +0 -40
  282. package/build/libarkts-copy/src/generated/peers/VerifierMessage.ts +0 -40
  283. package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +0 -71
  284. package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +0 -64
@@ -13,88 +13,88 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
- import { isNullPtr, KInt, KNativePointer, nullptr } from "@koalaui/interop"
17
- import { global } from "../static/global"
18
- import { allFlags, unpackNode, unpackNodeArray, unpackNonNullableNode, unpackString } from "../utilities/private"
19
- import { throwError } from "../../utils"
20
- import { Es2pandaAstNodeType, Es2pandaModifierFlags } from "../../generated/Es2pandaEnums"
21
- import { ArktsObject } from "./ArktsObject"
22
- import { SourcePosition } from "../../generated/peers/SourcePosition"
23
- import { NodeCache } from "../node-cache"
16
+ import { isNullPtr, KInt, KNativePointer, nullptr } from '@koalaui/interop';
17
+ import { global } from '../static/global';
18
+ import { allFlags, unpackNode, unpackNodeArray, unpackNonNullableNode, unpackString } from '../utilities/private';
19
+ import { throwError } from '../../utils';
20
+ import { Es2pandaAstNodeType, Es2pandaModifierFlags } from '../../../generated/Es2pandaEnums';
21
+ import { ArktsObject } from './ArktsObject';
22
+ import { SourcePosition } from '../../../generated/peers/SourcePosition';
23
+ import { NodeCache } from '../node-cache';
24
24
 
25
25
  export abstract class AstNode extends ArktsObject {
26
- public readonly astNodeType: Es2pandaAstNodeType
26
+ public readonly astNodeType: Es2pandaAstNodeType;
27
27
 
28
28
  protected constructor(peer: KNativePointer, astNodeType: Es2pandaAstNodeType) {
29
- global.profiler.nodeCreated()
29
+ global.profiler.nodeCreated();
30
30
  if (isNullPtr(peer)) {
31
- throwError(`attempted to create AstNode from nullptr`)
31
+ throwError(`attempted to create AstNode from nullptr`);
32
32
  }
33
- super(peer)
34
- this.astNodeType = astNodeType
35
- NodeCache.addToCache(peer, this)
33
+ super(peer);
34
+ this.astNodeType = astNodeType;
35
+ NodeCache.addToCache(peer, this);
36
36
  }
37
37
 
38
38
  public get originalPeer(): KNativePointer {
39
- const result = global.generatedEs2panda._AstNodeOriginalNodeConst(global.context, this.peer)
39
+ const result = global.generatedEs2panda._AstNodeOriginalNodeConst(global.context, this.peer);
40
40
  if (result === nullptr) {
41
- this.originalPeer = this.peer
42
- return this.peer
41
+ this.originalPeer = this.peer;
42
+ return this.peer;
43
43
  }
44
- return result
44
+ return result;
45
45
  }
46
46
 
47
47
  public set originalPeer(peer: KNativePointer) {
48
- global.generatedEs2panda._AstNodeSetOriginalNode(global.context, this.peer, peer)
48
+ global.generatedEs2panda._AstNodeSetOriginalNode(global.context, this.peer, peer);
49
49
  }
50
50
 
51
51
  public get original(): this {
52
- return unpackNonNullableNode(this.originalPeer)
52
+ return unpackNonNullableNode(this.originalPeer);
53
53
  }
54
54
 
55
55
  public getChildren(): readonly AstNode[] {
56
- return unpackNodeArray(global.es2panda._AstNodeChildren(global.context, this.peer))
56
+ return unpackNodeArray(global.es2panda._AstNodeChildren(global.context, this.peer));
57
57
  }
58
58
 
59
59
  public getSubtree(): readonly AstNode[] {
60
60
  return this.getChildren().reduce(
61
61
  (prev: readonly AstNode[], curr) => {
62
- return prev.concat(curr.getSubtree())
62
+ return prev.concat(curr.getSubtree());
63
63
  },
64
64
  [this]
65
- )
65
+ );
66
66
  }
67
67
 
68
68
  public updateModifiers(modifierFlags: KInt | undefined): this {
69
- global.generatedEs2panda._AstNodeClearModifier(global.context, this.peer, allFlags)
70
- global.generatedEs2panda._AstNodeAddModifier(global.context, this.peer, modifierFlags ?? Es2pandaModifierFlags.MODIFIER_FLAGS_NONE)
71
- return this
69
+ global.generatedEs2panda._AstNodeClearModifier(global.context, this.peer, allFlags);
70
+ global.generatedEs2panda._AstNodeAddModifier(
71
+ global.context,
72
+ this.peer,
73
+ modifierFlags ?? Es2pandaModifierFlags.MODIFIER_FLAGS_NONE
74
+ );
75
+ return this;
72
76
  }
73
77
 
74
78
  public dump(indentation: number = 0): string {
75
- const children = this.getChildren()
76
- .map((it) => it.dump(indentation + 1))
77
- const msg =
78
- `${indentation}_`
79
- + ` <mods: ${this.modifierFlags}>`
80
- + this.dumpMessage()
81
- return "> " + " ".repeat(4 * indentation) + msg + "\n" + children.join("")
79
+ const children = this.getChildren().map((it) => it.dump(indentation + 1));
80
+ const msg = `${indentation}_` + ` <mods: ${this.modifierFlags}>` + this.dumpMessage();
81
+ return '> ' + ' '.repeat(4 * indentation) + msg + '\n' + children.join('');
82
82
  }
83
83
 
84
84
  protected dumpMessage(): string {
85
- return ``
85
+ return ``;
86
86
  }
87
87
 
88
88
  public dumpJson(): string {
89
- return unpackString(global.generatedEs2panda._AstNodeDumpJSONConst(global.context, this.peer))
89
+ return unpackString(global.generatedEs2panda._AstNodeDumpJSONConst(global.context, this.peer));
90
90
  }
91
91
 
92
92
  public dumpSrc(): string {
93
- return unpackString(global.generatedEs2panda._AstNodeDumpEtsSrcConst(global.context, this.peer))
93
+ return unpackString(global.generatedEs2panda._AstNodeDumpEtsSrcConst(global.context, this.peer));
94
94
  }
95
95
 
96
96
  public dumpModifiers(): string {
97
- return unpackString(global.es2panda._AstNodeDumpModifiers(global.context, this.peer))
97
+ return unpackString(global.es2panda._AstNodeDumpModifiers(global.context, this.peer));
98
98
  }
99
99
 
100
100
  // public clone(): this {
@@ -120,7 +120,7 @@ export abstract class AstNode extends ArktsObject {
120
120
  clonedNode.parent = undefined;
121
121
  return clonedNode as this;
122
122
  }
123
-
123
+
124
124
  public get parent(): AstNode | undefined {
125
125
  const parent = global.generatedEs2panda._AstNodeParent(global.context, this.peer);
126
126
  return unpackNode(parent);
@@ -131,36 +131,40 @@ export abstract class AstNode extends ArktsObject {
131
131
  }
132
132
 
133
133
  public get modifierFlags(): Es2pandaModifierFlags {
134
- return global.generatedEs2panda._AstNodeModifiers(global.context, this.peer)
134
+ return global.generatedEs2panda._AstNodeModifiers(global.context, this.peer);
135
135
  }
136
136
 
137
137
  public set modifierFlags(flags: KInt | undefined) {
138
- global.generatedEs2panda._AstNodeClearModifier(global.context, this.peer, allFlags)
139
- global.generatedEs2panda._AstNodeAddModifier(global.context, this.peer, flags ?? Es2pandaModifierFlags.MODIFIER_FLAGS_NONE)
138
+ global.generatedEs2panda._AstNodeClearModifier(global.context, this.peer, allFlags);
139
+ global.generatedEs2panda._AstNodeAddModifier(
140
+ global.context,
141
+ this.peer,
142
+ flags ?? Es2pandaModifierFlags.MODIFIER_FLAGS_NONE
143
+ );
140
144
  }
141
-
145
+
142
146
  /** @deprecated Use {@link modifierFlags} instead */
143
147
  public get modifiers(): KInt {
144
- return this.modifierFlags
148
+ return this.modifierFlags;
145
149
  }
146
150
 
147
151
  /** @deprecated Use {@link modifierFlags} instead */
148
152
  public set modifiers(flags: KInt | undefined) {
149
- this.modifierFlags = flags
153
+ this.modifierFlags = flags;
150
154
  }
151
155
 
152
156
  public setChildrenParentPtr(): void {
153
157
  if (this.peer === nullptr) {
154
- throwError('setChildrenParentPtr called on NULLPTR')
158
+ throwError('setChildrenParentPtr called on NULLPTR');
155
159
  }
156
- global.es2panda._AstNodeSetChildrenParentPtr(global.context, this.peer)
160
+ global.es2panda._AstNodeSetChildrenParentPtr(global.context, this.peer);
157
161
  }
158
162
 
159
163
  public override onUpdate(original: AstNode): void {
160
164
  // Improve: Update modifiers only for specific AST nodes in the generated factory code
161
- this.modifierFlags = original.modifierFlags
165
+ this.modifierFlags = original.modifierFlags;
162
166
 
163
- global.es2panda._AstNodeOnUpdate(global.context, this.peer, original.peer)
167
+ global.es2panda._AstNodeOnUpdate(global.context, this.peer, original.peer);
164
168
  }
165
169
 
166
170
  public get isExport(): boolean {
@@ -174,7 +178,7 @@ export abstract class AstNode extends ArktsObject {
174
178
  public get isStatic(): boolean {
175
179
  return global.generatedEs2panda._AstNodeIsStaticConst(global.context, this.peer);
176
180
  }
177
-
181
+
178
182
  public get startPosition(): SourcePosition {
179
183
  return new SourcePosition(global.generatedEs2panda._AstNodeStartConst(global.context, this.peer));
180
184
  }
@@ -13,46 +13,40 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
- import { ArktsObject } from "./ArktsObject"
17
- import { global } from "../static/global"
18
- import { passStringArray } from "../utilities/private"
19
- import { KNativePointer, nullptr } from "@koalaui/interop"
20
- import { Es2pandaCompilationMode } from "../../generated/Es2pandaEnums"
16
+ import { ArktsObject } from './ArktsObject';
17
+ import { global } from '../static/global';
18
+ import { passStringArray } from '../utilities/private';
19
+ import { KNativePointer, nullptr } from '@koalaui/interop';
20
+ import { Es2pandaCompilationMode } from '../../../generated/Es2pandaEnums';
21
21
 
22
22
  export class Config extends ArktsObject {
23
23
  constructor(peer: KNativePointer) {
24
- super(peer)
24
+ super(peer);
25
25
  // Improve: wait for getter from api
26
- this.path = ``
26
+ this.path = ``;
27
27
  }
28
28
 
29
- static create(
30
- input: readonly string[]
31
- ): Config {
32
- return new Config(
33
- global.es2panda._CreateConfig(input.length, passStringArray(input))
34
- )
29
+ static create(input: readonly string[]): Config {
30
+ return new Config(global.es2panda._CreateConfig(input.length, passStringArray(input)));
35
31
  }
36
32
 
37
33
  static createDefault(): Config {
38
34
  if (global.configIsInitialized()) {
39
- console.warn(`Config already initialized`)
40
- return new Config(
41
- global.config
42
- )
35
+ console.warn(`Config already initialized`);
36
+ return new Config(global.config);
43
37
  }
44
38
  return new Config(
45
39
  global.es2panda._CreateConfig(
46
40
  4,
47
- passStringArray(["", "--arktsconfig", "./arktsconfig.json", global.filePath])
41
+ passStringArray(['', '--arktsconfig', './arktsconfig.json', global.filePath])
48
42
  )
49
- )
43
+ );
50
44
  }
51
45
 
52
46
  destroy() {
53
47
  if (this.peer != nullptr) {
54
- global.es2panda._DestroyConfig(this.peer)
55
- this.peer = nullptr
48
+ global.es2panda._DestroyConfig(this.peer);
49
+ this.peer = nullptr;
56
50
  }
57
51
  }
58
52
 
@@ -60,6 +54,5 @@ export class Config extends ArktsObject {
60
54
  return global.es2panda._GetCompilationMode(this.peer);
61
55
  }
62
56
 
63
-
64
- readonly path: string
65
- }
57
+ readonly path: string;
58
+ }
@@ -13,33 +13,29 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
- import { ArktsObject } from "./ArktsObject"
17
- import { Program } from "../../generated"
18
- import { global } from "../static/global"
19
- import { passString, passStringArray } from "../utilities/private"
20
- import { KNativePointer, nullptr, KBoolean } from "@koalaui/interop"
21
- import { Config } from "./Config"
22
- import { filterSource, throwError } from "../../utils"
23
- import { AstNode } from "./AstNode"
16
+ import { ArktsObject } from './ArktsObject';
17
+ import { Program } from '../../../generated';
18
+ import { global } from '../static/global';
19
+ import { passString, passStringArray } from '../utilities/private';
20
+ import { KNativePointer, nullptr, KBoolean } from '@koalaui/interop';
21
+ import { Config } from './Config';
22
+ import { filterSource, throwError } from '../../utils';
23
+ import { AstNode } from './AstNode';
24
24
 
25
25
  export class Context extends ArktsObject {
26
26
  constructor(peer: KNativePointer) {
27
- super(peer)
27
+ super(peer);
28
28
  }
29
29
 
30
30
  static createFromString(source: string): Context {
31
31
  if (!global.configIsInitialized()) {
32
- throw new Error(`Config not initialized`)
32
+ throw new Error(`Config not initialized`);
33
33
  }
34
34
  return new Context(
35
- global.es2panda._CreateContextFromString(
36
- global.config,
37
- passString(source),
38
- passString(global.filePath)
39
- )
40
- )
35
+ global.es2panda._CreateContextFromString(global.config, passString(source), passString(global.filePath))
36
+ );
41
37
  }
42
-
38
+
43
39
  /** @deprecated Use {@link createCacheFromFile} instead */
44
40
  static createCacheContextFromFile(
45
41
  configPtr: KNativePointer,
@@ -53,12 +49,7 @@ export class Context extends ArktsObject {
53
49
  }
54
50
 
55
51
  static createFromFile(filePath: string): Context {
56
- return new Context(
57
- global.es2panda._CreateContextFromFile(
58
- global.config,
59
- passString(filePath)
60
- )
61
- )
52
+ return new Context(global.es2panda._CreateContextFromFile(global.config, passString(filePath)));
62
53
  }
63
54
 
64
55
  static createCacheFromFile(filePath: string, config: Config, globalContext: GlobalContext, isExternal: boolean) {
@@ -69,26 +60,29 @@ export class Context extends ArktsObject {
69
60
  globalContext.peer,
70
61
  isExternal
71
62
  )
72
- )
63
+ );
73
64
  }
74
65
 
75
- static createContextGenerateAbcForExternalSourceFiles(
76
- filenames: string[]): Context {
66
+ static createContextGenerateAbcForExternalSourceFiles(filenames: string[]): Context {
77
67
  if (!global.configIsInitialized()) {
78
68
  throwError(`Config not initialized`);
79
69
  }
80
70
  return new Context(
81
- global.es2panda._CreateContextGenerateAbcForExternalSourceFiles(global.config, filenames.length, passStringArray(filenames))
71
+ global.es2panda._CreateContextGenerateAbcForExternalSourceFiles(
72
+ global.config,
73
+ filenames.length,
74
+ passStringArray(filenames)
75
+ )
82
76
  );
83
77
  }
84
78
 
85
79
  destroy() {
86
80
  if (this.peer != nullptr) {
87
- global.es2panda._DestroyContext(this.peer)
88
- this.peer = nullptr
81
+ global.es2panda._DestroyContext(this.peer);
82
+ this.peer = nullptr;
89
83
  }
90
84
  }
91
-
85
+
92
86
  /** @deprecated */
93
87
  static destroyAndRecreate(ast: AstNode): Context {
94
88
  console.log('[TS WRAPPER] DESTROY AND RECREATE');
@@ -105,9 +99,7 @@ export class Context extends ArktsObject {
105
99
  }
106
100
 
107
101
  export class GlobalContext extends ArktsObject {
108
- static create(
109
- config: Config, externalFileList: string[]
110
- ): GlobalContext {
102
+ static create(config: Config, externalFileList: string[]): GlobalContext {
111
103
  return new GlobalContext(
112
104
  global.es2panda._CreateGlobalContext(
113
105
  config.peer,
@@ -115,17 +107,17 @@ export class GlobalContext extends ArktsObject {
115
107
  externalFileList.length,
116
108
  false
117
109
  )
118
- )
110
+ );
119
111
  }
120
112
 
121
113
  constructor(peer: KNativePointer) {
122
- super(peer)
114
+ super(peer);
123
115
  }
124
116
 
125
117
  destroy() {
126
118
  if (this.peer != nullptr) {
127
- global.es2panda._DestroyGlobalContext(this.peer)
128
- this.peer = nullptr
119
+ global.es2panda._DestroyGlobalContext(this.peer);
120
+ this.peer = nullptr;
129
121
  }
130
122
  }
131
123
  }
@@ -13,12 +13,11 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
- import { KNativePointer } from "@koalaui/interop";
17
- import { ArktsObject } from "./ArktsObject"
18
-
16
+ import { KNativePointer } from '@koalaui/interop';
17
+ import { ArktsObject } from './ArktsObject';
19
18
 
20
19
  export class DiagnosticKind extends ArktsObject {
21
- constructor(peer: KNativePointer) {
22
- super(peer);
23
- }
20
+ constructor(peer: KNativePointer) {
21
+ super(peer);
22
+ }
24
23
  }
@@ -13,29 +13,29 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
- import { global } from "../static/global"
17
- import { acceptNativeObjectArrayResult, unpackString } from "../utilities/private"
18
- import { KNativePointer, nullptr } from "@koalaui/interop"
19
- import { Program } from "../../generated"
20
- import { ArktsObject } from "./ArktsObject"
16
+ import { global } from '../static/global';
17
+ import { acceptNativeObjectArrayResult, unpackString } from '../utilities/private';
18
+ import { KNativePointer, nullptr } from '@koalaui/interop';
19
+ import { Program } from '../../../generated';
20
+ import { ArktsObject } from './ArktsObject';
21
21
 
22
22
  export class ExternalSource extends ArktsObject {
23
23
  constructor(peer: KNativePointer) {
24
- super(peer)
24
+ super(peer);
25
25
  }
26
26
 
27
27
  getName(): string {
28
- return unpackString(global.es2panda._ExternalSourceName(this.peer))
28
+ return unpackString(global.es2panda._ExternalSourceName(this.peer));
29
29
  }
30
30
 
31
31
  get programs(): Program[] {
32
32
  return acceptNativeObjectArrayResult<Program>(
33
33
  global.es2panda._ExternalSourcePrograms(this.peer),
34
34
  (instance: KNativePointer) => new Program(instance)
35
- )
35
+ );
36
36
  }
37
37
 
38
38
  static instantiate(peer: KNativePointer) {
39
- return new ExternalSource(peer)
39
+ return new ExternalSource(peer);
40
40
  }
41
41
  }
@@ -13,18 +13,16 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
- import { ArktsObject } from "./ArktsObject"
17
- import { global } from "../static/global"
18
- import { KNativePointer } from "@koalaui/interop"
16
+ import { ArktsObject } from './ArktsObject';
17
+ import { global } from '../static/global';
18
+ import { KNativePointer } from '@koalaui/interop';
19
19
 
20
20
  export class ImportPathManager extends ArktsObject {
21
21
  constructor(peer: KNativePointer) {
22
- super(peer)
22
+ super(peer);
23
23
  }
24
24
 
25
25
  static create(): ImportPathManager {
26
- return new ImportPathManager(
27
- global.es2panda._ETSParserGetImportPathManager(global.context)
28
- );
26
+ return new ImportPathManager(global.es2panda._ETSParserGetImportPathManager(global.context));
29
27
  }
30
- }
28
+ }
@@ -13,22 +13,22 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
- import { KNativePointer } from "@koalaui/interop"
17
- import { ArktsObject } from "./ArktsObject"
18
- import { global } from "../static/global"
19
- import { Config } from "./Config"
20
- import { ArkTsConfig } from "../../generated"
16
+ import { KNativePointer } from '@koalaui/interop';
17
+ import { ArktsObject } from './ArktsObject';
18
+ import { global } from '../static/global';
19
+ import { Config } from './Config';
20
+ import { ArkTsConfig } from '../../../generated';
21
21
 
22
22
  export class Options extends ArktsObject {
23
23
  constructor(peer: KNativePointer) {
24
- super(peer)
24
+ super(peer);
25
25
  }
26
26
 
27
27
  static createOptions(config: Config) {
28
- return new Options(global.es2panda._ConfigGetOptions(config.peer))
28
+ return new Options(global.es2panda._ConfigGetOptions(config.peer));
29
29
  }
30
30
 
31
31
  getArkTsConfig(): ArkTsConfig {
32
- return new ArkTsConfig(global.es2panda._OptionsArkTsConfig(global.context, this.peer))
32
+ return new ArkTsConfig(global.es2panda._OptionsArkTsConfig(global.context, this.peer));
33
33
  }
34
34
  }
@@ -13,58 +13,126 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
- import { Es2pandaContextState } from "../generated/Es2pandaEnums"
17
- import { Program } from "../generated"
18
- import { ExternalSource } from "./peers/ExternalSource"
19
- import { KNativePointer } from "@koalaui/interop"
20
- import { global } from "./static/global"
21
- import { RunTransformerHooks } from "../plugin-utils"
16
+ import { Es2pandaContextState } from '../../generated/Es2pandaEnums';
17
+ import { ETSModule, Program } from '../../generated';
18
+ import { ExternalSource } from './peers/ExternalSource';
19
+ import { KNativePointer, nullptr } from '@koalaui/interop';
20
+ import { global } from './static/global';
21
+ import { RunTransformerHooks } from '../plugin-utils';
22
22
 
23
23
  export interface CompilationOptions {
24
- readonly isProgramForCodegeneration: boolean,
25
- readonly state: Es2pandaContextState,
24
+ readonly isProgramForCodegeneration: boolean;
25
+ readonly state: Es2pandaContextState;
26
+ }
27
+
28
+ export interface DependentModuleConfig {
29
+ packageName: string;
30
+ moduleName: string;
31
+ moduleType: string;
32
+ modulePath: string;
33
+ sourceRoots: string[];
34
+ entryFile: string;
35
+ language: string;
36
+ declFilesPath?: string;
37
+ dependencies?: string[];
38
+ }
39
+
40
+ export interface ProjectConfig {
41
+ bundleName: string;
42
+ moduleName: string;
43
+ cachePath: string;
44
+ dependentModuleList: DependentModuleConfig[];
45
+ appResource: string;
46
+ rawFileResource: string;
47
+ buildLoaderJson: string;
48
+ hspResourcesMap: boolean;
49
+ compileHar: boolean;
50
+ byteCodeHar: boolean;
51
+ uiTransformOptimization: boolean;
52
+ resetBundleName: boolean;
53
+ allowEmptyBundleName: boolean;
54
+ moduleType: string;
55
+ moduleRootPath: string;
56
+ aceModuleJsonPath: string;
57
+ ignoreError: boolean;
58
+ projectPath: string;
59
+ projectRootPath: string;
60
+ integratedHsp: boolean;
61
+ frameworkMode?: string;
62
+ isUi2abc?: boolean;
26
63
  }
27
64
 
28
65
  export interface PluginContext {
29
- setParameter<V>(name: string, value: V): void
30
- parameter<V>(name: string) : V | undefined
66
+ setParameter<V>(name: string, value: V): void;
67
+ parameter<V>(name: string): V | undefined;
31
68
  }
32
69
 
33
70
  export class PluginContextImpl implements PluginContext {
34
- map = new Map<String, Object|undefined>()
35
- parameter<V>(name: string): V|undefined {
36
- return this.map.get(name) as (V|undefined)
71
+ map = new Map<string, object | undefined>();
72
+
73
+ private ast: ETSModule | undefined = undefined;
74
+ private projectConfig: ProjectConfig | undefined = undefined;
75
+
76
+ parameter<V>(name: string): V | undefined {
77
+ return this.map.get(name) as V | undefined;
78
+ }
79
+ setParameter<V>(name: string, value: V): void {
80
+ this.map.set(name, value as object);
37
81
  }
38
- setParameter<V>(name: string, value: V) {
39
- this.map.set(name, value as Object)
82
+ getContextPtr(): KNativePointer {
83
+ return global.compilerContext?.peer ?? nullptr;
84
+ }
85
+ public setProjectConfig(projectConfig: ProjectConfig): void {
86
+ this.projectConfig = projectConfig;
87
+ }
88
+
89
+ public getProjectConfig(): ProjectConfig | undefined {
90
+ return this.projectConfig;
91
+ }
92
+ /**
93
+ * @deprecated
94
+ */
95
+ public setArkTSAst(ast: ETSModule): void {
96
+ this.ast = ast;
97
+ }
98
+
99
+ /**
100
+ * @deprecated
101
+ */
102
+ public getArkTSAst(): ETSModule | undefined {
103
+ return this.ast;
40
104
  }
41
105
  }
42
106
 
43
- export type ProgramTransformer = (program: Program, compilationOptions: CompilationOptions, context: PluginContext) => void
107
+ export type ProgramTransformer = (
108
+ program: Program,
109
+ compilationOptions: CompilationOptions,
110
+ context: PluginContext
111
+ ) => void;
44
112
 
45
- export function defaultFilter(name: string) {
46
- if (name.startsWith("std.")) return false
47
- if (name.startsWith("escompat")) return false
48
- return true
113
+ export function defaultFilter(name: string): boolean {
114
+ if (name.startsWith('std.')) return false;
115
+ if (name.startsWith('escompat')) return false;
116
+ return true;
49
117
  }
50
118
 
51
119
  export function listPrograms(program: Program, filter: (name: string) => boolean = defaultFilter): Program[] {
52
120
  return [
53
121
  program,
54
- ...program.getExternalSources().flatMap((it: ExternalSource) => {
122
+ ...program.getExternalSources().flatMap((it: ExternalSource): Program[] => {
55
123
  if (filter(it.getName())) {
56
- return it.programs
124
+ return it.programs;
57
125
  }
58
- return []
59
- })
60
- ]
126
+ return [];
127
+ }),
128
+ ];
61
129
  }
62
130
 
63
131
  export interface PluginEntry {
64
- name?: string
65
- parsed?: (hooks?: RunTransformerHooks) => void
66
- checked?: (hooks?: RunTransformerHooks) => void
67
- clean?: (hooks?: RunTransformerHooks) => void
132
+ name?: string;
133
+ parsed?: (hooks?: RunTransformerHooks) => void;
134
+ checked?: (hooks?: RunTransformerHooks) => void;
135
+ clean?: (hooks?: RunTransformerHooks) => void;
68
136
  }
69
137
 
70
- export type PluginInitializer = (parsedJson?: Object, checkedJson?: Object) => PluginEntry
138
+ export type PluginInitializer = (parsedJson?: object, checkedJson?: object) => PluginEntry;