@idlizer/arktscgen 2.1.2

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 (229) hide show
  1. package/build/libarkts-copy/generator/options.json5 +155 -0
  2. package/build/libarkts-copy/native/meson.build +62 -0
  3. package/build/libarkts-copy/native/meson_options.txt +24 -0
  4. package/build/libarkts-copy/native/src/bridges.cc +265 -0
  5. package/build/libarkts-copy/native/src/common.cc +231 -0
  6. package/build/libarkts-copy/native/src/common.h +39 -0
  7. package/build/libarkts-copy/native/src/generated/bridges.cc +11979 -0
  8. package/build/libarkts-copy/package.json +51 -0
  9. package/build/libarkts-copy/src/Es2pandaEnums.ts +183 -0
  10. package/build/libarkts-copy/src/Es2pandaNativeModule.ts +123 -0
  11. package/build/libarkts-copy/src/InteropNativeModule.ts +50 -0
  12. package/build/libarkts-copy/src/arkts-api/class-by-peer.ts +31 -0
  13. package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +147 -0
  14. package/build/libarkts-copy/src/arkts-api/index.ts +28 -0
  15. package/build/libarkts-copy/src/arkts-api/node-utilities/createCallExpression.ts +40 -0
  16. package/build/libarkts-copy/src/arkts-api/node-utilities/createNumberLiteral.ts +28 -0
  17. package/build/libarkts-copy/src/arkts-api/node-utilities/createScriptFunction.ts +55 -0
  18. package/build/libarkts-copy/src/arkts-api/peers/ArktsObject.ts +45 -0
  19. package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +121 -0
  20. package/build/libarkts-copy/src/arkts-api/peers/Config.ts +52 -0
  21. package/build/libarkts-copy/src/arkts-api/peers/Context.ts +46 -0
  22. package/build/libarkts-copy/src/arkts-api/peers/Program.ts +55 -0
  23. package/build/libarkts-copy/src/arkts-api/static/global.ts +67 -0
  24. package/build/libarkts-copy/src/arkts-api/utilities/nativePtrDecoder.ts +69 -0
  25. package/build/libarkts-copy/src/arkts-api/utilities/private.ts +156 -0
  26. package/build/libarkts-copy/src/arkts-api/utilities/public.ts +135 -0
  27. package/build/libarkts-copy/src/arkts-api/visitor.ts +297 -0
  28. package/build/libarkts-copy/src/es2panda.ts +277 -0
  29. package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +1266 -0
  30. package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +3745 -0
  31. package/build/libarkts-copy/src/generated/factory.ts +1299 -0
  32. package/build/libarkts-copy/src/generated/index.ts +191 -0
  33. package/build/libarkts-copy/src/generated/node-map.ts +182 -0
  34. package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +39 -0
  35. package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +49 -0
  36. package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +40 -0
  37. package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +110 -0
  38. package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +74 -0
  39. package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +98 -0
  40. package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +70 -0
  41. package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +57 -0
  42. package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +95 -0
  43. package/build/libarkts-copy/src/generated/peers/AstDumper.ts +42 -0
  44. package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +53 -0
  45. package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +53 -0
  46. package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +95 -0
  47. package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +64 -0
  48. package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +63 -0
  49. package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +53 -0
  50. package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +65 -0
  51. package/build/libarkts-copy/src/generated/peers/CallExpression.ts +97 -0
  52. package/build/libarkts-copy/src/generated/peers/CatchClause.ts +64 -0
  53. package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +53 -0
  54. package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +50 -0
  55. package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +58 -0
  56. package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +233 -0
  57. package/build/libarkts-copy/src/generated/peers/ClassElement.ts +80 -0
  58. package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +54 -0
  59. package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +70 -0
  60. package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +58 -0
  61. package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +74 -0
  62. package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +65 -0
  63. package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +50 -0
  64. package/build/libarkts-copy/src/generated/peers/Decorator.ts +54 -0
  65. package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +52 -0
  66. package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +58 -0
  67. package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +54 -0
  68. package/build/libarkts-copy/src/generated/peers/ETSDynamicFunctionType.ts +40 -0
  69. package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +84 -0
  70. package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +68 -0
  71. package/build/libarkts-copy/src/generated/peers/ETSLaunchExpression.ts +57 -0
  72. package/build/libarkts-copy/src/generated/peers/ETSModule.ts +71 -0
  73. package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +62 -0
  74. package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +69 -0
  75. package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +60 -0
  76. package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +50 -0
  77. package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +51 -0
  78. package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +126 -0
  79. package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +54 -0
  80. package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +51 -0
  81. package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +51 -0
  82. package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +73 -0
  83. package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +58 -0
  84. package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +68 -0
  85. package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +50 -0
  86. package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +53 -0
  87. package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +55 -0
  88. package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +50 -0
  89. package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +58 -0
  90. package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +56 -0
  91. package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +73 -0
  92. package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +57 -0
  93. package/build/libarkts-copy/src/generated/peers/Expression.ts +75 -0
  94. package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +59 -0
  95. package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +61 -0
  96. package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +64 -0
  97. package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +61 -0
  98. package/build/libarkts-copy/src/generated/peers/FunctionDecl.ts +40 -0
  99. package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +69 -0
  100. package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +64 -0
  101. package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +62 -0
  102. package/build/libarkts-copy/src/generated/peers/Identifier.ts +154 -0
  103. package/build/libarkts-copy/src/generated/peers/IfStatement.ts +65 -0
  104. package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +61 -0
  105. package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +54 -0
  106. package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +53 -0
  107. package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +54 -0
  108. package/build/libarkts-copy/src/generated/peers/ImportSource.ts +49 -0
  109. package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +57 -0
  110. package/build/libarkts-copy/src/generated/peers/InterfaceDecl.ts +40 -0
  111. package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +60 -0
  112. package/build/libarkts-copy/src/generated/peers/Literal.ts +40 -0
  113. package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +40 -0
  114. package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +48 -0
  115. package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +95 -0
  116. package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +54 -0
  117. package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +105 -0
  118. package/build/libarkts-copy/src/generated/peers/NamedType.ts +76 -0
  119. package/build/libarkts-copy/src/generated/peers/NewExpression.ts +56 -0
  120. package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +50 -0
  121. package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +47 -0
  122. package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +90 -0
  123. package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +50 -0
  124. package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +50 -0
  125. package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +57 -0
  126. package/build/libarkts-copy/src/generated/peers/Property.ts +82 -0
  127. package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +57 -0
  128. package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +62 -0
  129. package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +201 -0
  130. package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +53 -0
  131. package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +79 -0
  132. package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +82 -0
  133. package/build/libarkts-copy/src/generated/peers/Statement.ts +39 -0
  134. package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +56 -0
  135. package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +50 -0
  136. package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +62 -0
  137. package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +63 -0
  138. package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +50 -0
  139. package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +53 -0
  140. package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +76 -0
  141. package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +50 -0
  142. package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +50 -0
  143. package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +60 -0
  144. package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +63 -0
  145. package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +65 -0
  146. package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +81 -0
  147. package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +66 -0
  148. package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +53 -0
  149. package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +67 -0
  150. package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +61 -0
  151. package/build/libarkts-copy/src/generated/peers/TSImportType.ts +64 -0
  152. package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +65 -0
  153. package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +56 -0
  154. package/build/libarkts-copy/src/generated/peers/TSInferType.ts +54 -0
  155. package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +53 -0
  156. package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +102 -0
  157. package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +54 -0
  158. package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +54 -0
  159. package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +54 -0
  160. package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +64 -0
  161. package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +71 -0
  162. package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +53 -0
  163. package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +63 -0
  164. package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +60 -0
  165. package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +50 -0
  166. package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +58 -0
  167. package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +50 -0
  168. package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +50 -0
  169. package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +50 -0
  170. package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +66 -0
  171. package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +54 -0
  172. package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +72 -0
  173. package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +63 -0
  174. package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +67 -0
  175. package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +50 -0
  176. package/build/libarkts-copy/src/generated/peers/TSThisType.ts +50 -0
  177. package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +53 -0
  178. package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +88 -0
  179. package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +63 -0
  180. package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +53 -0
  181. package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +63 -0
  182. package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +84 -0
  183. package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +62 -0
  184. package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +54 -0
  185. package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +60 -0
  186. package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +54 -0
  187. package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +62 -0
  188. package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +50 -0
  189. package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +53 -0
  190. package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +50 -0
  191. package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +50 -0
  192. package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +61 -0
  193. package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +59 -0
  194. package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +60 -0
  195. package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +50 -0
  196. package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +54 -0
  197. package/build/libarkts-copy/src/generated/peers/TryStatement.ts +75 -0
  198. package/build/libarkts-copy/src/generated/peers/TypeNode.ts +49 -0
  199. package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +39 -0
  200. package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +40 -0
  201. package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +53 -0
  202. package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +57 -0
  203. package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +50 -0
  204. package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +60 -0
  205. package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +42 -0
  206. package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +71 -0
  207. package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +69 -0
  208. package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +58 -0
  209. package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +56 -0
  210. package/build/libarkts-copy/src/reexport-for-generated.ts +33 -0
  211. package/build/libarkts-copy/src/ts-api/factory/nodeFactory.ts +1375 -0
  212. package/build/libarkts-copy/src/ts-api/factory/nodeTests.ts +110 -0
  213. package/build/libarkts-copy/src/ts-api/index.ts +35 -0
  214. package/build/libarkts-copy/src/ts-api/static/enums.ts +18 -0
  215. package/build/libarkts-copy/src/ts-api/types.ts +920 -0
  216. package/build/libarkts-copy/src/ts-api/utilities/private.ts +289 -0
  217. package/build/libarkts-copy/src/ts-api/utilities/public.ts +55 -0
  218. package/build/libarkts-copy/src/ts-api/visitor/visitor.ts +155 -0
  219. package/build/libarkts-copy/src/utils.ts +89 -0
  220. package/build/libarkts-copy/tsconfig.json +15 -0
  221. package/lib/index.js +11858 -0
  222. package/package.json +54 -0
  223. package/templates/Es2pandaEnums.ts +16 -0
  224. package/templates/Es2pandaNativeModule.ts +32 -0
  225. package/templates/bridges.cc +18 -0
  226. package/templates/factory.ts +34 -0
  227. package/templates/index.ts +16 -0
  228. package/templates/node-map.ts +31 -0
  229. package/templates/peer.ts +32 -0
