@idlizer/arktscgen 2.1.9-arktscgen-6 → 2.1.9-arktscgen-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/libarkts-copy/generator/options.json5 +165 -3
- package/build/libarkts-copy/native/meson.build +11 -12
- package/build/libarkts-copy/native/meson_options.txt +1 -1
- package/build/libarkts-copy/native/mingw.cross +14 -0
- package/build/libarkts-copy/native/src/bridges.cc +105 -15
- package/build/libarkts-copy/native/src/common.cc +11 -7
- package/build/libarkts-copy/native/src/common.h +1 -0
- package/build/libarkts-copy/native/src/generated/bridges.cc +318 -35
- package/build/libarkts-copy/package.json +24 -21
- package/build/libarkts-copy/src/Es2pandaNativeModule.ts +33 -6
- package/build/libarkts-copy/src/arkts-api/ChainExpressionFilter.ts +2 -1
- package/build/libarkts-copy/src/arkts-api/ImportStorage.ts +18 -12
- package/build/libarkts-copy/src/arkts-api/ProgramProvider.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +15 -26
- package/build/libarkts-copy/src/arkts-api/index.ts +2 -4
- package/build/libarkts-copy/src/arkts-api/node-utilities/BlockStatement.ts +0 -4
- package/build/libarkts-copy/src/arkts-api/node-utilities/CallExpression.ts +1 -22
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDefinition.ts +7 -8
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassProperty.ts +1 -22
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSFunctionType.ts +2 -5
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSImportDeclaration.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSModule.ts +44 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSParameterExpression.ts +1 -4
- package/build/libarkts-copy/src/arkts-api/node-utilities/MethodDefinition.ts +3 -12
- package/build/libarkts-copy/src/arkts-api/node-utilities/ObjectExpression.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/node-utilities/Program.ts +10 -11
- package/build/libarkts-copy/src/arkts-api/node-utilities/ScriptFunction.ts +17 -6
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSInterfaceDeclaration.ts +3 -6
- package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +3 -3
- package/build/libarkts-copy/src/arkts-api/peers/Config.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/peers/Context.ts +26 -5
- package/build/libarkts-copy/src/arkts-api/peers/ExternalSource.ts +4 -0
- package/build/libarkts-copy/src/arkts-api/plugins.ts +15 -7
- package/build/libarkts-copy/src/arkts-api/static/global.ts +3 -2
- package/build/libarkts-copy/src/{wrapper-compat/arkts-api → arkts-api}/static/globalUtils.ts +4 -4
- package/build/libarkts-copy/src/arkts-api/static/profiler.ts +0 -8
- package/build/libarkts-copy/src/arkts-api/utilities/extensions.ts +80 -0
- package/build/libarkts-copy/src/arkts-api/utilities/nativePtrDecoder.ts +1 -1
- package/build/libarkts-copy/src/arkts-api/utilities/private.ts +5 -5
- package/build/libarkts-copy/src/arkts-api/utilities/public.ts +217 -29
- package/build/libarkts-copy/src/arkts-api/visitor.ts +17 -10
- package/build/libarkts-copy/src/checkSdk.ts +15 -0
- package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +343 -321
- package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +97 -14
- package/build/libarkts-copy/src/generated/factory.ts +40 -27
- package/build/libarkts-copy/src/generated/index.ts +4 -2
- package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/ArkTsConfig.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +26 -8
- package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/AstDumper.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AstVerifier.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AstVisitor.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/BindingProps.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/CallExpression.ts +19 -7
- package/build/libarkts-copy/src/generated/peers/CatchClause.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +21 -8
- package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +37 -13
- package/build/libarkts-copy/src/generated/peers/ClassElement.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +19 -7
- package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/CodeGen.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/Declaration.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/Decorator.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/DiagnosticInfo.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/DynamicImportData.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +20 -13
- package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSIntrinsicNode.ts +77 -0
- package/build/libarkts-copy/src/generated/peers/ETSKeyofType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSModule.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +46 -14
- package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +3 -3
- package/build/libarkts-copy/src/generated/peers/ETSStringLiteralType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +21 -9
- package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +20 -7
- package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/ErrorLogger.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +20 -8
- package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/Expression.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +5 -3
- package/build/libarkts-copy/src/generated/peers/FunctionDecl.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +11 -5
- package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/IRNode.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/Identifier.ts +14 -6
- package/build/libarkts-copy/src/generated/peers/IfStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/ImportSource.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/IndexInfo.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/InterfaceDecl.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/LabelPair.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/Literal.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +23 -7
- package/build/libarkts-copy/src/generated/peers/NamedType.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/NewExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +17 -7
- package/build/libarkts-copy/src/generated/peers/ObjectDescriptor.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/OverloadDeclaration.ts +103 -0
- package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/Program.ts +4 -2
- package/build/libarkts-copy/src/generated/peers/Property.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/ScopeFindResult.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +47 -14
- package/build/libarkts-copy/src/generated/peers/ScriptFunctionData.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/SignatureInfo.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/SourcePosition.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/SourceRange.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/Statement.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/SuggestionInfo.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +19 -6
- package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSImportType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSInferType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +21 -8
- package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSThisType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +42 -11
- package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/TryStatement.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/TypeNode.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +8 -4
- package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/VReg.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +20 -8
- package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +12 -6
- package/build/libarkts-copy/src/generated/peers/VerificationContext.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/VerifierMessage.ts +2 -2
- package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +9 -5
- package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +9 -5
- package/build/libarkts-copy/src/index.ts +1 -4
- package/build/libarkts-copy/src/plugin-utils.ts +45 -32
- package/build/libarkts-copy/src/reexport-for-generated.ts +10 -1
- package/build/libarkts-copy/src/ts-api/factory/nodeFactory.ts +14 -14
- package/build/libarkts-copy/src/ts-api/index.ts +1 -1
- package/build/libarkts-copy/src/ts-api/types.ts +56 -56
- package/build/libarkts-copy/src/ts-api/utilities/private.ts +6 -6
- package/build/libarkts-copy/src/ts-api/utilities/public.ts +3 -3
- package/build/libarkts-copy/src/ts-api/visitor/visitor.ts +4 -4
- package/build/libarkts-copy/src/utils.ts +13 -159
- package/build/libarkts-copy/src/wrapper-compat/README.md +4 -0
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/index.ts +5 -5
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ArrayExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ArrowFunctionExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/AssignmentExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/BlockStatement.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/CallExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassDefinition.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassProperty.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSFunctionType.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSImportDeclaration.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSParameterExpression.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ExpressionStatement.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/FunctionDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/FunctionExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/IfStatement.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/MemberExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/MethodDefinition.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/NumberLiteral.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ObjectExpression.ts +3 -3
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/Property.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ScriptFunction.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/StructDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSInterfaceDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSTypeAliasDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSTypeParameter.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TryStatement.ts +3 -3
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/VariableDeclaration.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/VariableDeclarator.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Diagnostic.ts +4 -5
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/DiagnosticInfo.ts +4 -3
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/DiagnosticKind.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/ImportPathManager.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Program.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SourcePosition.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SourceRange.ts +2 -2
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SuggestionInfo.ts +4 -3
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/to-be-generated/MemberExpression.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/types.ts +12 -30
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/nativePtrDecoder.ts +1 -1
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/private.ts +4 -4
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/public.ts +10 -8
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/visitor.ts +10 -10
- package/lib/index.js +2799 -2665
- package/package.json +2 -2
- package/templates/Es2pandaEnums.ts +1 -2
- package/templates/Es2pandaNativeModule.ts +2 -3
- package/templates/factory.ts +1 -2
- package/templates/index.ts +1 -2
- package/templates/node-map.ts +1 -2
- package/templates/peer.ts +1 -2
- package/build/libarkts-copy/src/arkts-api/CheckedBackFilter.ts +0 -131
- package/build/libarkts-copy/src/arkts-api/CompileWithCache.ts +0 -193
- package/build/libarkts-copy/src/arkts-api/InferVoidReturnType.ts +0 -89
- package/build/libarkts-copy/src/arkts-api/SetBaseOverloads.ts +0 -44
- package/build/libarkts-copy/src/arkts-api/node-utilities/AnnotationUsage.ts +0 -29
- package/build/libarkts-copy/src/arkts-api/node-utilities/ArrowFunctionExpression.ts +0 -49
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDeclaration.ts +0 -54
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeAliasDeclaration.ts +0 -68
- package/build/libarkts-copy/src/arkts-api/node-utilities/VariableDeclaration.ts +0 -54
- package/build/libarkts-copy/src/arkts-api/utilities/method-definition.ts +0 -38
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/ArktsObject.ts +0 -45
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Config.ts +0 -53
- package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Context.ts +0 -60
|
@@ -17,20 +17,18 @@ import {
|
|
|
17
17
|
Es2pandaContextState,
|
|
18
18
|
PluginContext,
|
|
19
19
|
ImportStorage,
|
|
20
|
-
setBaseOverloads,
|
|
21
20
|
arktsGlobal,
|
|
22
21
|
ChainExpressionFilter,
|
|
23
22
|
ProgramTransformer,
|
|
24
23
|
Program,
|
|
25
|
-
inferVoidReturnType,
|
|
26
24
|
ProgramProvider,
|
|
27
|
-
CompilationOptions
|
|
25
|
+
CompilationOptions,
|
|
26
|
+
dumpProgramSrcFormatted
|
|
28
27
|
} from "./arkts-api"
|
|
29
|
-
import { AstNode } from "./reexport-for-generated"
|
|
30
28
|
|
|
31
29
|
export interface RunTransformerHooks {
|
|
32
|
-
onProgramTransformStart?(options: CompilationOptions): void
|
|
33
|
-
onProgramTransformEnd?(options: CompilationOptions): void
|
|
30
|
+
onProgramTransformStart?(options: CompilationOptions, program: Program): void
|
|
31
|
+
onProgramTransformEnd?(options: CompilationOptions, program: Program): void
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
class ASTCache {
|
|
@@ -44,33 +42,50 @@ class ASTCache {
|
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
|
|
45
|
+
export class DumpingHooks implements RunTransformerHooks {
|
|
46
|
+
constructor(private state: Es2pandaContextState, private pluginName: string, private dumpAst: boolean = false) {
|
|
47
|
+
if (process.env.KOALA_DUMP_PLUGIN_AST) {
|
|
48
|
+
this.dumpAst = true
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
onProgramTransformStart(options: CompilationOptions, program: Program) {
|
|
52
|
+
if (this.dumpAst) {
|
|
53
|
+
console.log(`BEFORE ${this.pluginName}:`)
|
|
54
|
+
dumpProgramSrcFormatted(program, true)
|
|
55
|
+
}
|
|
56
|
+
if (!options.isProgramForCodegeneration) arktsGlobal.profiler.transformDepStarted()
|
|
57
|
+
}
|
|
58
|
+
onProgramTransformEnd(options: CompilationOptions, program: Program) {
|
|
59
|
+
if (!options.isProgramForCodegeneration) arktsGlobal.profiler.transformDepEnded(this.state, this.pluginName)
|
|
60
|
+
if (this.dumpAst) {
|
|
61
|
+
console.log(`AFTER ${this.pluginName}:`)
|
|
62
|
+
dumpProgramSrcFormatted(program, true)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
47
68
|
export function runTransformerOnProgram(program: Program, options: CompilationOptions, transform: ProgramTransformer | undefined, pluginContext: PluginContext, hooks: RunTransformerHooks = {}) {
|
|
48
69
|
// Perform some additional actions before the transformation start
|
|
49
|
-
hooks.onProgramTransformStart?.(options)
|
|
50
|
-
|
|
51
|
-
// AST to be transformed
|
|
52
|
-
const ast = program.ast
|
|
70
|
+
hooks.onProgramTransformStart?.(options, program)
|
|
53
71
|
|
|
54
72
|
// Save currently existing imports in the program
|
|
55
|
-
const importStorage = new ImportStorage(program, options.
|
|
56
|
-
|
|
57
|
-
// Run some common plugins that should be run before plugin usage and depends on the current stage
|
|
58
|
-
stageSpecificPreFilters(ast, options.stage)
|
|
73
|
+
const importStorage = new ImportStorage(program, options.state == Es2pandaContextState.ES2PANDA_STATE_PARSED)
|
|
59
74
|
|
|
60
75
|
// Run the plugin itself
|
|
61
76
|
transform?.(program, options, pluginContext)
|
|
62
77
|
|
|
63
|
-
// Run some common plugins that should be run after plugin usage and depends on the current
|
|
64
|
-
|
|
78
|
+
// Run some common plugins that should be run after plugin usage and depends on the current state
|
|
79
|
+
stateSpecificPostFilters(program, options.state)
|
|
65
80
|
|
|
66
81
|
// Update internal import information based on import modification by plugin
|
|
67
82
|
importStorage.update()
|
|
68
83
|
|
|
69
84
|
// Perform some additional actions after the transformation end
|
|
70
|
-
hooks.onProgramTransformEnd?.(options)
|
|
85
|
+
hooks.onProgramTransformEnd?.(options, program)
|
|
71
86
|
}
|
|
72
87
|
|
|
73
|
-
export function runTransformer(prog: Program, state: Es2pandaContextState,
|
|
88
|
+
export function runTransformer(prog: Program, state: Es2pandaContextState, transform: ProgramTransformer | undefined, pluginContext: PluginContext, hooks: RunTransformerHooks = {}) {
|
|
74
89
|
// Program provider used to provide programs to transformer dynamically relative to inserted imports
|
|
75
90
|
const provider = new ProgramProvider(prog)
|
|
76
91
|
|
|
@@ -81,15 +96,13 @@ export function runTransformer(prog: Program, state: Es2pandaContextState, resta
|
|
|
81
96
|
while (currentProgram) {
|
|
82
97
|
// Options passed to plugin and hooks
|
|
83
98
|
const options: CompilationOptions = {
|
|
84
|
-
isMainProgram,
|
|
85
|
-
|
|
86
|
-
restart,
|
|
99
|
+
isProgramForCodegeneration: isProgramForCodegeneration(currentProgram, isMainProgram),
|
|
100
|
+
state,
|
|
87
101
|
}
|
|
88
102
|
|
|
89
103
|
runTransformerOnProgram(currentProgram, options, transform, pluginContext, hooks)
|
|
90
104
|
|
|
91
|
-
// The first program is always the main program
|
|
92
|
-
if (restart) break
|
|
105
|
+
// The first program is always the main program
|
|
93
106
|
isMainProgram = false
|
|
94
107
|
|
|
95
108
|
// Proceed to the next program
|
|
@@ -97,18 +110,18 @@ export function runTransformer(prog: Program, state: Es2pandaContextState, resta
|
|
|
97
110
|
}
|
|
98
111
|
}
|
|
99
112
|
|
|
100
|
-
function
|
|
101
|
-
arktsGlobal.es2panda._AstNodeUpdateAll(arktsGlobal.context, ast.peer)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function stageSpecificPreFilters(script: AstNode, state: Es2pandaContextState) {
|
|
113
|
+
function stateSpecificPostFilters(program: Program, state: Es2pandaContextState) {
|
|
105
114
|
if (state == Es2pandaContextState.ES2PANDA_STATE_CHECKED) {
|
|
106
|
-
|
|
115
|
+
program.setAst(new ChainExpressionFilter().visitor(program.ast))
|
|
107
116
|
}
|
|
108
117
|
}
|
|
109
118
|
|
|
110
|
-
function
|
|
111
|
-
|
|
112
|
-
|
|
119
|
+
function isProgramForCodegeneration(
|
|
120
|
+
program: Program,
|
|
121
|
+
isMainProgram: boolean,
|
|
122
|
+
): boolean {
|
|
123
|
+
if (!arktsGlobal.isContextGenerateAbcForExternalSourceFiles) {
|
|
124
|
+
return isMainProgram
|
|
113
125
|
}
|
|
126
|
+
return program.isGenAbcForExternal
|
|
114
127
|
}
|
|
@@ -31,4 +31,13 @@ export {
|
|
|
31
31
|
export { nodeByType } from "./arkts-api/class-by-peer"
|
|
32
32
|
export { global } from "./arkts-api/static/global"
|
|
33
33
|
export { Es2pandaMemberExpressionKind } from "./generated/Es2pandaEnums"
|
|
34
|
-
export {
|
|
34
|
+
export {
|
|
35
|
+
extension_ETSModuleGetNamespaceFlag,
|
|
36
|
+
extension_MethodDefinitionOnUpdate,
|
|
37
|
+
extension_MethodDefinitionSetChildrenParentPtr,
|
|
38
|
+
extension_ScriptFunctionGetSignaturePointer,
|
|
39
|
+
extension_ScriptFunctionSetSignaturePointer,
|
|
40
|
+
extension_ScriptFunctionGetPreferredReturnTypePointer,
|
|
41
|
+
extension_ScriptFunctionSetPreferredReturnTypePointer,
|
|
42
|
+
extension_ProgramGetExternalSources,
|
|
43
|
+
} from "./arkts-api/utilities/extensions"
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
ImportSpecifier,
|
|
86
86
|
} from "../types"
|
|
87
87
|
|
|
88
|
-
//
|
|
88
|
+
// Improve: add flags and base
|
|
89
89
|
export function createNodeFactory() {
|
|
90
90
|
return {
|
|
91
91
|
createSourceFile,
|
|
@@ -154,7 +154,7 @@ export function createNodeFactory() {
|
|
|
154
154
|
return new SourceFile(node)
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
//
|
|
157
|
+
// Improve: fix (now doesn't create a new node)
|
|
158
158
|
// @api
|
|
159
159
|
// updateSourceFile(
|
|
160
160
|
// node: SourceFile,
|
|
@@ -315,7 +315,7 @@ export function createNodeFactory() {
|
|
|
315
315
|
): VariableDeclaration {
|
|
316
316
|
return new VariableDeclaration(
|
|
317
317
|
arkts.factory.createVariableDeclarator(
|
|
318
|
-
//
|
|
318
|
+
// Improve: maybe incorrect
|
|
319
319
|
Es2pandaVariableDeclaratorFlag.VARIABLE_DECLARATOR_FLAG_UNKNOWN,
|
|
320
320
|
passIdentifier(name, type),
|
|
321
321
|
passNode(initializer)
|
|
@@ -341,7 +341,7 @@ export function createNodeFactory() {
|
|
|
341
341
|
return new VariableDeclaration(
|
|
342
342
|
arkts.factory.updateVariableDeclarator(
|
|
343
343
|
node.node,
|
|
344
|
-
//
|
|
344
|
+
// Improve: maybe incorrect
|
|
345
345
|
Es2pandaVariableDeclaratorFlag.VARIABLE_DECLARATOR_FLAG_UNKNOWN,
|
|
346
346
|
passIdentifier(name, type),
|
|
347
347
|
passNode(initializer)
|
|
@@ -867,7 +867,7 @@ export function createNodeFactory() {
|
|
|
867
867
|
)
|
|
868
868
|
}
|
|
869
869
|
|
|
870
|
-
//
|
|
870
|
+
// Improve: rewrite maybe
|
|
871
871
|
// @api
|
|
872
872
|
// createToken(
|
|
873
873
|
// token: SyntaxKind._
|
|
@@ -1017,7 +1017,7 @@ export function createNodeFactory() {
|
|
|
1017
1017
|
passNodeArray(members),
|
|
1018
1018
|
// passModifiers(modifiers) | es2panda_ModifierFlags.MODIFIER_FLAGS_PUBLIC | es2panda_ModifierFlags.MODIFIER_FLAGS_STATIC,
|
|
1019
1019
|
Es2pandaModifierFlags.MODIFIER_FLAGS_NONE,
|
|
1020
|
-
//
|
|
1020
|
+
// Improve: pass through modifiers
|
|
1021
1021
|
Es2pandaClassDefinitionModifiers.CLASS_DEFINITION_MODIFIERS_NONE,
|
|
1022
1022
|
passTypeParams(typeParameters),
|
|
1023
1023
|
undefined
|
|
@@ -1052,7 +1052,7 @@ export function createNodeFactory() {
|
|
|
1052
1052
|
passNodeArray(members),
|
|
1053
1053
|
// passModifiers(modifiers) | es2panda_ModifierFlags.MODIFIER_FLAGS_PUBLIC | es2panda_ModifierFlags.MODIFIER_FLAGS_STATIC,
|
|
1054
1054
|
Es2pandaModifierFlags.MODIFIER_FLAGS_NONE,
|
|
1055
|
-
//
|
|
1055
|
+
// Improve: pass through modifiers
|
|
1056
1056
|
Es2pandaClassDefinitionModifiers.CLASS_DEFINITION_MODIFIERS_NONE,
|
|
1057
1057
|
passTypeParams(typeParameters)
|
|
1058
1058
|
)
|
|
@@ -1109,7 +1109,7 @@ export function createNodeFactory() {
|
|
|
1109
1109
|
)
|
|
1110
1110
|
}
|
|
1111
1111
|
|
|
1112
|
-
//
|
|
1112
|
+
// Improve: fix modifiers
|
|
1113
1113
|
// @api
|
|
1114
1114
|
// createMethodDeclaration(
|
|
1115
1115
|
// modifiers: readonly ModifierLike[] | undefined,
|
|
@@ -1186,7 +1186,7 @@ export function createNodeFactory() {
|
|
|
1186
1186
|
Es2pandaMethodDefinitionKind.METHOD_DEFINITION_KIND_METHOD,
|
|
1187
1187
|
_name,
|
|
1188
1188
|
arkts.factory.createFunctionExpression(
|
|
1189
|
-
//
|
|
1189
|
+
// Improve: maybe fix
|
|
1190
1190
|
arkts.factory.updateScriptFunction(
|
|
1191
1191
|
node.node.scriptFunction,
|
|
1192
1192
|
passNode(body),
|
|
@@ -1231,7 +1231,7 @@ export function createNodeFactory() {
|
|
|
1231
1231
|
arkts.FunctionSignature.create(
|
|
1232
1232
|
undefined,
|
|
1233
1233
|
passNodeArray(parameters),
|
|
1234
|
-
//
|
|
1234
|
+
// Improve: change to void maybe
|
|
1235
1235
|
undefined
|
|
1236
1236
|
),
|
|
1237
1237
|
passModifiersToScriptFunction(modifiers) | Es2pandaScriptFunctionFlags.SCRIPT_FUNCTION_FLAGS_CONSTRUCTOR,
|
|
@@ -1269,14 +1269,14 @@ export function createNodeFactory() {
|
|
|
1269
1269
|
Es2pandaMethodDefinitionKind.METHOD_DEFINITION_KIND_CONSTRUCTOR,
|
|
1270
1270
|
_name,
|
|
1271
1271
|
arkts.factory.createFunctionExpression(
|
|
1272
|
-
//
|
|
1272
|
+
// Improve: maybe fix
|
|
1273
1273
|
arkts.factory.updateScriptFunction(
|
|
1274
1274
|
node.node.scriptFunction,
|
|
1275
1275
|
passNode(body),
|
|
1276
1276
|
arkts.FunctionSignature.create(
|
|
1277
1277
|
undefined,
|
|
1278
1278
|
passNodeArray(parameters),
|
|
1279
|
-
//
|
|
1279
|
+
// Improve: change to void maybe
|
|
1280
1280
|
undefined
|
|
1281
1281
|
),
|
|
1282
1282
|
passModifiersToScriptFunction(modifiers) | Es2pandaScriptFunctionFlags.SCRIPT_FUNCTION_FLAGS_CONSTRUCTOR,
|
|
@@ -1324,7 +1324,7 @@ export function createNodeFactory() {
|
|
|
1324
1324
|
expression: Expression
|
|
1325
1325
|
): ParenthesizedExpression {
|
|
1326
1326
|
return expression
|
|
1327
|
-
//
|
|
1327
|
+
// Improve:
|
|
1328
1328
|
// return new ParenthesizedExpression(
|
|
1329
1329
|
// expression
|
|
1330
1330
|
// )
|
|
@@ -1340,7 +1340,7 @@ export function createNodeFactory() {
|
|
|
1340
1340
|
expression: Expression
|
|
1341
1341
|
): ParenthesizedExpression {
|
|
1342
1342
|
return expression
|
|
1343
|
-
//
|
|
1343
|
+
// Improve:
|
|
1344
1344
|
// return new ParenthesizedExpression(
|
|
1345
1345
|
// expression
|
|
1346
1346
|
// )
|
|
@@ -19,7 +19,7 @@ import * as arkts from "../arkts-api"
|
|
|
19
19
|
import { throwError } from "../utils"
|
|
20
20
|
import {
|
|
21
21
|
passModifiers,
|
|
22
|
-
|
|
22
|
+
emptyImplementation,
|
|
23
23
|
unpackModifiers,
|
|
24
24
|
unpackNode,
|
|
25
25
|
unpackNodeArray,
|
|
@@ -27,13 +27,13 @@ import {
|
|
|
27
27
|
} from "./utilities/private"
|
|
28
28
|
import { SyntaxKind } from "./static/enums"
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// Improve: write implementation
|
|
31
31
|
export interface TransformationContext {}
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// Improve: write implementation
|
|
34
34
|
export interface Program {}
|
|
35
35
|
|
|
36
|
-
//
|
|
36
|
+
// Improve: remove U type param
|
|
37
37
|
export type NodeArray<T extends Node<U>, U extends arkts.AstNode | undefined = arkts.AstNode | undefined> = ts.NodeArray<T>
|
|
38
38
|
|
|
39
39
|
export abstract class Node<T extends arkts.AstNode | undefined = arkts.AstNode | undefined> implements ts.Node {
|
|
@@ -43,7 +43,7 @@ export abstract class Node<T extends arkts.AstNode | undefined = arkts.AstNode |
|
|
|
43
43
|
|
|
44
44
|
readonly node: T
|
|
45
45
|
|
|
46
|
-
//
|
|
46
|
+
// Improve: remove any
|
|
47
47
|
get parent(): any {
|
|
48
48
|
if (this.node === undefined) {
|
|
49
49
|
throwError('trying to get parent of undefined _node')
|
|
@@ -74,7 +74,7 @@ export abstract class Node<T extends arkts.AstNode | undefined = arkts.AstNode |
|
|
|
74
74
|
|
|
75
75
|
abstract kind: SyntaxKind
|
|
76
76
|
|
|
77
|
-
//
|
|
77
|
+
// Improve:
|
|
78
78
|
forEachChild<T>(cbNode: (node: ts.Node) => T | undefined, cbNodeArray?: ((nodes: ts.NodeArray<ts.Node>) => T | undefined) | undefined): T | undefined { throw new Error("Method not implemented.") }
|
|
79
79
|
getSourceFile(): ts.SourceFile { throw new Error("Method not implemented.") }
|
|
80
80
|
getChildCount(sourceFile?: ts.SourceFile | undefined): number { throw new Error("Method not implemented.") }
|
|
@@ -92,13 +92,13 @@ export abstract class Node<T extends arkts.AstNode | undefined = arkts.AstNode |
|
|
|
92
92
|
getFirstToken(sourceFile?: ts.SourceFile | undefined): ts.Node | undefined { throw new Error("Method not implemented.") }
|
|
93
93
|
getLastToken(sourceFile?: ts.SourceFile | undefined): ts.Node | undefined { throw new Error("Method not implemented.") }
|
|
94
94
|
|
|
95
|
-
get symbol(): ts.Symbol { return
|
|
96
|
-
get flags(): ts.NodeFlags { return
|
|
97
|
-
get pos(): number { return
|
|
98
|
-
get end(): number { return
|
|
95
|
+
get symbol(): ts.Symbol { return emptyImplementation() }
|
|
96
|
+
get flags(): ts.NodeFlags { return emptyImplementation() }
|
|
97
|
+
get pos(): number { return emptyImplementation() }
|
|
98
|
+
get end(): number { return emptyImplementation() }
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
//
|
|
101
|
+
// Improve: add all tokens
|
|
102
102
|
export type BinaryOperator =
|
|
103
103
|
| ts.SyntaxKind.PlusToken
|
|
104
104
|
| ts.SyntaxKind.MinusToken
|
|
@@ -107,7 +107,7 @@ export type BinaryOperator =
|
|
|
107
107
|
|
|
108
108
|
export type BinaryOperatorToken = Token<BinaryOperator>;
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// Improve: rethink maybe (temporary solution)
|
|
111
111
|
export class Token<TKind extends ts.TokenSyntaxKind> extends Node<undefined> {
|
|
112
112
|
constructor(kind: TKind) {
|
|
113
113
|
super(undefined)
|
|
@@ -149,7 +149,7 @@ export class Modifier extends Node<undefined> {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
export abstract class Expression extends Node<arkts.AstNode> implements ts.Expression {
|
|
152
|
-
//
|
|
152
|
+
// Improve: support minimal interface
|
|
153
153
|
_expressionBrand: any
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -212,8 +212,8 @@ export class Identifier extends Node<arkts.Identifier> implements ts.Identifier,
|
|
|
212
212
|
readonly text: string
|
|
213
213
|
readonly kind: ts.SyntaxKind.Identifier = ts.SyntaxKind.Identifier
|
|
214
214
|
|
|
215
|
-
//
|
|
216
|
-
get escapedText(): ts.__String { return
|
|
215
|
+
// Improve:
|
|
216
|
+
get escapedText(): ts.__String { return emptyImplementation() }
|
|
217
217
|
|
|
218
218
|
// brands
|
|
219
219
|
_primaryExpressionBrand: any
|
|
@@ -237,8 +237,8 @@ export class PrivateIdentifier extends Node<arkts.Identifier> implements ts.Priv
|
|
|
237
237
|
readonly text: string
|
|
238
238
|
readonly kind: ts.SyntaxKind.PrivateIdentifier = ts.SyntaxKind.PrivateIdentifier
|
|
239
239
|
|
|
240
|
-
//
|
|
241
|
-
get escapedText(): ts.__String { return
|
|
240
|
+
// Improve:
|
|
241
|
+
get escapedText(): ts.__String { return emptyImplementation() }
|
|
242
242
|
|
|
243
243
|
// brands
|
|
244
244
|
_primaryExpressionBrand: any
|
|
@@ -278,23 +278,23 @@ export class SourceFile extends Node<arkts.EtsScript> implements ts.SourceFile {
|
|
|
278
278
|
readonly statements: NodeArray<Statement>
|
|
279
279
|
readonly kind: ts.SyntaxKind.SourceFile = ts.SyntaxKind.SourceFile
|
|
280
280
|
|
|
281
|
-
//
|
|
281
|
+
// Improve:
|
|
282
282
|
getLineAndCharacterOfPosition(pos: number): ts.LineAndCharacter { throw new Error("Method not implemented.") }
|
|
283
283
|
getLineEndOfPosition(pos: number): number { throw new Error("Method not implemented.") }
|
|
284
284
|
getLineStarts(): readonly number[] { throw new Error("Method not implemented.") }
|
|
285
285
|
getPositionOfLineAndCharacter(line: number, character: number): number { throw new Error("Method not implemented.") }
|
|
286
286
|
update(newText: string, textChangeRange: ts.TextChangeRange): ts.SourceFile { throw new Error("Method not implemented.") }
|
|
287
|
-
get endOfFileToken(): ts.Token<ts.SyntaxKind.EndOfFileToken> { return
|
|
288
|
-
get fileName(): string { return
|
|
289
|
-
get text() { return
|
|
290
|
-
get amdDependencies(): readonly ts.AmdDependency[] { return
|
|
291
|
-
get referencedFiles(): readonly ts.FileReference[] { return
|
|
292
|
-
get typeReferenceDirectives(): readonly ts.FileReference[] { return
|
|
293
|
-
get libReferenceDirectives(): readonly ts.FileReference[] { return
|
|
294
|
-
get languageVariant(): ts.LanguageVariant { return
|
|
295
|
-
get isDeclarationFile(): boolean { return
|
|
296
|
-
get hasNoDefaultLib(): boolean { return
|
|
297
|
-
get languageVersion(): ts.ScriptTarget { return
|
|
287
|
+
get endOfFileToken(): ts.Token<ts.SyntaxKind.EndOfFileToken> { return emptyImplementation() }
|
|
288
|
+
get fileName(): string { return emptyImplementation() }
|
|
289
|
+
get text() { return emptyImplementation() }
|
|
290
|
+
get amdDependencies(): readonly ts.AmdDependency[] { return emptyImplementation() }
|
|
291
|
+
get referencedFiles(): readonly ts.FileReference[] { return emptyImplementation() }
|
|
292
|
+
get typeReferenceDirectives(): readonly ts.FileReference[] { return emptyImplementation() }
|
|
293
|
+
get libReferenceDirectives(): readonly ts.FileReference[] { return emptyImplementation() }
|
|
294
|
+
get languageVariant(): ts.LanguageVariant { return emptyImplementation() }
|
|
295
|
+
get isDeclarationFile(): boolean { return emptyImplementation() }
|
|
296
|
+
get hasNoDefaultLib(): boolean { return emptyImplementation() }
|
|
297
|
+
get languageVersion(): ts.ScriptTarget { return emptyImplementation() }
|
|
298
298
|
|
|
299
299
|
// brands
|
|
300
300
|
_declarationBrand: any
|
|
@@ -407,11 +407,11 @@ export abstract class ClassElement extends Node<arkts.AstNode> implements ts.Cla
|
|
|
407
407
|
|
|
408
408
|
export type MemberName = Identifier | PrivateIdentifier;
|
|
409
409
|
|
|
410
|
-
//
|
|
410
|
+
// Improve: support
|
|
411
411
|
// export type PropertyName = Identifier | StringLiteral | NumericLiteral | ts.ComputedPropertyName | PrivateIdentifier;
|
|
412
412
|
export type PropertyName = Identifier | StringLiteral | NumericLiteral | PrivateIdentifier;
|
|
413
413
|
|
|
414
|
-
//
|
|
414
|
+
// Improve: support
|
|
415
415
|
export type DeclarationName =
|
|
416
416
|
| PropertyName
|
|
417
417
|
// | JsxAttributeName
|
|
@@ -440,7 +440,7 @@ export interface FunctionLikeDeclarationBase extends SignatureDeclarationBase {
|
|
|
440
440
|
_functionLikeDeclarationBrand: any;
|
|
441
441
|
}
|
|
442
442
|
|
|
443
|
-
//
|
|
443
|
+
// Improve: support
|
|
444
444
|
// export type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ConstructorDeclaration | FunctionExpression | ArrowFunction;
|
|
445
445
|
export type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | FunctionExpression | ArrowFunction;
|
|
446
446
|
|
|
@@ -453,7 +453,7 @@ export class MethodSignature extends Node<arkts.AstNode> implements ts.MethodSig
|
|
|
453
453
|
// readonly parameters: NodeArray<ParameterDeclaration>
|
|
454
454
|
readonly kind: ts.SyntaxKind.MethodSignature = ts.SyntaxKind.MethodSignature
|
|
455
455
|
|
|
456
|
-
//
|
|
456
|
+
// Improve:
|
|
457
457
|
name: any
|
|
458
458
|
parameters: any
|
|
459
459
|
|
|
@@ -508,7 +508,7 @@ export class ConstructorDeclaration extends Node<arkts.MethodDefinition> impleme
|
|
|
508
508
|
_declarationBrand: any
|
|
509
509
|
}
|
|
510
510
|
|
|
511
|
-
//
|
|
511
|
+
// Improve: specify arkts.AstNode type
|
|
512
512
|
export class PropertySignature extends Node<arkts.AstNode> implements ts.TypeElement {
|
|
513
513
|
constructor(node: arkts.AstNode) {
|
|
514
514
|
super(node)
|
|
@@ -522,7 +522,7 @@ export class PropertySignature extends Node<arkts.AstNode> implements ts.TypeEle
|
|
|
522
522
|
_declarationBrand: any
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
//
|
|
525
|
+
// Improve: specify arkts.AstNode type
|
|
526
526
|
export class PropertyDeclaration extends Node<arkts.AstNode> implements ts.PropertyDeclaration, ClassElement {
|
|
527
527
|
constructor(node: arkts.AstNode) {
|
|
528
528
|
super(node)
|
|
@@ -530,7 +530,7 @@ export class PropertyDeclaration extends Node<arkts.AstNode> implements ts.Prope
|
|
|
530
530
|
|
|
531
531
|
readonly kind: ts.SyntaxKind.PropertyDeclaration = ts.SyntaxKind.PropertyDeclaration
|
|
532
532
|
|
|
533
|
-
//
|
|
533
|
+
// Improve:
|
|
534
534
|
name: any
|
|
535
535
|
|
|
536
536
|
// brands
|
|
@@ -538,7 +538,7 @@ export class PropertyDeclaration extends Node<arkts.AstNode> implements ts.Prope
|
|
|
538
538
|
_declarationBrand: any
|
|
539
539
|
}
|
|
540
540
|
|
|
541
|
-
//
|
|
541
|
+
// Improve: specify arkts.AstNode type
|
|
542
542
|
export class GetAccessorDeclaration extends Node<arkts.AstNode> implements ts.GetAccessorDeclaration, FunctionLikeDeclarationBase, ClassElement {
|
|
543
543
|
constructor(node: arkts.AstNode) {
|
|
544
544
|
super(node)
|
|
@@ -548,7 +548,7 @@ export class GetAccessorDeclaration extends Node<arkts.AstNode> implements ts.Ge
|
|
|
548
548
|
// readonly parameters: NodeArray<ParameterDeclaration>
|
|
549
549
|
readonly kind: ts.SyntaxKind.GetAccessor = ts.SyntaxKind.GetAccessor
|
|
550
550
|
|
|
551
|
-
//
|
|
551
|
+
// Improve:
|
|
552
552
|
name: any
|
|
553
553
|
parameters: any
|
|
554
554
|
|
|
@@ -560,7 +560,7 @@ export class GetAccessorDeclaration extends Node<arkts.AstNode> implements ts.Ge
|
|
|
560
560
|
_objectLiteralBrand: any
|
|
561
561
|
}
|
|
562
562
|
|
|
563
|
-
//
|
|
563
|
+
// Improve: specify arkts.AstNode type
|
|
564
564
|
export class SetAccessorDeclaration extends Node<arkts.AstNode> implements ts.SetAccessorDeclaration, FunctionLikeDeclarationBase, ClassElement {
|
|
565
565
|
constructor(node: arkts.AstNode) {
|
|
566
566
|
super(node)
|
|
@@ -570,7 +570,7 @@ export class SetAccessorDeclaration extends Node<arkts.AstNode> implements ts.Se
|
|
|
570
570
|
// readonly parameters: NodeArray<ParameterDeclaration>
|
|
571
571
|
readonly kind: ts.SyntaxKind.SetAccessor = ts.SyntaxKind.SetAccessor
|
|
572
572
|
|
|
573
|
-
//
|
|
573
|
+
// Improve:
|
|
574
574
|
name: any
|
|
575
575
|
parameters: any
|
|
576
576
|
|
|
@@ -589,7 +589,7 @@ export class ParameterDeclaration extends Node<arkts.ETSParameterExpression> imp
|
|
|
589
589
|
|
|
590
590
|
readonly kind: ts.SyntaxKind.Parameter = ts.SyntaxKind.Parameter
|
|
591
591
|
|
|
592
|
-
//
|
|
592
|
+
// Improve:
|
|
593
593
|
name: any
|
|
594
594
|
|
|
595
595
|
// brands
|
|
@@ -671,7 +671,7 @@ export class TypeReferenceNode extends Node<arkts.AstNode> implements ts.TypeRef
|
|
|
671
671
|
|
|
672
672
|
readonly kind: ts.SyntaxKind.TypeReference = ts.SyntaxKind.TypeReference
|
|
673
673
|
|
|
674
|
-
//
|
|
674
|
+
// Improve:
|
|
675
675
|
typeName: any
|
|
676
676
|
|
|
677
677
|
// brands
|
|
@@ -686,7 +686,7 @@ export class FunctionTypeNode extends Node<arkts.AstNode> implements ts.Function
|
|
|
686
686
|
readonly name?: DeclarationName
|
|
687
687
|
readonly kind: ts.SyntaxKind.FunctionType = ts.SyntaxKind.FunctionType
|
|
688
688
|
|
|
689
|
-
//
|
|
689
|
+
// Improve: support minimal interface
|
|
690
690
|
parameters: any
|
|
691
691
|
type: any
|
|
692
692
|
|
|
@@ -728,7 +728,7 @@ export class IfStatement extends Node<arkts.IfStatement> implements ts.IfStateme
|
|
|
728
728
|
|
|
729
729
|
readonly kind: ts.SyntaxKind.IfStatement = ts.SyntaxKind.IfStatement
|
|
730
730
|
|
|
731
|
-
//
|
|
731
|
+
// Improve:
|
|
732
732
|
thenStatement: any
|
|
733
733
|
expression: any
|
|
734
734
|
|
|
@@ -743,7 +743,7 @@ export class BinaryExpression extends Node<arkts.BinaryExpression> implements ts
|
|
|
743
743
|
|
|
744
744
|
readonly kind: ts.SyntaxKind.BinaryExpression = ts.SyntaxKind.BinaryExpression
|
|
745
745
|
|
|
746
|
-
//
|
|
746
|
+
// Improve:
|
|
747
747
|
left: any
|
|
748
748
|
right: any
|
|
749
749
|
operatorToken: any
|
|
@@ -760,7 +760,7 @@ export class AssignmentExpression extends Node<arkts.AssignmentExpression> imple
|
|
|
760
760
|
|
|
761
761
|
readonly kind: ts.SyntaxKind.BinaryExpression = ts.SyntaxKind.BinaryExpression
|
|
762
762
|
|
|
763
|
-
//
|
|
763
|
+
// Improve:
|
|
764
764
|
right: any
|
|
765
765
|
left: any
|
|
766
766
|
operatorToken: any
|
|
@@ -785,7 +785,7 @@ export class ArrowFunction extends Node<arkts.ArrowFunctionExpression> implement
|
|
|
785
785
|
readonly parameters: NodeArray<ParameterDeclaration>
|
|
786
786
|
readonly kind: ts.SyntaxKind.ArrowFunction = ts.SyntaxKind.ArrowFunction
|
|
787
787
|
|
|
788
|
-
//
|
|
788
|
+
// Improve:
|
|
789
789
|
equalsGreaterThanToken: any
|
|
790
790
|
|
|
791
791
|
// brands
|
|
@@ -840,13 +840,13 @@ export class HeritageClause extends Node<arkts.SuperExpression> implements ts.He
|
|
|
840
840
|
// token: ts.SyntaxKind.ExtendsKeyword | ts.SyntaxKind.ImplementsKeyword
|
|
841
841
|
// types: ts.NodeArray<ts.ExpressionWithTypeArguments>
|
|
842
842
|
|
|
843
|
-
//
|
|
843
|
+
// Improve:
|
|
844
844
|
token: any
|
|
845
845
|
types: any
|
|
846
846
|
}
|
|
847
847
|
|
|
848
848
|
|
|
849
|
-
//
|
|
849
|
+
// Improve: there is no ParenthesizedExpression in ArkTS,
|
|
850
850
|
// so for temporary solution we're just gonna ignore this type of nodes
|
|
851
851
|
// and replace it with Expression underneath
|
|
852
852
|
export type ParenthesizedExpression = Expression
|
|
@@ -868,7 +868,7 @@ export type ParenthesizedExpression = Expression
|
|
|
868
868
|
// _expressionBrand: any
|
|
869
869
|
// }
|
|
870
870
|
|
|
871
|
-
//
|
|
871
|
+
// Improve:
|
|
872
872
|
export class ImportDeclaration extends Node<arkts.UnsupportedNode> implements ts.ImportDeclaration {
|
|
873
873
|
constructor(node: arkts.UnsupportedNode) {
|
|
874
874
|
super(node)
|
|
@@ -876,14 +876,14 @@ export class ImportDeclaration extends Node<arkts.UnsupportedNode> implements ts
|
|
|
876
876
|
|
|
877
877
|
readonly kind: ts.SyntaxKind.ImportDeclaration = ts.SyntaxKind.ImportDeclaration
|
|
878
878
|
|
|
879
|
-
//
|
|
879
|
+
// Improve:
|
|
880
880
|
moduleSpecifier: any
|
|
881
881
|
|
|
882
882
|
// brands
|
|
883
883
|
_statementBrand: any
|
|
884
884
|
}
|
|
885
885
|
|
|
886
|
-
//
|
|
886
|
+
// Improve:
|
|
887
887
|
export class ImportClause extends Node<arkts.UnsupportedNode> implements ts.ImportClause {
|
|
888
888
|
constructor(node: arkts.UnsupportedNode) {
|
|
889
889
|
super(node)
|
|
@@ -891,14 +891,14 @@ export class ImportClause extends Node<arkts.UnsupportedNode> implements ts.Impo
|
|
|
891
891
|
|
|
892
892
|
readonly kind: ts.SyntaxKind.ImportClause = ts.SyntaxKind.ImportClause
|
|
893
893
|
|
|
894
|
-
//
|
|
894
|
+
// Improve:
|
|
895
895
|
isTypeOnly: any
|
|
896
896
|
|
|
897
897
|
// brands
|
|
898
898
|
_declarationBrand: any
|
|
899
899
|
}
|
|
900
900
|
|
|
901
|
-
//
|
|
901
|
+
// Improve:
|
|
902
902
|
export class NamedImports extends Node<arkts.UnsupportedNode> implements ts.NamedImports {
|
|
903
903
|
constructor(node: arkts.UnsupportedNode) {
|
|
904
904
|
super(node)
|
|
@@ -906,7 +906,7 @@ export class NamedImports extends Node<arkts.UnsupportedNode> implements ts.Name
|
|
|
906
906
|
|
|
907
907
|
readonly kind: ts.SyntaxKind.NamedImports = ts.SyntaxKind.NamedImports
|
|
908
908
|
|
|
909
|
-
//
|
|
909
|
+
// Improve:
|
|
910
910
|
elements: any
|
|
911
911
|
}
|
|
912
912
|
|
|
@@ -919,7 +919,7 @@ export class ImportSpecifier extends Node<arkts.Identifier> implements ts.Import
|
|
|
919
919
|
readonly name: Identifier
|
|
920
920
|
readonly kind: ts.SyntaxKind.ImportSpecifier = ts.SyntaxKind.ImportSpecifier
|
|
921
921
|
|
|
922
|
-
//
|
|
922
|
+
// Improve:
|
|
923
923
|
isTypeOnly: any
|
|
924
924
|
|
|
925
925
|
// brands
|