diff --git a/ui2abc/libarkts/generator/options.json5 b/ui2abc/libarkts/generator/options.json5 index c2e74938015abcf089c9e89b95d53692012ad727..e686ec6921e03c2fb6bba47c522a61c8456804bc 100644 --- a/ui2abc/libarkts/generator/options.json5 +++ b/ui2abc/libarkts/generator/options.json5 @@ -87,7 +87,25 @@ interface: "es2panda_Impl", methods: [ "LogSyntaxError", "LogWarning", "LogTypeError", // wrong idl - "DestroyContext", // cleanup arena (Improve: move this cleanup to another method) + "DestroyContext", // cleanup arena (Improve: move this cleanup to another method) + + // Handwritten bridges + "AstNodeRebind", + "ConfigGetOptions", + "CreateCacheContextFromFile", + "CreateContextFromFile", + "CreateContextFromString", + "CreateContextGenerateAbcForExternalSourceFiles", + "CreateDiagnosticInfo", + "CreateDiagnosticKind", + "CreateGlobalContext", + "CreateSuggestionInfo", + "DestroyGlobalContext", + "SourcePositionCol", + "ExternalSourceName", + "ExternalSourcePrograms", + "GenerateTsDeclarationsFromContext", + "LogDiagnostic", ], }, { @@ -96,6 +114,46 @@ "GetOverloadInfo", // return type is wrong ] }, + { + interface: "Decl", // handwritten bridge + methods: [ + "Node" + ] + }, + { + interface: "ETSParser", // handwritten bridge + methods: [ + "BuildImportDeclaration", + "CreateExpression", + "GetGlobalProgramAbsName", + "GetImportPathManager", + ] + }, + { + interface: "Program", // handwritten bridge + methods: [ + "DirectExternalSources", + "ExternalSources", + ] + }, + { + interface: "Scope", // handwritten bridge + methods: [ + "SetParent", + ] + }, + { + interface: "Signature", // handwritten bridge + methods: [ + "Function", + ] + }, + { + interface: "TSInterfaceBody", // handwritten bridge + methods: [ + "BodyPtr", + ] + }, { interface: "AnnotationDeclaration", methods: [ diff --git a/ui2abc/libarkts/native/src/bridges.cc b/ui2abc/libarkts/native/src/bridges.cc index e3b1d2f91c33dc8511ff29511c41f5fb4f2c0b6a..4acc35671a4aba1e381a94eae8c997489dbf2e49 100644 --- a/ui2abc/libarkts/native/src/bridges.cc +++ b/ui2abc/libarkts/native/src/bridges.cc @@ -19,6 +19,10 @@ #include #include +/** XXX: If you add or remove methods that exist in C API, + * please change generator/options.json5 accordingly. + */ + KNativePointer impl_AstNodeRebind(KNativePointer contextPtr, KNativePointer nodePtr) { auto context = reinterpret_cast(contextPtr); @@ -540,4 +544,4 @@ KNativePointer impl_CreateTypeNodeFromTsType(KNativePointer context, KNativePoin auto _typeAnnotation = GetImpl()->CreateOpaqueTypeNode(_context, _nodeTsType); return _typeAnnotation; } -KOALA_INTEROP_2(CreateTypeNodeFromTsType, KNativePointer, KNativePointer, KNativePointer); \ No newline at end of file +KOALA_INTEROP_2(CreateTypeNodeFromTsType, KNativePointer, KNativePointer, KNativePointer);