@@ -0,0 +1,1299 @@
1
+ /*
2
+ * Copyright (c) 2024 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
+ global,
18
+ passNode,
19
+ passNodeArray,
20
+ unpackNonNullableNode,
21
+ unpackNode,
22
+ unpackNodeArray,
23
+ assertValidPeer,
24
+ AstNode,
25
+ Es2pandaAstNodeType,
26
+ KNativePointer,
27
+ nodeByType,
28
+ ArktsObject,
29
+ isSameNativeObject,
30
+ unpackString,
31
+ updateNodeByNode
32
+ } from "../reexport-for-generated"
33
+
34
+ import { AnnotationDeclaration } from "./peers/AnnotationDeclaration"
35
+ import { AnnotationUsage } from "./peers/AnnotationUsage"
36
+ import { ArrowFunctionExpression } from "./peers/ArrowFunctionExpression"
37
+ import { AssertStatement } from "./peers/AssertStatement"
38
+ import { AwaitExpression } from "./peers/AwaitExpression"
39
+ import { BigIntLiteral } from "./peers/BigIntLiteral"
40
+ import { BinaryExpression } from "./peers/BinaryExpression"
41
+ import { BlockExpression } from "./peers/BlockExpression"
42
+ import { BlockStatement } from "./peers/BlockStatement"
43
+ import { BooleanLiteral } from "./peers/BooleanLiteral"
44
+ import { BreakStatement } from "./peers/BreakStatement"
45
+ import { CallExpression } from "./peers/CallExpression"
46
+ import { CatchClause } from "./peers/CatchClause"
47
+ import { ChainExpression } from "./peers/ChainExpression"
48
+ import { CharLiteral } from "./peers/CharLiteral"
49
+ import { ClassDeclaration } from "./peers/ClassDeclaration"
50
+ import { ClassDefinition } from "./peers/ClassDefinition"
51
+ import { ClassExpression } from "./peers/ClassExpression"
52
+ import { ConditionalExpression } from "./peers/ConditionalExpression"
53
+ import { ContinueStatement } from "./peers/ContinueStatement"
54
+ import { DebuggerStatement } from "./peers/DebuggerStatement"
55
+ import { Decorator } from "./peers/Decorator"
56
+ import { DoWhileStatement } from "./peers/DoWhileStatement"
57
+ import { ETSClassLiteral } from "./peers/ETSClassLiteral"
58
+ import { ETSLaunchExpression } from "./peers/ETSLaunchExpression"
59
+ import { ETSNewArrayInstanceExpression } from "./peers/ETSNewArrayInstanceExpression"
60
+ import { ETSNewClassInstanceExpression } from "./peers/ETSNewClassInstanceExpression"
61
+ import { ETSNewMultiDimArrayInstanceExpression } from "./peers/ETSNewMultiDimArrayInstanceExpression"
62
+ import { ETSNullType } from "./peers/ETSNullType"
63
+ import { ETSPrimitiveType } from "./peers/ETSPrimitiveType"
64
+ import { ETSTypeReference } from "./peers/ETSTypeReference"
65
+ import { ETSTypeReferencePart } from "./peers/ETSTypeReferencePart"
66
+ import { ETSUndefinedType } from "./peers/ETSUndefinedType"
67
+ import { ETSUnionType } from "./peers/ETSUnionType"
68
+ import { EmptyStatement } from "./peers/EmptyStatement"
69
+ import { Es2pandaMetaPropertyKind } from "./Es2pandaEnums"
70
+ import { Es2pandaPrimitiveType } from "./Es2pandaEnums"
71
+ import { Es2pandaPropertyKind } from "./Es2pandaEnums"
72
+ import { Es2pandaTokenType } from "./Es2pandaEnums"
73
+ import { Es2pandaVariableDeclarationKind } from "./Es2pandaEnums"
74
+ import { ExportAllDeclaration } from "./peers/ExportAllDeclaration"
75
+ import { ExportDefaultDeclaration } from "./peers/ExportDefaultDeclaration"
76
+ import { ExportSpecifier } from "./peers/ExportSpecifier"
77
+ import { Expression } from "./peers/Expression"
78
+ import { ExpressionStatement } from "./peers/ExpressionStatement"
79
+ import { ForInStatement } from "./peers/ForInStatement"
80
+ import { ForOfStatement } from "./peers/ForOfStatement"
81
+ import { ForUpdateStatement } from "./peers/ForUpdateStatement"
82
+ import { FunctionDeclaration } from "./peers/FunctionDeclaration"
83
+ import { FunctionExpression } from "./peers/FunctionExpression"
84
+ import { FunctionSignature } from "./peers/FunctionSignature"
85
+ import { Identifier } from "./peers/Identifier"
86
+ import { IfStatement } from "./peers/IfStatement"
87
+ import { ImportDefaultSpecifier } from "./peers/ImportDefaultSpecifier"
88
+ import { ImportExpression } from "./peers/ImportExpression"
89
+ import { ImportNamespaceSpecifier } from "./peers/ImportNamespaceSpecifier"
90
+ import { ImportSource } from "./peers/ImportSource"
91
+ import { ImportSpecifier } from "./peers/ImportSpecifier"
92
+ import { LabelledStatement } from "./peers/LabelledStatement"
93
+ import { MetaProperty } from "./peers/MetaProperty"
94
+ import { NamedType } from "./peers/NamedType"
95
+ import { NewExpression } from "./peers/NewExpression"
96
+ import { NullLiteral } from "./peers/NullLiteral"
97
+ import { OmittedExpression } from "./peers/OmittedExpression"
98
+ import { OpaqueTypeNode } from "./peers/OpaqueTypeNode"
99
+ import { PrefixAssertionExpression } from "./peers/PrefixAssertionExpression"
100
+ import { Property } from "./peers/Property"
101
+ import { ReturnStatement } from "./peers/ReturnStatement"
102
+ import { ScriptFunction } from "./peers/ScriptFunction"
103
+ import { SequenceExpression } from "./peers/SequenceExpression"
104
+ import { Statement } from "./peers/Statement"
105
+ import { StringLiteral } from "./peers/StringLiteral"
106
+ import { SuperExpression } from "./peers/SuperExpression"
107
+ import { SwitchCaseStatement } from "./peers/SwitchCaseStatement"
108
+ import { SwitchStatement } from "./peers/SwitchStatement"
109
+ import { TSAnyKeyword } from "./peers/TSAnyKeyword"
110
+ import { TSArrayType } from "./peers/TSArrayType"
111
+ import { TSAsExpression } from "./peers/TSAsExpression"
112
+ import { TSBigintKeyword } from "./peers/TSBigintKeyword"
113
+ import { TSBooleanKeyword } from "./peers/TSBooleanKeyword"
114
+ import { TSClassImplements } from "./peers/TSClassImplements"
115
+ import { TSConditionalType } from "./peers/TSConditionalType"
116
+ import { TSEnumMember } from "./peers/TSEnumMember"
117
+ import { TSExternalModuleReference } from "./peers/TSExternalModuleReference"
118
+ import { TSImportEqualsDeclaration } from "./peers/TSImportEqualsDeclaration"
119
+ import { TSImportType } from "./peers/TSImportType"
120
+ import { TSIndexSignature } from "./peers/TSIndexSignature"
121
+ import { TSIndexedAccessType } from "./peers/TSIndexedAccessType"
122
+ import { TSInferType } from "./peers/TSInferType"
123
+ import { TSInterfaceBody } from "./peers/TSInterfaceBody"
124
+ import { TSInterfaceHeritage } from "./peers/TSInterfaceHeritage"
125
+ import { TSIntersectionType } from "./peers/TSIntersectionType"
126
+ import { TSLiteralType } from "./peers/TSLiteralType"
127
+ import { TSModuleBlock } from "./peers/TSModuleBlock"
128
+ import { TSNamedTupleMember } from "./peers/TSNamedTupleMember"
129
+ import { TSNeverKeyword } from "./peers/TSNeverKeyword"
130
+ import { TSNonNullExpression } from "./peers/TSNonNullExpression"
131
+ import { TSNullKeyword } from "./peers/TSNullKeyword"
132
+ import { TSNumberKeyword } from "./peers/TSNumberKeyword"
133
+ import { TSObjectKeyword } from "./peers/TSObjectKeyword"
134
+ import { TSQualifiedName } from "./peers/TSQualifiedName"
135
+ import { TSStringKeyword } from "./peers/TSStringKeyword"
136
+ import { TSThisType } from "./peers/TSThisType"
137
+ import { TSTupleType } from "./peers/TSTupleType"
138
+ import { TSTypeAliasDeclaration } from "./peers/TSTypeAliasDeclaration"
139
+ import { TSTypeAssertion } from "./peers/TSTypeAssertion"
140
+ import { TSTypeLiteral } from "./peers/TSTypeLiteral"
141
+ import { TSTypeParameter } from "./peers/TSTypeParameter"
142
+ import { TSTypeParameterDeclaration } from "./peers/TSTypeParameterDeclaration"
143
+ import { TSTypeParameterInstantiation } from "./peers/TSTypeParameterInstantiation"
144
+ import { TSTypePredicate } from "./peers/TSTypePredicate"
145
+ import { TSTypeQuery } from "./peers/TSTypeQuery"
146
+ import { TSTypeReference } from "./peers/TSTypeReference"
147
+ import { TSUndefinedKeyword } from "./peers/TSUndefinedKeyword"
148
+ import { TSUnionType } from "./peers/TSUnionType"
149
+ import { TSUnknownKeyword } from "./peers/TSUnknownKeyword"
150
+ import { TSVoidKeyword } from "./peers/TSVoidKeyword"
151
+ import { TaggedTemplateExpression } from "./peers/TaggedTemplateExpression"
152
+ import { TemplateElement } from "./peers/TemplateElement"
153
+ import { TemplateLiteral } from "./peers/TemplateLiteral"
154
+ import { ThisExpression } from "./peers/ThisExpression"
155
+ import { ThrowStatement } from "./peers/ThrowStatement"
156
+ import { TypeNode } from "./peers/TypeNode"
157
+ import { TypeofExpression } from "./peers/TypeofExpression"
158
+ import { UnaryExpression } from "./peers/UnaryExpression"
159
+ import { UndefinedLiteral } from "./peers/UndefinedLiteral"
160
+ import { UpdateExpression } from "./peers/UpdateExpression"
161
+ import { ValidationInfo } from "./peers/ValidationInfo"
162
+ import { VariableDeclaration } from "./peers/VariableDeclaration"
163
+ import { VariableDeclarator } from "./peers/VariableDeclarator"
164
+ import { WhileStatement } from "./peers/WhileStatement"
165
+ import { YieldExpression } from "./peers/YieldExpression"
166
+ export const factory = {
167
+ createLabelledStatement(ident?: Identifier, body?: Statement): LabelledStatement {
168
+ return LabelledStatement.createLabelledStatement(ident, body)
169
+ }
170
+ ,
171
+ updateLabelledStatement(original: LabelledStatement, ident?: Identifier, body?: Statement): LabelledStatement {
172
+ if (isSameNativeObject(ident, original.ident) && isSameNativeObject(body, original.body))
173
+ return original
174
+ return updateNodeByNode(LabelledStatement.createLabelledStatement(ident, body), original)
175
+ }
176
+ ,
177
+ createThrowStatement(argument?: Expression): ThrowStatement {
178
+ return ThrowStatement.createThrowStatement(argument)
179
+ }
180
+ ,
181
+ updateThrowStatement(original: ThrowStatement, argument?: Expression): ThrowStatement {
182
+ if (isSameNativeObject(argument, original.argument))
183
+ return original
184
+ return updateNodeByNode(ThrowStatement.createThrowStatement(argument), original)
185
+ }
186
+ ,
187
+ createTSVoidKeyword(): TSVoidKeyword {
188
+ return TSVoidKeyword.createTSVoidKeyword()
189
+ }
190
+ ,
191
+ updateTSVoidKeyword(original: TSVoidKeyword): TSVoidKeyword {
192
+ return updateNodeByNode(TSVoidKeyword.createTSVoidKeyword(), original)
193
+ }
194
+ ,
195
+ createIfStatement(test: Expression, consequent: Statement, alternate?: Statement): IfStatement {
196
+ return IfStatement.createIfStatement(test, consequent, alternate)
197
+ }
198
+ ,
199
+ updateIfStatement(original: IfStatement, test: Expression, consequent: Statement, alternate?: Statement): IfStatement {
200
+ if (isSameNativeObject(test, original.test) && isSameNativeObject(consequent, original.consequent) && isSameNativeObject(alternate, original.alternate))
201
+ return original
202
+ return updateNodeByNode(IfStatement.createIfStatement(test, consequent, alternate), original)
203
+ }
204
+ ,
205
+ createDecorator(expr?: Expression): Decorator {
206
+ return Decorator.createDecorator(expr)
207
+ }
208
+ ,
209
+ updateDecorator(original: Decorator, expr?: Expression): Decorator {
210
+ if (isSameNativeObject(expr, original.expr))
211
+ return original
212
+ return updateNodeByNode(Decorator.createDecorator(expr), original)
213
+ }
214
+ ,
215
+ createTSNeverKeyword(): TSNeverKeyword {
216
+ return TSNeverKeyword.createTSNeverKeyword()
217
+ }
218
+ ,
219
+ updateTSNeverKeyword(original: TSNeverKeyword): TSNeverKeyword {
220
+ return updateNodeByNode(TSNeverKeyword.createTSNeverKeyword(), original)
221
+ }
222
+ ,
223
+ createImportDefaultSpecifier(local?: Identifier): ImportDefaultSpecifier {
224
+ return ImportDefaultSpecifier.createImportDefaultSpecifier(local)
225
+ }
226
+ ,
227
+ updateImportDefaultSpecifier(original: ImportDefaultSpecifier, local?: Identifier): ImportDefaultSpecifier {
228
+ if (isSameNativeObject(local, original.local))
229
+ return original
230
+ return updateNodeByNode(ImportDefaultSpecifier.createImportDefaultSpecifier(local), original)
231
+ }
232
+ ,
233
+ createImportSpecifier(imported?: Identifier, local?: Identifier): ImportSpecifier {
234
+ return ImportSpecifier.createImportSpecifier(imported, local)
235
+ }
236
+ ,
237
+ updateImportSpecifier(original: ImportSpecifier, imported?: Identifier, local?: Identifier): ImportSpecifier {
238
+ if (isSameNativeObject(imported, original.imported) && isSameNativeObject(local, original.local))
239
+ return original
240
+ return updateNodeByNode(ImportSpecifier.createImportSpecifier(imported, local), original)
241
+ }
242
+ ,
243
+ createConditionalExpression(test?: Expression, consequent?: Expression, alternate?: Expression): ConditionalExpression {
244
+ return ConditionalExpression.createConditionalExpression(test, consequent, alternate)
245
+ }
246
+ ,
247
+ updateConditionalExpression(original: ConditionalExpression, test?: Expression, consequent?: Expression, alternate?: Expression): ConditionalExpression {
248
+ if (isSameNativeObject(test, original.test) && isSameNativeObject(consequent, original.consequent) && isSameNativeObject(alternate, original.alternate))
249
+ return original
250
+ return updateNodeByNode(ConditionalExpression.createConditionalExpression(test, consequent, alternate), original)
251
+ }
252
+ ,
253
+ createBigIntLiteral(str: string): BigIntLiteral {
254
+ return BigIntLiteral.createBigIntLiteral(str)
255
+ }
256
+ ,
257
+ updateBigIntLiteral(original: BigIntLiteral, str: string): BigIntLiteral {
258
+ if (isSameNativeObject(str, original.str))
259
+ return original
260
+ return updateNodeByNode(BigIntLiteral.createBigIntLiteral(str), original)
261
+ }
262
+ ,
263
+ createTSImportType(param: Expression | undefined, typeParams: TSTypeParameterInstantiation | undefined, qualifier: Expression | undefined, isTypeof: boolean): TSImportType {
264
+ return TSImportType.createTSImportType(param, typeParams, qualifier, isTypeof)
265
+ }
266
+ ,
267
+ updateTSImportType(original: TSImportType, param: Expression | undefined, typeParams: TSTypeParameterInstantiation | undefined, qualifier: Expression | undefined, isTypeof: boolean): TSImportType {
268
+ if (isSameNativeObject(param, original.param) && isSameNativeObject(typeParams, original.typeParams) && isSameNativeObject(qualifier, original.qualifier) && isSameNativeObject(isTypeof, original.isTypeof))
269
+ return original
270
+ return updateNodeByNode(TSImportType.createTSImportType(param, typeParams, qualifier, isTypeof), original)
271
+ }
272
+ ,
273
+ createTaggedTemplateExpression(tag?: Expression, quasi?: TemplateLiteral, typeParams?: TSTypeParameterInstantiation): TaggedTemplateExpression {
274
+ return TaggedTemplateExpression.createTaggedTemplateExpression(tag, quasi, typeParams)
275
+ }
276
+ ,
277
+ updateTaggedTemplateExpression(original: TaggedTemplateExpression, tag?: Expression, quasi?: TemplateLiteral, typeParams?: TSTypeParameterInstantiation): TaggedTemplateExpression {
278
+ if (isSameNativeObject(tag, original.tag) && isSameNativeObject(quasi, original.quasi) && isSameNativeObject(typeParams, original.typeParams))
279
+ return original
280
+ return updateNodeByNode(TaggedTemplateExpression.createTaggedTemplateExpression(tag, quasi, typeParams), original)
281
+ }
282
+ ,
283
+ createFunctionDeclaration(_function: ScriptFunction, annotations: readonly AnnotationUsage[], isAnonymous: boolean): FunctionDeclaration {
284
+ return FunctionDeclaration.createFunctionDeclaration(_function, annotations, isAnonymous)
285
+ }
286
+ ,
287
+ updateFunctionDeclaration(original: FunctionDeclaration, _function: ScriptFunction, annotations: readonly AnnotationUsage[], isAnonymous: boolean): FunctionDeclaration {
288
+ if (isSameNativeObject(_function, original.function) && isSameNativeObject(annotations, original.annotations) && isSameNativeObject(isAnonymous, original.isAnonymous))
289
+ return original
290
+ return updateNodeByNode(FunctionDeclaration.createFunctionDeclaration(_function, annotations, isAnonymous), original)
291
+ }
292
+ ,
293
+ createETSTypeReference(part?: ETSTypeReferencePart): ETSTypeReference {
294
+ return ETSTypeReference.createETSTypeReference(part)
295
+ }
296
+ ,
297
+ updateETSTypeReference(original: ETSTypeReference, part?: ETSTypeReferencePart): ETSTypeReference {
298
+ if (isSameNativeObject(part, original.part))
299
+ return original
300
+ return updateNodeByNode(ETSTypeReference.createETSTypeReference(part), original)
301
+ }
302
+ ,
303
+ createTSTypeReference(typeName?: Expression, typeParams?: TSTypeParameterInstantiation): TSTypeReference {
304
+ return TSTypeReference.createTSTypeReference(typeName, typeParams)
305
+ }
306
+ ,
307
+ updateTSTypeReference(original: TSTypeReference, typeName?: Expression, typeParams?: TSTypeParameterInstantiation): TSTypeReference {
308
+ if (isSameNativeObject(typeName, original.typeName) && isSameNativeObject(typeParams, original.typeParams))
309
+ return original
310
+ return updateNodeByNode(TSTypeReference.createTSTypeReference(typeName, typeParams), original)
311
+ }
312
+ ,
313
+ createImportSource(source: StringLiteral | undefined, resolvedSource: StringLiteral | undefined, hasDecl: boolean): ImportSource {
314
+ return ImportSource.createImportSource(source, resolvedSource, hasDecl)
315
+ }
316
+ ,
317
+ updateImportSource(original: ImportSource, source: StringLiteral | undefined, resolvedSource: StringLiteral | undefined, hasDecl: boolean): ImportSource {
318
+ if (isSameNativeObject(source, original.source) && isSameNativeObject(resolvedSource, original.resolvedSource) && isSameNativeObject(hasDecl, original.hasDecl))
319
+ return original
320
+ return updateNodeByNode(ImportSource.createImportSource(source, resolvedSource, hasDecl), original)
321
+ }
322
+ ,
323
+ createNamedType(name?: Identifier): NamedType {
324
+ return NamedType.createNamedType(name)
325
+ }
326
+ ,
327
+ updateNamedType(original: NamedType, name?: Identifier): NamedType {
328
+ if (isSameNativeObject(name, original.name))
329
+ return original
330
+ return updateNodeByNode(NamedType.createNamedType(name), original)
331
+ }
332
+ ,
333
+ createTemplateElement(raw: string, cooked: string): TemplateElement {
334
+ return TemplateElement.create1TemplateElement(raw, cooked)
335
+ }
336
+ ,
337
+ updateTemplateElement(original: TemplateElement, raw: string, cooked: string): TemplateElement {
338
+ if (isSameNativeObject(raw, original.raw) && isSameNativeObject(cooked, original.cooked))
339
+ return original
340
+ return updateNodeByNode(TemplateElement.create1TemplateElement(raw, cooked), original)
341
+ }
342
+ ,
343
+ createVariableDeclaration(kind: Es2pandaVariableDeclarationKind, declarators: readonly VariableDeclarator[]): VariableDeclaration {
344
+ return VariableDeclaration.createVariableDeclaration(kind, declarators)
345
+ }
346
+ ,
347
+ updateVariableDeclaration(original: VariableDeclaration, kind: Es2pandaVariableDeclarationKind, declarators: readonly VariableDeclarator[]): VariableDeclaration {
348
+ if (isSameNativeObject(kind, original.kind) && isSameNativeObject(declarators, original.declarators))
349
+ return original
350
+ return updateNodeByNode(VariableDeclaration.createVariableDeclaration(kind, declarators), original)
351
+ }
352
+ ,
353
+ createUndefinedLiteral(): UndefinedLiteral {
354
+ return UndefinedLiteral.createUndefinedLiteral()
355
+ }
356
+ ,
357
+ updateUndefinedLiteral(original: UndefinedLiteral): UndefinedLiteral {
358
+ return updateNodeByNode(UndefinedLiteral.createUndefinedLiteral(), original)
359
+ }
360
+ ,
361
+ createTSClassImplements(expr?: Expression, typeParameters?: TSTypeParameterInstantiation): TSClassImplements {
362
+ return TSClassImplements.createTSClassImplements(expr, typeParameters)
363
+ }
364
+ ,
365
+ updateTSClassImplements(original: TSClassImplements, expr?: Expression, typeParameters?: TSTypeParameterInstantiation): TSClassImplements {
366
+ if (isSameNativeObject(expr, original.expr) && isSameNativeObject(typeParameters, original.typeParameters))
367
+ return original
368
+ return updateNodeByNode(TSClassImplements.createTSClassImplements(expr, typeParameters), original)
369
+ }
370
+ ,
371
+ createTSObjectKeyword(): TSObjectKeyword {
372
+ return TSObjectKeyword.createTSObjectKeyword()
373
+ }
374
+ ,
375
+ updateTSObjectKeyword(original: TSObjectKeyword): TSObjectKeyword {
376
+ return updateNodeByNode(TSObjectKeyword.createTSObjectKeyword(), original)
377
+ }
378
+ ,
379
+ createETSUnionType(types: readonly TypeNode[]): ETSUnionType {
380
+ return ETSUnionType.createETSUnionType(types)
381
+ }
382
+ ,
383
+ updateETSUnionType(original: ETSUnionType, types: readonly TypeNode[]): ETSUnionType {
384
+ if (isSameNativeObject(types, original.types))
385
+ return original
386
+ return updateNodeByNode(ETSUnionType.createETSUnionType(types), original)
387
+ }
388
+ ,
389
+ createTSConditionalType(checkType?: Expression, extendsType?: Expression, trueType?: Expression, falseType?: Expression): TSConditionalType {
390
+ return TSConditionalType.createTSConditionalType(checkType, extendsType, trueType, falseType)
391
+ }
392
+ ,
393
+ updateTSConditionalType(original: TSConditionalType, checkType?: Expression, extendsType?: Expression, trueType?: Expression, falseType?: Expression): TSConditionalType {
394
+ if (isSameNativeObject(checkType, original.checkType) && isSameNativeObject(extendsType, original.extendsType) && isSameNativeObject(trueType, original.trueType) && isSameNativeObject(falseType, original.falseType))
395
+ return original
396
+ return updateNodeByNode(TSConditionalType.createTSConditionalType(checkType, extendsType, trueType, falseType), original)
397
+ }
398
+ ,
399
+ createTSLiteralType(literal?: Expression): TSLiteralType {
400
+ return TSLiteralType.createTSLiteralType(literal)
401
+ }
402
+ ,
403
+ updateTSLiteralType(original: TSLiteralType, literal?: Expression): TSLiteralType {
404
+ if (isSameNativeObject(literal, original.literal))
405
+ return original
406
+ return updateNodeByNode(TSLiteralType.createTSLiteralType(literal), original)
407
+ }
408
+ ,
409
+ createTSTypeAliasDeclaration(id?: Identifier, typeParams?: TSTypeParameterDeclaration, typeAnnotation?: TypeNode): TSTypeAliasDeclaration {
410
+ return TSTypeAliasDeclaration.createTSTypeAliasDeclaration(id, typeParams, typeAnnotation)
411
+ }
412
+ ,
413
+ updateTSTypeAliasDeclaration(original: TSTypeAliasDeclaration, id?: Identifier, typeParams?: TSTypeParameterDeclaration, typeAnnotation?: TypeNode): TSTypeAliasDeclaration {
414
+ if (isSameNativeObject(id, original.id) && isSameNativeObject(typeParams, original.typeParams) && isSameNativeObject(typeAnnotation, original.typeAnnotation))
415
+ return original
416
+ return updateNodeByNode(TSTypeAliasDeclaration.createTSTypeAliasDeclaration(id, typeParams, typeAnnotation), original)
417
+ }
418
+ ,
419
+ createDebuggerStatement(): DebuggerStatement {
420
+ return DebuggerStatement.createDebuggerStatement()
421
+ }
422
+ ,
423
+ updateDebuggerStatement(original: DebuggerStatement): DebuggerStatement {
424
+ return updateNodeByNode(DebuggerStatement.createDebuggerStatement(), original)
425
+ }
426
+ ,
427
+ createReturnStatement(argument?: Expression): ReturnStatement {
428
+ return ReturnStatement.create1ReturnStatement(argument)
429
+ }
430
+ ,
431
+ updateReturnStatement(original: ReturnStatement, argument?: Expression): ReturnStatement {
432
+ if (isSameNativeObject(argument, original.argument))
433
+ return original
434
+ return updateNodeByNode(ReturnStatement.create1ReturnStatement(argument), original)
435
+ }
436
+ ,
437
+ createExportDefaultDeclaration(decl: AstNode | undefined, isExportEquals: boolean): ExportDefaultDeclaration {
438
+ return ExportDefaultDeclaration.createExportDefaultDeclaration(decl, isExportEquals)
439
+ }
440
+ ,
441
+ updateExportDefaultDeclaration(original: ExportDefaultDeclaration, decl: AstNode | undefined, isExportEquals: boolean): ExportDefaultDeclaration {
442
+ if (isSameNativeObject(decl, original.decl) && isSameNativeObject(isExportEquals, original.isExportEquals))
443
+ return original
444
+ return updateNodeByNode(ExportDefaultDeclaration.createExportDefaultDeclaration(decl, isExportEquals), original)
445
+ }
446
+ ,
447
+ createTSInterfaceBody(body: readonly AstNode[]): TSInterfaceBody {
448
+ return TSInterfaceBody.createTSInterfaceBody(body)
449
+ }
450
+ ,
451
+ updateTSInterfaceBody(original: TSInterfaceBody, body: readonly AstNode[]): TSInterfaceBody {
452
+ if (isSameNativeObject(body, original.body))
453
+ return original
454
+ return updateNodeByNode(TSInterfaceBody.createTSInterfaceBody(body), original)
455
+ }
456
+ ,
457
+ createTSTypeQuery(exprName?: Expression): TSTypeQuery {
458
+ return TSTypeQuery.createTSTypeQuery(exprName)
459
+ }
460
+ ,
461
+ updateTSTypeQuery(original: TSTypeQuery, exprName?: Expression): TSTypeQuery {
462
+ if (isSameNativeObject(exprName, original.exprName))
463
+ return original
464
+ return updateNodeByNode(TSTypeQuery.createTSTypeQuery(exprName), original)
465
+ }
466
+ ,
467
+ createTSBigintKeyword(): TSBigintKeyword {
468
+ return TSBigintKeyword.createTSBigintKeyword()
469
+ }
470
+ ,
471
+ updateTSBigintKeyword(original: TSBigintKeyword): TSBigintKeyword {
472
+ return updateNodeByNode(TSBigintKeyword.createTSBigintKeyword(), original)
473
+ }
474
+ ,
475
+ createProperty(kind: Es2pandaPropertyKind, key: Expression | undefined, value: Expression | undefined, isMethod: boolean, isComputed: boolean): Property {
476
+ return Property.create1Property(kind, key, value, isMethod, isComputed)
477
+ }
478
+ ,
479
+ updateProperty(original: Property, kind: Es2pandaPropertyKind, key: Expression | undefined, value: Expression | undefined, isMethod: boolean, isComputed: boolean): Property {
480
+ if (isSameNativeObject(kind, original.kind) && isSameNativeObject(key, original.key) && isSameNativeObject(value, original.value) && isSameNativeObject(isMethod, original.isMethod) && isSameNativeObject(isComputed, original.isComputed))
481
+ return original
482
+ return updateNodeByNode(Property.create1Property(kind, key, value, isMethod, isComputed), original)
483
+ }
484
+ ,
485
+ createStringLiteral(str: string): StringLiteral {
486
+ return StringLiteral.create1StringLiteral(str)
487
+ }
488
+ ,
489
+ updateStringLiteral(original: StringLiteral, str: string): StringLiteral {
490
+ if (isSameNativeObject(str, original.str))
491
+ return original
492
+ return updateNodeByNode(StringLiteral.create1StringLiteral(str), original)
493
+ }
494
+ ,
495
+ createTSTypeAssertion(typeAnnotation?: TypeNode, expression?: Expression): TSTypeAssertion {
496
+ return TSTypeAssertion.createTSTypeAssertion(typeAnnotation, expression)
497
+ }
498
+ ,
499
+ updateTSTypeAssertion(original: TSTypeAssertion, typeAnnotation?: TypeNode, expression?: Expression): TSTypeAssertion {
500
+ if (isSameNativeObject(typeAnnotation, original.typeAnnotation) && isSameNativeObject(expression, original.expression))
501
+ return original
502
+ return updateNodeByNode(TSTypeAssertion.createTSTypeAssertion(typeAnnotation, expression), original)
503
+ }
504
+ ,
505
+ createTSExternalModuleReference(expr?: Expression): TSExternalModuleReference {
506
+ return TSExternalModuleReference.createTSExternalModuleReference(expr)
507
+ }
508
+ ,
509
+ updateTSExternalModuleReference(original: TSExternalModuleReference, expr?: Expression): TSExternalModuleReference {
510
+ if (isSameNativeObject(expr, original.expr))
511
+ return original
512
+ return updateNodeByNode(TSExternalModuleReference.createTSExternalModuleReference(expr), original)
513
+ }
514
+ ,
515
+ createTSUndefinedKeyword(): TSUndefinedKeyword {
516
+ return TSUndefinedKeyword.createTSUndefinedKeyword()
517
+ }
518
+ ,
519
+ updateTSUndefinedKeyword(original: TSUndefinedKeyword): TSUndefinedKeyword {
520
+ return updateNodeByNode(TSUndefinedKeyword.createTSUndefinedKeyword(), original)
521
+ }
522
+ ,
523
+ createUnaryExpression(argument: Expression | undefined, operatorType: Es2pandaTokenType): UnaryExpression {
524
+ return UnaryExpression.createUnaryExpression(argument, operatorType)
525
+ }
526
+ ,
527
+ updateUnaryExpression(original: UnaryExpression, argument: Expression | undefined, operatorType: Es2pandaTokenType): UnaryExpression {
528
+ if (isSameNativeObject(argument, original.argument) && isSameNativeObject(operatorType, original.operatorType))
529
+ return original
530
+ return updateNodeByNode(UnaryExpression.createUnaryExpression(argument, operatorType), original)
531
+ }
532
+ ,
533
+ createForInStatement(left?: AstNode, right?: Expression, body?: Statement): ForInStatement {
534
+ return ForInStatement.createForInStatement(left, right, body)
535
+ }
536
+ ,
537
+ updateForInStatement(original: ForInStatement, left?: AstNode, right?: Expression, body?: Statement): ForInStatement {
538
+ if (isSameNativeObject(left, original.left) && isSameNativeObject(right, original.right) && isSameNativeObject(body, original.body))
539
+ return original
540
+ return updateNodeByNode(ForInStatement.createForInStatement(left, right, body), original)
541
+ }
542
+ ,
543
+ createThisExpression(): ThisExpression {
544
+ return ThisExpression.createThisExpression()
545
+ }
546
+ ,
547
+ updateThisExpression(original: ThisExpression): ThisExpression {
548
+ return updateNodeByNode(ThisExpression.createThisExpression(), original)
549
+ }
550
+ ,
551
+ createBinaryExpression(left: Expression | undefined, right: Expression | undefined, operatorType: Es2pandaTokenType): BinaryExpression {
552
+ return BinaryExpression.createBinaryExpression(left, right, operatorType)
553
+ }
554
+ ,
555
+ updateBinaryExpression(original: BinaryExpression, left: Expression | undefined, right: Expression | undefined, operatorType: Es2pandaTokenType): BinaryExpression {
556
+ if (isSameNativeObject(left, original.left) && isSameNativeObject(right, original.right) && isSameNativeObject(operatorType, original.operatorType))
557
+ return original
558
+ return updateNodeByNode(BinaryExpression.createBinaryExpression(left, right, operatorType), original)
559
+ }
560
+ ,
561
+ createSuperExpression(): SuperExpression {
562
+ return SuperExpression.createSuperExpression()
563
+ }
564
+ ,
565
+ updateSuperExpression(original: SuperExpression): SuperExpression {
566
+ return updateNodeByNode(SuperExpression.createSuperExpression(), original)
567
+ }
568
+ ,
569
+ createAssertStatement(test?: Expression, second?: Expression): AssertStatement {
570
+ return AssertStatement.createAssertStatement(test, second)
571
+ }
572
+ ,
573
+ updateAssertStatement(original: AssertStatement, test?: Expression, second?: Expression): AssertStatement {
574
+ if (isSameNativeObject(test, original.test) && isSameNativeObject(second, original.second))
575
+ return original
576
+ return updateNodeByNode(AssertStatement.createAssertStatement(test, second), original)
577
+ }
578
+ ,
579
+ createTSStringKeyword(): TSStringKeyword {
580
+ return TSStringKeyword.createTSStringKeyword()
581
+ }
582
+ ,
583
+ updateTSStringKeyword(original: TSStringKeyword): TSStringKeyword {
584
+ return updateNodeByNode(TSStringKeyword.createTSStringKeyword(), original)
585
+ }
586
+ ,
587
+ createExpressionStatement(expression: Expression): ExpressionStatement {
588
+ return ExpressionStatement.createExpressionStatement(expression)
589
+ }
590
+ ,
591
+ updateExpressionStatement(original: ExpressionStatement, expression: Expression): ExpressionStatement {
592
+ if (isSameNativeObject(expression, original.expression))
593
+ return original
594
+ return updateNodeByNode(ExpressionStatement.createExpressionStatement(expression), original)
595
+ }
596
+ ,
597
+ createMetaProperty(kind: Es2pandaMetaPropertyKind): MetaProperty {
598
+ return MetaProperty.createMetaProperty(kind)
599
+ }
600
+ ,
601
+ updateMetaProperty(original: MetaProperty, kind: Es2pandaMetaPropertyKind): MetaProperty {
602
+ if (isSameNativeObject(kind, original.kind))
603
+ return original
604
+ return updateNodeByNode(MetaProperty.createMetaProperty(kind), original)
605
+ }
606
+ ,
607
+ createTSArrayType(elementType?: TypeNode): TSArrayType {
608
+ return TSArrayType.createTSArrayType(elementType)
609
+ }
610
+ ,
611
+ updateTSArrayType(original: TSArrayType, elementType?: TypeNode): TSArrayType {
612
+ if (isSameNativeObject(elementType, original.elementType))
613
+ return original
614
+ return updateNodeByNode(TSArrayType.createTSArrayType(elementType), original)
615
+ }
616
+ ,
617
+ createExportAllDeclaration(source?: StringLiteral, exported?: Identifier): ExportAllDeclaration {
618
+ return ExportAllDeclaration.createExportAllDeclaration(source, exported)
619
+ }
620
+ ,
621
+ updateExportAllDeclaration(original: ExportAllDeclaration, source?: StringLiteral, exported?: Identifier): ExportAllDeclaration {
622
+ if (isSameNativeObject(source, original.source) && isSameNativeObject(exported, original.exported))
623
+ return original
624
+ return updateNodeByNode(ExportAllDeclaration.createExportAllDeclaration(source, exported), original)
625
+ }
626
+ ,
627
+ createExportSpecifier(local?: Identifier, exported?: Identifier): ExportSpecifier {
628
+ return ExportSpecifier.createExportSpecifier(local, exported)
629
+ }
630
+ ,
631
+ updateExportSpecifier(original: ExportSpecifier, local?: Identifier, exported?: Identifier): ExportSpecifier {
632
+ if (isSameNativeObject(local, original.local) && isSameNativeObject(exported, original.exported))
633
+ return original
634
+ return updateNodeByNode(ExportSpecifier.createExportSpecifier(local, exported), original)
635
+ }
636
+ ,
637
+ createTSTupleType(elementType: readonly TypeNode[]): TSTupleType {
638
+ return TSTupleType.createTSTupleType(elementType)
639
+ }
640
+ ,
641
+ updateTSTupleType(original: TSTupleType, elementType: readonly TypeNode[]): TSTupleType {
642
+ if (isSameNativeObject(elementType, original.elementType))
643
+ return original
644
+ return updateNodeByNode(TSTupleType.createTSTupleType(elementType), original)
645
+ }
646
+ ,
647
+ createFunctionExpression(id?: Identifier, _function?: ScriptFunction): FunctionExpression {
648
+ return FunctionExpression.create1FunctionExpression(id, _function)
649
+ }
650
+ ,
651
+ updateFunctionExpression(original: FunctionExpression, id?: Identifier, _function?: ScriptFunction): FunctionExpression {
652
+ if (isSameNativeObject(id, original.id) && isSameNativeObject(_function, original.function))
653
+ return original
654
+ return updateNodeByNode(FunctionExpression.create1FunctionExpression(id, _function), original)
655
+ }
656
+ ,
657
+ createTSIndexSignature(param: Expression | undefined, typeAnnotation: TypeNode | undefined, readonly: boolean): TSIndexSignature {
658
+ return TSIndexSignature.createTSIndexSignature(param, typeAnnotation, readonly)
659
+ }
660
+ ,
661
+ updateTSIndexSignature(original: TSIndexSignature, param: Expression | undefined, typeAnnotation: TypeNode | undefined, readonly: boolean): TSIndexSignature {
662
+ if (isSameNativeObject(param, original.param) && isSameNativeObject(typeAnnotation, original.typeAnnotation) && isSameNativeObject(readonly, original.readonly))
663
+ return original
664
+ return updateNodeByNode(TSIndexSignature.createTSIndexSignature(param, typeAnnotation, readonly), original)
665
+ }
666
+ ,
667
+ createCharLiteral(): CharLiteral {
668
+ return CharLiteral.createCharLiteral()
669
+ }
670
+ ,
671
+ updateCharLiteral(original: CharLiteral): CharLiteral {
672
+ return updateNodeByNode(CharLiteral.createCharLiteral(), original)
673
+ }
674
+ ,
675
+ createTSModuleBlock(statements: readonly Statement[]): TSModuleBlock {
676
+ return TSModuleBlock.createTSModuleBlock(statements)
677
+ }
678
+ ,
679
+ updateTSModuleBlock(original: TSModuleBlock, statements: readonly Statement[]): TSModuleBlock {
680
+ if (isSameNativeObject(statements, original.statements))
681
+ return original
682
+ return updateNodeByNode(TSModuleBlock.createTSModuleBlock(statements), original)
683
+ }
684
+ ,
685
+ createETSNewArrayInstanceExpression(typeReference?: TypeNode, dimension?: Expression): ETSNewArrayInstanceExpression {
686
+ return ETSNewArrayInstanceExpression.createETSNewArrayInstanceExpression(typeReference, dimension)
687
+ }
688
+ ,
689
+ updateETSNewArrayInstanceExpression(original: ETSNewArrayInstanceExpression, typeReference?: TypeNode, dimension?: Expression): ETSNewArrayInstanceExpression {
690
+ if (isSameNativeObject(typeReference, original.typeReference) && isSameNativeObject(dimension, original.dimension))
691
+ return original
692
+ return updateNodeByNode(ETSNewArrayInstanceExpression.createETSNewArrayInstanceExpression(typeReference, dimension), original)
693
+ }
694
+ ,
695
+ createAnnotationDeclaration(expr: Expression | undefined, properties: readonly AstNode[]): AnnotationDeclaration {
696
+ return AnnotationDeclaration.create1AnnotationDeclaration(expr, properties)
697
+ }
698
+ ,
699
+ updateAnnotationDeclaration(original: AnnotationDeclaration, expr: Expression | undefined, properties: readonly AstNode[]): AnnotationDeclaration {
700
+ if (isSameNativeObject(expr, original.expr) && isSameNativeObject(properties, original.properties))
701
+ return original
702
+ return updateNodeByNode(AnnotationDeclaration.create1AnnotationDeclaration(expr, properties), original)
703
+ }
704
+ ,
705
+ createAnnotationUsage(expr: Expression | undefined, properties: readonly AstNode[]): AnnotationUsage {
706
+ return AnnotationUsage.create1AnnotationUsage(expr, properties)
707
+ }
708
+ ,
709
+ updateAnnotationUsage(original: AnnotationUsage, expr: Expression | undefined, properties: readonly AstNode[]): AnnotationUsage {
710
+ if (isSameNativeObject(expr, original.expr) && isSameNativeObject(properties, original.properties))
711
+ return original
712
+ return updateNodeByNode(AnnotationUsage.create1AnnotationUsage(expr, properties), original)
713
+ }
714
+ ,
715
+ createEmptyStatement(): EmptyStatement {
716
+ return EmptyStatement.createEmptyStatement()
717
+ }
718
+ ,
719
+ updateEmptyStatement(original: EmptyStatement): EmptyStatement {
720
+ return updateNodeByNode(EmptyStatement.createEmptyStatement(), original)
721
+ }
722
+ ,
723
+ createETSLaunchExpression(call?: CallExpression): ETSLaunchExpression {
724
+ return ETSLaunchExpression.createETSLaunchExpression(call)
725
+ }
726
+ ,
727
+ updateETSLaunchExpression(original: ETSLaunchExpression, call?: CallExpression): ETSLaunchExpression {
728
+ if (isSameNativeObject(call, original.call))
729
+ return original
730
+ return updateNodeByNode(ETSLaunchExpression.createETSLaunchExpression(call), original)
731
+ }
732
+ ,
733
+ createWhileStatement(test?: Expression, body?: Statement): WhileStatement {
734
+ return WhileStatement.createWhileStatement(test, body)
735
+ }
736
+ ,
737
+ updateWhileStatement(original: WhileStatement, test?: Expression, body?: Statement): WhileStatement {
738
+ if (isSameNativeObject(test, original.test) && isSameNativeObject(body, original.body))
739
+ return original
740
+ return updateNodeByNode(WhileStatement.createWhileStatement(test, body), original)
741
+ }
742
+ ,
743
+ createFunctionSignature(typeParams: TSTypeParameterDeclaration | undefined, params: readonly Expression[], returnType: TypeNode | undefined, hasReceiver: boolean): FunctionSignature {
744
+ return FunctionSignature.createFunctionSignature(typeParams, params, returnType, hasReceiver)
745
+ }
746
+ ,
747
+ updateFunctionSignature(original: FunctionSignature, typeParams: TSTypeParameterDeclaration | undefined, params: readonly Expression[], returnType: TypeNode | undefined, hasReceiver: boolean): FunctionSignature {
748
+ if (isSameNativeObject(typeParams, original.typeParams) && isSameNativeObject(params, original.params) && isSameNativeObject(returnType, original.returnType) && isSameNativeObject(hasReceiver, original.hasReceiver))
749
+ return original
750
+ return updateNodeByNode(FunctionSignature.createFunctionSignature(typeParams, params, returnType, hasReceiver), original)
751
+ }
752
+ ,
753
+ createChainExpression(expression?: Expression): ChainExpression {
754
+ return ChainExpression.createChainExpression(expression)
755
+ }
756
+ ,
757
+ updateChainExpression(original: ChainExpression, expression?: Expression): ChainExpression {
758
+ if (isSameNativeObject(expression, original.expression))
759
+ return original
760
+ return updateNodeByNode(ChainExpression.createChainExpression(expression), original)
761
+ }
762
+ ,
763
+ createTSIntersectionType(types: readonly Expression[]): TSIntersectionType {
764
+ return TSIntersectionType.createTSIntersectionType(types)
765
+ }
766
+ ,
767
+ updateTSIntersectionType(original: TSIntersectionType, types: readonly Expression[]): TSIntersectionType {
768
+ if (isSameNativeObject(types, original.types))
769
+ return original
770
+ return updateNodeByNode(TSIntersectionType.createTSIntersectionType(types), original)
771
+ }
772
+ ,
773
+ createUpdateExpression(argument: Expression | undefined, operatorType: Es2pandaTokenType, isPrefix: boolean): UpdateExpression {
774
+ return UpdateExpression.createUpdateExpression(argument, operatorType, isPrefix)
775
+ }
776
+ ,
777
+ updateUpdateExpression(original: UpdateExpression, argument: Expression | undefined, operatorType: Es2pandaTokenType, isPrefix: boolean): UpdateExpression {
778
+ if (isSameNativeObject(argument, original.argument) && isSameNativeObject(operatorType, original.operatorType) && isSameNativeObject(isPrefix, original.isPrefix))
779
+ return original
780
+ return updateNodeByNode(UpdateExpression.createUpdateExpression(argument, operatorType, isPrefix), original)
781
+ }
782
+ ,
783
+ createBlockExpression(statements: readonly Statement[]): BlockExpression {
784
+ return BlockExpression.createBlockExpression(statements)
785
+ }
786
+ ,
787
+ updateBlockExpression(original: BlockExpression, statements: readonly Statement[]): BlockExpression {
788
+ if (isSameNativeObject(statements, original.statements))
789
+ return original
790
+ return updateNodeByNode(BlockExpression.createBlockExpression(statements), original)
791
+ }
792
+ ,
793
+ createTSTypeLiteral(members: readonly AstNode[]): TSTypeLiteral {
794
+ return TSTypeLiteral.createTSTypeLiteral(members)
795
+ }
796
+ ,
797
+ updateTSTypeLiteral(original: TSTypeLiteral, members: readonly AstNode[]): TSTypeLiteral {
798
+ if (isSameNativeObject(members, original.members))
799
+ return original
800
+ return updateNodeByNode(TSTypeLiteral.createTSTypeLiteral(members), original)
801
+ }
802
+ ,
803
+ createTSBooleanKeyword(): TSBooleanKeyword {
804
+ return TSBooleanKeyword.createTSBooleanKeyword()
805
+ }
806
+ ,
807
+ updateTSBooleanKeyword(original: TSBooleanKeyword): TSBooleanKeyword {
808
+ return updateNodeByNode(TSBooleanKeyword.createTSBooleanKeyword(), original)
809
+ }
810
+ ,
811
+ createTSTypePredicate(parameterName: Expression | undefined, typeAnnotation: TypeNode | undefined, asserts: boolean): TSTypePredicate {
812
+ return TSTypePredicate.createTSTypePredicate(parameterName, typeAnnotation, asserts)
813
+ }
814
+ ,
815
+ updateTSTypePredicate(original: TSTypePredicate, parameterName: Expression | undefined, typeAnnotation: TypeNode | undefined, asserts: boolean): TSTypePredicate {
816
+ if (isSameNativeObject(parameterName, original.parameterName) && isSameNativeObject(typeAnnotation, original.typeAnnotation) && isSameNativeObject(asserts, original.asserts))
817
+ return original
818
+ return updateNodeByNode(TSTypePredicate.createTSTypePredicate(parameterName, typeAnnotation, asserts), original)
819
+ }
820
+ ,
821
+ createImportNamespaceSpecifier(local?: Identifier): ImportNamespaceSpecifier {
822
+ return ImportNamespaceSpecifier.createImportNamespaceSpecifier(local)
823
+ }
824
+ ,
825
+ updateImportNamespaceSpecifier(original: ImportNamespaceSpecifier, local?: Identifier): ImportNamespaceSpecifier {
826
+ if (isSameNativeObject(local, original.local))
827
+ return original
828
+ return updateNodeByNode(ImportNamespaceSpecifier.createImportNamespaceSpecifier(local), original)
829
+ }
830
+ ,
831
+ createTSTypeParameterInstantiation(params: readonly TypeNode[]): TSTypeParameterInstantiation {
832
+ return TSTypeParameterInstantiation.createTSTypeParameterInstantiation(params)
833
+ }
834
+ ,
835
+ updateTSTypeParameterInstantiation(original: TSTypeParameterInstantiation, params: readonly TypeNode[]): TSTypeParameterInstantiation {
836
+ if (isSameNativeObject(params, original.params))
837
+ return original
838
+ return updateNodeByNode(TSTypeParameterInstantiation.createTSTypeParameterInstantiation(params), original)
839
+ }
840
+ ,
841
+ createNullLiteral(): NullLiteral {
842
+ return NullLiteral.createNullLiteral()
843
+ }
844
+ ,
845
+ updateNullLiteral(original: NullLiteral): NullLiteral {
846
+ return updateNodeByNode(NullLiteral.createNullLiteral(), original)
847
+ }
848
+ ,
849
+ createTSInferType(typeParam?: TSTypeParameter): TSInferType {
850
+ return TSInferType.createTSInferType(typeParam)
851
+ }
852
+ ,
853
+ updateTSInferType(original: TSInferType, typeParam?: TSTypeParameter): TSInferType {
854
+ if (isSameNativeObject(typeParam, original.typeParam))
855
+ return original
856
+ return updateNodeByNode(TSInferType.createTSInferType(typeParam), original)
857
+ }
858
+ ,
859
+ createSwitchCaseStatement(test: Expression | undefined, consequent: readonly Statement[]): SwitchCaseStatement {
860
+ return SwitchCaseStatement.createSwitchCaseStatement(test, consequent)
861
+ }
862
+ ,
863
+ updateSwitchCaseStatement(original: SwitchCaseStatement, test: Expression | undefined, consequent: readonly Statement[]): SwitchCaseStatement {
864
+ if (isSameNativeObject(test, original.test) && isSameNativeObject(consequent, original.consequent))
865
+ return original
866
+ return updateNodeByNode(SwitchCaseStatement.createSwitchCaseStatement(test, consequent), original)
867
+ }
868
+ ,
869
+ createYieldExpression(argument: Expression | undefined, hasDelegate: boolean): YieldExpression {
870
+ return YieldExpression.createYieldExpression(argument, hasDelegate)
871
+ }
872
+ ,
873
+ updateYieldExpression(original: YieldExpression, argument: Expression | undefined, hasDelegate: boolean): YieldExpression {
874
+ if (isSameNativeObject(argument, original.argument) && isSameNativeObject(hasDelegate, original.hasDelegate))
875
+ return original
876
+ return updateNodeByNode(YieldExpression.createYieldExpression(argument, hasDelegate), original)
877
+ }
878
+ ,
879
+ createTSImportEqualsDeclaration(id: Identifier | undefined, moduleReference: Expression | undefined, isExport: boolean): TSImportEqualsDeclaration {
880
+ return TSImportEqualsDeclaration.createTSImportEqualsDeclaration(id, moduleReference, isExport)
881
+ }
882
+ ,
883
+ updateTSImportEqualsDeclaration(original: TSImportEqualsDeclaration, id: Identifier | undefined, moduleReference: Expression | undefined, isExport: boolean): TSImportEqualsDeclaration {
884
+ if (isSameNativeObject(id, original.id) && isSameNativeObject(moduleReference, original.moduleReference) && isSameNativeObject(isExport, original.isExport))
885
+ return original
886
+ return updateNodeByNode(TSImportEqualsDeclaration.createTSImportEqualsDeclaration(id, moduleReference, isExport), original)
887
+ }
888
+ ,
889
+ createBooleanLiteral(value: boolean): BooleanLiteral {
890
+ return BooleanLiteral.createBooleanLiteral(value)
891
+ }
892
+ ,
893
+ updateBooleanLiteral(original: BooleanLiteral, value: boolean): BooleanLiteral {
894
+ if (isSameNativeObject(value, original.value))
895
+ return original
896
+ return updateNodeByNode(BooleanLiteral.createBooleanLiteral(value), original)
897
+ }
898
+ ,
899
+ createTSNumberKeyword(): TSNumberKeyword {
900
+ return TSNumberKeyword.createTSNumberKeyword()
901
+ }
902
+ ,
903
+ updateTSNumberKeyword(original: TSNumberKeyword): TSNumberKeyword {
904
+ return updateNodeByNode(TSNumberKeyword.createTSNumberKeyword(), original)
905
+ }
906
+ ,
907
+ createTSNonNullExpression(expr?: Expression): TSNonNullExpression {
908
+ return TSNonNullExpression.createTSNonNullExpression(expr)
909
+ }
910
+ ,
911
+ updateTSNonNullExpression(original: TSNonNullExpression, expr?: Expression): TSNonNullExpression {
912
+ if (isSameNativeObject(expr, original.expr))
913
+ return original
914
+ return updateNodeByNode(TSNonNullExpression.createTSNonNullExpression(expr), original)
915
+ }
916
+ ,
917
+ createPrefixAssertionExpression(expr?: Expression, type?: TypeNode): PrefixAssertionExpression {
918
+ return PrefixAssertionExpression.createPrefixAssertionExpression(expr, type)
919
+ }
920
+ ,
921
+ updatePrefixAssertionExpression(original: PrefixAssertionExpression, expr?: Expression, type?: TypeNode): PrefixAssertionExpression {
922
+ if (isSameNativeObject(expr, original.expr) && isSameNativeObject(type, original.type))
923
+ return original
924
+ return updateNodeByNode(PrefixAssertionExpression.createPrefixAssertionExpression(expr, type), original)
925
+ }
926
+ ,
927
+ createClassExpression(definition?: ClassDefinition): ClassExpression {
928
+ return ClassExpression.createClassExpression(definition)
929
+ }
930
+ ,
931
+ updateClassExpression(original: ClassExpression, definition?: ClassDefinition): ClassExpression {
932
+ if (isSameNativeObject(definition, original.definition))
933
+ return original
934
+ return updateNodeByNode(ClassExpression.createClassExpression(definition), original)
935
+ }
936
+ ,
937
+ createForOfStatement(left: AstNode | undefined, right: Expression | undefined, body: Statement | undefined, isAwait: boolean): ForOfStatement {
938
+ return ForOfStatement.createForOfStatement(left, right, body, isAwait)
939
+ }
940
+ ,
941
+ updateForOfStatement(original: ForOfStatement, left: AstNode | undefined, right: Expression | undefined, body: Statement | undefined, isAwait: boolean): ForOfStatement {
942
+ if (isSameNativeObject(left, original.left) && isSameNativeObject(right, original.right) && isSameNativeObject(body, original.body) && isSameNativeObject(isAwait, original.isAwait))
943
+ return original
944
+ return updateNodeByNode(ForOfStatement.createForOfStatement(left, right, body, isAwait), original)
945
+ }
946
+ ,
947
+ createTemplateLiteral(quasis: readonly TemplateElement[], expressions: readonly Expression[], multilineString: string): TemplateLiteral {
948
+ return TemplateLiteral.createTemplateLiteral(quasis, expressions, multilineString)
949
+ }
950
+ ,
951
+ updateTemplateLiteral(original: TemplateLiteral, quasis: readonly TemplateElement[], expressions: readonly Expression[], multilineString: string): TemplateLiteral {
952
+ if (isSameNativeObject(quasis, original.quasis) && isSameNativeObject(expressions, original.expressions) && isSameNativeObject(multilineString, original.multilineString))
953
+ return original
954
+ return updateNodeByNode(TemplateLiteral.createTemplateLiteral(quasis, expressions, multilineString), original)
955
+ }
956
+ ,
957
+ createTSUnionType(types: readonly TypeNode[]): TSUnionType {
958
+ return TSUnionType.createTSUnionType(types)
959
+ }
960
+ ,
961
+ updateTSUnionType(original: TSUnionType, types: readonly TypeNode[]): TSUnionType {
962
+ if (isSameNativeObject(types, original.types))
963
+ return original
964
+ return updateNodeByNode(TSUnionType.createTSUnionType(types), original)
965
+ }
966
+ ,
967
+ createTSUnknownKeyword(): TSUnknownKeyword {
968
+ return TSUnknownKeyword.createTSUnknownKeyword()
969
+ }
970
+ ,
971
+ updateTSUnknownKeyword(original: TSUnknownKeyword): TSUnknownKeyword {
972
+ return updateNodeByNode(TSUnknownKeyword.createTSUnknownKeyword(), original)
973
+ }
974
+ ,
975
+ createIdentifier(name: string, typeAnnotation?: TypeNode): Identifier {
976
+ return Identifier.create2Identifier(name, typeAnnotation)
977
+ }
978
+ ,
979
+ updateIdentifier(original: Identifier, name: string, typeAnnotation?: TypeNode): Identifier {
980
+ if (isSameNativeObject(name, original.name) && isSameNativeObject(typeAnnotation, original.typeAnnotation))
981
+ return original
982
+ return updateNodeByNode(Identifier.create2Identifier(name, typeAnnotation), original)
983
+ }
984
+ ,
985
+ createOpaqueTypeNode(): OpaqueTypeNode {
986
+ return OpaqueTypeNode.create1OpaqueTypeNode()
987
+ }
988
+ ,
989
+ updateOpaqueTypeNode(original: OpaqueTypeNode): OpaqueTypeNode {
990
+ return updateNodeByNode(OpaqueTypeNode.create1OpaqueTypeNode(), original)
991
+ }
992
+ ,
993
+ createBlockStatement(statements: readonly Statement[]): BlockStatement {
994
+ return BlockStatement.createBlockStatement(statements)
995
+ }
996
+ ,
997
+ updateBlockStatement(original: BlockStatement, statements: readonly Statement[]): BlockStatement {
998
+ if (isSameNativeObject(statements, original.statements))
999
+ return original
1000
+ return updateNodeByNode(BlockStatement.createBlockStatement(statements), original)
1001
+ }
1002
+ ,
1003
+ createTSTypeParameterDeclaration(params: readonly TSTypeParameter[], requiredParams: number): TSTypeParameterDeclaration {
1004
+ return TSTypeParameterDeclaration.createTSTypeParameterDeclaration(params, requiredParams)
1005
+ }
1006
+ ,
1007
+ updateTSTypeParameterDeclaration(original: TSTypeParameterDeclaration, params: readonly TSTypeParameter[], requiredParams: number): TSTypeParameterDeclaration {
1008
+ if (isSameNativeObject(params, original.params) && isSameNativeObject(requiredParams, original.requiredParams))
1009
+ return original
1010
+ return updateNodeByNode(TSTypeParameterDeclaration.createTSTypeParameterDeclaration(params, requiredParams), original)
1011
+ }
1012
+ ,
1013
+ createTSNullKeyword(): TSNullKeyword {
1014
+ return TSNullKeyword.createTSNullKeyword()
1015
+ }
1016
+ ,
1017
+ updateTSNullKeyword(original: TSNullKeyword): TSNullKeyword {
1018
+ return updateNodeByNode(TSNullKeyword.createTSNullKeyword(), original)
1019
+ }
1020
+ ,
1021
+ createTSInterfaceHeritage(expr?: TypeNode): TSInterfaceHeritage {
1022
+ return TSInterfaceHeritage.createTSInterfaceHeritage(expr)
1023
+ }
1024
+ ,
1025
+ updateTSInterfaceHeritage(original: TSInterfaceHeritage, expr?: TypeNode): TSInterfaceHeritage {
1026
+ if (isSameNativeObject(expr, original.expr))
1027
+ return original
1028
+ return updateNodeByNode(TSInterfaceHeritage.createTSInterfaceHeritage(expr), original)
1029
+ }
1030
+ ,
1031
+ createETSClassLiteral(expr?: TypeNode): ETSClassLiteral {
1032
+ return ETSClassLiteral.createETSClassLiteral(expr)
1033
+ }
1034
+ ,
1035
+ updateETSClassLiteral(original: ETSClassLiteral, expr?: TypeNode): ETSClassLiteral {
1036
+ if (isSameNativeObject(expr, original.expr))
1037
+ return original
1038
+ return updateNodeByNode(ETSClassLiteral.createETSClassLiteral(expr), original)
1039
+ }
1040
+ ,
1041
+ createBreakStatement(ident?: Identifier): BreakStatement {
1042
+ return BreakStatement.create1BreakStatement(ident)
1043
+ }
1044
+ ,
1045
+ updateBreakStatement(original: BreakStatement, ident?: Identifier): BreakStatement {
1046
+ if (isSameNativeObject(ident, original.ident))
1047
+ return original
1048
+ return updateNodeByNode(BreakStatement.create1BreakStatement(ident), original)
1049
+ }
1050
+ ,
1051
+ createTSAnyKeyword(): TSAnyKeyword {
1052
+ return TSAnyKeyword.createTSAnyKeyword()
1053
+ }
1054
+ ,
1055
+ updateTSAnyKeyword(original: TSAnyKeyword): TSAnyKeyword {
1056
+ return updateNodeByNode(TSAnyKeyword.createTSAnyKeyword(), original)
1057
+ }
1058
+ ,
1059
+ createClassDeclaration(definition?: ClassDefinition): ClassDeclaration {
1060
+ return ClassDeclaration.createClassDeclaration(definition)
1061
+ }
1062
+ ,
1063
+ updateClassDeclaration(original: ClassDeclaration, definition?: ClassDefinition): ClassDeclaration {
1064
+ if (isSameNativeObject(definition, original.definition))
1065
+ return original
1066
+ return updateNodeByNode(ClassDeclaration.createClassDeclaration(definition), original)
1067
+ }
1068
+ ,
1069
+ createTSIndexedAccessType(objectType?: TypeNode, indexType?: TypeNode): TSIndexedAccessType {
1070
+ return TSIndexedAccessType.createTSIndexedAccessType(objectType, indexType)
1071
+ }
1072
+ ,
1073
+ updateTSIndexedAccessType(original: TSIndexedAccessType, objectType?: TypeNode, indexType?: TypeNode): TSIndexedAccessType {
1074
+ if (isSameNativeObject(objectType, original.objectType) && isSameNativeObject(indexType, original.indexType))
1075
+ return original
1076
+ return updateNodeByNode(TSIndexedAccessType.createTSIndexedAccessType(objectType, indexType), original)
1077
+ }
1078
+ ,
1079
+ createTSQualifiedName(left?: Expression, right?: Identifier): TSQualifiedName {
1080
+ return TSQualifiedName.createTSQualifiedName(left, right)
1081
+ }
1082
+ ,
1083
+ updateTSQualifiedName(original: TSQualifiedName, left?: Expression, right?: Identifier): TSQualifiedName {
1084
+ if (isSameNativeObject(left, original.left) && isSameNativeObject(right, original.right))
1085
+ return original
1086
+ return updateNodeByNode(TSQualifiedName.createTSQualifiedName(left, right), original)
1087
+ }
1088
+ ,
1089
+ createAwaitExpression(argument?: Expression): AwaitExpression {
1090
+ return AwaitExpression.createAwaitExpression(argument)
1091
+ }
1092
+ ,
1093
+ updateAwaitExpression(original: AwaitExpression, argument?: Expression): AwaitExpression {
1094
+ if (isSameNativeObject(argument, original.argument))
1095
+ return original
1096
+ return updateNodeByNode(AwaitExpression.createAwaitExpression(argument), original)
1097
+ }
1098
+ ,
1099
+ createValidationInfo(): ValidationInfo {
1100
+ return ValidationInfo.createValidationInfo()
1101
+ }
1102
+ ,
1103
+ updateValidationInfo(original: ValidationInfo): ValidationInfo {
1104
+ return updateNodeByNode(ValidationInfo.createValidationInfo(), original)
1105
+ }
1106
+ ,
1107
+ createContinueStatement(ident?: Identifier): ContinueStatement {
1108
+ return ContinueStatement.create1ContinueStatement(ident)
1109
+ }
1110
+ ,
1111
+ updateContinueStatement(original: ContinueStatement, ident?: Identifier): ContinueStatement {
1112
+ if (isSameNativeObject(ident, original.ident))
1113
+ return original
1114
+ return updateNodeByNode(ContinueStatement.create1ContinueStatement(ident), original)
1115
+ }
1116
+ ,
1117
+ createETSNewMultiDimArrayInstanceExpression(typeReference: TypeNode | undefined, dimensions: readonly Expression[]): ETSNewMultiDimArrayInstanceExpression {
1118
+ return ETSNewMultiDimArrayInstanceExpression.createETSNewMultiDimArrayInstanceExpression(typeReference, dimensions)
1119
+ }
1120
+ ,
1121
+ updateETSNewMultiDimArrayInstanceExpression(original: ETSNewMultiDimArrayInstanceExpression, typeReference: TypeNode | undefined, dimensions: readonly Expression[]): ETSNewMultiDimArrayInstanceExpression {
1122
+ if (isSameNativeObject(typeReference, original.typeReference) && isSameNativeObject(dimensions, original.dimensions))
1123
+ return original
1124
+ return updateNodeByNode(ETSNewMultiDimArrayInstanceExpression.createETSNewMultiDimArrayInstanceExpression(typeReference, dimensions), original)
1125
+ }
1126
+ ,
1127
+ createTSNamedTupleMember(label: Expression | undefined, elementType: TypeNode | undefined, isOptional: boolean): TSNamedTupleMember {
1128
+ return TSNamedTupleMember.createTSNamedTupleMember(label, elementType, isOptional)
1129
+ }
1130
+ ,
1131
+ updateTSNamedTupleMember(original: TSNamedTupleMember, label: Expression | undefined, elementType: TypeNode | undefined, isOptional: boolean): TSNamedTupleMember {
1132
+ if (isSameNativeObject(label, original.label) && isSameNativeObject(elementType, original.elementType) && isSameNativeObject(isOptional, original.isOptional))
1133
+ return original
1134
+ return updateNodeByNode(TSNamedTupleMember.createTSNamedTupleMember(label, elementType, isOptional), original)
1135
+ }
1136
+ ,
1137
+ createImportExpression(source?: Expression): ImportExpression {
1138
+ return ImportExpression.createImportExpression(source)
1139
+ }
1140
+ ,
1141
+ updateImportExpression(original: ImportExpression, source?: Expression): ImportExpression {
1142
+ if (isSameNativeObject(source, original.source))
1143
+ return original
1144
+ return updateNodeByNode(ImportExpression.createImportExpression(source), original)
1145
+ }
1146
+ ,
1147
+ createETSNullType(): ETSNullType {
1148
+ return ETSNullType.createETSNullType()
1149
+ }
1150
+ ,
1151
+ updateETSNullType(original: ETSNullType): ETSNullType {
1152
+ return updateNodeByNode(ETSNullType.createETSNullType(), original)
1153
+ }
1154
+ ,
1155
+ createETSUndefinedType(): ETSUndefinedType {
1156
+ return ETSUndefinedType.createETSUndefinedType()
1157
+ }
1158
+ ,
1159
+ updateETSUndefinedType(original: ETSUndefinedType): ETSUndefinedType {
1160
+ return updateNodeByNode(ETSUndefinedType.createETSUndefinedType(), original)
1161
+ }
1162
+ ,
1163
+ createTypeofExpression(argument?: Expression): TypeofExpression {
1164
+ return TypeofExpression.createTypeofExpression(argument)
1165
+ }
1166
+ ,
1167
+ updateTypeofExpression(original: TypeofExpression, argument?: Expression): TypeofExpression {
1168
+ if (isSameNativeObject(argument, original.argument))
1169
+ return original
1170
+ return updateNodeByNode(TypeofExpression.createTypeofExpression(argument), original)
1171
+ }
1172
+ ,
1173
+ createTSEnumMember(key: Expression | undefined, init: Expression | undefined, isGenerated: boolean): TSEnumMember {
1174
+ return TSEnumMember.create1TSEnumMember(key, init, isGenerated)
1175
+ }
1176
+ ,
1177
+ updateTSEnumMember(original: TSEnumMember, key: Expression | undefined, init: Expression | undefined, isGenerated: boolean): TSEnumMember {
1178
+ if (isSameNativeObject(key, original.key) && isSameNativeObject(init, original.init) && isSameNativeObject(isGenerated, original.isGenerated))
1179
+ return original
1180
+ return updateNodeByNode(TSEnumMember.create1TSEnumMember(key, init, isGenerated), original)
1181
+ }
1182
+ ,
1183
+ createSwitchStatement(discriminant: Expression | undefined, cases: readonly SwitchCaseStatement[]): SwitchStatement {
1184
+ return SwitchStatement.createSwitchStatement(discriminant, cases)
1185
+ }
1186
+ ,
1187
+ updateSwitchStatement(original: SwitchStatement, discriminant: Expression | undefined, cases: readonly SwitchCaseStatement[]): SwitchStatement {
1188
+ if (isSameNativeObject(discriminant, original.discriminant) && isSameNativeObject(cases, original.cases))
1189
+ return original
1190
+ return updateNodeByNode(SwitchStatement.createSwitchStatement(discriminant, cases), original)
1191
+ }
1192
+ ,
1193
+ createDoWhileStatement(body?: Statement, test?: Expression): DoWhileStatement {
1194
+ return DoWhileStatement.createDoWhileStatement(body, test)
1195
+ }
1196
+ ,
1197
+ updateDoWhileStatement(original: DoWhileStatement, body?: Statement, test?: Expression): DoWhileStatement {
1198
+ if (isSameNativeObject(body, original.body) && isSameNativeObject(test, original.test))
1199
+ return original
1200
+ return updateNodeByNode(DoWhileStatement.createDoWhileStatement(body, test), original)
1201
+ }
1202
+ ,
1203
+ createCatchClause(param?: Expression, body?: BlockStatement): CatchClause {
1204
+ return CatchClause.createCatchClause(param, body)
1205
+ }
1206
+ ,
1207
+ updateCatchClause(original: CatchClause, param?: Expression, body?: BlockStatement): CatchClause {
1208
+ if (isSameNativeObject(param, original.param) && isSameNativeObject(body, original.body))
1209
+ return original
1210
+ return updateNodeByNode(CatchClause.createCatchClause(param, body), original)
1211
+ }
1212
+ ,
1213
+ createSequenceExpression(sequence: readonly Expression[]): SequenceExpression {
1214
+ return SequenceExpression.createSequenceExpression(sequence)
1215
+ }
1216
+ ,
1217
+ updateSequenceExpression(original: SequenceExpression, sequence: readonly Expression[]): SequenceExpression {
1218
+ if (isSameNativeObject(sequence, original.sequence))
1219
+ return original
1220
+ return updateNodeByNode(SequenceExpression.createSequenceExpression(sequence), original)
1221
+ }
1222
+ ,
1223
+ createArrowFunctionExpression(_function: ScriptFunction): ArrowFunctionExpression {
1224
+ return ArrowFunctionExpression.createArrowFunctionExpression(_function)
1225
+ }
1226
+ ,
1227
+ updateArrowFunctionExpression(original: ArrowFunctionExpression, _function: ScriptFunction): ArrowFunctionExpression {
1228
+ if (isSameNativeObject(_function, original.function))
1229
+ return original
1230
+ return updateNodeByNode(ArrowFunctionExpression.createArrowFunctionExpression(_function), original)
1231
+ }
1232
+ ,
1233
+ createOmittedExpression(): OmittedExpression {
1234
+ return OmittedExpression.createOmittedExpression()
1235
+ }
1236
+ ,
1237
+ updateOmittedExpression(original: OmittedExpression): OmittedExpression {
1238
+ return updateNodeByNode(OmittedExpression.createOmittedExpression(), original)
1239
+ }
1240
+ ,
1241
+ createETSNewClassInstanceExpression(typeRef: Expression | undefined, _arguments: readonly Expression[]): ETSNewClassInstanceExpression {
1242
+ return ETSNewClassInstanceExpression.createETSNewClassInstanceExpression(typeRef, _arguments)
1243
+ }
1244
+ ,
1245
+ updateETSNewClassInstanceExpression(original: ETSNewClassInstanceExpression, typeRef: Expression | undefined, _arguments: readonly Expression[]): ETSNewClassInstanceExpression {
1246
+ if (isSameNativeObject(typeRef, original.typeRef) && isSameNativeObject(_arguments, original.arguments))
1247
+ return original
1248
+ return updateNodeByNode(ETSNewClassInstanceExpression.createETSNewClassInstanceExpression(typeRef, _arguments), original)
1249
+ }
1250
+ ,
1251
+ createTSAsExpression(expr: Expression | undefined, typeAnnotation: TypeNode | undefined, isConst: boolean): TSAsExpression {
1252
+ return TSAsExpression.createTSAsExpression(expr, typeAnnotation, isConst)
1253
+ }
1254
+ ,
1255
+ updateTSAsExpression(original: TSAsExpression, expr: Expression | undefined, typeAnnotation: TypeNode | undefined, isConst: boolean): TSAsExpression {
1256
+ if (isSameNativeObject(expr, original.expr) && isSameNativeObject(typeAnnotation, original.typeAnnotation) && isSameNativeObject(isConst, original.isConst))
1257
+ return original
1258
+ return updateNodeByNode(TSAsExpression.createTSAsExpression(expr, typeAnnotation, isConst), original)
1259
+ }
1260
+ ,
1261
+ createForUpdateStatement(init?: AstNode, test?: Expression, update?: Expression, body?: Statement): ForUpdateStatement {
1262
+ return ForUpdateStatement.createForUpdateStatement(init, test, update, body)
1263
+ }
1264
+ ,
1265
+ updateForUpdateStatement(original: ForUpdateStatement, init?: AstNode, test?: Expression, update?: Expression, body?: Statement): ForUpdateStatement {
1266
+ if (isSameNativeObject(init, original.init) && isSameNativeObject(test, original.test) && isSameNativeObject(update, original.update) && isSameNativeObject(body, original.body))
1267
+ return original
1268
+ return updateNodeByNode(ForUpdateStatement.createForUpdateStatement(init, test, update, body), original)
1269
+ }
1270
+ ,
1271
+ createETSPrimitiveType(primitiveType: Es2pandaPrimitiveType): ETSPrimitiveType {
1272
+ return ETSPrimitiveType.createETSPrimitiveType(primitiveType)
1273
+ }
1274
+ ,
1275
+ updateETSPrimitiveType(original: ETSPrimitiveType, primitiveType: Es2pandaPrimitiveType): ETSPrimitiveType {
1276
+ if (isSameNativeObject(primitiveType, original.primitiveType))
1277
+ return original
1278
+ return updateNodeByNode(ETSPrimitiveType.createETSPrimitiveType(primitiveType), original)
1279
+ }
1280
+ ,
1281
+ createNewExpression(callee: Expression | undefined, _arguments: readonly Expression[]): NewExpression {
1282
+ return NewExpression.createNewExpression(callee, _arguments)
1283
+ }
1284
+ ,
1285
+ updateNewExpression(original: NewExpression, callee: Expression | undefined, _arguments: readonly Expression[]): NewExpression {
1286
+ if (isSameNativeObject(callee, original.callee) && isSameNativeObject(_arguments, original.arguments))
1287
+ return original
1288
+ return updateNodeByNode(NewExpression.createNewExpression(callee, _arguments), original)
1289
+ }
1290
+ ,
1291
+ createTSThisType(): TSThisType {
1292
+ return TSThisType.createTSThisType()
1293
+ }
1294
+ ,
1295
+ updateTSThisType(original: TSThisType): TSThisType {
1296
+ return updateNodeByNode(TSThisType.createTSThisType(), original)
1297
+ }
1298
+ ,
1299
+ }