diff --git a/ui2abc/libarkts/generator/options.json5 b/ui2abc/libarkts/generator/options.json5 index c2e74938015abcf089c9e89b95d53692012ad727..f9146ba9f958f11a8c825ba4dc8ca0465c1a5165 100644 --- a/ui2abc/libarkts/generator/options.json5 +++ b/ui2abc/libarkts/generator/options.json5 @@ -358,6 +358,10 @@ name: "setSignaturePointer", definition: "extension_ScriptFunctionSetSignaturePointer", }, + { + name: "getParamsCasted", + definition: "extension_ScriptFunctionGetParamsCasted", + }, { name: "getPreferredReturnTypePointer", definition: "extension_ScriptFunctionGetPreferredReturnTypePointer", @@ -414,6 +418,10 @@ name: "getCol", definition: "extension_SourcePositionGetCol", }, + { + name: "getIndex", + definition: "extension_SourcePositionGetIndex", + }, { name: "toString", definition: "extension_SourcePositionToString", @@ -429,6 +437,15 @@ }, ], }, + { + interface: "ETSFunctionType", + methods: [ + { + name: "getParamsCasted", + definition: "extension_ETSFunctionTypeGetParamsCasted", + }, + ], + }, ], parameters: [ { diff --git a/ui2abc/libarkts/native/src/generated/bridges.cc b/ui2abc/libarkts/native/src/generated/bridges.cc index 13c2f8f47ec9c3a4230f0c26896f1fb2586e1f11..d877ea3d025e2f2106e5556bae3cc249d7ac73aa 100644 --- a/ui2abc/libarkts/native/src/generated/bridges.cc +++ b/ui2abc/libarkts/native/src/generated/bridges.cc @@ -17,7 +17,7 @@ /* * THIS FILE IS AUTOGENERATED BY arktscgen v2.1.10-arktscgen-2. DO NOT EDIT MANUALLY! - * es2panda 8950988a4162d5cf0fe7f8adc92c0ac5cb6852d7(2025-08-15) sdk v1.5.0-dev.41863 + * es2panda be06fffa365626583bd82b9a8e19260aa8d58ec3(2025-08-19) sdk v1.5.0-dev.42229 */ KNativePointer impl_GetAllErrorMessages(KNativePointer context) @@ -15062,24 +15062,6 @@ KNativePointer impl_ArrowFunctionExpressionFunction(KNativePointer context, KNat } KOALA_INTEROP_2(ArrowFunctionExpressionFunction, KNativePointer, KNativePointer, KNativePointer); -void impl_ArrowFunctionExpressionSetConvertedLambdaMayNeedFix(KNativePointer context, KNativePointer receiver) -{ - const auto _context = reinterpret_cast(context); - const auto _receiver = reinterpret_cast(receiver); - GetImpl()->ArrowFunctionExpressionSetConvertedLambdaMayNeedFix(_context, _receiver); - return ; -} -KOALA_INTEROP_V2(ArrowFunctionExpressionSetConvertedLambdaMayNeedFix, KNativePointer, KNativePointer); - -KBoolean impl_ArrowFunctionExpressionDoesConvertedLambdaMayNeedFixConst(KNativePointer context, KNativePointer receiver) -{ - const auto _context = reinterpret_cast(context); - const auto _receiver = reinterpret_cast(receiver); - auto result = GetImpl()->ArrowFunctionExpressionDoesConvertedLambdaMayNeedFixConst(_context, _receiver); - return result; -} -KOALA_INTEROP_2(ArrowFunctionExpressionDoesConvertedLambdaMayNeedFixConst, KBoolean, KNativePointer, KNativePointer); - KNativePointer impl_ArrowFunctionExpressionCreateTypeAnnotation(KNativePointer context, KNativePointer receiver) { const auto _context = reinterpret_cast(context); @@ -16176,6 +16158,15 @@ void impl_ProgramSetASTChecked(KNativePointer context, KNativePointer receiver) } KOALA_INTEROP_V2(ProgramSetASTChecked, KNativePointer, KNativePointer); +void impl_ProgramRemoveAstChecked(KNativePointer context, KNativePointer receiver) +{ + const auto _context = reinterpret_cast(context); + const auto _receiver = reinterpret_cast(receiver); + GetImpl()->ProgramRemoveAstChecked(_context, _receiver); + return ; +} +KOALA_INTEROP_V2(ProgramRemoveAstChecked, KNativePointer, KNativePointer); + KBoolean impl_ProgramIsASTChecked(KNativePointer context, KNativePointer receiver) { const auto _context = reinterpret_cast(context); diff --git a/ui2abc/libarkts/src/Es2pandaNativeModule.ts b/ui2abc/libarkts/src/Es2pandaNativeModule.ts index 27218e76ba1a2bb21f365a82d30f874e493613a1..1a334cfea75004bc8cb2fb90c7ef090115eb51e5 100644 --- a/ui2abc/libarkts/src/Es2pandaNativeModule.ts +++ b/ui2abc/libarkts/src/Es2pandaNativeModule.ts @@ -129,7 +129,7 @@ export class Es2pandaNativeModule { _ETSParserGetImportPathManager(context: KNativePointer): KPtr { throw new Error("Not implemented"); } - _SourcePositionCol(context: KNativePointer, instance: KNativePointer): KInt { + _SourcePositionCol(context: KNativePointer, instance: KNativePointer): KUInt { throw new Error("Not implemented"); } _ConfigGetOptions(config: KNativePointer): KNativePointer { diff --git a/ui2abc/libarkts/src/arkts-api/utilities/extensions.ts b/ui2abc/libarkts/src/arkts-api/utilities/extensions.ts index 85e816557b737a1698570a5d4b4a4470635b2be8..636c127ef55a2fe37ad54facd109218e802bf030 100644 --- a/ui2abc/libarkts/src/arkts-api/utilities/extensions.ts +++ b/ui2abc/libarkts/src/arkts-api/utilities/extensions.ts @@ -13,10 +13,12 @@ * limitations under the License. */ -import { KInt, KNativePointer } from "@koalaui/interop" +import { KInt, KNativePointer, KUInt } from "@koalaui/interop" import type { ClassDefinition, + ETSFunctionType, ETSModule, + ETSParameterExpression, Expression, MethodDefinition, NumberLiteral, @@ -27,7 +29,7 @@ import type { import { ExternalSource } from "../peers/ExternalSource" import { Es2pandaModuleFlag } from "../../generated/Es2pandaEnums" import { global } from "../static/global" -import { acceptNativeObjectArrayResult, passNodeArray } from "./private" +import { acceptNativeObjectArrayResult, passNodeArray, unpackNodeArray } from "./private" import type { AstNode } from "../peers/AstNode" export function extension_ETSModuleGetNamespaceFlag(this: ETSModule): Es2pandaModuleFlag { @@ -64,6 +66,11 @@ export function extension_ScriptFunctionSetSignaturePointer(this: ScriptFunction global.es2panda._Checker_ScriptFunctionSetSignature(global.context, this.peer, signaturePointer) } +// Improve: weird API +export function extension_ScriptFunctionGetParamsCasted(this: ScriptFunction): readonly ETSParameterExpression[] { + return unpackNodeArray(global.generatedEs2panda._ScriptFunctionParams(global.context, this.peer)) +} + // Improve: perhaps "preferredReturnType" stuff can be removed later if "signature" is always enough export function extension_ScriptFunctionGetPreferredReturnTypePointer(this: ScriptFunction): KNativePointer { return global.es2panda._Checker_ScriptFunctionGetPreferredReturnType(global.context, this.peer) @@ -91,15 +98,20 @@ export function extension_ProgramGetExternalSources(this: Program): ExternalSour } // Improve: SourcePositionLine is global in idl -export function extension_SourcePositionGetLine(this: SourcePosition): KInt { +export function extension_SourcePositionGetLine(this: SourcePosition): KUInt { return global.generatedEs2panda._SourcePositionLine(global.context, this.peer) } // Improve: SourcePositionCol is not described in idl -export function extension_SourcePositionGetCol(this: SourcePosition): KInt { +export function extension_SourcePositionGetCol(this: SourcePosition): KUInt { return global.es2panda._SourcePositionCol(global.context, this.peer) } +// Improve: SourcePositionIndex is global in idl +export function extension_SourcePositionGetIndex(this: SourcePosition): KUInt { + return global.generatedEs2panda._SourcePositionIndex(global.context, this.peer) +} + export function extension_SourcePositionToString(this: SourcePosition): string { return `:${this.getLine() + 1}:${this.getCol()}` } @@ -118,3 +130,8 @@ export function extension_ScriptFunctionSetParams(this: ScriptFunction, params: export function extension_ClassDefinitionSetBody(this: ClassDefinition, body: readonly AstNode[]): void { global.es2panda._ClassDefinitionSetBody(global.context, this.peer, passNodeArray(body), body.length) } + +// Improve: weird API +export function extension_ETSFunctionTypeGetParamsCasted(this: ETSFunctionType): readonly ETSParameterExpression[] { + return unpackNodeArray(global.generatedEs2panda._ETSFunctionTypeParamsConst(global.context, this.peer)) +} diff --git a/ui2abc/libarkts/src/arkts-api/utilities/private.ts b/ui2abc/libarkts/src/arkts-api/utilities/private.ts index 24d909ff81baaaadd8750e82d811775169660014..148ce864d97e0ab6c891e96d2fe6bbcee8ac4987 100644 --- a/ui2abc/libarkts/src/arkts-api/utilities/private.ts +++ b/ui2abc/libarkts/src/arkts-api/utilities/private.ts @@ -104,20 +104,6 @@ export function passNodeArray(nodes: readonly ArktsObject[] | undefined): BigUin ) } -export function unpackNonNullableObject(type: { new (peer: KNativePointer): T }, peer: KNativePointer): T { - if (peer === nullptr) { - throwError('peer is NULLPTR (maybe you should use unpackObject)') - } - return new type(peer) -} - -export function unpackObject(type: { new (peer: KNativePointer): T }, peer: KNativePointer): T | undefined { - if (peer === nullptr) { - return undefined - } - return new type(peer) -} - export function unpackString(peer: KNativePointer): string { return global.interop._RawUtf8ToString(peer) } diff --git a/ui2abc/libarkts/src/arkts-api/utilities/public.ts b/ui2abc/libarkts/src/arkts-api/utilities/public.ts index f6f9c256dfdca9c29167109107ae6da0eddf0c9c..7e7ea363900297fae9dcf442fb9f4fe9355a1a84 100644 --- a/ui2abc/libarkts/src/arkts-api/utilities/public.ts +++ b/ui2abc/libarkts/src/arkts-api/utilities/public.ts @@ -15,12 +15,11 @@ import { global } from "../static/global" import { isNumber, throwError, withWarning } from "../../utils" -import { KNativePointer, nullptr, KInt} from "@koalaui/interop" -import { passNode, passNodeArray, unpackNodeArray, unpackNonNullableNode, passString, unpackString, nodeType } from "./private" -import { Es2pandaContextState, Es2pandaModifierFlags, Es2pandaMethodDefinitionKind, Es2pandaPrimitiveType, Es2pandaScriptFunctionFlags, Es2pandaAstNodeType } from "../../generated/Es2pandaEnums" +import { KNativePointer, nullptr, KInt, KUInt} from "@koalaui/interop" +import { passNode, unpackNodeArray, unpackNonNullableNode, passString, unpackString } from "./private" +import { Es2pandaContextState, Es2pandaModifierFlags, Es2pandaMethodDefinitionKind, Es2pandaAstNodeType } from "../../generated/Es2pandaEnums" import type { AstNode } from "../peers/AstNode" import { SourcePosition } from "../../generated" -import { isSameNativeObject } from "../peers/ArktsObject" import { type AnnotationUsage, ClassDefinition, @@ -32,7 +31,6 @@ import { isScriptFunction, isIdentifier, isETSModule, - ImportSpecifier, Program, isObjectExpression, ETSImportDeclaration, @@ -47,7 +45,6 @@ import { import { Config } from "../peers/Config" import { Context } from "../peers/Context" import { NodeCache } from "../node-cache" -import { listPrograms } from "../plugins" import { factory } from "../factory/nodeFactory" import { traceGlobal } from "../../tracer" @@ -403,3 +400,7 @@ export function createTypeNodeFromTsType(node: AstNode): AstNode | undefined { } return unpackNonNullableNode(typeAnnotation); } + +export function createSourcePosition(index: KUInt, line: KUInt): SourcePosition { + return new SourcePosition(global.generatedEs2panda._CreateSourcePosition(global.context, index, line)) +} diff --git a/ui2abc/libarkts/src/generated/Es2pandaNativeModule.ts b/ui2abc/libarkts/src/generated/Es2pandaNativeModule.ts index f51850accc94acbc6c2cd831b3726fe3d3bcc6d1..c56876221f5f0cc99d83a2b866cb2536def1637e 100644 --- a/ui2abc/libarkts/src/generated/Es2pandaNativeModule.ts +++ b/ui2abc/libarkts/src/generated/Es2pandaNativeModule.ts @@ -4775,12 +4775,6 @@ export class Es2pandaNativeModule { _ArrowFunctionExpressionFunction(context: KNativePointer, receiver: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } - _ArrowFunctionExpressionSetConvertedLambdaMayNeedFix(context: KNativePointer, receiver: KNativePointer): void { - throw new Error("This methods was not overloaded by native module initialization") - } - _ArrowFunctionExpressionDoesConvertedLambdaMayNeedFixConst(context: KNativePointer, receiver: KNativePointer): KBoolean { - throw new Error("This methods was not overloaded by native module initialization") - } _ArrowFunctionExpressionCreateTypeAnnotation(context: KNativePointer, receiver: KNativePointer): KNativePointer { throw new Error("This methods was not overloaded by native module initialization") } @@ -5120,6 +5114,9 @@ export class Es2pandaNativeModule { _ProgramSetASTChecked(context: KNativePointer, receiver: KNativePointer): void { throw new Error("This methods was not overloaded by native module initialization") } + _ProgramRemoveAstChecked(context: KNativePointer, receiver: KNativePointer): void { + throw new Error("This methods was not overloaded by native module initialization") + } _ProgramIsASTChecked(context: KNativePointer, receiver: KNativePointer): KBoolean { throw new Error("This methods was not overloaded by native module initialization") } diff --git a/ui2abc/libarkts/src/generated/peers/ArrowFunctionExpression.ts b/ui2abc/libarkts/src/generated/peers/ArrowFunctionExpression.ts index 3d81ba7f82d03257fa3a726c0b65ec908467ef5b..28a32ae1afac82e79827aa364a5739cdf9423586 100644 --- a/ui2abc/libarkts/src/generated/peers/ArrowFunctionExpression.ts +++ b/ui2abc/libarkts/src/generated/peers/ArrowFunctionExpression.ts @@ -72,14 +72,6 @@ export class ArrowFunctionExpression extends Expression { get function(): ScriptFunction | undefined { return unpackNode(global.generatedEs2panda._ArrowFunctionExpressionFunction(global.context, this.peer)) } - /** @deprecated */ - setConvertedLambdaMayNeedFix(): this { - global.generatedEs2panda._ArrowFunctionExpressionSetConvertedLambdaMayNeedFix(global.context, this.peer) - return this - } - get doesConvertedLambdaMayNeedFix(): boolean { - return global.generatedEs2panda._ArrowFunctionExpressionDoesConvertedLambdaMayNeedFixConst(global.context, this.peer) - } get createTypeAnnotation(): TypeNode | undefined { return unpackNode(global.generatedEs2panda._ArrowFunctionExpressionCreateTypeAnnotation(global.context, this.peer)) } diff --git a/ui2abc/libarkts/src/generated/peers/ETSFunctionType.ts b/ui2abc/libarkts/src/generated/peers/ETSFunctionType.ts index 9298f1bf650a9b85690db4e75b4bcc873a023b82..47228e44245c48d349640442bc627e7378b6c7ae 100644 --- a/ui2abc/libarkts/src/generated/peers/ETSFunctionType.ts +++ b/ui2abc/libarkts/src/generated/peers/ETSFunctionType.ts @@ -40,6 +40,7 @@ import { FunctionSignature } from "./FunctionSignature" import { TSInterfaceDeclaration } from "./TSInterfaceDeclaration" import { TSTypeParameterDeclaration } from "./TSTypeParameterDeclaration" import { TypeNode } from "./TypeNode" +import { extension_ETSFunctionTypeGetParamsCasted } from "./../../reexport-for-generated" export class ETSFunctionType extends TypeNode { constructor(pointer: KNativePointer, astNodeType: Es2pandaAstNodeType) { @@ -86,6 +87,7 @@ export class ETSFunctionType extends TypeNode { get isExtensionFunction(): boolean { return global.generatedEs2panda._ETSFunctionTypeIsExtensionFunctionConst(global.context, this.peer) } + getParamsCasted = extension_ETSFunctionTypeGetParamsCasted protected readonly brandETSFunctionType: undefined } export function isETSFunctionType(node: object | undefined): node is ETSFunctionType { diff --git a/ui2abc/libarkts/src/generated/peers/Program.ts b/ui2abc/libarkts/src/generated/peers/Program.ts index de6e81e64ef4d4aa03b332769fae4e48fe1d43eb..a1d31feb5e84534965961ea87585d80561b71bb7 100644 --- a/ui2abc/libarkts/src/generated/peers/Program.ts +++ b/ui2abc/libarkts/src/generated/peers/Program.ts @@ -153,6 +153,11 @@ export class Program extends ArktsObject { global.generatedEs2panda._ProgramSetASTChecked(global.context, this.peer) return this } + /** @deprecated */ + removeAstChecked(): this { + global.generatedEs2panda._ProgramRemoveAstChecked(global.context, this.peer) + return this + } get isASTChecked(): boolean { return global.generatedEs2panda._ProgramIsASTChecked(global.context, this.peer) } diff --git a/ui2abc/libarkts/src/generated/peers/ScriptFunction.ts b/ui2abc/libarkts/src/generated/peers/ScriptFunction.ts index fc7b2bd3bdebe4bfbfdeeaf7b170ce44c9da2b75..dbcbfacccf5e8131059b6b726d6b0ab6e5c3f416 100644 --- a/ui2abc/libarkts/src/generated/peers/ScriptFunction.ts +++ b/ui2abc/libarkts/src/generated/peers/ScriptFunction.ts @@ -41,6 +41,7 @@ import { Identifier } from "./Identifier" import { ReturnStatement } from "./ReturnStatement" import { TSTypeParameterDeclaration } from "./TSTypeParameterDeclaration" import { TypeNode } from "./TypeNode" +import { extension_ScriptFunctionGetParamsCasted } from "./../../reexport-for-generated" import { extension_ScriptFunctionGetPreferredReturnTypePointer } from "./../../reexport-for-generated" import { extension_ScriptFunctionGetSignaturePointer } from "./../../reexport-for-generated" import { extension_ScriptFunctionSetParams } from "./../../reexport-for-generated" @@ -294,6 +295,7 @@ export class ScriptFunction extends AstNode { } getSignaturePointer = extension_ScriptFunctionGetSignaturePointer setSignaturePointer = extension_ScriptFunctionSetSignaturePointer + getParamsCasted = extension_ScriptFunctionGetParamsCasted getPreferredReturnTypePointer = extension_ScriptFunctionGetPreferredReturnTypePointer setPreferredReturnTypePointer = extension_ScriptFunctionSetPreferredReturnTypePointer setParams = extension_ScriptFunctionSetParams diff --git a/ui2abc/libarkts/src/generated/peers/SourcePosition.ts b/ui2abc/libarkts/src/generated/peers/SourcePosition.ts index 8309bce5b4041d275d80ecab1d67ddc3f7fcd16b..84393ac94b9272a203fe8c106a3418b2aa964879 100644 --- a/ui2abc/libarkts/src/generated/peers/SourcePosition.ts +++ b/ui2abc/libarkts/src/generated/peers/SourcePosition.ts @@ -33,6 +33,7 @@ import { } from "../../reexport-for-generated" import { extension_SourcePositionGetCol } from "./../../reexport-for-generated" +import { extension_SourcePositionGetIndex } from "./../../reexport-for-generated" import { extension_SourcePositionGetLine } from "./../../reexport-for-generated" import { extension_SourcePositionToString } from "./../../reexport-for-generated" @@ -42,6 +43,7 @@ export class SourcePosition extends ArktsObject { } getLine = extension_SourcePositionGetLine getCol = extension_SourcePositionGetCol + getIndex = extension_SourcePositionGetIndex toString = extension_SourcePositionToString protected readonly brandSourcePosition: undefined } diff --git a/ui2abc/libarkts/src/reexport-for-generated.ts b/ui2abc/libarkts/src/reexport-for-generated.ts index 824c34447a9b30091ca62115514dd13459808d2c..b3d8e6b2b9db7da357761889eec377374aea2929 100644 --- a/ui2abc/libarkts/src/reexport-for-generated.ts +++ b/ui2abc/libarkts/src/reexport-for-generated.ts @@ -22,30 +22,11 @@ export { unpackNodeArray, passNodeArray, unpackNode, - unpackNonNullableObject, unpackString, - unpackObject, assertValidPeer, updateNodeByNode } from "./arkts-api/utilities/private" export { nodeByType } from "./arkts-api/class-by-peer" export { global } from "./arkts-api/static/global" export { Es2pandaMemberExpressionKind } from "./generated/Es2pandaEnums" -export { - extension_ETSModuleGetNamespaceFlag, - extension_MethodDefinitionOnUpdate, - extension_MethodDefinitionSetChildrenParentPtr, - extension_ScriptFunctionGetSignaturePointer, - extension_ScriptFunctionSetSignaturePointer, - extension_ScriptFunctionGetPreferredReturnTypePointer, - extension_ScriptFunctionSetPreferredReturnTypePointer, - extension_ExpressionGetPreferredTypePointer, - extension_ExpressionSetPreferredTypePointer, - extension_ProgramGetExternalSources, - extension_SourcePositionGetCol, - extension_SourcePositionGetLine, - extension_SourcePositionToString, - extension_NumberLiteralValue, - extension_ScriptFunctionSetParams, - extension_ClassDefinitionSetBody, -} from "./arkts-api/utilities/extensions" +export * from "./arkts-api/utilities/extensions"