From ec852ab57ec95603a2204da1a8b8b79eedbb5d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E5=87=AF?= Date: Thu, 5 Jun 2025 11:02:41 +0800 Subject: [PATCH] api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘永凯 Change-Id: Idf2e8ba4665fd4c42c4d215eb682b4b0996e8cce --- arkui/ace_engine/native/libace.ndk.json | 8 ++++++++ arkui/ace_engine/native/native_node_napi.h | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 4471718884c..cefa5cc32da 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3467,6 +3467,14 @@ "first_introduced": "20", "name": "OH_ArkUI_NodeUtils_GetLayoutPositionInGlobalDisplay" }, + { + "first_introduced": "20", + "name": "OH_ArkUI_InitModuleForArkTSEnv" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_NotifyArkTSEnvDestroy" + }, { "first_introduced": "20", "name": "OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent" diff --git a/arkui/ace_engine/native/native_node_napi.h b/arkui/ace_engine/native/native_node_napi.h index af0c3b1069e..ef6d68fee3e 100644 --- a/arkui/ace_engine/native/native_node_napi.h +++ b/arkui/ace_engine/native/native_node_napi.h @@ -374,6 +374,28 @@ ArkUI_ErrorCode OH_ArkUI_GetRouterPageId( int32_t OH_ArkUI_PostFrameCallback(ArkUI_ContextHandle uiContext, void* userData, void (*callback)(uint64_t nanoTimestamp, uint32_t frameCount, void* userData)); +/** + * @brief Initialize the ArkTS method for the specified env environment. Cannot be called on + * the non-UI thread. Checking for non-UI thread calls will abort. + * + * @param env napi environment pointer. + * @return The error code. + * {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} if env is null or failed to set the whitelist. + * {@link ARKUI_ERROR_CODE_CAPI_INIT_ERROR} if the CAPI init error. + * @since 20 + */ +ArkUI_ErrorCode OH_ArkUI_InitModuleForArkTSEnv(napi_env env); + +/** + * @brief Notify the specified env environment is invalid. Cannot be called on + * the non-UI thread. Checking for non-UI thread calls will abort. + * + * @param env napi environment pointer. + * @since 20 + */ +void OH_ArkUI_NotifyArkTSEnvDestroy(napi_env env); + /** * @brief Register a callback to be executed at the end of the next idle frame.If there is no next frame, will request one automatically. * -- Gitee