@idlizer/arktscgen 2.1.7 → 2.1.9-arktscgen-4

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 (354) hide show
  1. package/build/libarkts-copy/generator/options.json5 +34 -0
  2. package/build/libarkts-copy/native/meson.build +128 -75
  3. package/build/libarkts-copy/native/meson_options.txt +6 -0
  4. package/build/libarkts-copy/native/src/bridges.cc +271 -8
  5. package/build/libarkts-copy/native/src/common.cc +166 -45
  6. package/build/libarkts-copy/native/src/common.h +53 -8
  7. package/build/libarkts-copy/native/src/generated/bridges.cc +2654 -319
  8. package/build/libarkts-copy/package.json +31 -17
  9. package/build/libarkts-copy/src/Es2pandaNativeModule.ts +97 -3
  10. package/build/libarkts-copy/src/arkts-api/AbstractVisitor.ts +1 -1
  11. package/build/libarkts-copy/src/arkts-api/ChainExpressionFilter.ts +78 -0
  12. package/build/libarkts-copy/src/arkts-api/CheckedBackFilter.ts +86 -8
  13. package/build/libarkts-copy/src/arkts-api/CompileWithCache.ts +193 -0
  14. package/build/libarkts-copy/src/arkts-api/ImportStorage.ts +78 -0
  15. package/build/libarkts-copy/src/arkts-api/InferVoidReturnType.ts +89 -0
  16. package/build/libarkts-copy/src/arkts-api/ProgramProvider.ts +50 -0
  17. package/build/libarkts-copy/src/arkts-api/SetBaseOverloads.ts +10 -17
  18. package/build/libarkts-copy/src/arkts-api/class-by-peer.ts +2 -3
  19. package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +89 -6
  20. package/build/libarkts-copy/src/arkts-api/index.ts +10 -1
  21. package/build/libarkts-copy/src/arkts-api/node-cache.ts +8 -4
  22. package/build/libarkts-copy/src/arkts-api/node-utilities/AnnotationDeclaration.ts +32 -0
  23. package/build/libarkts-copy/src/arkts-api/node-utilities/AnnotationUsage.ts +37 -0
  24. package/build/libarkts-copy/src/arkts-api/node-utilities/ArkTsConfig.ts +26 -0
  25. package/build/libarkts-copy/src/arkts-api/node-utilities/ArrayExpression.ts +1 -1
  26. package/build/libarkts-copy/src/arkts-api/node-utilities/BinaryExpression.ts +37 -0
  27. package/build/libarkts-copy/src/arkts-api/node-utilities/BlockExpression.ts +27 -0
  28. package/build/libarkts-copy/src/arkts-api/node-utilities/BlockStatement.ts +29 -0
  29. package/build/libarkts-copy/src/arkts-api/node-utilities/CallExpression.ts +2 -2
  30. package/build/libarkts-copy/src/arkts-api/node-utilities/ChainExpression.ts +27 -0
  31. package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDeclaration.ts +54 -0
  32. package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDefinition.ts +1 -1
  33. package/build/libarkts-copy/src/arkts-api/node-utilities/ClassProperty.ts +3 -3
  34. package/build/libarkts-copy/src/arkts-api/node-utilities/ConditionalExpression.ts +36 -0
  35. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSFunctionType.ts +2 -2
  36. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSImportDeclaration.ts +3 -33
  37. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSNewClassInstanceExpression.ts +34 -0
  38. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSParameterExpression.ts +3 -9
  39. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSPrimitiveType.ts +28 -0
  40. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSStructDeclaration.ts +1 -1
  41. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSTuple.ts +1 -1
  42. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSTypeReference.ts +27 -0
  43. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSTypeReferencePart.ts +36 -0
  44. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSUndefinedType.ts +24 -0
  45. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSUnionType.ts +27 -0
  46. package/build/libarkts-copy/src/arkts-api/node-utilities/Identifier.ts +27 -0
  47. package/build/libarkts-copy/src/arkts-api/node-utilities/ImportSpecifier.ts +31 -0
  48. package/build/libarkts-copy/src/arkts-api/node-utilities/MemberExpression.ts +1 -1
  49. package/build/libarkts-copy/src/arkts-api/node-utilities/MethodDefinition.ts +2 -2
  50. package/build/libarkts-copy/src/arkts-api/node-utilities/NullLiteral.ts +24 -0
  51. package/build/libarkts-copy/src/arkts-api/node-utilities/NumberLiteral.ts +2 -2
  52. package/build/libarkts-copy/src/arkts-api/node-utilities/ObjectExpression.ts +1 -1
  53. package/build/libarkts-copy/src/arkts-api/node-utilities/Program.ts +40 -0
  54. package/build/libarkts-copy/src/arkts-api/node-utilities/ReturnStatement.ts +27 -0
  55. package/build/libarkts-copy/src/arkts-api/node-utilities/StringLiteral.ts +27 -0
  56. package/build/libarkts-copy/src/arkts-api/node-utilities/SuperExpression.ts +24 -0
  57. package/build/libarkts-copy/src/arkts-api/node-utilities/TSAsExpression.ts +36 -0
  58. package/build/libarkts-copy/src/arkts-api/node-utilities/TSClassImplements.ts +31 -0
  59. package/build/libarkts-copy/src/arkts-api/node-utilities/TSInterfaceBody.ts +28 -0
  60. package/build/libarkts-copy/src/arkts-api/node-utilities/TSInterfaceDeclaration.ts +2 -2
  61. package/build/libarkts-copy/src/arkts-api/node-utilities/TSNonNullExpression.ts +27 -0
  62. package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeParameter.ts +1 -1
  63. package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeParameterDeclaration.ts +31 -0
  64. package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeParameterInstantiation.ts +30 -0
  65. package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeReferencePart.ts +1 -1
  66. package/build/libarkts-copy/src/arkts-api/node-utilities/TemplateLiteral.ts +35 -0
  67. package/build/libarkts-copy/src/arkts-api/node-utilities/ThisExpression.ts +24 -0
  68. package/build/libarkts-copy/src/arkts-api/node-utilities/UndefinedLiteral.ts +24 -0
  69. package/build/libarkts-copy/src/arkts-api/node-utilities/VariableDeclaration.ts +1 -1
  70. package/build/libarkts-copy/src/arkts-api/node-utilities/VariableDeclarator.ts +1 -1
  71. package/build/libarkts-copy/src/arkts-api/peers/ArktsObject.ts +3 -1
  72. package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +75 -12
  73. package/build/libarkts-copy/src/arkts-api/peers/Config.ts +8 -1
  74. package/build/libarkts-copy/src/arkts-api/peers/Context.ts +71 -4
  75. package/build/libarkts-copy/src/arkts-api/peers/{Program.ts → ExternalSource.ts} +2 -22
  76. package/build/libarkts-copy/src/arkts-api/peers/Options.ts +34 -0
  77. package/build/libarkts-copy/src/arkts-api/plugins.ts +26 -12
  78. package/build/libarkts-copy/src/arkts-api/static/global.ts +7 -4
  79. package/build/libarkts-copy/src/arkts-api/static/profiler.ts +180 -23
  80. package/build/libarkts-copy/src/arkts-api/utilities/private.ts +32 -8
  81. package/build/libarkts-copy/src/arkts-api/utilities/public.ts +54 -12
  82. package/build/libarkts-copy/src/arkts-api/visitor.ts +32 -37
  83. package/build/libarkts-copy/src/arkts-api/wrapper-compat.ts +32 -0
  84. package/build/libarkts-copy/src/checkSdk.ts +25 -0
  85. package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +448 -436
  86. package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +778 -63
  87. package/build/libarkts-copy/src/generated/factory.ts +12 -15
  88. package/build/libarkts-copy/src/generated/index.ts +10 -3
  89. package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +7 -1
  90. package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +7 -1
  91. package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +7 -1
  92. package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +58 -6
  93. package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +10 -4
  94. package/build/libarkts-copy/src/generated/peers/ArkTsConfig.ts +75 -0
  95. package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +11 -5
  96. package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +40 -6
  97. package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +9 -3
  98. package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +11 -5
  99. package/build/libarkts-copy/src/generated/peers/AstDumper.ts +7 -1
  100. package/build/libarkts-copy/src/generated/peers/AstVerifier.ts +7 -1
  101. package/build/libarkts-copy/src/generated/peers/AstVisitor.ts +7 -1
  102. package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +9 -3
  103. package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +9 -3
  104. package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +9 -3
  105. package/build/libarkts-copy/src/generated/peers/BindingProps.ts +7 -1
  106. package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +10 -4
  107. package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +26 -7
  108. package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +9 -3
  109. package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +10 -4
  110. package/build/libarkts-copy/src/generated/peers/CallExpression.ts +20 -3
  111. package/build/libarkts-copy/src/generated/peers/CatchClause.ts +10 -4
  112. package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +9 -3
  113. package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +9 -3
  114. package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +33 -4
  115. package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +128 -42
  116. package/build/libarkts-copy/src/generated/peers/ClassElement.ts +28 -4
  117. package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +9 -3
  118. package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +39 -5
  119. package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +9 -3
  120. package/build/libarkts-copy/src/generated/peers/CodeGen.ts +7 -1
  121. package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +9 -3
  122. package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +10 -4
  123. package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +9 -3
  124. package/build/libarkts-copy/src/generated/peers/Declaration.ts +7 -1
  125. package/build/libarkts-copy/src/generated/peers/Decorator.ts +9 -3
  126. package/build/libarkts-copy/src/generated/peers/{OverloadInfo.ts → DiagnosticInfo.ts} +8 -2
  127. package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +9 -3
  128. package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +9 -3
  129. package/build/libarkts-copy/src/generated/peers/DynamicImportData.ts +7 -1
  130. package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +10 -4
  131. package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +10 -4
  132. package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +16 -5
  133. package/build/libarkts-copy/src/generated/peers/ETSKeyofType.ts +10 -4
  134. package/build/libarkts-copy/src/generated/peers/ETSModule.ts +59 -4
  135. package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +10 -4
  136. package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +11 -5
  137. package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +11 -5
  138. package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +10 -4
  139. package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +10 -4
  140. package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +46 -12
  141. package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +10 -4
  142. package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +7 -1
  143. package/build/libarkts-copy/src/generated/peers/ETSStringLiteralType.ts +10 -4
  144. package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +10 -4
  145. package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +14 -8
  146. package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +10 -4
  147. package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +11 -5
  148. package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +10 -4
  149. package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +15 -4
  150. package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +10 -4
  151. package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +16 -4
  152. package/build/libarkts-copy/src/generated/peers/ErrorLogger.ts +7 -1
  153. package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +9 -3
  154. package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +9 -3
  155. package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +18 -7
  156. package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +26 -3
  157. package/build/libarkts-copy/src/generated/peers/Expression.ts +7 -1
  158. package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +9 -3
  159. package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +9 -3
  160. package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +9 -3
  161. package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +8 -2
  162. package/build/libarkts-copy/src/generated/peers/FunctionDecl.ts +7 -1
  163. package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +44 -6
  164. package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +10 -4
  165. package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +7 -1
  166. package/build/libarkts-copy/src/generated/peers/IRNode.ts +7 -1
  167. package/build/libarkts-copy/src/generated/peers/Identifier.ts +16 -5
  168. package/build/libarkts-copy/src/generated/peers/IfStatement.ts +14 -3
  169. package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +28 -4
  170. package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +9 -3
  171. package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +9 -3
  172. package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +9 -3
  173. package/build/libarkts-copy/src/generated/peers/ImportSource.ts +7 -1
  174. package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +9 -3
  175. package/build/libarkts-copy/src/generated/peers/IndexInfo.ts +7 -1
  176. package/build/libarkts-copy/src/generated/peers/InterfaceDecl.ts +7 -1
  177. package/build/libarkts-copy/src/generated/peers/LabelPair.ts +7 -1
  178. package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +9 -3
  179. package/build/libarkts-copy/src/generated/peers/Literal.ts +15 -1
  180. package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +7 -1
  181. package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +7 -1
  182. package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +9 -3
  183. package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +9 -3
  184. package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +26 -10
  185. package/build/libarkts-copy/src/generated/peers/NamedType.ts +9 -3
  186. package/build/libarkts-copy/src/generated/peers/NewExpression.ts +9 -3
  187. package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +9 -3
  188. package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +15 -9
  189. package/build/libarkts-copy/src/generated/peers/ObjectDescriptor.ts +7 -1
  190. package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +10 -4
  191. package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +9 -3
  192. package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +10 -4
  193. package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +9 -3
  194. package/build/libarkts-copy/src/generated/peers/Program.ts +194 -0
  195. package/build/libarkts-copy/src/generated/peers/Property.ts +10 -4
  196. package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +9 -3
  197. package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +10 -4
  198. package/build/libarkts-copy/src/generated/peers/ScopeFindResult.ts +7 -1
  199. package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +77 -10
  200. package/build/libarkts-copy/src/generated/peers/ScriptFunctionData.ts +7 -1
  201. package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +9 -3
  202. package/build/libarkts-copy/src/generated/peers/SignatureInfo.ts +7 -1
  203. package/build/libarkts-copy/src/generated/peers/SourcePosition.ts +7 -1
  204. package/build/libarkts-copy/src/generated/peers/SourceRange.ts +7 -1
  205. package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +10 -4
  206. package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +46 -9
  207. package/build/libarkts-copy/src/generated/peers/Statement.ts +7 -1
  208. package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +10 -4
  209. package/build/libarkts-copy/src/generated/peers/{ETSDynamicFunctionType.ts → SuggestionInfo.ts} +7 -5
  210. package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +10 -4
  211. package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +10 -4
  212. package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +10 -4
  213. package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +10 -4
  214. package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +10 -4
  215. package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +10 -4
  216. package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +10 -4
  217. package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +10 -4
  218. package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +11 -5
  219. package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +10 -4
  220. package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +10 -4
  221. package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +48 -6
  222. package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +11 -5
  223. package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +10 -4
  224. package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +10 -4
  225. package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +10 -4
  226. package/build/libarkts-copy/src/generated/peers/TSImportType.ts +10 -4
  227. package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +10 -4
  228. package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +10 -4
  229. package/build/libarkts-copy/src/generated/peers/TSInferType.ts +10 -4
  230. package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +10 -4
  231. package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +78 -8
  232. package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +10 -4
  233. package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +10 -4
  234. package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +10 -4
  235. package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +10 -4
  236. package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +10 -4
  237. package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +10 -4
  238. package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +10 -4
  239. package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +10 -4
  240. package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +10 -4
  241. package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +10 -4
  242. package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +10 -4
  243. package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +10 -4
  244. package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +10 -4
  245. package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +10 -4
  246. package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +10 -4
  247. package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +10 -4
  248. package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +10 -4
  249. package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +10 -4
  250. package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +10 -4
  251. package/build/libarkts-copy/src/generated/peers/TSThisType.ts +10 -4
  252. package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +10 -4
  253. package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +53 -6
  254. package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +10 -4
  255. package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +10 -4
  256. package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +10 -4
  257. package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +41 -7
  258. package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +15 -4
  259. package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +10 -4
  260. package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +10 -4
  261. package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +10 -4
  262. package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +10 -4
  263. package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +10 -4
  264. package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +10 -4
  265. package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +10 -4
  266. package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +10 -4
  267. package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +10 -4
  268. package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +11 -5
  269. package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +10 -4
  270. package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +10 -4
  271. package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +10 -4
  272. package/build/libarkts-copy/src/generated/peers/TryStatement.ts +11 -5
  273. package/build/libarkts-copy/src/generated/peers/TypeNode.ts +37 -3
  274. package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +7 -1
  275. package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +7 -1
  276. package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +10 -4
  277. package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +15 -4
  278. package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +9 -3
  279. package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +10 -4
  280. package/build/libarkts-copy/src/generated/peers/VReg.ts +7 -1
  281. package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +7 -1
  282. package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +48 -8
  283. package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +11 -5
  284. package/build/libarkts-copy/src/generated/peers/VerificationContext.ts +7 -1
  285. package/build/libarkts-copy/src/generated/peers/VerifierMessage.ts +7 -1
  286. package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +15 -4
  287. package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +10 -4
  288. package/build/libarkts-copy/src/index.ts +13 -1
  289. package/build/libarkts-copy/src/plugin-utils.ts +117 -0
  290. package/build/libarkts-copy/src/utils.ts +17 -28
  291. package/build/libarkts-copy/src/wrapper-compat/README.md +16 -0
  292. package/build/libarkts-copy/src/wrapper-compat/arkts-api/class-by-peer.ts +46 -0
  293. package/build/libarkts-copy/src/wrapper-compat/arkts-api/factory/nodeFactory.ts +454 -0
  294. package/build/libarkts-copy/src/wrapper-compat/arkts-api/factory/nodeTests.ts +99 -0
  295. package/build/libarkts-copy/src/wrapper-compat/arkts-api/index.ts +88 -0
  296. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ArrayExpression.ts +38 -0
  297. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ArrowFunctionExpression.ts +35 -0
  298. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/AssignmentExpression.ts +38 -0
  299. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/BlockStatement.ts +27 -0
  300. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/CallExpression.ts +45 -0
  301. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassDeclaration.ts +27 -0
  302. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassDefinition.ts +73 -0
  303. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassProperty.ts +51 -0
  304. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSFunctionType.ts +42 -0
  305. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSImportDeclaration.ts +39 -0
  306. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSParameterExpression.ts +43 -0
  307. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ExpressionStatement.ts +28 -0
  308. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/FunctionDeclaration.ts +37 -0
  309. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/FunctionExpression.ts +28 -0
  310. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/IfStatement.ts +37 -0
  311. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/MemberExpression.ts +42 -0
  312. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/MethodDefinition.ts +46 -0
  313. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/NumberLiteral.ts +30 -0
  314. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ObjectExpression.ts +37 -0
  315. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/Property.ts +27 -0
  316. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ScriptFunction.ts +46 -0
  317. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/StructDeclaration.ts +28 -0
  318. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSInterfaceDeclaration.ts +47 -0
  319. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSTypeAliasDeclaration.ts +40 -0
  320. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSTypeParameter.ts +36 -0
  321. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TryStatement.ts +41 -0
  322. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/VariableDeclaration.ts +42 -0
  323. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/VariableDeclarator.ts +39 -0
  324. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/ArktsObject.ts +45 -0
  325. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/AstNode.ts +26 -0
  326. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Config.ts +53 -0
  327. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Context.ts +60 -0
  328. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Diagnostic.ts +39 -0
  329. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/DiagnosticInfo.ts +33 -0
  330. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/DiagnosticKind.ts +33 -0
  331. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/ImportPathManager.ts +34 -0
  332. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Program.ts +105 -0
  333. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SourcePosition.ts +38 -0
  334. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SourceRange.ts +38 -0
  335. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SuggestionInfo.ts +33 -0
  336. package/build/libarkts-copy/src/wrapper-compat/arkts-api/static/global.ts +16 -0
  337. package/build/libarkts-copy/src/wrapper-compat/arkts-api/static/globalUtils.ts +27 -0
  338. package/build/libarkts-copy/src/wrapper-compat/arkts-api/to-be-generated/MemberExpression.ts +108 -0
  339. package/build/libarkts-copy/src/wrapper-compat/arkts-api/types.ts +907 -0
  340. package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/nativePtrDecoder.ts +69 -0
  341. package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/performance.ts +190 -0
  342. package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/private.ts +198 -0
  343. package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/public.ts +325 -0
  344. package/build/libarkts-copy/src/wrapper-compat/arkts-api/visitor.ts +421 -0
  345. package/build/libarkts-copy/src/wrapper-compat/index.ts +20 -0
  346. package/lib/index.js +323 -148
  347. package/package.json +2 -2
  348. package/templates/Es2pandaEnums.ts +4 -0
  349. package/templates/Es2pandaNativeModule.ts +5 -1
  350. package/templates/factory.ts +5 -1
  351. package/templates/index.ts +5 -1
  352. package/templates/node-map.ts +5 -1
  353. package/templates/peer.ts +5 -1
  354. package/build/libarkts-copy/README.md +0 -36
