@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.
- package/build/libarkts-copy/generator/options.json5 +155 -0
- package/build/libarkts-copy/native/meson.build +62 -0
- package/build/libarkts-copy/native/meson_options.txt +24 -0
- package/build/libarkts-copy/native/src/bridges.cc +265 -0
- package/build/libarkts-copy/native/src/common.cc +231 -0
- package/build/libarkts-copy/native/src/common.h +39 -0
- package/build/libarkts-copy/native/src/generated/bridges.cc +11979 -0
- package/build/libarkts-copy/package.json +51 -0
- package/build/libarkts-copy/src/Es2pandaEnums.ts +183 -0
- package/build/libarkts-copy/src/Es2pandaNativeModule.ts +123 -0
- package/build/libarkts-copy/src/InteropNativeModule.ts +50 -0
- package/build/libarkts-copy/src/arkts-api/class-by-peer.ts +31 -0
- package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +147 -0
- package/build/libarkts-copy/src/arkts-api/index.ts +28 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/createCallExpression.ts +40 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/createNumberLiteral.ts +28 -0
- package/build/libarkts-copy/src/arkts-api/node-utilities/createScriptFunction.ts +55 -0
- package/build/libarkts-copy/src/arkts-api/peers/ArktsObject.ts +45 -0
- package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +121 -0
- package/build/libarkts-copy/src/arkts-api/peers/Config.ts +52 -0
- package/build/libarkts-copy/src/arkts-api/peers/Context.ts +46 -0
- package/build/libarkts-copy/src/arkts-api/peers/Program.ts +55 -0
- package/build/libarkts-copy/src/arkts-api/static/global.ts +67 -0
- package/build/libarkts-copy/src/arkts-api/utilities/nativePtrDecoder.ts +69 -0
- package/build/libarkts-copy/src/arkts-api/utilities/private.ts +156 -0
- package/build/libarkts-copy/src/arkts-api/utilities/public.ts +135 -0
- package/build/libarkts-copy/src/arkts-api/visitor.ts +297 -0
- package/build/libarkts-copy/src/es2panda.ts +277 -0
- package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +1266 -0
- package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +3745 -0
- package/build/libarkts-copy/src/generated/factory.ts +1299 -0
- package/build/libarkts-copy/src/generated/index.ts +191 -0
- package/build/libarkts-copy/src/generated/node-map.ts +182 -0
- package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +39 -0
- package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +49 -0
- package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +110 -0
- package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +74 -0
- package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +98 -0
- package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +70 -0
- package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +95 -0
- package/build/libarkts-copy/src/generated/peers/AstDumper.ts +42 -0
- package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +95 -0
- package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +65 -0
- package/build/libarkts-copy/src/generated/peers/CallExpression.ts +97 -0
- package/build/libarkts-copy/src/generated/peers/CatchClause.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +233 -0
- package/build/libarkts-copy/src/generated/peers/ClassElement.ts +80 -0
- package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +70 -0
- package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +74 -0
- package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +65 -0
- package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/Decorator.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +52 -0
- package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/ETSDynamicFunctionType.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +84 -0
- package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +68 -0
- package/build/libarkts-copy/src/generated/peers/ETSLaunchExpression.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/ETSModule.ts +71 -0
- package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +69 -0
- package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +51 -0
- package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +126 -0
- package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +51 -0
- package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +51 -0
- package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +73 -0
- package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +68 -0
- package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +55 -0
- package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +56 -0
- package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +73 -0
- package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/Expression.ts +75 -0
- package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +59 -0
- package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +61 -0
- package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +61 -0
- package/build/libarkts-copy/src/generated/peers/FunctionDecl.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +69 -0
- package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/Identifier.ts +154 -0
- package/build/libarkts-copy/src/generated/peers/IfStatement.ts +65 -0
- package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +61 -0
- package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/ImportSource.ts +49 -0
- package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/InterfaceDecl.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/Literal.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +48 -0
- package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +95 -0
- package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +105 -0
- package/build/libarkts-copy/src/generated/peers/NamedType.ts +76 -0
- package/build/libarkts-copy/src/generated/peers/NewExpression.ts +56 -0
- package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +47 -0
- package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +90 -0
- package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/Property.ts +82 -0
- package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +201 -0
- package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +79 -0
- package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +82 -0
- package/build/libarkts-copy/src/generated/peers/Statement.ts +39 -0
- package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +56 -0
- package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +76 -0
- package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +65 -0
- package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +81 -0
- package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +66 -0
- package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +67 -0
- package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +61 -0
- package/build/libarkts-copy/src/generated/peers/TSImportType.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +65 -0
- package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +56 -0
- package/build/libarkts-copy/src/generated/peers/TSInferType.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +102 -0
- package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +64 -0
- package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +71 -0
- package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +66 -0
- package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +72 -0
- package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +67 -0
- package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSThisType.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +88 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +63 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +84 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +62 -0
- package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +61 -0
- package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +59 -0
- package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +54 -0
- package/build/libarkts-copy/src/generated/peers/TryStatement.ts +75 -0
- package/build/libarkts-copy/src/generated/peers/TypeNode.ts +49 -0
- package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +39 -0
- package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +40 -0
- package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +53 -0
- package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +57 -0
- package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +50 -0
- package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +60 -0
- package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +42 -0
- package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +71 -0
- package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +69 -0
- package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +58 -0
- package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +56 -0
- package/build/libarkts-copy/src/reexport-for-generated.ts +33 -0
- package/build/libarkts-copy/src/ts-api/factory/nodeFactory.ts +1375 -0
- package/build/libarkts-copy/src/ts-api/factory/nodeTests.ts +110 -0
- package/build/libarkts-copy/src/ts-api/index.ts +35 -0
- package/build/libarkts-copy/src/ts-api/static/enums.ts +18 -0
- package/build/libarkts-copy/src/ts-api/types.ts +920 -0
- package/build/libarkts-copy/src/ts-api/utilities/private.ts +289 -0
- package/build/libarkts-copy/src/ts-api/utilities/public.ts +55 -0
- package/build/libarkts-copy/src/ts-api/visitor/visitor.ts +155 -0
- package/build/libarkts-copy/src/utils.ts +89 -0
- package/build/libarkts-copy/tsconfig.json +15 -0
- package/lib/index.js +11858 -0
- package/package.json +54 -0
- package/templates/Es2pandaEnums.ts +16 -0
- package/templates/Es2pandaNativeModule.ts +32 -0
- package/templates/bridges.cc +18 -0
- package/templates/factory.ts +34 -0
- package/templates/index.ts +16 -0
- package/templates/node-map.ts +31 -0
- package/templates/peer.ts +32 -0
|
@@ -0,0 +1,233 @@
|
|
|
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
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { AnnotationUsage } from "./AnnotationUsage"
|
|
33
|
+
import { ClassDeclaration } from "./ClassDeclaration"
|
|
34
|
+
import { Es2pandaClassDefinitionModifiers } from "./../Es2pandaEnums"
|
|
35
|
+
import { Es2pandaModifierFlags } from "./../Es2pandaEnums"
|
|
36
|
+
import { Expression } from "./Expression"
|
|
37
|
+
import { FunctionExpression } from "./FunctionExpression"
|
|
38
|
+
import { Identifier } from "./Identifier"
|
|
39
|
+
import { MethodDefinition } from "./MethodDefinition"
|
|
40
|
+
import { TSClassImplements } from "./TSClassImplements"
|
|
41
|
+
import { TSEnumDeclaration } from "./TSEnumDeclaration"
|
|
42
|
+
import { TSTypeParameterDeclaration } from "./TSTypeParameterDeclaration"
|
|
43
|
+
import { TSTypeParameterInstantiation } from "./TSTypeParameterInstantiation"
|
|
44
|
+
import { TypedAstNode } from "./TypedAstNode"
|
|
45
|
+
export class ClassDefinition extends TypedAstNode {
|
|
46
|
+
constructor(pointer: KNativePointer) {
|
|
47
|
+
assertValidPeer(pointer, 14)
|
|
48
|
+
super(pointer)
|
|
49
|
+
}
|
|
50
|
+
static createClassDefinition(ident: Identifier | undefined, typeParams: TSTypeParameterDeclaration | undefined, superTypeParams: TSTypeParameterInstantiation | undefined, _implements: readonly TSClassImplements[], ctor: MethodDefinition | undefined, superClass: Expression | undefined, body: readonly AstNode[], modifiers: Es2pandaClassDefinitionModifiers, flags: Es2pandaModifierFlags): ClassDefinition {
|
|
51
|
+
return new ClassDefinition(global.generatedEs2panda._CreateClassDefinition(global.context, passNode(ident), passNode(typeParams), passNode(superTypeParams), passNodeArray(_implements), _implements.length, passNode(ctor), passNode(superClass), passNodeArray(body), body.length, modifiers, flags))
|
|
52
|
+
}
|
|
53
|
+
static updateClassDefinition(original: ClassDefinition | undefined, ident: Identifier | undefined, typeParams: TSTypeParameterDeclaration | undefined, superTypeParams: TSTypeParameterInstantiation | undefined, _implements: readonly TSClassImplements[], ctor: MethodDefinition | undefined, superClass: Expression | undefined, body: readonly AstNode[], modifiers: Es2pandaClassDefinitionModifiers, flags: Es2pandaModifierFlags): ClassDefinition {
|
|
54
|
+
return new ClassDefinition(global.generatedEs2panda._UpdateClassDefinition(global.context, passNode(original), passNode(ident), passNode(typeParams), passNode(superTypeParams), passNodeArray(_implements), _implements.length, passNode(ctor), passNode(superClass), passNodeArray(body), body.length, modifiers, flags))
|
|
55
|
+
}
|
|
56
|
+
static update1ClassDefinition(original: ClassDefinition | undefined, ident: Identifier | undefined, body: readonly AstNode[], modifiers: Es2pandaClassDefinitionModifiers, flags: Es2pandaModifierFlags): ClassDefinition {
|
|
57
|
+
return new ClassDefinition(global.generatedEs2panda._UpdateClassDefinition1(global.context, passNode(original), passNode(ident), passNodeArray(body), body.length, modifiers, flags))
|
|
58
|
+
}
|
|
59
|
+
static update2ClassDefinition(original: ClassDefinition | undefined, ident: Identifier | undefined, modifiers: Es2pandaClassDefinitionModifiers, flags: Es2pandaModifierFlags): ClassDefinition {
|
|
60
|
+
return new ClassDefinition(global.generatedEs2panda._UpdateClassDefinition2(global.context, passNode(original), passNode(ident), modifiers, flags))
|
|
61
|
+
}
|
|
62
|
+
get ident(): Identifier | undefined {
|
|
63
|
+
return unpackNode(global.generatedEs2panda._ClassDefinitionIdentConst(global.context, this.peer))
|
|
64
|
+
}
|
|
65
|
+
/** @deprecated */
|
|
66
|
+
setIdent(ident?: Identifier): this {
|
|
67
|
+
global.generatedEs2panda._ClassDefinitionSetIdent(global.context, this.peer, passNode(ident))
|
|
68
|
+
return this
|
|
69
|
+
}
|
|
70
|
+
get internalName(): string {
|
|
71
|
+
return unpackString(global.generatedEs2panda._ClassDefinitionInternalNameConst(global.context, this.peer))
|
|
72
|
+
}
|
|
73
|
+
/** @deprecated */
|
|
74
|
+
setInternalName(internalName: string): this {
|
|
75
|
+
global.generatedEs2panda._ClassDefinitionSetInternalName(global.context, this.peer, internalName)
|
|
76
|
+
return this
|
|
77
|
+
}
|
|
78
|
+
get super(): Expression | undefined {
|
|
79
|
+
return unpackNode(global.generatedEs2panda._ClassDefinitionSuperConst(global.context, this.peer))
|
|
80
|
+
}
|
|
81
|
+
/** @deprecated */
|
|
82
|
+
setSuper(superClass?: Expression): this {
|
|
83
|
+
global.generatedEs2panda._ClassDefinitionSetSuper(global.context, this.peer, passNode(superClass))
|
|
84
|
+
return this
|
|
85
|
+
}
|
|
86
|
+
get isGlobal(): boolean {
|
|
87
|
+
return global.generatedEs2panda._ClassDefinitionIsGlobalConst(global.context, this.peer)
|
|
88
|
+
}
|
|
89
|
+
get isLocal(): boolean {
|
|
90
|
+
return global.generatedEs2panda._ClassDefinitionIsLocalConst(global.context, this.peer)
|
|
91
|
+
}
|
|
92
|
+
get isExtern(): boolean {
|
|
93
|
+
return global.generatedEs2panda._ClassDefinitionIsExternConst(global.context, this.peer)
|
|
94
|
+
}
|
|
95
|
+
get isFromExternal(): boolean {
|
|
96
|
+
return global.generatedEs2panda._ClassDefinitionIsFromExternalConst(global.context, this.peer)
|
|
97
|
+
}
|
|
98
|
+
get isInner(): boolean {
|
|
99
|
+
return global.generatedEs2panda._ClassDefinitionIsInnerConst(global.context, this.peer)
|
|
100
|
+
}
|
|
101
|
+
get isGlobalInitialized(): boolean {
|
|
102
|
+
return global.generatedEs2panda._ClassDefinitionIsGlobalInitializedConst(global.context, this.peer)
|
|
103
|
+
}
|
|
104
|
+
get isClassDefinitionChecked(): boolean {
|
|
105
|
+
return global.generatedEs2panda._ClassDefinitionIsClassDefinitionCheckedConst(global.context, this.peer)
|
|
106
|
+
}
|
|
107
|
+
get isAnonymous(): boolean {
|
|
108
|
+
return global.generatedEs2panda._ClassDefinitionIsAnonymousConst(global.context, this.peer)
|
|
109
|
+
}
|
|
110
|
+
get isIntEnumTransformed(): boolean {
|
|
111
|
+
return global.generatedEs2panda._ClassDefinitionIsIntEnumTransformedConst(global.context, this.peer)
|
|
112
|
+
}
|
|
113
|
+
get isStringEnumTransformed(): boolean {
|
|
114
|
+
return global.generatedEs2panda._ClassDefinitionIsStringEnumTransformedConst(global.context, this.peer)
|
|
115
|
+
}
|
|
116
|
+
get isEnumTransformed(): boolean {
|
|
117
|
+
return global.generatedEs2panda._ClassDefinitionIsEnumTransformedConst(global.context, this.peer)
|
|
118
|
+
}
|
|
119
|
+
get isNamespaceTransformed(): boolean {
|
|
120
|
+
return global.generatedEs2panda._ClassDefinitionIsNamespaceTransformedConst(global.context, this.peer)
|
|
121
|
+
}
|
|
122
|
+
get isModule(): boolean {
|
|
123
|
+
return global.generatedEs2panda._ClassDefinitionIsModuleConst(global.context, this.peer)
|
|
124
|
+
}
|
|
125
|
+
/** @deprecated */
|
|
126
|
+
setGlobalInitialized(): this {
|
|
127
|
+
global.generatedEs2panda._ClassDefinitionSetGlobalInitialized(global.context, this.peer)
|
|
128
|
+
return this
|
|
129
|
+
}
|
|
130
|
+
/** @deprecated */
|
|
131
|
+
setInnerModifier(): this {
|
|
132
|
+
global.generatedEs2panda._ClassDefinitionSetInnerModifier(global.context, this.peer)
|
|
133
|
+
return this
|
|
134
|
+
}
|
|
135
|
+
/** @deprecated */
|
|
136
|
+
setClassDefinitionChecked(): this {
|
|
137
|
+
global.generatedEs2panda._ClassDefinitionSetClassDefinitionChecked(global.context, this.peer)
|
|
138
|
+
return this
|
|
139
|
+
}
|
|
140
|
+
/** @deprecated */
|
|
141
|
+
setAnonymousModifier(): this {
|
|
142
|
+
global.generatedEs2panda._ClassDefinitionSetAnonymousModifier(global.context, this.peer)
|
|
143
|
+
return this
|
|
144
|
+
}
|
|
145
|
+
/** @deprecated */
|
|
146
|
+
setNamespaceTransformed(): this {
|
|
147
|
+
global.generatedEs2panda._ClassDefinitionSetNamespaceTransformed(global.context, this.peer)
|
|
148
|
+
return this
|
|
149
|
+
}
|
|
150
|
+
get modifiers(): Es2pandaClassDefinitionModifiers {
|
|
151
|
+
return global.generatedEs2panda._ClassDefinitionModifiersConst(global.context, this.peer)
|
|
152
|
+
}
|
|
153
|
+
/** @deprecated */
|
|
154
|
+
setModifiers(modifiers: Es2pandaClassDefinitionModifiers): this {
|
|
155
|
+
global.generatedEs2panda._ClassDefinitionSetModifiers(global.context, this.peer, modifiers)
|
|
156
|
+
return this
|
|
157
|
+
}
|
|
158
|
+
/** @deprecated */
|
|
159
|
+
addProperties(body: readonly AstNode[]): this {
|
|
160
|
+
global.generatedEs2panda._ClassDefinitionAddProperties(global.context, this.peer, passNodeArray(body), body.length)
|
|
161
|
+
return this
|
|
162
|
+
}
|
|
163
|
+
get body(): readonly AstNode[] {
|
|
164
|
+
return unpackNodeArray(global.generatedEs2panda._ClassDefinitionBodyConst(global.context, this.peer))
|
|
165
|
+
}
|
|
166
|
+
/** @deprecated */
|
|
167
|
+
setCtor(ctor?: MethodDefinition): this {
|
|
168
|
+
global.generatedEs2panda._ClassDefinitionSetCtor(global.context, this.peer, passNode(ctor))
|
|
169
|
+
return this
|
|
170
|
+
}
|
|
171
|
+
get implements(): readonly TSClassImplements[] {
|
|
172
|
+
return unpackNodeArray(global.generatedEs2panda._ClassDefinitionImplementsConst(global.context, this.peer))
|
|
173
|
+
}
|
|
174
|
+
get typeParams(): TSTypeParameterDeclaration | undefined {
|
|
175
|
+
return unpackNode(global.generatedEs2panda._ClassDefinitionTypeParamsConst(global.context, this.peer))
|
|
176
|
+
}
|
|
177
|
+
/** @deprecated */
|
|
178
|
+
setTypeParams(typeParams?: TSTypeParameterDeclaration): this {
|
|
179
|
+
global.generatedEs2panda._ClassDefinitionSetTypeParams(global.context, this.peer, passNode(typeParams))
|
|
180
|
+
return this
|
|
181
|
+
}
|
|
182
|
+
get superTypeParams(): TSTypeParameterInstantiation | undefined {
|
|
183
|
+
return unpackNode(global.generatedEs2panda._ClassDefinitionSuperTypeParamsConst(global.context, this.peer))
|
|
184
|
+
}
|
|
185
|
+
get localTypeCounter(): number {
|
|
186
|
+
return global.generatedEs2panda._ClassDefinitionLocalTypeCounter(global.context, this.peer)
|
|
187
|
+
}
|
|
188
|
+
get localIndex(): number {
|
|
189
|
+
return global.generatedEs2panda._ClassDefinitionLocalIndexConst(global.context, this.peer)
|
|
190
|
+
}
|
|
191
|
+
get localPrefix(): string {
|
|
192
|
+
return unpackString(global.generatedEs2panda._ClassDefinitionLocalPrefixConst(global.context, this.peer))
|
|
193
|
+
}
|
|
194
|
+
/** @deprecated */
|
|
195
|
+
setOrigEnumDecl(enumDecl?: TSEnumDeclaration): this {
|
|
196
|
+
global.generatedEs2panda._ClassDefinitionSetOrigEnumDecl(global.context, this.peer, passNode(enumDecl))
|
|
197
|
+
return this
|
|
198
|
+
}
|
|
199
|
+
get origEnumDecl(): TSEnumDeclaration | undefined {
|
|
200
|
+
return unpackNode(global.generatedEs2panda._ClassDefinitionOrigEnumDeclConst(global.context, this.peer))
|
|
201
|
+
}
|
|
202
|
+
get anonClass(): ClassDeclaration | undefined {
|
|
203
|
+
return unpackNode(global.generatedEs2panda._ClassDefinitionGetAnonClass(global.context, this.peer))
|
|
204
|
+
}
|
|
205
|
+
/** @deprecated */
|
|
206
|
+
setAnonClass(anonClass?: ClassDeclaration): this {
|
|
207
|
+
global.generatedEs2panda._ClassDefinitionSetAnonClass(global.context, this.peer, passNode(anonClass))
|
|
208
|
+
return this
|
|
209
|
+
}
|
|
210
|
+
get ctor(): FunctionExpression | undefined {
|
|
211
|
+
return unpackNode(global.generatedEs2panda._ClassDefinitionCtorConst(global.context, this.peer))
|
|
212
|
+
}
|
|
213
|
+
get hasPrivateMethod(): boolean {
|
|
214
|
+
return global.generatedEs2panda._ClassDefinitionHasPrivateMethodConst(global.context, this.peer)
|
|
215
|
+
}
|
|
216
|
+
get hasComputedInstanceField(): boolean {
|
|
217
|
+
return global.generatedEs2panda._ClassDefinitionHasComputedInstanceFieldConst(global.context, this.peer)
|
|
218
|
+
}
|
|
219
|
+
get annotations(): readonly AnnotationUsage[] {
|
|
220
|
+
return unpackNodeArray(global.generatedEs2panda._ClassDefinitionAnnotationsConst(global.context, this.peer))
|
|
221
|
+
}
|
|
222
|
+
/** @deprecated */
|
|
223
|
+
setAnnotations(annotations: readonly AnnotationUsage[]): this {
|
|
224
|
+
global.generatedEs2panda._ClassDefinitionSetAnnotations(global.context, this.peer, passNodeArray(annotations), annotations.length)
|
|
225
|
+
return this
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
export function isClassDefinition(node: object | undefined): node is ClassDefinition {
|
|
229
|
+
return node instanceof ClassDefinition
|
|
230
|
+
}
|
|
231
|
+
if (!nodeByType.has(14)) {
|
|
232
|
+
nodeByType.set(14, ClassDefinition)
|
|
233
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { Decorator } from "./Decorator"
|
|
33
|
+
import { Expression } from "./Expression"
|
|
34
|
+
import { Identifier } from "./Identifier"
|
|
35
|
+
import { TSEnumMember } from "./TSEnumMember"
|
|
36
|
+
import { TypedStatement } from "./TypedStatement"
|
|
37
|
+
export class ClassElement extends TypedStatement {
|
|
38
|
+
constructor(pointer: KNativePointer) {
|
|
39
|
+
super(pointer)
|
|
40
|
+
}
|
|
41
|
+
get id(): Identifier {
|
|
42
|
+
return unpackNonNullableNode(global.generatedEs2panda._ClassElementIdConst(global.context, this.peer))
|
|
43
|
+
}
|
|
44
|
+
get key(): Expression | undefined {
|
|
45
|
+
return unpackNode(global.generatedEs2panda._ClassElementKeyConst(global.context, this.peer))
|
|
46
|
+
}
|
|
47
|
+
/** @deprecated */
|
|
48
|
+
setValue(value?: Expression): this {
|
|
49
|
+
global.generatedEs2panda._ClassElementSetValue(global.context, this.peer, passNode(value))
|
|
50
|
+
return this
|
|
51
|
+
}
|
|
52
|
+
get value(): Expression | undefined {
|
|
53
|
+
return unpackNode(global.generatedEs2panda._ClassElementValueConst(global.context, this.peer))
|
|
54
|
+
}
|
|
55
|
+
get originEnumMember(): TSEnumMember | undefined {
|
|
56
|
+
return unpackNode(global.generatedEs2panda._ClassElementOriginEnumMemberConst(global.context, this.peer))
|
|
57
|
+
}
|
|
58
|
+
/** @deprecated */
|
|
59
|
+
setOrigEnumMember(enumMember?: TSEnumMember): this {
|
|
60
|
+
global.generatedEs2panda._ClassElementSetOrigEnumMember(global.context, this.peer, passNode(enumMember))
|
|
61
|
+
return this
|
|
62
|
+
}
|
|
63
|
+
get isPrivateElement(): boolean {
|
|
64
|
+
return global.generatedEs2panda._ClassElementIsPrivateElementConst(global.context, this.peer)
|
|
65
|
+
}
|
|
66
|
+
get decorators(): readonly Decorator[] {
|
|
67
|
+
return unpackNodeArray(global.generatedEs2panda._ClassElementDecoratorsConst(global.context, this.peer))
|
|
68
|
+
}
|
|
69
|
+
get isComputed(): boolean {
|
|
70
|
+
return global.generatedEs2panda._ClassElementIsComputedConst(global.context, this.peer)
|
|
71
|
+
}
|
|
72
|
+
/** @deprecated */
|
|
73
|
+
addDecorator(decorator?: Decorator): this {
|
|
74
|
+
global.generatedEs2panda._ClassElementAddDecorator(global.context, this.peer, passNode(decorator))
|
|
75
|
+
return this
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export function isClassElement(node: object | undefined): node is ClassElement {
|
|
79
|
+
return node instanceof ClassElement
|
|
80
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { ClassDefinition } from "./ClassDefinition"
|
|
33
|
+
import { Expression } from "./Expression"
|
|
34
|
+
export class ClassExpression extends Expression {
|
|
35
|
+
constructor(pointer: KNativePointer) {
|
|
36
|
+
assertValidPeer(pointer, 16)
|
|
37
|
+
super(pointer)
|
|
38
|
+
}
|
|
39
|
+
static createClassExpression(def?: ClassDefinition): ClassExpression {
|
|
40
|
+
return new ClassExpression(global.generatedEs2panda._CreateClassExpression(global.context, passNode(def)))
|
|
41
|
+
}
|
|
42
|
+
static updateClassExpression(original?: ClassExpression, def?: ClassDefinition): ClassExpression {
|
|
43
|
+
return new ClassExpression(global.generatedEs2panda._UpdateClassExpression(global.context, passNode(original), passNode(def)))
|
|
44
|
+
}
|
|
45
|
+
get definition(): ClassDefinition | undefined {
|
|
46
|
+
return unpackNode(global.generatedEs2panda._ClassExpressionDefinitionConst(global.context, this.peer))
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export function isClassExpression(node: object | undefined): node is ClassExpression {
|
|
50
|
+
return node instanceof ClassExpression
|
|
51
|
+
}
|
|
52
|
+
if (!nodeByType.has(16)) {
|
|
53
|
+
nodeByType.set(16, ClassExpression)
|
|
54
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { AnnotationUsage } from "./AnnotationUsage"
|
|
33
|
+
import { ClassElement } from "./ClassElement"
|
|
34
|
+
import { Es2pandaModifierFlags } from "./../Es2pandaEnums"
|
|
35
|
+
import { Expression } from "./Expression"
|
|
36
|
+
import { TypeNode } from "./TypeNode"
|
|
37
|
+
export class ClassProperty extends ClassElement {
|
|
38
|
+
constructor(pointer: KNativePointer) {
|
|
39
|
+
assertValidPeer(pointer, 17)
|
|
40
|
+
super(pointer)
|
|
41
|
+
}
|
|
42
|
+
static createClassProperty(key: Expression | undefined, value: Expression | undefined, typeAnnotation: TypeNode | undefined, modifiers: Es2pandaModifierFlags, isComputed: boolean): ClassProperty {
|
|
43
|
+
return new ClassProperty(global.generatedEs2panda._CreateClassProperty(global.context, passNode(key), passNode(value), passNode(typeAnnotation), modifiers, isComputed))
|
|
44
|
+
}
|
|
45
|
+
static updateClassProperty(original: ClassProperty | undefined, key: Expression | undefined, value: Expression | undefined, typeAnnotation: TypeNode | undefined, modifiers: Es2pandaModifierFlags, isComputed: boolean): ClassProperty {
|
|
46
|
+
return new ClassProperty(global.generatedEs2panda._UpdateClassProperty(global.context, passNode(original), passNode(key), passNode(value), passNode(typeAnnotation), modifiers, isComputed))
|
|
47
|
+
}
|
|
48
|
+
get typeAnnotation(): TypeNode | undefined {
|
|
49
|
+
return unpackNode(global.generatedEs2panda._ClassPropertyTypeAnnotationConst(global.context, this.peer))
|
|
50
|
+
}
|
|
51
|
+
/** @deprecated */
|
|
52
|
+
setTypeAnnotation(typeAnnotation?: TypeNode): this {
|
|
53
|
+
global.generatedEs2panda._ClassPropertySetTypeAnnotation(global.context, this.peer, passNode(typeAnnotation))
|
|
54
|
+
return this
|
|
55
|
+
}
|
|
56
|
+
get annotations(): readonly AnnotationUsage[] {
|
|
57
|
+
return unpackNodeArray(global.generatedEs2panda._ClassPropertyAnnotationsConst(global.context, this.peer))
|
|
58
|
+
}
|
|
59
|
+
/** @deprecated */
|
|
60
|
+
setAnnotations(annotations: readonly AnnotationUsage[]): this {
|
|
61
|
+
global.generatedEs2panda._ClassPropertySetAnnotations(global.context, this.peer, passNodeArray(annotations), annotations.length)
|
|
62
|
+
return this
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export function isClassProperty(node: object | undefined): node is ClassProperty {
|
|
66
|
+
return node instanceof ClassProperty
|
|
67
|
+
}
|
|
68
|
+
if (!nodeByType.has(17)) {
|
|
69
|
+
nodeByType.set(17, ClassProperty)
|
|
70
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { ClassElement } from "./ClassElement"
|
|
33
|
+
import { Expression } from "./Expression"
|
|
34
|
+
import { ScriptFunction } from "./ScriptFunction"
|
|
35
|
+
export class ClassStaticBlock extends ClassElement {
|
|
36
|
+
constructor(pointer: KNativePointer) {
|
|
37
|
+
assertValidPeer(pointer, 18)
|
|
38
|
+
super(pointer)
|
|
39
|
+
}
|
|
40
|
+
static createClassStaticBlock(value?: Expression): ClassStaticBlock {
|
|
41
|
+
return new ClassStaticBlock(global.generatedEs2panda._CreateClassStaticBlock(global.context, passNode(value)))
|
|
42
|
+
}
|
|
43
|
+
static updateClassStaticBlock(original?: ClassStaticBlock, value?: Expression): ClassStaticBlock {
|
|
44
|
+
return new ClassStaticBlock(global.generatedEs2panda._UpdateClassStaticBlock(global.context, passNode(original), passNode(value)))
|
|
45
|
+
}
|
|
46
|
+
get function(): ScriptFunction | undefined {
|
|
47
|
+
return unpackNode(global.generatedEs2panda._ClassStaticBlockFunctionConst(global.context, this.peer))
|
|
48
|
+
}
|
|
49
|
+
get name(): string {
|
|
50
|
+
return unpackString(global.generatedEs2panda._ClassStaticBlockNameConst(global.context, this.peer))
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export function isClassStaticBlock(node: object | undefined): node is ClassStaticBlock {
|
|
54
|
+
return node instanceof ClassStaticBlock
|
|
55
|
+
}
|
|
56
|
+
if (!nodeByType.has(18)) {
|
|
57
|
+
nodeByType.set(18, ClassStaticBlock)
|
|
58
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { Expression } from "./Expression"
|
|
33
|
+
export class ConditionalExpression extends Expression {
|
|
34
|
+
constructor(pointer: KNativePointer) {
|
|
35
|
+
assertValidPeer(pointer, 19)
|
|
36
|
+
super(pointer)
|
|
37
|
+
}
|
|
38
|
+
static createConditionalExpression(test?: Expression, consequent?: Expression, alternate?: Expression): ConditionalExpression {
|
|
39
|
+
return new ConditionalExpression(global.generatedEs2panda._CreateConditionalExpression(global.context, passNode(test), passNode(consequent), passNode(alternate)))
|
|
40
|
+
}
|
|
41
|
+
static updateConditionalExpression(original?: ConditionalExpression, test?: Expression, consequent?: Expression, alternate?: Expression): ConditionalExpression {
|
|
42
|
+
return new ConditionalExpression(global.generatedEs2panda._UpdateConditionalExpression(global.context, passNode(original), passNode(test), passNode(consequent), passNode(alternate)))
|
|
43
|
+
}
|
|
44
|
+
get test(): Expression | undefined {
|
|
45
|
+
return unpackNode(global.generatedEs2panda._ConditionalExpressionTestConst(global.context, this.peer))
|
|
46
|
+
}
|
|
47
|
+
/** @deprecated */
|
|
48
|
+
setTest(expr?: Expression): this {
|
|
49
|
+
global.generatedEs2panda._ConditionalExpressionSetTest(global.context, this.peer, passNode(expr))
|
|
50
|
+
return this
|
|
51
|
+
}
|
|
52
|
+
get consequent(): Expression | undefined {
|
|
53
|
+
return unpackNode(global.generatedEs2panda._ConditionalExpressionConsequentConst(global.context, this.peer))
|
|
54
|
+
}
|
|
55
|
+
/** @deprecated */
|
|
56
|
+
setConsequent(expr?: Expression): this {
|
|
57
|
+
global.generatedEs2panda._ConditionalExpressionSetConsequent(global.context, this.peer, passNode(expr))
|
|
58
|
+
return this
|
|
59
|
+
}
|
|
60
|
+
get alternate(): Expression | undefined {
|
|
61
|
+
return unpackNode(global.generatedEs2panda._ConditionalExpressionAlternateConst(global.context, this.peer))
|
|
62
|
+
}
|
|
63
|
+
/** @deprecated */
|
|
64
|
+
setAlternate(expr?: Expression): this {
|
|
65
|
+
global.generatedEs2panda._ConditionalExpressionSetAlternate(global.context, this.peer, passNode(expr))
|
|
66
|
+
return this
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export function isConditionalExpression(node: object | undefined): node is ConditionalExpression {
|
|
70
|
+
return node instanceof ConditionalExpression
|
|
71
|
+
}
|
|
72
|
+
if (!nodeByType.has(19)) {
|
|
73
|
+
nodeByType.set(19, ConditionalExpression)
|
|
74
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
unpackString
|
|
30
|
+
} from "../../reexport-for-generated"
|
|
31
|
+
|
|
32
|
+
import { Identifier } from "./Identifier"
|
|
33
|
+
import { Statement } from "./Statement"
|
|
34
|
+
export class ContinueStatement extends Statement {
|
|
35
|
+
constructor(pointer: KNativePointer) {
|
|
36
|
+
assertValidPeer(pointer, 20)
|
|
37
|
+
super(pointer)
|
|
38
|
+
}
|
|
39
|
+
static create1ContinueStatement(ident?: Identifier): ContinueStatement {
|
|
40
|
+
return new ContinueStatement(global.generatedEs2panda._CreateContinueStatement1(global.context, passNode(ident)))
|
|
41
|
+
}
|
|
42
|
+
static updateContinueStatement(original?: ContinueStatement): ContinueStatement {
|
|
43
|
+
return new ContinueStatement(global.generatedEs2panda._UpdateContinueStatement(global.context, passNode(original)))
|
|
44
|
+
}
|
|
45
|
+
static update1ContinueStatement(original?: ContinueStatement, ident?: Identifier): ContinueStatement {
|
|
46
|
+
return new ContinueStatement(global.generatedEs2panda._UpdateContinueStatement1(global.context, passNode(original), passNode(ident)))
|
|
47
|
+
}
|
|
48
|
+
get ident(): Identifier | undefined {
|
|
49
|
+
return unpackNode(global.generatedEs2panda._ContinueStatementIdentConst(global.context, this.peer))
|
|
50
|
+
}
|
|
51
|
+
get target(): AstNode | undefined {
|
|
52
|
+
return unpackNode(global.generatedEs2panda._ContinueStatementTargetConst(global.context, this.peer))
|
|
53
|
+
}
|
|
54
|
+
/** @deprecated */
|
|
55
|
+
setTarget(target?: AstNode): this {
|
|
56
|
+
global.generatedEs2panda._ContinueStatementSetTarget(global.context, this.peer, passNode(target))
|
|
57
|
+
return this
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export function isContinueStatement(node: object | undefined): node is ContinueStatement {
|
|
61
|
+
return node instanceof ContinueStatement
|
|
62
|
+
}
|
|
63
|
+
if (!nodeByType.has(20)) {
|
|
64
|
+
nodeByType.set(20, ContinueStatement)
|
|
65
|
+
}
|