@idlizer/arktscgen 2.1.10-arktscgen-4 → 2.1.10-arktscgen-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/libarkts-copy/native/meson.build +1 -1
- package/build/libarkts-copy/native/src/bridges.cc +72 -115
- package/build/libarkts-copy/native/src/common.cc +225 -84
- package/build/libarkts-copy/native/src/common.h +22 -22
- package/build/libarkts-copy/native/src/memoryTracker.cc +30 -37
- package/build/libarkts-copy/native/src/memoryTracker.h +5 -5
- package/build/libarkts-copy/package.json +21 -17
- package/build/libarkts-copy/src/Es2pandaNativeModule.ts +176 -100
- package/build/libarkts-copy/src/InteropNativeModule.ts +18 -15
- package/build/libarkts-copy/src/arkts-api/AbstractVisitor.ts +17 -18
- package/build/libarkts-copy/src/arkts-api/ImportStorage.ts +31 -30
- package/build/libarkts-copy/src/arkts-api/ProgramProvider.ts +20 -17
- package/build/libarkts-copy/src/arkts-api/class-by-peer.ts +12 -12
- package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +38 -29
- package/build/libarkts-copy/src/arkts-api/index.ts +24 -24
- package/build/libarkts-copy/src/arkts-api/node-cache.ts +12 -12
- package/build/libarkts-copy/src/arkts-api/node-utilities/ArkTsConfig.ts +8 -8
- package/build/libarkts-copy/src/arkts-api/node-utilities/ArrayExpression.ts +9 -21
- package/build/libarkts-copy/src/arkts-api/node-utilities/AssignmentExpression.ts +12 -14
- package/build/libarkts-copy/src/arkts-api/node-utilities/BlockStatement.ts +5 -5
- package/build/libarkts-copy/src/arkts-api/node-utilities/CallExpression.ts +26 -24
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDefinition.ts +62 -32
- package/build/libarkts-copy/src/arkts-api/node-utilities/ClassProperty.ts +14 -13
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSFunctionType.ts +24 -21
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSImportDeclaration.ts +10 -12
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSModule.ts +14 -18
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSParameterExpression.ts +15 -16
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSStructDeclaration.ts +5 -8
- package/build/libarkts-copy/src/arkts-api/node-utilities/ETSTuple.ts +6 -12
- package/build/libarkts-copy/src/arkts-api/node-utilities/MemberExpression.ts +12 -11
- package/build/libarkts-copy/src/arkts-api/node-utilities/MethodDefinition.ts +14 -33
- package/build/libarkts-copy/src/arkts-api/node-utilities/NumberLiteral.ts +12 -23
- package/build/libarkts-copy/src/arkts-api/node-utilities/ObjectExpression.ts +17 -21
- package/build/libarkts-copy/src/arkts-api/node-utilities/OpaqueTypeNode.ts +9 -8
- package/build/libarkts-copy/src/arkts-api/node-utilities/Program.ts +21 -16
- package/build/libarkts-copy/src/arkts-api/node-utilities/ScriptFunction.ts +52 -53
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSInterfaceDeclaration.ts +22 -32
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeParameter.ts +12 -14
- package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeReferencePart.ts +10 -12
- package/build/libarkts-copy/src/arkts-api/node-utilities/TryStatement.ts +10 -9
- package/build/libarkts-copy/src/arkts-api/node-utilities/VariableDeclarator.ts +10 -12
- package/build/libarkts-copy/src/arkts-api/peers/ArktsObject.ts +8 -8
- package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +53 -49
- package/build/libarkts-copy/src/arkts-api/peers/Config.ts +17 -24
- package/build/libarkts-copy/src/arkts-api/peers/Context.ts +29 -37
- package/build/libarkts-copy/src/arkts-api/peers/DiagnosticKind.ts +5 -6
- package/build/libarkts-copy/src/arkts-api/peers/ExternalSource.ts +9 -9
- package/build/libarkts-copy/src/arkts-api/peers/ImportPathManager.ts +6 -8
- package/build/libarkts-copy/src/arkts-api/peers/Options.ts +8 -8
- package/build/libarkts-copy/src/arkts-api/plugins.ts +98 -30
- package/build/libarkts-copy/src/arkts-api/static/global.ts +35 -36
- package/build/libarkts-copy/src/arkts-api/static/globalUtils.ts +5 -5
- package/build/libarkts-copy/src/arkts-api/static/profiler.ts +107 -91
- package/build/libarkts-copy/src/arkts-api/utilities/extensions.ts +54 -37
- package/build/libarkts-copy/src/arkts-api/utilities/nativePtrDecoder.ts +86 -69
- package/build/libarkts-copy/src/arkts-api/utilities/performance.ts +39 -23
- package/build/libarkts-copy/src/arkts-api/utilities/private.ts +73 -61
- package/build/libarkts-copy/src/arkts-api/utilities/public.ts +220 -173
- package/build/libarkts-copy/src/arkts-api/visitor.ts +606 -742
- package/build/libarkts-copy/src/arkts-api/wrapper-compat.ts +8 -8
- package/build/libarkts-copy/src/checkSdk.ts +15 -18
- package/build/libarkts-copy/src/index.ts +29 -29
- package/build/libarkts-copy/src/plugin-utils.ts +52 -40
- package/build/libarkts-copy/src/reexport-for-generated.ts +11 -10
- package/build/libarkts-copy/src/tracer.ts +75 -69
- package/build/libarkts-copy/src/ts-api/factory/nodeFactory.ts +134 -274
- package/build/libarkts-copy/src/ts-api/factory/nodeTests.ts +23 -23
- package/build/libarkts-copy/src/ts-api/index.ts +27 -35
- package/build/libarkts-copy/src/ts-api/static/enums.ts +3 -3
- package/build/libarkts-copy/src/ts-api/types.ts +535 -395
- package/build/libarkts-copy/src/ts-api/utilities/private.ts +115 -112
- package/build/libarkts-copy/src/ts-api/utilities/public.ts +18 -18
- package/build/libarkts-copy/src/ts-api/visitor/visitor.ts +33 -49
- package/build/libarkts-copy/src/utils.ts +97 -70
- package/build/libarkts-copy/tsconfig.json +3 -2
- package/lib/index.js +172 -77
- package/package.json +51 -52
- package/templates/Es2pandaNativeModule.ts +1 -0
- package/templates/peer.ts +1 -0
- package/build/libarkts-copy/native/src/generated/bridges.cc +0 -16375
- package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +0 -1344
- package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +0 -5192
- package/build/libarkts-copy/src/generated/factory.ts +0 -1285
- package/build/libarkts-copy/src/generated/index.ts +0 -222
- package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +0 -44
- package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +0 -54
- package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +0 -45
- package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +0 -165
- package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +0 -84
- package/build/libarkts-copy/src/generated/peers/ArkTsConfig.ts +0 -73
- package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +0 -109
- package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +0 -119
- package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +0 -65
- package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +0 -111
- package/build/libarkts-copy/src/generated/peers/AstDumper.ts +0 -49
- package/build/libarkts-copy/src/generated/peers/AstVerifier.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/AstVisitor.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +0 -110
- package/build/libarkts-copy/src/generated/peers/BindingProps.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +0 -72
- package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +0 -94
- package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +0 -78
- package/build/libarkts-copy/src/generated/peers/CallExpression.ts +0 -129
- package/build/libarkts-copy/src/generated/peers/CatchClause.ts +0 -74
- package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +0 -76
- package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +0 -365
- package/build/libarkts-copy/src/generated/peers/ClassElement.ts +0 -76
- package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +0 -137
- package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/CodeGen.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +0 -82
- package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +0 -78
- package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/Declaration.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/Decorator.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/DiagnosticInfo.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +0 -60
- package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/DynamicImportData.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +0 -102
- package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +0 -90
- package/build/libarkts-copy/src/generated/peers/ETSIntrinsicNode.ts +0 -69
- package/build/libarkts-copy/src/generated/peers/ETSKeyofType.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/ETSModule.ts +0 -129
- package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +0 -79
- package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +0 -59
- package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +0 -189
- package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +0 -55
- package/build/libarkts-copy/src/generated/peers/ETSStringLiteralType.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +0 -59
- package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +0 -89
- package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +0 -78
- package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +0 -63
- package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/ErrorLogger.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +0 -64
- package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +0 -94
- package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +0 -82
- package/build/libarkts-copy/src/generated/peers/Expression.ts +0 -84
- package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +0 -67
- package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +0 -69
- package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +0 -72
- package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +0 -67
- package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +0 -106
- package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +0 -74
- package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +0 -70
- package/build/libarkts-copy/src/generated/peers/IRNode.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/Identifier.ts +0 -162
- package/build/libarkts-copy/src/generated/peers/IfStatement.ts +0 -78
- package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +0 -87
- package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/ImportSource.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +0 -73
- package/build/libarkts-copy/src/generated/peers/IndexInfo.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/LabelPair.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/Literal.ts +0 -53
- package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +0 -45
- package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +0 -53
- package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +0 -115
- package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +0 -152
- package/build/libarkts-copy/src/generated/peers/NamedType.ts +0 -84
- package/build/libarkts-copy/src/generated/peers/NewExpression.ts +0 -64
- package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +0 -78
- package/build/libarkts-copy/src/generated/peers/ObjectDescriptor.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +0 -94
- package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/OverloadDeclaration.ts +0 -101
- package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +0 -65
- package/build/libarkts-copy/src/generated/peers/Program.ts +0 -206
- package/build/libarkts-copy/src/generated/peers/Property.ts +0 -92
- package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +0 -65
- package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/ScopeFindResult.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +0 -310
- package/build/libarkts-copy/src/generated/peers/ScriptFunctionData.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/SignatureInfo.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/SourcePosition.ts +0 -48
- package/build/libarkts-copy/src/generated/peers/SourceRange.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +0 -83
- package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +0 -120
- package/build/libarkts-copy/src/generated/peers/Statement.ts +0 -44
- package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/SuggestionInfo.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +0 -70
- package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +0 -84
- package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +0 -70
- package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +0 -73
- package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +0 -112
- package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +0 -76
- package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +0 -69
- package/build/libarkts-copy/src/generated/peers/TSImportType.ts +0 -72
- package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +0 -73
- package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +0 -64
- package/build/libarkts-copy/src/generated/peers/TSInferType.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +0 -160
- package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +0 -72
- package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +0 -79
- package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +0 -66
- package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +0 -74
- package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +0 -80
- package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSThisType.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +0 -151
- package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +0 -121
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +0 -75
- package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +0 -70
- package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +0 -69
- package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +0 -69
- package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +0 -62
- package/build/libarkts-copy/src/generated/peers/TryStatement.ts +0 -89
- package/build/libarkts-copy/src/generated/peers/TypeNode.ts +0 -81
- package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +0 -44
- package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +0 -45
- package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +0 -61
- package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +0 -70
- package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +0 -58
- package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +0 -68
- package/build/libarkts-copy/src/generated/peers/VReg.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +0 -50
- package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +0 -113
- package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +0 -79
- package/build/libarkts-copy/src/generated/peers/VerificationContext.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/VerifierMessage.ts +0 -40
- package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +0 -71
- package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +0 -64
package/lib/index.js
CHANGED
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
var path$1 = require('node:path');
|
|
23
23
|
var path = require('path');
|
|
24
24
|
var fs = require('fs');
|
|
25
|
-
var ts = require('typescript');
|
|
26
25
|
require('console');
|
|
27
26
|
require('node:os');
|
|
28
27
|
var fs$1 = require('node:fs');
|
|
@@ -50,7 +49,6 @@ function _interopNamespaceDefault(e) {
|
|
|
50
49
|
var path__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(path$1);
|
|
51
50
|
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
52
51
|
var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
|
|
53
|
-
var ts__namespace = /*#__PURE__*/_interopNamespaceDefault(ts);
|
|
54
52
|
var fs__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(fs$1);
|
|
55
53
|
var ps__namespace = /*#__PURE__*/_interopNamespaceDefault(ps);
|
|
56
54
|
|
|
@@ -3657,7 +3655,6 @@ class Language {
|
|
|
3657
3655
|
static fromString(name) {
|
|
3658
3656
|
switch (name) {
|
|
3659
3657
|
case "arkts": return Language.ARKTS;
|
|
3660
|
-
case "java": return Language.JAVA;
|
|
3661
3658
|
case "ts": return Language.TS;
|
|
3662
3659
|
case "cangjie": return Language.CJ;
|
|
3663
3660
|
case "cpp": return Language.CPP;
|
|
@@ -3668,7 +3665,6 @@ class Language {
|
|
|
3668
3665
|
}
|
|
3669
3666
|
Language.TS = new Language("TS", ".ts");
|
|
3670
3667
|
Language.ARKTS = new Language("ArkTS", ".ts"); // using .ts for ArkTS until we get rit of tsc preprocessing
|
|
3671
|
-
Language.JAVA = new Language("Java", ".java");
|
|
3672
3668
|
Language.CPP = new Language("C++", ".cc");
|
|
3673
3669
|
Language.CJ = new Language("CangJie", ".cj");
|
|
3674
3670
|
Language.KOTLIN = new Language("Kotlin", ".kt");
|
|
@@ -4140,6 +4136,10 @@ function isEntry(node) {
|
|
|
4140
4136
|
function isNamespace(node) {
|
|
4141
4137
|
return node.kind === IDLKind.Namespace;
|
|
4142
4138
|
}
|
|
4139
|
+
function isSyntheticEntry(node) {
|
|
4140
|
+
var _a;
|
|
4141
|
+
return isDefined((_a = node.extendedAttributes) === null || _a === void 0 ? void 0 : _a.find(it => it.name === IDLExtendedAttributes.Synthetic));
|
|
4142
|
+
}
|
|
4143
4143
|
function isOptionalType(type) {
|
|
4144
4144
|
return type.kind === IDLKind.OptionalType;
|
|
4145
4145
|
}
|
|
@@ -4229,6 +4229,7 @@ function getNamespacesPathFor(node) {
|
|
|
4229
4229
|
}
|
|
4230
4230
|
return result;
|
|
4231
4231
|
}
|
|
4232
|
+
const nodesWithoutIDLFiles = new Set();
|
|
4232
4233
|
function getFileFor(node) {
|
|
4233
4234
|
let iterator = node;
|
|
4234
4235
|
while (iterator) {
|
|
@@ -4236,7 +4237,11 @@ function getFileFor(node) {
|
|
|
4236
4237
|
return iterator;
|
|
4237
4238
|
iterator = iterator.parent;
|
|
4238
4239
|
}
|
|
4239
|
-
|
|
4240
|
+
const name = getQualifiedName(node, "namespace.name");
|
|
4241
|
+
if (!nodesWithoutIDLFiles.has(name)) {
|
|
4242
|
+
console.warn(`Node ${name} does not have IDLFile in parents`);
|
|
4243
|
+
nodesWithoutIDLFiles.add(name);
|
|
4244
|
+
}
|
|
4240
4245
|
return undefined;
|
|
4241
4246
|
}
|
|
4242
4247
|
function getPackageClause(node) {
|
|
@@ -5340,6 +5345,8 @@ var FieldModifier;
|
|
|
5340
5345
|
FieldModifier[FieldModifier["VOLATILE"] = 6] = "VOLATILE";
|
|
5341
5346
|
FieldModifier[FieldModifier["INTERNAL"] = 7] = "INTERNAL";
|
|
5342
5347
|
FieldModifier[FieldModifier["OVERRIDE"] = 8] = "OVERRIDE";
|
|
5348
|
+
FieldModifier[FieldModifier["GET"] = 9] = "GET";
|
|
5349
|
+
FieldModifier[FieldModifier["SET"] = 10] = "SET";
|
|
5343
5350
|
})(FieldModifier || (FieldModifier = {}));
|
|
5344
5351
|
var MethodModifier;
|
|
5345
5352
|
(function (MethodModifier) {
|
|
@@ -5940,6 +5947,70 @@ function convertDeclaration(convertor, decl) {
|
|
|
5940
5947
|
throw new Error(`Unknown declaration type ${decl.kind ? IDLKind[decl.kind] : "(undefined kind)"}`);
|
|
5941
5948
|
}
|
|
5942
5949
|
|
|
5950
|
+
const findTopLevelConflicts_cache = new Map();
|
|
5951
|
+
function findTopLevelConflicts(library, language) {
|
|
5952
|
+
if (!findTopLevelConflicts_cache.has(library))
|
|
5953
|
+
findTopLevelConflicts_cache.set(library, new Map);
|
|
5954
|
+
const libraryCache = findTopLevelConflicts_cache.get(library);
|
|
5955
|
+
if (!libraryCache.has(language))
|
|
5956
|
+
libraryCache.set(language, findTopLevelConflictsUncached(library, language));
|
|
5957
|
+
return libraryCache.get(language);
|
|
5958
|
+
}
|
|
5959
|
+
function findTopLevelConflictsUncached(library, language) {
|
|
5960
|
+
const foundNames = new Set();
|
|
5961
|
+
const conflictingNames = new Set();
|
|
5962
|
+
const ignoreTypedefs = language === Language.CPP;
|
|
5963
|
+
for (const file of library.files) {
|
|
5964
|
+
for (const entry of file.entries) {
|
|
5965
|
+
if (isSyntheticEntry(entry))
|
|
5966
|
+
continue;
|
|
5967
|
+
if (ignoreTypedefs && isTypedef$1(entry))
|
|
5968
|
+
// for redefinitions like `typedef _Resource Resource;` - in CPP than anyway will be expanded to Resource declaration
|
|
5969
|
+
continue;
|
|
5970
|
+
if (isCallback$1(entry) || isInterface$1(entry) || isTypedef$1(entry) || isEnum$1(entry)) {
|
|
5971
|
+
if (foundNames.has(entry.name)) {
|
|
5972
|
+
conflictingNames.add(entry.name);
|
|
5973
|
+
}
|
|
5974
|
+
else {
|
|
5975
|
+
foundNames.add(entry.name);
|
|
5976
|
+
}
|
|
5977
|
+
}
|
|
5978
|
+
}
|
|
5979
|
+
}
|
|
5980
|
+
return Array.from(conflictingNames);
|
|
5981
|
+
}
|
|
5982
|
+
function isTopLevelConflicted(library, language, node) {
|
|
5983
|
+
const topLevelConflicts = findTopLevelConflicts(library, language);
|
|
5984
|
+
while (node.parent && isNamespace(node.parent)) {
|
|
5985
|
+
node = node.parent;
|
|
5986
|
+
}
|
|
5987
|
+
return node.parent !== undefined
|
|
5988
|
+
&& isFile(node.parent) && isEntry(node) && topLevelConflicts.includes(node.name);
|
|
5989
|
+
}
|
|
5990
|
+
|
|
5991
|
+
/*
|
|
5992
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
5993
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5994
|
+
* you may not use this file except in compliance with the License.
|
|
5995
|
+
* You may obtain a copy of the License at
|
|
5996
|
+
*
|
|
5997
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5998
|
+
*
|
|
5999
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6000
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6001
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6002
|
+
* See the License for the specific language governing permissions and
|
|
6003
|
+
* limitations under the License.
|
|
6004
|
+
*/
|
|
6005
|
+
var LayoutNodeRole;
|
|
6006
|
+
(function (LayoutNodeRole) {
|
|
6007
|
+
LayoutNodeRole[LayoutNodeRole["PEER"] = 0] = "PEER";
|
|
6008
|
+
LayoutNodeRole[LayoutNodeRole["INTERFACE"] = 1] = "INTERFACE";
|
|
6009
|
+
LayoutNodeRole[LayoutNodeRole["GLOBAL"] = 2] = "GLOBAL";
|
|
6010
|
+
LayoutNodeRole[LayoutNodeRole["COMPONENT"] = 3] = "COMPONENT";
|
|
6011
|
+
LayoutNodeRole[LayoutNodeRole["SERIALIZER"] = 4] = "SERIALIZER";
|
|
6012
|
+
})(LayoutNodeRole || (LayoutNodeRole = {}));
|
|
6013
|
+
|
|
5943
6014
|
/*
|
|
5944
6015
|
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
5945
6016
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -7693,7 +7764,7 @@ class IDLDeserializer {
|
|
|
7693
7764
|
}
|
|
7694
7765
|
}
|
|
7695
7766
|
const DifferenceFound = new DiagnosticMessageGroup("error", "DifferenceFound", "Difference found");
|
|
7696
|
-
const noCompare = new Set(["parent", "fileName", "nodeLocation", "nameLocation", "valueLocation", "typesValue"]);
|
|
7767
|
+
const noCompare = new Set(["parent", "fileName", "nodeLocation", "nameLocation", "valueLocation", "typesValue", "text"]);
|
|
7697
7768
|
const canContainMoreCompare = new Set(["extendedAttributes", "typeParameters", "typeArguments"]);
|
|
7698
7769
|
function safeString(value) {
|
|
7699
7770
|
if (typeof value == "symbol") {
|
|
@@ -8243,6 +8314,9 @@ class CppLanguageWriter extends CLikeLanguageWriter {
|
|
|
8243
8314
|
var _a;
|
|
8244
8315
|
return new CppLanguageWriter(new IndentedPrinter([], this.indentDepth()), (_a = options === null || options === void 0 ? void 0 : options.resolver) !== null && _a !== void 0 ? _a : this.resolver, this.typeConvertor, this.primitivesTypes);
|
|
8245
8316
|
}
|
|
8317
|
+
get interopModule() {
|
|
8318
|
+
throw new Error(`Modules are not supported in C++`);
|
|
8319
|
+
}
|
|
8246
8320
|
writeDeclaration(name, signature, modifiers, postfix) {
|
|
8247
8321
|
const realName = this.classMode === 'normal' ? name : `${this.currentClass.at(0)}::${name}`;
|
|
8248
8322
|
const newModifiers = this.classMode === 'normal'
|
|
@@ -8315,6 +8389,9 @@ class CppLanguageWriter extends CLikeLanguageWriter {
|
|
|
8315
8389
|
writeConstant(constName, constType, constVal) {
|
|
8316
8390
|
this.print(`${this.getNodeName(constType)} ${constName}${constVal ? ' = ' + constVal : ''};`);
|
|
8317
8391
|
}
|
|
8392
|
+
writeImports(moduleName, importedFeatures, aliases) {
|
|
8393
|
+
throw new Error(`Imports are not supported in C++`);
|
|
8394
|
+
}
|
|
8318
8395
|
/**
|
|
8319
8396
|
* Writes multiline comments decorated with stars
|
|
8320
8397
|
*/
|
|
@@ -8690,6 +8767,9 @@ class TSLanguageWriter extends LanguageWriter {
|
|
|
8690
8767
|
}
|
|
8691
8768
|
return this.typeConvertor.convert(type);
|
|
8692
8769
|
}
|
|
8770
|
+
get interopModule() {
|
|
8771
|
+
return "@koalaui/interop";
|
|
8772
|
+
}
|
|
8693
8773
|
writeClass(name, op, superClass, interfaces, generics, isDeclared, isAbstract) {
|
|
8694
8774
|
let extendsClause = superClass ? ` extends ${superClass}` : '';
|
|
8695
8775
|
let implementsClause = interfaces ? ` implements ${interfaces.join(",")}` : '';
|
|
@@ -8749,11 +8829,22 @@ class TSLanguageWriter extends LanguageWriter {
|
|
|
8749
8829
|
this.printer.print("}");
|
|
8750
8830
|
}
|
|
8751
8831
|
writeFieldDeclaration(name, type, modifiers, optional, initExpr) {
|
|
8752
|
-
const init = initExpr != undefined ? ` = ${initExpr.asString()}` : ``;
|
|
8753
8832
|
let prefix = this.makeFieldModifiersList(modifiers);
|
|
8754
8833
|
if (prefix)
|
|
8755
8834
|
prefix += " ";
|
|
8756
|
-
|
|
8835
|
+
const typeName = this.getNodeName(type);
|
|
8836
|
+
const isGetter = modifiers === null || modifiers === void 0 ? void 0 : modifiers.includes(FieldModifier.GET);
|
|
8837
|
+
const isSetter = modifiers === null || modifiers === void 0 ? void 0 : modifiers.includes(FieldModifier.SET);
|
|
8838
|
+
if (isGetter) {
|
|
8839
|
+
this.printer.print(`${prefix}get ${name}(): ${typeName}`);
|
|
8840
|
+
}
|
|
8841
|
+
if (isSetter) {
|
|
8842
|
+
this.printer.print(`${prefix}set ${name}(value: ${typeName})`);
|
|
8843
|
+
}
|
|
8844
|
+
if (isGetter || isSetter)
|
|
8845
|
+
return;
|
|
8846
|
+
const init = initExpr != undefined ? ` = ${initExpr.asString()}` : ``;
|
|
8847
|
+
this.printer.print(`${prefix}${name}${optional ? "?" : ""}: ${typeName}${init}`);
|
|
8757
8848
|
}
|
|
8758
8849
|
writeNativeMethodDeclaration(method) {
|
|
8759
8850
|
let name = method.name;
|
|
@@ -8790,7 +8881,6 @@ class TSLanguageWriter extends LanguageWriter {
|
|
|
8790
8881
|
}
|
|
8791
8882
|
writeProperty(propName, propType, modifiers, getter, setter, initExpr) {
|
|
8792
8883
|
let isStatic = modifiers.includes(FieldModifier.STATIC);
|
|
8793
|
-
let isMutable = !modifiers.includes(FieldModifier.READONLY);
|
|
8794
8884
|
let containerName = propName.concat("_container");
|
|
8795
8885
|
if (getter) {
|
|
8796
8886
|
if (!getter.op) {
|
|
@@ -8800,17 +8890,17 @@ class TSLanguageWriter extends LanguageWriter {
|
|
|
8800
8890
|
(writer) => {
|
|
8801
8891
|
writer.print(`return ${containerName}`);
|
|
8802
8892
|
});
|
|
8803
|
-
if (isMutable) {
|
|
8804
|
-
const setSignature = new NamedMethodSignature(IDLVoidType, [propType], [propName]);
|
|
8805
|
-
this.writeSetterImplementation(new Method(propName, setSignature, isStatic ? [MethodModifier.STATIC] : []), setter ? setter.op :
|
|
8806
|
-
(writer) => {
|
|
8807
|
-
writer.print(`${containerName} = ${propName}`);
|
|
8808
|
-
});
|
|
8809
|
-
}
|
|
8810
8893
|
}
|
|
8811
|
-
|
|
8812
|
-
|
|
8894
|
+
if (setter) {
|
|
8895
|
+
const setSignature = new NamedMethodSignature(IDLVoidType, [propType], [propName]);
|
|
8896
|
+
this.writeSetterImplementation(new Method(propName, setSignature, isStatic ? [MethodModifier.STATIC] : []), setter ? setter.op :
|
|
8897
|
+
(writer) => {
|
|
8898
|
+
writer.print(`${containerName} = ${propName}`);
|
|
8899
|
+
});
|
|
8813
8900
|
}
|
|
8901
|
+
if (getter || setter)
|
|
8902
|
+
return;
|
|
8903
|
+
this.writeFieldDeclaration(propName, propType, modifiers, isOptionalType(propType), initExpr);
|
|
8814
8904
|
}
|
|
8815
8905
|
writeTypeDeclaration(decl) {
|
|
8816
8906
|
var _a;
|
|
@@ -8821,6 +8911,16 @@ class TSLanguageWriter extends LanguageWriter {
|
|
|
8821
8911
|
writeConstant(constName, constType, constVal) {
|
|
8822
8912
|
this.print(`export const ${constName}: ${this.getNodeName(constType)}${constVal ? ' = ' + constVal : ''}`);
|
|
8823
8913
|
}
|
|
8914
|
+
writeImports(moduleName, importedFeatures, aliases) {
|
|
8915
|
+
if (importedFeatures.length !== aliases.length) {
|
|
8916
|
+
throw new Error(`Inconsistent imports from ${moduleName}`);
|
|
8917
|
+
}
|
|
8918
|
+
const importNodes = [];
|
|
8919
|
+
for (let i = 0; i < importedFeatures.length; i++) {
|
|
8920
|
+
importNodes.push(importedFeatures[i] + (aliases[i] ? ` as ${aliases[i]}` : ``));
|
|
8921
|
+
}
|
|
8922
|
+
this.writeExpressionStatement(this.makeString(`import { ${importNodes.join(', ')} } from "${moduleName}"`));
|
|
8923
|
+
}
|
|
8824
8924
|
writeDeclaration(name, signature, needReturn, needBracket, modifiers, generics) {
|
|
8825
8925
|
let prefix = !modifiers ? undefined : this.supportedModifiers
|
|
8826
8926
|
.filter(it => modifiers.includes(it))
|
|
@@ -9042,6 +9142,15 @@ class CJDeclarationNameConvertor extends DeclarationNameConvertor {
|
|
|
9042
9142
|
}
|
|
9043
9143
|
}
|
|
9044
9144
|
CJDeclarationNameConvertor.I = new CJDeclarationNameConvertor();
|
|
9145
|
+
class KotlinDeclarationNameConvertor extends DeclarationNameConvertor {
|
|
9146
|
+
convertInterface(decl) {
|
|
9147
|
+
return removePoints(getQualifiedName(decl, "namespace.name"));
|
|
9148
|
+
}
|
|
9149
|
+
convertEnum(decl) {
|
|
9150
|
+
return removePoints(getQualifiedName(decl, "namespace.name"));
|
|
9151
|
+
}
|
|
9152
|
+
}
|
|
9153
|
+
KotlinDeclarationNameConvertor.I = new KotlinDeclarationNameConvertor();
|
|
9045
9154
|
class ETSFeatureNameConvertor extends DeclarationNameConvertor {
|
|
9046
9155
|
convertEnum(decl) {
|
|
9047
9156
|
const namespace = getNamespacesPathFor(decl).map(it => it.name);
|
|
@@ -9058,18 +9167,20 @@ class CJFeatureNameConvertor extends DeclarationNameConvertor {
|
|
|
9058
9167
|
}
|
|
9059
9168
|
CJFeatureNameConvertor.I = new CJFeatureNameConvertor();
|
|
9060
9169
|
class KotlinFeatureNameConvertor extends DeclarationNameConvertor {
|
|
9170
|
+
convertInterface(decl) {
|
|
9171
|
+
return removePoints(getQualifiedName(decl, "namespace.name"));
|
|
9172
|
+
}
|
|
9061
9173
|
convertEnum(decl) {
|
|
9062
|
-
return decl.name;
|
|
9174
|
+
return removePoints(getQualifiedName(decl, "namespace.name"));
|
|
9063
9175
|
}
|
|
9064
9176
|
}
|
|
9065
9177
|
KotlinFeatureNameConvertor.I = new KotlinFeatureNameConvertor();
|
|
9066
9178
|
function createDeclarationNameConvertor(language) {
|
|
9067
9179
|
switch (language) {
|
|
9068
9180
|
case Language.ARKTS: return ETSDeclarationNameConvertor.I;
|
|
9069
|
-
case Language.JAVA:
|
|
9070
9181
|
case Language.CPP:
|
|
9071
9182
|
case Language.TS: return DeclarationNameConvertor.I;
|
|
9072
|
-
case Language.CJ: default: throw new Error(`Language ${language.toString()} is not supported`);
|
|
9183
|
+
case Language.CJ: case Language.KOTLIN: default: throw new Error(`Language ${language.toString()} is not supported`);
|
|
9073
9184
|
}
|
|
9074
9185
|
}
|
|
9075
9186
|
|
|
@@ -9237,9 +9348,6 @@ class ETSLanguageWriter extends TSLanguageWriter {
|
|
|
9237
9348
|
super(printer, resolver, typeConvertor, Language.ARKTS);
|
|
9238
9349
|
this.arrayConvertor = arrayConvertor;
|
|
9239
9350
|
}
|
|
9240
|
-
pushNamespace(namespace, options) {
|
|
9241
|
-
super.pushNamespace(namespace, options);
|
|
9242
|
-
}
|
|
9243
9351
|
fork(options) {
|
|
9244
9352
|
var _a;
|
|
9245
9353
|
return new ETSLanguageWriter(new IndentedPrinter([], this.indentDepth()), (_a = options === null || options === void 0 ? void 0 : options.resolver) !== null && _a !== void 0 ? _a : this.resolver, this.typeConvertor, this.arrayConvertor);
|
|
@@ -9400,31 +9508,10 @@ ETSLanguageWriter._isUseTypeChecker = true;
|
|
|
9400
9508
|
* See the License for the specific language governing permissions and
|
|
9401
9509
|
* limitations under the License.
|
|
9402
9510
|
*/
|
|
9403
|
-
|
|
9404
|
-
(
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
LayoutNodeRole[LayoutNodeRole["GLOBAL"] = 2] = "GLOBAL";
|
|
9408
|
-
LayoutNodeRole[LayoutNodeRole["COMPONENT"] = 3] = "COMPONENT";
|
|
9409
|
-
LayoutNodeRole[LayoutNodeRole["SERIALIZER"] = 4] = "SERIALIZER";
|
|
9410
|
-
})(LayoutNodeRole || (LayoutNodeRole = {}));
|
|
9411
|
-
|
|
9412
|
-
/*
|
|
9413
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
9414
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9415
|
-
* you may not use this file except in compliance with the License.
|
|
9416
|
-
* You may obtain a copy of the License at
|
|
9417
|
-
*
|
|
9418
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9419
|
-
*
|
|
9420
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9421
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9422
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9423
|
-
* See the License for the specific language governing permissions and
|
|
9424
|
-
* limitations under the License.
|
|
9425
|
-
*/
|
|
9426
|
-
function getSerializerName(declaration) {
|
|
9427
|
-
return `${getQualifiedName(declaration, "namespace.name").split('.').join('_')}_serializer`;
|
|
9511
|
+
function getSerializerName(library, language, declaration) {
|
|
9512
|
+
const qualifier = isTopLevelConflicted(library, language, declaration)
|
|
9513
|
+
? "package.namespace.name" : "namespace.name";
|
|
9514
|
+
return `${getQualifiedName(declaration, qualifier).split('.').join('_')}_serializer`;
|
|
9428
9515
|
}
|
|
9429
9516
|
class BaseArgConvertor {
|
|
9430
9517
|
constructor(idlType, runtimeTypes, isScoped, useArray, param) {
|
|
@@ -9572,12 +9659,12 @@ class InterfaceConvertor extends BaseArgConvertor {
|
|
|
9572
9659
|
throw new Error("Must never be used");
|
|
9573
9660
|
}
|
|
9574
9661
|
convertorSerialize(param, value, writer) {
|
|
9575
|
-
const accessor = getSerializerName(this.declaration);
|
|
9662
|
+
const accessor = getSerializerName(this.library, writer.language, this.declaration);
|
|
9576
9663
|
writer.addFeature(accessor, this.library.layout.resolve({ node: this.declaration, role: LayoutNodeRole.SERIALIZER }));
|
|
9577
9664
|
return writer.makeStatement(writer.makeStaticMethodCall(accessor, 'write', [writer.makeString(`${param}Serializer`), writer.makeString(writer.escapeKeyword(value))]));
|
|
9578
9665
|
}
|
|
9579
9666
|
convertorDeserialize(bufferName, deserializerName, assigneer, writer) {
|
|
9580
|
-
const accessor = getSerializerName(this.declaration);
|
|
9667
|
+
const accessor = getSerializerName(this.library, writer.language, this.declaration);
|
|
9581
9668
|
writer.addFeature(accessor, this.library.layout.resolve({ node: this.declaration, role: LayoutNodeRole.SERIALIZER }));
|
|
9582
9669
|
return assigneer(writer.makeStaticMethodCall(accessor, 'read', [writer.makeString(deserializerName)]));
|
|
9583
9670
|
}
|
|
@@ -9665,10 +9752,10 @@ class MaterializedClassConvertor extends BaseArgConvertor {
|
|
|
9665
9752
|
this.declaration = declaration;
|
|
9666
9753
|
}
|
|
9667
9754
|
convertorArg(param, writer) {
|
|
9755
|
+
const nameConvertor = this.library.createTypeNameConvertor(Language.CPP);
|
|
9668
9756
|
switch (writer.language) {
|
|
9669
9757
|
case Language.CPP:
|
|
9670
|
-
return `static_cast<${
|
|
9671
|
-
case Language.JAVA:
|
|
9758
|
+
return `static_cast<${nameConvertor.convert(this.declaration)}>(${param})`;
|
|
9672
9759
|
case Language.CJ:
|
|
9673
9760
|
return `MaterializedBase.toPeerPtr(${writer.escapeKeyword(param)})`;
|
|
9674
9761
|
default:
|
|
@@ -9680,12 +9767,12 @@ class MaterializedClassConvertor extends BaseArgConvertor {
|
|
|
9680
9767
|
}
|
|
9681
9768
|
}
|
|
9682
9769
|
convertorSerialize(param, value, printer) {
|
|
9683
|
-
const accessorRoot = getSerializerName(this.declaration);
|
|
9770
|
+
const accessorRoot = getSerializerName(this.library, printer.language, this.declaration);
|
|
9684
9771
|
printer.addFeature(accessorRoot, this.library.layout.resolve({ node: this.declaration, role: LayoutNodeRole.SERIALIZER }));
|
|
9685
9772
|
return printer.makeStatement(printer.makeStaticMethodCall(accessorRoot, 'write', [printer.makeString(`${param}Serializer`), printer.makeString(value)]));
|
|
9686
9773
|
}
|
|
9687
9774
|
convertorDeserialize(bufferName, deserializerName, assigneer, writer) {
|
|
9688
|
-
const accessorRoot = getSerializerName(this.declaration);
|
|
9775
|
+
const accessorRoot = getSerializerName(this.library, writer.language, this.declaration);
|
|
9689
9776
|
writer.addFeature(accessorRoot, this.library.layout.resolve({ node: this.declaration, role: LayoutNodeRole.SERIALIZER }));
|
|
9690
9777
|
const readStatement = writer.makeCast(writer.makeStaticMethodCall(accessorRoot, "read", [writer.makeString(deserializerName)]), this.declaration);
|
|
9691
9778
|
return assigneer(readStatement);
|
|
@@ -9787,9 +9874,6 @@ function zip(left, right) {
|
|
|
9787
9874
|
throw new Error("Arrays of different length");
|
|
9788
9875
|
return left.map((_, i) => [left[i], right[i]]);
|
|
9789
9876
|
}
|
|
9790
|
-
({
|
|
9791
|
-
target: ts__namespace.ScriptTarget.ES5,
|
|
9792
|
-
module: ts__namespace.ModuleKind.CommonJS});
|
|
9793
9877
|
function throwException(message) {
|
|
9794
9878
|
throw new Error(message);
|
|
9795
9879
|
}
|
|
@@ -9838,6 +9922,9 @@ function getExtractor(target, lang, toPtr = true) {
|
|
|
9838
9922
|
const method = toPtr ? `to${extractorClass}Ptr` : `from${extractorClass}Ptr`;
|
|
9839
9923
|
return { receiver, method };
|
|
9840
9924
|
}
|
|
9925
|
+
function removePoints(s) {
|
|
9926
|
+
return s.split(/[\.\-]/g).join('_');
|
|
9927
|
+
}
|
|
9841
9928
|
|
|
9842
9929
|
/*
|
|
9843
9930
|
* Copyright (c) 2025 Huawei Device Co., Ltd.
|
|
@@ -10292,10 +10379,6 @@ let currentConfig = defaultCoreConfiguration;
|
|
|
10292
10379
|
function generatorConfiguration() {
|
|
10293
10380
|
return currentConfig;
|
|
10294
10381
|
}
|
|
10295
|
-
function generatorTypePrefix() {
|
|
10296
|
-
const conf = generatorConfiguration();
|
|
10297
|
-
return `${conf.TypePrefix}${conf.LibraryPrefix}`;
|
|
10298
|
-
}
|
|
10299
10382
|
|
|
10300
10383
|
/*
|
|
10301
10384
|
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
@@ -12152,9 +12235,6 @@ class Config {
|
|
|
12152
12235
|
return `ir`;
|
|
12153
12236
|
}
|
|
12154
12237
|
}
|
|
12155
|
-
Config.DoNotPrintPeers = [
|
|
12156
|
-
'es2panda_Context', // useless
|
|
12157
|
-
];
|
|
12158
12238
|
|
|
12159
12239
|
/*
|
|
12160
12240
|
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
@@ -12226,6 +12306,9 @@ class BridgesConstructions {
|
|
|
12226
12306
|
static get stringCast() {
|
|
12227
12307
|
return `getStringCopy`;
|
|
12228
12308
|
}
|
|
12309
|
+
static get stringArrayCast() {
|
|
12310
|
+
return `getStringArray`;
|
|
12311
|
+
}
|
|
12229
12312
|
static dropConstCast(value) {
|
|
12230
12313
|
return `(void*)${value}`;
|
|
12231
12314
|
}
|
|
@@ -12937,7 +13020,7 @@ class InteropTypeConvertor extends BaseTypeConvertor {
|
|
|
12937
13020
|
class InteropMacroTypeConvertor extends InteropTypeConvertor {
|
|
12938
13021
|
constructor(typechecker) {
|
|
12939
13022
|
super(typechecker, {
|
|
12940
|
-
sequence: (type) => `KNativePointerArray`,
|
|
13023
|
+
sequence: (type) => isString(type.elementType[0]) ? `KStringArray` : `KNativePointerArray`,
|
|
12941
13024
|
string: (type) => `KStringPtr`,
|
|
12942
13025
|
});
|
|
12943
13026
|
}
|
|
@@ -12960,7 +13043,7 @@ class InteropMacroTypeConvertor extends InteropTypeConvertor {
|
|
|
12960
13043
|
class NativeTypeConvertor extends InteropTypeConvertor {
|
|
12961
13044
|
constructor(typechecker) {
|
|
12962
13045
|
super(typechecker, {
|
|
12963
|
-
sequence: (type) => `KNativePointerArray`,
|
|
13046
|
+
sequence: (type) => isString(type.elementType[0]) ? `KStringArray&` : `KNativePointerArray`,
|
|
12964
13047
|
string: (type) => `KStringPtr&`,
|
|
12965
13048
|
});
|
|
12966
13049
|
}
|
|
@@ -12984,7 +13067,9 @@ class CastTypeConvertor extends BaseTypeConvertor {
|
|
|
12984
13067
|
constructor(typechecker) {
|
|
12985
13068
|
const primitive = (type) => BridgesConstructions.primitiveTypeCast(this.castToTypeConvertor.convertType(type));
|
|
12986
13069
|
super(typechecker, {
|
|
12987
|
-
sequence: (type) =>
|
|
13070
|
+
sequence: (type) => isString(type.elementType[0]) ?
|
|
13071
|
+
BridgesConstructions.stringArrayCast :
|
|
13072
|
+
BridgesConstructions.referenceTypeCast(this.castToTypeConvertor.convertType(type)),
|
|
12988
13073
|
enum: (type) => BridgesConstructions.enumCast(this.castToTypeConvertor.convertType(type)),
|
|
12989
13074
|
reference: (type) => BridgesConstructions.referenceTypeCast(this.castToTypeConvertor.convertType(type)),
|
|
12990
13075
|
i8: primitive,
|
|
@@ -13216,12 +13301,13 @@ class EnumsPrinter extends SingleFilePrinter {
|
|
|
13216
13301
|
* limitations under the License.
|
|
13217
13302
|
*/
|
|
13218
13303
|
class IndexPrinter extends SingleFilePrinter {
|
|
13219
|
-
constructor() {
|
|
13220
|
-
super(
|
|
13304
|
+
constructor(config, idl) {
|
|
13305
|
+
super(idl);
|
|
13306
|
+
this.config = config;
|
|
13221
13307
|
this.writer = createDefaultTypescriptWriter();
|
|
13222
13308
|
}
|
|
13223
13309
|
filterInterface(node) {
|
|
13224
|
-
return !this.typechecker.isPeer(node) ||
|
|
13310
|
+
return !this.typechecker.isPeer(node) || this.config.ignore.isIgnoredPeer(fqName(node));
|
|
13225
13311
|
}
|
|
13226
13312
|
printInterface(node) {
|
|
13227
13313
|
this.writer.writeExpressionStatement(this.writer.makeString(`export * from "./peers/${dropPrefix(node.name, Config.dataClassPrefix)}"`));
|
|
@@ -13271,7 +13357,7 @@ class BindingsConstructions {
|
|
|
13271
13357
|
class BindingsTypeConvertor extends InteropTypeConvertor {
|
|
13272
13358
|
constructor(typechecker) {
|
|
13273
13359
|
super(typechecker, {
|
|
13274
|
-
sequence: (type) => `BigUint64Array`,
|
|
13360
|
+
sequence: (type) => isString(type.elementType[0]) ? `KStringArrayPtr` : `BigUint64Array`,
|
|
13275
13361
|
string: (type) => `KStringPtr`,
|
|
13276
13362
|
});
|
|
13277
13363
|
}
|
|
@@ -13440,6 +13526,9 @@ class PeersConstructions {
|
|
|
13440
13526
|
static passNode(name) {
|
|
13441
13527
|
return `passNode(${name})`;
|
|
13442
13528
|
}
|
|
13529
|
+
static passStringArray(name) {
|
|
13530
|
+
return `passStringArray(${name})`;
|
|
13531
|
+
}
|
|
13443
13532
|
static passNodeArray(name) {
|
|
13444
13533
|
return `passNodeArray(${name})`;
|
|
13445
13534
|
}
|
|
@@ -13665,7 +13754,8 @@ class BindingParameterTypeConvertor extends TopLevelTypeConvertor {
|
|
|
13665
13754
|
constructor(typechecker) {
|
|
13666
13755
|
super(typechecker, {
|
|
13667
13756
|
sequence: (type) => (parameter) => [
|
|
13668
|
-
|
|
13757
|
+
isString(type.elementType[0]) ?
|
|
13758
|
+
PeersConstructions.passStringArray(parameter) : PeersConstructions.passNodeArray(parameter),
|
|
13669
13759
|
PeersConstructions.arrayLength(parameter)
|
|
13670
13760
|
],
|
|
13671
13761
|
string: (type) => (parameter) => parameter,
|
|
@@ -13988,7 +14078,7 @@ class AllPeersPrinter extends MultiFilePrinter {
|
|
|
13988
14078
|
this.config = config;
|
|
13989
14079
|
}
|
|
13990
14080
|
filterInterface(node) {
|
|
13991
|
-
return !this.typechecker.isPeer(node) ||
|
|
14081
|
+
return !this.typechecker.isPeer(node) || this.config.ignore.isIgnoredPeer(fqName(node));
|
|
13992
14082
|
}
|
|
13993
14083
|
printInterface(node) {
|
|
13994
14084
|
return {
|
|
@@ -14549,7 +14639,7 @@ class DynamicEmitter {
|
|
|
14549
14639
|
this.bridgesPrinter = new SingleFileEmitter((idl) => new BridgesPrinter(this.config, idl).print(), `libarkts/generated/native/bridges.cc`, `bridges.cc`, true);
|
|
14550
14640
|
this.bindingsPrinter = new SingleFileEmitter((idl) => new BindingsPrinter(idl).print(), `libarkts/generated/Es2pandaNativeModule.ts`, `Es2pandaNativeModule.ts`, true);
|
|
14551
14641
|
this.enumsPrinter = new SingleFileEmitter((idl) => new EnumsPrinter(idl).print(), `libarkts/generated/Es2pandaEnums.ts`, `Es2pandaEnums.ts`, true);
|
|
14552
|
-
this.indexPrinter = new SingleFileEmitter((idl) => new IndexPrinter(idl).print(), `libarkts/generated/index.ts`, `index.ts`, true);
|
|
14642
|
+
this.indexPrinter = new SingleFileEmitter((idl) => new IndexPrinter(this.config, idl).print(), `libarkts/generated/index.ts`, `index.ts`, true);
|
|
14553
14643
|
this.peersPrinter = new MultiFileEmitter((idl) => new AllPeersPrinter(this.config, idl).print(), `libarkts/generated/peers`, `peer.ts`, true);
|
|
14554
14644
|
this.factoryPrinter = new SingleFileEmitter((idl) => new FactoryPrinter(this.config, idl).print(), `libarkts/generated/factory.ts`, `factory.ts`, true);
|
|
14555
14645
|
const myJson = path__namespace$1.resolve(__dirname, '..', 'package.json');
|
|
@@ -14661,7 +14751,8 @@ class DynamicEmitter {
|
|
|
14661
14751
|
*/
|
|
14662
14752
|
class IgnoreOptions {
|
|
14663
14753
|
constructor(filePath) {
|
|
14664
|
-
var _a, _b;
|
|
14754
|
+
var _a, _b, _c;
|
|
14755
|
+
this.peers = [];
|
|
14665
14756
|
this.partial = [];
|
|
14666
14757
|
this.ignored = new Map();
|
|
14667
14758
|
if (filePath === undefined) {
|
|
@@ -14669,7 +14760,8 @@ class IgnoreOptions {
|
|
|
14669
14760
|
}
|
|
14670
14761
|
const ignore = lib.parse(fs__namespace$1.readFileSync(filePath).toString()).ignore;
|
|
14671
14762
|
this.partial = (_a = ignore === null || ignore === void 0 ? void 0 : ignore.partial) !== null && _a !== void 0 ? _a : [];
|
|
14672
|
-
|
|
14763
|
+
this.peers = (_b = ignore === null || ignore === void 0 ? void 0 : ignore.peers) !== null && _b !== void 0 ? _b : ['es2panda_Context'];
|
|
14764
|
+
const full = (_c = ignore === null || ignore === void 0 ? void 0 : ignore.full) !== null && _c !== void 0 ? _c : [];
|
|
14673
14765
|
full.forEach((fqName) => {
|
|
14674
14766
|
const parts = fqName.split('.');
|
|
14675
14767
|
const [ns, name] = parts.length === 1 ? ['', parts.at(0)] : parts;
|
|
@@ -14681,6 +14773,9 @@ class IgnoreOptions {
|
|
|
14681
14773
|
this.ignored.get(ns).set(key, last !== '!');
|
|
14682
14774
|
});
|
|
14683
14775
|
}
|
|
14776
|
+
isIgnoredPeer(name) {
|
|
14777
|
+
return this.peers.includes(name);
|
|
14778
|
+
}
|
|
14684
14779
|
isIgnoredMethod(iface, method) {
|
|
14685
14780
|
var _a;
|
|
14686
14781
|
return (_a = this.partial) === null || _a === void 0 ? void 0 : _a.some(it => { var _a; return it.interface === iface && ((_a = it.methods) === null || _a === void 0 ? void 0 : _a.includes(method)); });
|
package/package.json
CHANGED
|
@@ -1,54 +1,53 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
2
|
+
"name": "@idlizer/arktscgen",
|
|
3
|
+
"version": "2.1.10-arktscgen-5",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"bin": "lib/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib/*.js",
|
|
9
|
+
"templates/*",
|
|
10
|
+
"./build/libarkts-copy/src",
|
|
11
|
+
"./build/libarkts-copy/native",
|
|
12
|
+
"./build/libarkts-copy/generator",
|
|
13
|
+
"./build/libarkts-copy/package.json",
|
|
14
|
+
"./build/libarkts-copy/tsconfig.json",
|
|
15
|
+
"!./build/libarkts-copy/generated",
|
|
16
|
+
"!./build/libarkts-copy/native/build"
|
|
17
|
+
],
|
|
18
|
+
"license": "Apache-2.0",
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@idlizer/core": "2.1.10-arktscgen-5",
|
|
22
|
+
"@types/node": "^18.0.0",
|
|
23
|
+
"commander": "^10.0.0",
|
|
24
|
+
"typescript": "^4.9.5"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
28
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
29
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
30
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
31
|
+
"@types/chai": "^4.3.1",
|
|
32
|
+
"@types/json5": "^2.2.0",
|
|
33
|
+
"@types/node": "^18.0.0",
|
|
34
|
+
"json5": "^2.2.3",
|
|
35
|
+
"source-map-support": "^0.5.21"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"compile:core": "npm run --prefix ../core compile",
|
|
39
|
+
"compile:self": "rollup -c",
|
|
40
|
+
"compile": "npm run compile:core && npm run compile:self",
|
|
41
|
+
"external:test": "npm run --prefix ../external/ui2abc/libarkts run:current",
|
|
42
|
+
"external:clean": "rimraf ../external/ui2abc/libarkts/generated",
|
|
43
|
+
"external:generate": "npm run compile && node . --panda-sdk-path ../external/incremental/tools/panda/node_modules/@panda/sdk/ --output-dir ../external/ui2abc/ --options-file ../external/ui2abc/libarkts/generator/options.json5 --debug --no-initialize",
|
|
44
|
+
"all": "npm run compile && npm run external:clean && npm run external:generate && npm run external:test",
|
|
45
|
+
"prepack": "npm run compile && mkdir -p ./build && cp -r ../external/ui2abc/libarkts ./build/libarkts-copy",
|
|
46
|
+
"postpack": "rimraf ./build/libarkts-copy",
|
|
47
|
+
"test:pack": "node ./tools/main.mjs test-pack",
|
|
48
|
+
"test:all": "npm run all && npm run test:pack",
|
|
49
|
+
"release:patch": "node ./tools/main.mjs release patch",
|
|
50
|
+
"release:minor": "node ./tools/main.mjs release minor",
|
|
51
|
+
"release:major": "node ./tools/main.mjs release major"
|
|
52
|
+
}
|
|
54
53
|
}
|