@@ -13,6 +13,10 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ /*
17
+ * THIS FILE IS AUTOGENERATED BY arktscgen. DO NOT EDIT MANUALLY!
18
+ */
19
+
16
20
  import {
17
21
  global,
18
22
  passNode,
@@ -30,21 +34,23 @@ import {
30
34
 
31
35
  import { Es2pandaAstNodeType } from "./../Es2pandaEnums"
32
36
  import { Literal } from "./Literal"
37
+
33
38
  export class UndefinedLiteral extends Literal {
34
39
  constructor(pointer: KNativePointer) {
35
40
  assertValidPeer(pointer, 51)
36
41
  super(pointer)
37
42
  }
38
43
  static createUndefinedLiteral(): UndefinedLiteral {
39
- return new UndefinedLiteral(global.generatedEs2panda._CreateUndefinedLiteral(global.context))
44
+ return new UndefinedLiteral(global.generatedEs2panda._CreateUndefinedLiteral(global.context)).updateChildren()
40
45
  }
41
46
  static updateUndefinedLiteral(original?: UndefinedLiteral): UndefinedLiteral {
42
- return new UndefinedLiteral(global.generatedEs2panda._UpdateUndefinedLiteral(global.context, passNode(original)))
47
+ return new UndefinedLiteral(global.generatedEs2panda._UpdateUndefinedLiteral(global.context, passNode(original))).updateChildren()
43
48
  }
49
+ protected readonly brandUndefinedLiteral: undefined
44
50
  }
45
51
  export function isUndefinedLiteral(node: object | undefined): node is UndefinedLiteral {
46
52
  return node instanceof UndefinedLiteral
47
53
  }
48
54
  if (!nodeByType.has(Es2pandaAstNodeType.AST_NODE_TYPE_UNDEFINED_LITERAL)) {
49
55
  nodeByType.set(Es2pandaAstNodeType.AST_NODE_TYPE_UNDEFINED_LITERAL, (peer: KNativePointer) => new UndefinedLiteral(peer))
50
- }
56
+ }
@@ -13,6 +13,10 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ /*
17
+ * THIS FILE IS AUTOGENERATED BY arktscgen. DO NOT EDIT MANUALLY!
18
+ */
19
+
16
20
  import {
17
21
  global,
18
22
  passNode,
@@ -31,16 +35,17 @@ import {
31
35
  import { Es2pandaAstNodeType } from "./../Es2pandaEnums"
32
36
  import { Es2pandaTokenType } from "./../Es2pandaEnums"
33
37
  import { Expression } from "./Expression"
38
+
34
39
  export class UpdateExpression extends Expression {
35
40
  constructor(pointer: KNativePointer) {
36
- assertValidPeer(pointer, 148)
41
+ assertValidPeer(pointer, 149)
37
42
  super(pointer)
38
43
  }
39
44
  static createUpdateExpression(argument: Expression | undefined, updateOperator: Es2pandaTokenType, isPrefix: boolean): UpdateExpression {
40
- return new UpdateExpression(global.generatedEs2panda._CreateUpdateExpression(global.context, passNode(argument), updateOperator, isPrefix))
45
+ return new UpdateExpression(global.generatedEs2panda._CreateUpdateExpression(global.context, passNode(argument), updateOperator, isPrefix)).updateChildren()
41
46
  }
42
47
  static updateUpdateExpression(original: UpdateExpression | undefined, argument: Expression | undefined, updateOperator: Es2pandaTokenType, isPrefix: boolean): UpdateExpression {
43
- return new UpdateExpression(global.generatedEs2panda._UpdateUpdateExpression(global.context, passNode(original), passNode(argument), updateOperator, isPrefix))
48
+ return new UpdateExpression(global.generatedEs2panda._UpdateUpdateExpression(global.context, passNode(original), passNode(argument), updateOperator, isPrefix)).updateChildren()
44
49
  }
45
50
  get operatorType(): Es2pandaTokenType {
46
51
  return global.generatedEs2panda._UpdateExpressionOperatorTypeConst(global.context, this.peer)
@@ -51,10 +56,11 @@ export class UpdateExpression extends Expression {
51
56
  get isPrefix(): boolean {
52
57
  return global.generatedEs2panda._UpdateExpressionIsPrefixConst(global.context, this.peer)
53
58
  }
59
+ protected readonly brandUpdateExpression: undefined
54
60
  }
55
61
  export function isUpdateExpression(node: object | undefined): node is UpdateExpression {
56
62
  return node instanceof UpdateExpression
57
63
  }
58
64
  if (!nodeByType.has(Es2pandaAstNodeType.AST_NODE_TYPE_UPDATE_EXPRESSION)) {
59
65
  nodeByType.set(Es2pandaAstNodeType.AST_NODE_TYPE_UPDATE_EXPRESSION, (peer: KNativePointer) => new UpdateExpression(peer))
60
- }
66
+ }
@@ -13,6 +13,10 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ /*
17
+ * THIS FILE IS AUTOGENERATED BY arktscgen. DO NOT EDIT MANUALLY!
18
+ */
19
+
16
20
  import {
17
21
  global,
18
22
  passNode,
@@ -28,8 +32,10 @@ import {
28
32
  unpackString
29
33
  } from "../../reexport-for-generated"
30
34
 
35
+
31
36
  export class VReg extends ArktsObject {
32
37
  constructor(pointer: KNativePointer) {
33
38
  super(pointer)
34
39
  }
35
- }
40
+ protected readonly brandVReg: undefined
41
+ }
@@ -13,6 +13,10 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ /*
17
+ * THIS FILE IS AUTOGENERATED BY arktscgen. DO NOT EDIT MANUALLY!
18
+ */
19
+
16
20
  import {
17
21
  global,
18
22
  passNode,
@@ -29,6 +33,7 @@ import {
29
33
  } from "../../reexport-for-generated"
30
34
 
31
35
  import { SourcePosition } from "./SourcePosition"
36
+
32
37
  export class ValidationInfo extends ArktsObject {
33
38
  constructor(pointer: KNativePointer) {
34
39
  super(pointer)
@@ -39,4 +44,5 @@ export class ValidationInfo extends ArktsObject {
39
44
  get fail(): boolean {
40
45
  return global.generatedEs2panda._ValidationInfoFailConst(global.context, this.peer)
41
46
  }
42
- }
47
+ protected readonly brandValidationInfo: undefined
48
+ }
@@ -13,6 +13,10 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ /*
17
+ * THIS FILE IS AUTOGENERATED BY arktscgen. DO NOT EDIT MANUALLY!
18
+ */
19
+
16
20
  import {
17
21
  global,
18
22
  passNode,
@@ -34,38 +38,74 @@ import { Es2pandaAstNodeType } from "./../Es2pandaEnums"
34
38
  import { Es2pandaVariableDeclarationKind } from "./../Es2pandaEnums"
35
39
  import { Statement } from "./Statement"
36
40
  import { VariableDeclarator } from "./VariableDeclarator"
41
+
37
42
  export class VariableDeclaration extends Statement {
38
43
  constructor(pointer: KNativePointer) {
39
- assertValidPeer(pointer, 149)
44
+ assertValidPeer(pointer, 150)
40
45
  super(pointer)
41
46
  }
42
47
  static createVariableDeclaration(kind: Es2pandaVariableDeclarationKind, declarators: readonly VariableDeclarator[]): VariableDeclaration {
43
- return new VariableDeclaration(global.generatedEs2panda._CreateVariableDeclaration(global.context, kind, passNodeArray(declarators), declarators.length))
48
+ return new VariableDeclaration(global.generatedEs2panda._CreateVariableDeclaration(global.context, kind, passNodeArray(declarators), declarators.length)).updateChildren()
44
49
  }
45
50
  static updateVariableDeclaration(original: VariableDeclaration | undefined, kind: Es2pandaVariableDeclarationKind, declarators: readonly VariableDeclarator[]): VariableDeclaration {
46
- return new VariableDeclaration(global.generatedEs2panda._UpdateVariableDeclaration(global.context, passNode(original), kind, passNodeArray(declarators), declarators.length))
51
+ return new VariableDeclaration(global.generatedEs2panda._UpdateVariableDeclaration(global.context, passNode(original), kind, passNodeArray(declarators), declarators.length)).updateChildren()
47
52
  }
48
53
  get declarators(): readonly VariableDeclarator[] {
49
- return unpackNodeArray(global.generatedEs2panda._VariableDeclarationDeclaratorsConst(global.context, this.peer))
54
+ return unpackNodeArray(global.generatedEs2panda._VariableDeclarationDeclarators(global.context, this.peer))
55
+ }
56
+ get declaratorsForUpdate(): readonly VariableDeclarator[] {
57
+ return unpackNodeArray(global.generatedEs2panda._VariableDeclarationDeclaratorsForUpdate(global.context, this.peer))
50
58
  }
51
59
  get kind(): Es2pandaVariableDeclarationKind {
52
60
  return global.generatedEs2panda._VariableDeclarationKindConst(global.context, this.peer)
53
61
  }
54
62
  get decorators(): readonly Decorator[] {
55
- return unpackNodeArray(global.generatedEs2panda._VariableDeclarationDecoratorsConst(global.context, this.peer))
63
+ return unpackNodeArray(global.generatedEs2panda._VariableDeclarationDecorators(global.context, this.peer))
64
+ }
65
+ get decoratorsForUpdate(): readonly Decorator[] {
66
+ return unpackNodeArray(global.generatedEs2panda._VariableDeclarationDecoratorsForUpdate(global.context, this.peer))
67
+ }
68
+ /** @deprecated */
69
+ emplaceAnnotations(source?: AnnotationUsage): this {
70
+ global.generatedEs2panda._VariableDeclarationEmplaceAnnotations(global.context, this.peer, passNode(source))
71
+ return this
72
+ }
73
+ /** @deprecated */
74
+ clearAnnotations(): this {
75
+ global.generatedEs2panda._VariableDeclarationClearAnnotations(global.context, this.peer)
76
+ return this
77
+ }
78
+ /** @deprecated */
79
+ setValueAnnotations(source: AnnotationUsage | undefined, index: number): this {
80
+ global.generatedEs2panda._VariableDeclarationSetValueAnnotations(global.context, this.peer, passNode(source), index)
81
+ return this
82
+ }
83
+ get annotationsForUpdate(): readonly AnnotationUsage[] {
84
+ return unpackNodeArray(global.generatedEs2panda._VariableDeclarationAnnotationsForUpdate(global.context, this.peer))
56
85
  }
57
86
  get annotations(): readonly AnnotationUsage[] {
58
87
  return unpackNodeArray(global.generatedEs2panda._VariableDeclarationAnnotations(global.context, this.peer))
59
88
  }
60
89
  /** @deprecated */
61
- setAnnotations(annotations: readonly AnnotationUsage[]): this {
62
- global.generatedEs2panda._VariableDeclarationSetAnnotations(global.context, this.peer, passNodeArray(annotations), annotations.length)
90
+ setAnnotations(annotationList: readonly AnnotationUsage[]): this {
91
+ global.generatedEs2panda._VariableDeclarationSetAnnotations(global.context, this.peer, passNodeArray(annotationList), annotationList.length)
63
92
  return this
64
93
  }
94
+ /** @deprecated */
95
+ setAnnotations1(annotationList: readonly AnnotationUsage[]): this {
96
+ global.generatedEs2panda._VariableDeclarationSetAnnotations1(global.context, this.peer, passNodeArray(annotationList), annotationList.length)
97
+ return this
98
+ }
99
+ /** @deprecated */
100
+ addAnnotations(annotations?: AnnotationUsage): this {
101
+ global.generatedEs2panda._VariableDeclarationAddAnnotations(global.context, this.peer, passNode(annotations))
102
+ return this
103
+ }
104
+ protected readonly brandVariableDeclaration: undefined
65
105
  }
66
106
  export function isVariableDeclaration(node: object | undefined): node is VariableDeclaration {
67
107
  return node instanceof VariableDeclaration
68
108
  }
69
109
  if (!nodeByType.has(Es2pandaAstNodeType.AST_NODE_TYPE_VARIABLE_DECLARATION)) {
70
110
  nodeByType.set(Es2pandaAstNodeType.AST_NODE_TYPE_VARIABLE_DECLARATION, (peer: KNativePointer) => new VariableDeclaration(peer))
71
- }
111
+ }
@@ -13,6 +13,10 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ /*
17
+ * THIS FILE IS AUTOGENERATED BY arktscgen. DO NOT EDIT MANUALLY!
18
+ */
19
+
16
20
  import {
17
21
  global,
18
22
  passNode,
@@ -32,19 +36,20 @@ import { Es2pandaAstNodeType } from "./../Es2pandaEnums"
32
36
  import { Es2pandaVariableDeclaratorFlag } from "./../Es2pandaEnums"
33
37
  import { Expression } from "./Expression"
34
38
  import { TypedStatement } from "./TypedStatement"
39
+
35
40
  export class VariableDeclarator extends TypedStatement {
36
41
  constructor(pointer: KNativePointer) {
37
- assertValidPeer(pointer, 150)
42
+ assertValidPeer(pointer, 151)
38
43
  super(pointer)
39
44
  }
40
45
  static create1VariableDeclarator(flag: Es2pandaVariableDeclaratorFlag, ident?: Expression, init?: Expression): VariableDeclarator {
41
- return new VariableDeclarator(global.generatedEs2panda._CreateVariableDeclarator1(global.context, flag, passNode(ident), passNode(init)))
46
+ return new VariableDeclarator(global.generatedEs2panda._CreateVariableDeclarator1(global.context, flag, passNode(ident), passNode(init))).updateChildren()
42
47
  }
43
48
  static updateVariableDeclarator(original: VariableDeclarator | undefined, flag: Es2pandaVariableDeclaratorFlag, ident?: Expression): VariableDeclarator {
44
- return new VariableDeclarator(global.generatedEs2panda._UpdateVariableDeclarator(global.context, passNode(original), flag, passNode(ident)))
49
+ return new VariableDeclarator(global.generatedEs2panda._UpdateVariableDeclarator(global.context, passNode(original), flag, passNode(ident))).updateChildren()
45
50
  }
46
51
  static update1VariableDeclarator(original: VariableDeclarator | undefined, flag: Es2pandaVariableDeclaratorFlag, ident?: Expression, init?: Expression): VariableDeclarator {
47
- return new VariableDeclarator(global.generatedEs2panda._UpdateVariableDeclarator1(global.context, passNode(original), flag, passNode(ident), passNode(init)))
52
+ return new VariableDeclarator(global.generatedEs2panda._UpdateVariableDeclarator1(global.context, passNode(original), flag, passNode(ident), passNode(init))).updateChildren()
48
53
  }
49
54
  get init(): Expression | undefined {
50
55
  return unpackNode(global.generatedEs2panda._VariableDeclaratorInit(global.context, this.peer))
@@ -60,10 +65,11 @@ export class VariableDeclarator extends TypedStatement {
60
65
  get flag(): Es2pandaVariableDeclaratorFlag {
61
66
  return global.generatedEs2panda._VariableDeclaratorFlag(global.context, this.peer)
62
67
  }
68
+ protected readonly brandVariableDeclarator: undefined
63
69
  }
64
70
  export function isVariableDeclarator(node: object | undefined): node is VariableDeclarator {
65
71
  return node instanceof VariableDeclarator
66
72
  }
67
73
  if (!nodeByType.has(Es2pandaAstNodeType.AST_NODE_TYPE_VARIABLE_DECLARATOR)) {
68
74
  nodeByType.set(Es2pandaAstNodeType.AST_NODE_TYPE_VARIABLE_DECLARATOR, (peer: KNativePointer) => new VariableDeclarator(peer))
69
- }
75
+ }
@@ -13,6 +13,10 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ /*
17
+ * THIS FILE IS AUTOGENERATED BY arktscgen. DO NOT EDIT MANUALLY!
18
+ */
19
+
16
20
  import {
17
21
  global,
18
22
  passNode,
@@ -28,8 +32,10 @@ import {
28
32
  unpackString
29
33
  } from "../../reexport-for-generated"
30
34
 
35
+
31
36
  export class VerificationContext extends ArktsObject {
32
37
  constructor(pointer: KNativePointer) {
33
38
  super(pointer)
34
39
  }
35
- }
40
+ protected readonly brandVerificationContext: undefined
41
+ }
@@ -13,6 +13,10 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ /*
17
+ * THIS FILE IS AUTOGENERATED BY arktscgen. DO NOT EDIT MANUALLY!
18
+ */
19
+
16
20
  import {
17
21
  global,
18
22
  passNode,
@@ -28,8 +32,10 @@ import {
28
32
  unpackString
29
33
  } from "../../reexport-for-generated"
30
34
 
35
+
31
36
  export class VerifierMessage extends ArktsObject {
32
37
  constructor(pointer: KNativePointer) {
33
38
  super(pointer)
34
39
  }
35
- }
40
+ protected readonly brandVerifierMessage: undefined
41
+ }
@@ -13,6 +13,10 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ /*
17
+ * THIS FILE IS AUTOGENERATED BY arktscgen. DO NOT EDIT MANUALLY!
18
+ */
19
+
16
20
  import {
17
21
  global,
18
22
  passNode,
@@ -32,27 +36,34 @@ import { Es2pandaAstNodeType } from "./../Es2pandaEnums"
32
36
  import { Expression } from "./Expression"
33
37
  import { LoopStatement } from "./LoopStatement"
34
38
  import { Statement } from "./Statement"
39
+
35
40
  export class WhileStatement extends LoopStatement {
36
41
  constructor(pointer: KNativePointer) {
37
- assertValidPeer(pointer, 151)
42
+ assertValidPeer(pointer, 152)
38
43
  super(pointer)
39
44
  }
40
45
  static createWhileStatement(test?: Expression, body?: Statement): WhileStatement {
41
- return new WhileStatement(global.generatedEs2panda._CreateWhileStatement(global.context, passNode(test), passNode(body)))
46
+ return new WhileStatement(global.generatedEs2panda._CreateWhileStatement(global.context, passNode(test), passNode(body))).updateChildren()
42
47
  }
43
48
  static updateWhileStatement(original?: WhileStatement, test?: Expression, body?: Statement): WhileStatement {
44
- return new WhileStatement(global.generatedEs2panda._UpdateWhileStatement(global.context, passNode(original), passNode(test), passNode(body)))
49
+ return new WhileStatement(global.generatedEs2panda._UpdateWhileStatement(global.context, passNode(original), passNode(test), passNode(body))).updateChildren()
45
50
  }
46
51
  get test(): Expression | undefined {
47
52
  return unpackNode(global.generatedEs2panda._WhileStatementTest(global.context, this.peer))
48
53
  }
54
+ /** @deprecated */
55
+ setTest(test?: Expression): this {
56
+ global.generatedEs2panda._WhileStatementSetTest(global.context, this.peer, passNode(test))
57
+ return this
58
+ }
49
59
  get body(): Statement | undefined {
50
60
  return unpackNode(global.generatedEs2panda._WhileStatementBody(global.context, this.peer))
51
61
  }
62
+ protected readonly brandWhileStatement: undefined
52
63
  }
53
64
  export function isWhileStatement(node: object | undefined): node is WhileStatement {
54
65
  return node instanceof WhileStatement
55
66
  }
56
67
  if (!nodeByType.has(Es2pandaAstNodeType.AST_NODE_TYPE_WHILE_STATEMENT)) {
57
68
  nodeByType.set(Es2pandaAstNodeType.AST_NODE_TYPE_WHILE_STATEMENT, (peer: KNativePointer) => new WhileStatement(peer))
58
- }
69
+ }
@@ -13,6 +13,10 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ /*
17
+ * THIS FILE IS AUTOGENERATED BY arktscgen. DO NOT EDIT MANUALLY!
18
+ */
19
+
16
20
  import {
17
21
  global,
18
22
  passNode,
@@ -30,16 +34,17 @@ import {
30
34
 
31
35
  import { Es2pandaAstNodeType } from "./../Es2pandaEnums"
32
36
  import { Expression } from "./Expression"
37
+
33
38
  export class YieldExpression extends Expression {
34
39
  constructor(pointer: KNativePointer) {
35
- assertValidPeer(pointer, 152)
40
+ assertValidPeer(pointer, 153)
36
41
  super(pointer)
37
42
  }
38
43
  static createYieldExpression(argument: Expression | undefined, isDelegate: boolean): YieldExpression {
39
- return new YieldExpression(global.generatedEs2panda._CreateYieldExpression(global.context, passNode(argument), isDelegate))
44
+ return new YieldExpression(global.generatedEs2panda._CreateYieldExpression(global.context, passNode(argument), isDelegate)).updateChildren()
40
45
  }
41
46
  static updateYieldExpression(original: YieldExpression | undefined, argument: Expression | undefined, isDelegate: boolean): YieldExpression {
42
- return new YieldExpression(global.generatedEs2panda._UpdateYieldExpression(global.context, passNode(original), passNode(argument), isDelegate))
47
+ return new YieldExpression(global.generatedEs2panda._UpdateYieldExpression(global.context, passNode(original), passNode(argument), isDelegate)).updateChildren()
43
48
  }
44
49
  get hasDelegate(): boolean {
45
50
  return global.generatedEs2panda._YieldExpressionHasDelegateConst(global.context, this.peer)
@@ -47,10 +52,11 @@ export class YieldExpression extends Expression {
47
52
  get argument(): Expression | undefined {
48
53
  return unpackNode(global.generatedEs2panda._YieldExpressionArgumentConst(global.context, this.peer))
49
54
  }
55
+ protected readonly brandYieldExpression: undefined
50
56
  }
51
57
  export function isYieldExpression(node: object | undefined): node is YieldExpression {
52
58
  return node instanceof YieldExpression
53
59
  }
54
60
  if (!nodeByType.has(Es2pandaAstNodeType.AST_NODE_TYPE_YIELD_EXPRESSION)) {
55
61
  nodeByType.set(Es2pandaAstNodeType.AST_NODE_TYPE_YIELD_EXPRESSION, (peer: KNativePointer) => new YieldExpression(peer))
56
- }
62
+ }
@@ -13,6 +13,7 @@
13
13
  * limitations under the License.
14
14
  */
15
15
 
16
+ export * from "./checkSdk"
16
17
  export * from "./utils"
17
18
  export * from "./reexport-for-generated"
18
19
  export * from "./generated/Es2pandaEnums"
@@ -23,13 +24,24 @@ export * from "./arkts-api/utilities/public"
23
24
  export * from "./arkts-api/factory/nodeFactory"
24
25
  export * from "./arkts-api/visitor"
25
26
  export * from "./arkts-api/AbstractVisitor"
27
+ export * from "./arkts-api/ChainExpressionFilter"
26
28
  export * from "./arkts-api/CheckedBackFilter"
29
+ export * from "./arkts-api/CompileWithCache"
27
30
  export * from "./arkts-api/SetBaseOverloads"
28
31
  export * from "./arkts-api/plugins"
32
+ export * from "./arkts-api/ImportStorage"
33
+ export * from "./arkts-api/InferVoidReturnType"
34
+ export * from "./arkts-api/ProgramProvider"
35
+ export * from "./arkts-api/node-utilities/Program"
36
+ export * from "./arkts-api/node-utilities/ArkTsConfig"
29
37
 
30
38
  export * from "./arkts-api/peers/AstNode"
31
39
  export * from "./arkts-api/peers/Config"
32
40
  export * from "./arkts-api/peers/Context"
33
- export * from "./arkts-api/peers/Program"
41
+ export * from "./arkts-api/peers/ExternalSource"
34
42
  export * from "./arkts-api/peers/ImportPathManager"
43
+ export * from "./arkts-api/peers/Options"
35
44
  export { global as arktsGlobal } from "./arkts-api/static/global"
45
+ export * as arkts from "./arkts-api"
46
+
47
+ export * from "./plugin-utils"
@@ -0,0 +1,117 @@
1
+ /*
2
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+
16
+ import {
17
+ Es2pandaContextState,
18
+ PluginContext,
19
+ ImportStorage,
20
+ setBaseOverloads,
21
+ arktsGlobal,
22
+ ChainExpressionFilter,
23
+ ProgramTransformer,
24
+ Program,
25
+ inferVoidReturnType,
26
+ ProgramProvider,
27
+ CompilationOptions
28
+ } from "./arkts-api"
29
+ import { AstNode } from "./reexport-for-generated"
30
+
31
+ export interface RunTransformerHooks {
32
+ onProgramTransformStart?(options: CompilationOptions): void
33
+ onProgramTransformEnd?(options: CompilationOptions): void
34
+ }
35
+
36
+ class ASTCache {
37
+ processedPrograms = new Set<string>()
38
+ constructor() { }
39
+ find(program: Program): boolean {
40
+ return this.processedPrograms.has(program.absoluteName)
41
+ }
42
+ update(program: Program) {
43
+ this.processedPrograms.add(program.absoluteName)
44
+ }
45
+ }
46
+
47
+ export function runTransformerOnProgram(program: Program, options: CompilationOptions, transform: ProgramTransformer | undefined, pluginContext: PluginContext, hooks: RunTransformerHooks = {}) {
48
+ // Perform some additional actions before the transformation start
49
+ hooks.onProgramTransformStart?.(options)
50
+
51
+ // AST to be transformed
52
+ const ast = program.ast
53
+
54
+ // Save currently existing imports in the program
55
+ const importStorage = new ImportStorage(program, options.stage == Es2pandaContextState.ES2PANDA_STATE_PARSED)
56
+
57
+ // Run some common plugins that should be run before plugin usage and depends on the current stage
58
+ stageSpecificPreFilters(ast, options.stage)
59
+
60
+ // Run the plugin itself
61
+ transform?.(program, options, pluginContext)
62
+
63
+ // Run some common plugins that should be run after plugin usage and depends on the current stage
64
+ stageSpecificPostFilters(ast, options.stage)
65
+
66
+ // For oveloads, set additional pointer to base overload to fix AST
67
+ setBaseOverloads(ast)
68
+
69
+ // Update internal import information based on import modification by plugin
70
+ importStorage.update()
71
+
72
+ // Perform some additional actions after the transformation end
73
+ hooks.onProgramTransformEnd?.(options)
74
+ }
75
+
76
+ export function runTransformer(prog: Program, state: Es2pandaContextState, restart: boolean, transform: ProgramTransformer | undefined, pluginContext: PluginContext, hooks: RunTransformerHooks = {}) {
77
+ // Program provider used to provide programs to transformer dynamically relative to inserted imports
78
+ const provider = new ProgramProvider(prog)
79
+
80
+ // The first program provided by program provider is the main program
81
+ let currentProgram = provider.next()
82
+ let isMainProgram = true
83
+
84
+ while (currentProgram) {
85
+ // Options passed to plugin and hooks
86
+ const options: CompilationOptions = {
87
+ isMainProgram,
88
+ stage: state,
89
+ restart,
90
+ }
91
+
92
+ runTransformerOnProgram(currentProgram, options, transform, pluginContext, hooks)
93
+
94
+ // The first program is always the main program, so break here if should not proceed external sources
95
+ if (restart) break
96
+ isMainProgram = false
97
+
98
+ // Proceed to the next program
99
+ currentProgram = provider.next()
100
+ }
101
+ }
102
+
103
+ function setAllParents(ast: AstNode) {
104
+ arktsGlobal.es2panda._AstNodeUpdateAll(arktsGlobal.context, ast.peer)
105
+ }
106
+
107
+ function stageSpecificPreFilters(script: AstNode, state: Es2pandaContextState) {
108
+ if (state == Es2pandaContextState.ES2PANDA_STATE_CHECKED) {
109
+ inferVoidReturnType(script)
110
+ }
111
+ }
112
+
113
+ function stageSpecificPostFilters(script: AstNode, state: Es2pandaContextState) {
114
+ if (state == Es2pandaContextState.ES2PANDA_STATE_CHECKED) {
115
+ new ChainExpressionFilter().visitor(script)
116
+ }
117
+ }
@@ -271,7 +271,9 @@ function fixDuplicateSettersInInterfaces(code: string): string {
271
271
  }
272
272
 
273
273
  function excludePartialInterfaces(code: string): string {
274
- return code.replaceAll(/interface (.*)\$partial<>([\s\S]*?)}/g, '')
274
+ return code
275
+ .replaceAll(/export interface (.*)\$partial<>([\s\S]*?)}/g, '')
276
+ .replaceAll(/interface (.*)\$partial<>([\s\S]*?)}/g, '')
275
277
  }
276
278
 
277
279
  function fixNamespace(code: string) {
@@ -281,11 +283,16 @@ function fixNamespace(code: string) {
281
283
 
282
284
  we have only one such place, so fix manually
283
285
  */
284
- code = code.replaceAll(/export (declare )?abstract class (Profiler|GestureControl|text|common2D) {/g, `export $1 namespace $2 {`)
286
+ code = code.replaceAll(/export (declare )?abstract class (Profiler|GestureControl|text|common2D|common|observer|unifiedDataChannel|uniformTypeDescriptor|drawing|uiEffect|intl|matrix4|image|pointer|promptAction|webview|window) {/g, `export $1 namespace $2 {`)
285
287
  code = code.replaceAll(`public static _$init$_() {}`, ``)
286
- code = code.replaceAll(`public static _$initializerBlockInit$_() {}`, ``)
288
+ code = code.replaceAll(`public static _$init$_(): void {}`, ``)
289
+ code = code.replaceAll(/.*_\$initializerBlockInit\$_.*/g, ``)
287
290
  code = code.replaceAll(/public static ((?:un)?registerVsyncCallback)/g, "export function $1")
288
-
291
+ code = code.replaceAll(/public static (setCursor)/g, "export function $1")
292
+ code = code.replaceAll(/public static (restoreDefault)/g, "export function $1")
293
+ code = code.replaceAll(/public static (requestFocus\(value)/g, "export function $1")
294
+ code = code.replaceAll(/public static (getSystemFontFullNamesByType|getFontDescriptorByFullName|matchFontDescriptors|createEffect|createBrightnessBlender)/g, "export function $1")
295
+ code = code.replaceAll('\n type Blender =', '\n export type Blender = ')
289
296
  return code
290
297
  }
291
298
 
@@ -327,28 +334,6 @@ function fixEnums(code: string) {
327
334
  return code
328
335
  }
329
336
 
330
- function fixSwitchCase(code: string) {
331
- const lines = code.split('\n')
332
- // assume good formatting on start, return also good formatting (spaces on line beginnings)
333
- const spacesStack = []
334
- for (var i = 1; i < lines.length; i++) {
335
- if (lines[i].trimStart().startsWith('case ') || lines[i].trimStart().startsWith('default:')) {
336
- if (lines[i - 1].trimStart().startsWith('switch')) {
337
- spacesStack.push(lines[i - 1].indexOf('s'))
338
- lines[i] = lines[i] + ` {`
339
- } else {
340
- const indent = ` `.repeat(spacesStack[spacesStack.length - 1] + 2)
341
- lines[i] = indent + `}\n` + indent + lines[i].trimStart() + ` {`
342
- }
343
- }
344
- else if (spacesStack.length && lines[i].trimStart().startsWith('}') && lines[i].indexOf('}') <= spacesStack[spacesStack.length - 1]) {
345
- lines[i] = ` `.repeat(spacesStack[spacesStack.length - 1]) + `} ` + lines[i].trimStart()
346
- spacesStack.pop()
347
- }
348
- }
349
- return lines.join('\n')
350
- }
351
-
352
337
  /*
353
338
  TODO:
354
339
  The lowerings insert %% and other special symbols into names of temporary variables.
@@ -372,10 +357,14 @@ export function filterSource(text: string): string {
372
357
  (code: string) => code.replaceAll("<cctor>", "_cctor_"),
373
358
  (code: string) => code.replaceAll("public constructor() {}", ""),
374
359
  (code: string) => code.replaceAll("@Module()", ""),
375
- fixPropertyLines,
376
- fixSwitchCase,
360
+ (code: string) => code.replaceAll("export * as from", "export * from"),
361
+ fixPropertyLines
377
362
  ]
378
363
  // console.error("====")
379
364
  // console.error(dumperUnwrappers.reduceRight((code, f) => f(code), text).split('\n').map((it, index) => `${`${index + 1}`.padStart(4)} |${it}`).join('\n'))
380
365
  return dumperUnwrappers.reduceRight((code, f) => f(code), text)
381
366
  }
367
+
368
+ export function getEnumName(enumType: any, value: number): string | undefined {
369
+ return enumType[value];
370
+ }
@@ -0,0 +1,16 @@
1
+ # koala-wrapper compatibility layer
2
+
3
+ THE CONTENT OF THIS FOLDER WILL BE REMOVED SOON, DO NOT MAKE ANY CHNGES HERE
4
+
5
+ > Synced from commit `9a450680e6d84afa55edb0bbc356a0d31824da16`
6
+ >
7
+ > _!4864 customdialog
8
+ Merge pull request !4864 from lishihao/customdialog_
9
+
10
+ ## How to migrate
11
+ For each file in the `./arkts-api`:
12
+ 1. Migrate the necessary changes to the `../src/arkts-api`
13
+ 2. Remove the file
14
+ 3. Add a reexport to the `./arkts-api/index.ts`
15
+
16
+ Once all the sources are be removed we can drop this compatibility layer at all