diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/.gitignore b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..d2ff20141ceed86d87c0ea5d99481973005bab2b
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/.gitignore
@@ -0,0 +1,12 @@
+/node_modules
+/oh_modules
+/local.properties
+/.idea
+**/build
+/.hvigor
+.cxx
+/.clangd
+/.clang-format
+/.clang-tidy
+**/.test
+/.appanalyzer
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/app.json5 b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/app.json5
new file mode 100644
index 0000000000000000000000000000000000000000..0fcdee187b6053ad02b3463be5572d332f96cfb9
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/app.json5
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "app": {
+ "bundleName": "com.example.nodeapimethodpromise",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_layered_image",
+ "label": "$string:app_name"
+ }
+}
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/element/string.json b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..e82ee8f23039e81a50c9144ffb6b680d1c7bcdf2
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "NodeAPIMethodPromise"
+ }
+ ]
+}
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/media/app_background.png b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/media/app_background.png
new file mode 100644
index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f
Binary files /dev/null and b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/media/app_background.png differ
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/media/app_foreground.png b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/media/app_foreground.png
new file mode 100644
index 0000000000000000000000000000000000000000..eb9427585b36d14b12477435b6419d1f07b3e0bb
Binary files /dev/null and b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/media/app_foreground.png differ
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/media/app_layered_image.json b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/media/app_layered_image.json
new file mode 100644
index 0000000000000000000000000000000000000000..b71c16122943f248ace0f5fa26da38b71dbdbdde
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/AppScope/resources/base/media/app_layered_image.json
@@ -0,0 +1,7 @@
+{
+ "layered-image":
+ {
+ "background" : "$media:app_background",
+ "foreground" : "$media:app_foreground"
+ }
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/README.md b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..aa146a300d11dcced25de518e47f1a9dbdc235e5
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/README.md
@@ -0,0 +1,73 @@
+# ArkTS使用Node-API调用返回值为promise的ArkTS方法
+
+### 介绍
+
+当ArkTS的返回值为promise,开发者可以按照以下方式在自己创建的ArkTS运行环境中调用异步的ArkTS接口。
+
+- [使用Node-API调用返回值为promise的ArkTS方法](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/napi/use-napi-method-promise.md)
+
+### 效果预览
+
+| 首页 | 执行结果图 |
+| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
+|
|
|
+
+### 使用说明
+
+1. 运行Index主界面。
+2. 页面呈现上述首页效果,点击按钮,随后点击界面显示的文本字符串即可触发程序执行。
+3. 运行测试用例NodeAPIMethodPromise.test.ets文件对页面代码进行测试可以全部通过。
+
+### 工程目录
+
+```
+entry/src/
+ ├── main
+ │ ├── cpp
+ │ │ ├── types
+ │ │ ├── Index.d.ts
+ │ │ ├── oh-package.json5
+ │ │ ├── CMakeLists.txt
+ │ │ ├── hello.cpp
+ │ ├── ets
+ │ │ ├── entryability
+ │ │ ├── entrybackupability
+ │ │ ├── pages
+ │ │ ├── Index.ets // 使用Node-API调用返回值为promise的ArkTS方法示例代码
+ │ ├── module.json5
+ │ └── resources
+ ├── ohosTest
+ │ ├── ets
+ │ │ └── test
+ │ │ ├── Ability.test.ets
+ │ │ ├── NodeAPIMethodPromise.test.ets // 自动化测试代码
+ │ │ └── List.test.ets
+```
+
+### 相关权限
+
+不涉及。
+
+### 依赖
+
+不涉及。
+
+### 约束与限制
+
+1.本示例仅支持标准系统上运行, 支持设备:RK3568。
+
+2.本示例为Stage模型,支持API14版本SDK,版本号:5.0.2.57,镜像版本号:OpenHarmony_5.0.2.58。
+
+3.本示例需要使用DevEco Studio 5.0.1 Release (Build Version: 5.0.5.306, built on December 6, 2024)及以上版本才可编译运行。
+
+### 下载
+
+如需单独下载本工程,执行如下命令:
+
+```
+git init
+git config core.sparsecheckout true
+echo code/DocsSample/ArkTs/NodeAPI/NodeAPIUse/NodeAPIMethodPromise > .git/info/sparse-checkout
+git remote add origin https://gitee.com/openharmony/applications_app_samples.git
+git pull origin master
+```
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/build-profile.json5 b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..9a067264a40737cf79d1d8ae7c574b8d2cc87ce0
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/build-profile.json5
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "app": {
+ "signingConfigs": [],
+ "products": [
+ {
+ "name": "default",
+ "signingConfig": "default",
+ "compileSdkVersion": 14,
+ "compatibleSdkVersion": 14,
+ "targetSdkVersion": 14,
+ "runtimeOS": "OpenHarmony",
+ "buildOption": {
+ "strictMode": {
+ "caseSensitiveCheck": true,
+ "useNormalizedOHMUrl": true
+ }
+ }
+ }
+ ],
+ "buildModeSet": [
+ {
+ "name": "debug",
+ },
+ {
+ "name": "release"
+ }
+ ]
+ },
+ "modules": [
+ {
+ "name": "entry",
+ "srcPath": "./entry",
+ "targets": [
+ {
+ "name": "default",
+ "applyToProducts": [
+ "default"
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/code-linter.json5 b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/code-linter.json5
new file mode 100644
index 0000000000000000000000000000000000000000..ed05653cca31b61d64cf6471529eaf50d4f70709
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/code-linter.json5
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "files": [
+ "**/*.ets"
+ ],
+ "ignore": [
+ "**/src/ohosTest/**/*",
+ "**/src/test/**/*",
+ "**/src/mock/**/*",
+ "**/node_modules/**/*",
+ "**/oh_modules/**/*",
+ "**/build/**/*",
+ "**/.preview/**/*"
+ ],
+ "ruleSet": [
+ "plugin:@performance/recommended",
+ "plugin:@typescript-eslint/recommended"
+ ],
+ "rules": {
+ "@security/no-unsafe-aes": "error",
+ "@security/no-unsafe-hash": "error",
+ "@security/no-unsafe-mac": "warn",
+ "@security/no-unsafe-dh": "error",
+ "@security/no-unsafe-dsa": "error",
+ "@security/no-unsafe-ecdsa": "error",
+ "@security/no-unsafe-rsa-encrypt": "error",
+ "@security/no-unsafe-rsa-sign": "error",
+ "@security/no-unsafe-rsa-key": "error",
+ "@security/no-unsafe-dsa-key": "error",
+ "@security/no-unsafe-dh-key": "error",
+ "@security/no-unsafe-3des": "error"
+ }
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/.gitignore b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/.gitignore
@@ -0,0 +1,6 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/build-profile.json5 b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..8bbe548ca77166375df1b97f53c10c7b4b7e46ad
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/build-profile.json5
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "apiType": "stageMode",
+ "buildOption": {
+ "externalNativeOptions": {
+ "path": "./src/main/cpp/CMakeLists.txt",
+ "arguments": "",
+ "cppFlags": "",
+ "abiFilters": [
+ "x86_64",
+ "armeabi-v7a",
+ "arm64-v8a"
+ ]
+ }
+ },
+ "buildOptionSet": [
+ {
+ "name": "release",
+ "arkOptions": {
+ "obfuscation": {
+ "ruleOptions": {
+ "enable": false,
+ "files": [
+ "./obfuscation-rules.txt"
+ ]
+ }
+ }
+ },
+ "nativeLib": {
+ "debugSymbol": {
+ "strip": true,
+ "exclude": []
+ }
+ }
+ },
+ ],
+ "targets": [
+ {
+ "name": "default"
+ },
+ {
+ "name": "ohosTest",
+ }
+ ]
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/hvigorfile.ts b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/hvigorfile.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e4f43d54667f8327c367c8096bd08bb8c75aff54
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/hvigorfile.ts
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { hapTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+ system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+}
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/obfuscation-rules.txt b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/obfuscation-rules.txt
new file mode 100644
index 0000000000000000000000000000000000000000..272efb6ca3f240859091bbbfc7c5802d52793b0b
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/obfuscation-rules.txt
@@ -0,0 +1,23 @@
+# Define project specific obfuscation rules here.
+# You can include the obfuscation configuration files in the current module's build-profile.json5.
+#
+# For more details, see
+# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
+
+# Obfuscation options:
+# -disable-obfuscation: disable all obfuscations
+# -enable-property-obfuscation: obfuscate the property names
+# -enable-toplevel-obfuscation: obfuscate the names in the global scope
+# -compact: remove unnecessary blank spaces and all line feeds
+# -remove-log: remove all console.* statements
+# -print-namecache: print the name cache that contains the mapping from the old names to new names
+# -apply-namecache: reuse the given cache file
+
+# Keep options:
+# -keep-property-name: specifies property names that you want to keep
+# -keep-global-name: specifies names that you want to keep in the global scope
+
+-enable-property-obfuscation
+-enable-toplevel-obfuscation
+-enable-filename-obfuscation
+-enable-export-obfuscation
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/oh-package.json5 b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/oh-package.json5
new file mode 100644
index 0000000000000000000000000000000000000000..118bdd4fe7699368a010e04c24f5bfc887cf1298
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/oh-package.json5
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "name": "entry",
+ "version": "1.0.0",
+ "description": "Please describe the basic information.",
+ "main": "",
+ "author": "",
+ "license": "",
+ "dependencies": {
+ "libentry.so": "file:./src/main/cpp/types/libentry"
+ }
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/CMakeLists.txt b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..631e75662a288d2dc7d6dc82cab3a4fb1db79b00
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/CMakeLists.txt
@@ -0,0 +1,14 @@
+# the minimum version of CMake.
+cmake_minimum_required(VERSION 3.4.1)
+project(nodeapimethodpromise)
+
+set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+
+if(DEFINED PACKAGE_FIND_FILE)
+ include(${PACKAGE_FIND_FILE})
+endif()
+
+include_directories(${NATIVERENDER_ROOT_PATH}
+ ${NATIVERENDER_ROOT_PATH}/include)
+add_library(entry SHARED hello.cpp)
+target_link_libraries(entry PUBLIC libace_napi.z.so libhilog_ndk.z.so)
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/hello.cpp b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/hello.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..82f742a99f546729c0c883d82c02b93bab72c235
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/hello.cpp
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "hilog/log.h"
+#include "napi/native_api.h"
+#include
+#include
+
+//解析Promise结果的回调
+static napi_value ResolvedCallback(napi_env env, napi_callback_info info)
+{
+ size_t argc = 1;
+ napi_value args[1];
+ napi_get_cb_info(env, info, &argc, args, nullptr, nullptr);
+
+ int result;
+ napi_get_value_int32(env, args[0], &result);
+ OH_LOG_INFO(LOG_APP, "Promise resolved with result:%{public}d", result);
+ return nullptr;
+}
+
+//拒绝Promise的回调
+static napi_value RejectedCallback(napi_env env, napi_callback_info info)
+{
+ size_t argc = 1;
+ napi_value args[1];
+ napi_get_cb_info(env, info, &argc, args, nullptr, nullptr);
+
+ napi_value error;
+ napi_coerce_to_string(env, args[0], &error);
+ char errorMsg[1024];
+ size_t len;
+ napi_get_value_string_utf8(env, error, errorMsg, sizeof(errorMsg), &len);
+ OH_LOG_ERROR(LOG_APP, "Promise rejected with error:%{public}s", errorMsg);
+ return nullptr;
+}
+
+static napi_value CallArkTSAsync(napi_env env, napi_callback_info info)
+{
+ size_t argc = 1;
+ napi_value argv[1] = { nullptr };
+ napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr);
+ napi_value promise = nullptr;
+ napi_call_function(env, nullptr, argv[0], 0, nullptr, &promise);
+
+ napi_value thenFunc = nullptr;
+ if (napi_get_named_property(env, promise, "then", &thenFunc) != napi_ok) {
+ return nullptr;
+ }
+
+ napi_value onResolve = nullptr;
+ napi_value onReject = nullptr;
+ napi_create_function(env, "onResolve", NAPI_AUTO_LENGTH, ResolvedCallback, nullptr, &onResolve);
+ napi_create_function(env, "onReject", NAPI_AUTO_LENGTH, RejectedCallback, nullptr, &onReject);
+ constexpr size_t kPromiseCallbackCount = 2;
+ napi_value argv1[2] = {onResolve, onReject};
+ napi_call_function(env, promise, thenFunc, kPromiseCallbackCount, argv1, nullptr);
+
+ return nullptr;
+}
+
+// 注册模块接口
+EXTERN_C_START
+static napi_value Init(napi_env env, napi_value exports)
+{
+ napi_property_descriptor desc[] = {
+ {"callArkTSAsync", nullptr, CallArkTSAsync, nullptr, nullptr, nullptr, napi_default, nullptr}
+ };
+ napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc);
+ return exports;
+}
+EXTERN_C_END
+
+static napi_module nativeModule = {
+ .nm_version = 1,
+ .nm_flags = 0,
+ .nm_filename = nullptr,
+ .nm_register_func = Init,
+ .nm_modname = "entry",
+ .nm_priv = nullptr,
+ .reserved = { 0 },
+};
+
+extern "C" __attribute__((constructor)) void RegisterEntryModule()
+{
+ napi_module_register(&nativeModule);
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/types/libentry/Index.d.ts b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/types/libentry/Index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4b538de4fc83553940ebedfb391ddba87284e63e
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/types/libentry/Index.d.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export const callArkTSAsync: (func: Function) => object;
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/types/libentry/oh-package.json5 b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/types/libentry/oh-package.json5
new file mode 100644
index 0000000000000000000000000000000000000000..6abf3b7c20f22c62aaac6a995a25cae672f73f35
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/cpp/types/libentry/oh-package.json5
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "name": "libentry.so",
+ "types": "./Index.d.ts",
+ "version": "1.0.0",
+ "description": "Please describe the basic information."
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/ets/entryability/EntryAbility.ets b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/ets/entryability/EntryAbility.ets
new file mode 100644
index 0000000000000000000000000000000000000000..d3ee54d2beea61d38866762868bd056d3e39e3c9
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/ets/entryability/EntryAbility.ets
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit';
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { window } from '@kit.ArkUI';
+
+const DOMAIN = 0x0000;
+
+export default class EntryAbility extends UIAbility {
+ onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
+ this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET);
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate');
+ }
+
+ onDestroy(): void {
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy');
+ }
+
+ onWindowStageCreate(windowStage: window.WindowStage): void {
+ // Main window is created, set main page for this ability
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
+
+ windowStage.loadContent('pages/Index', (err) => {
+ if (err.code) {
+ hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err));
+ return;
+ }
+ hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.');
+ });
+ }
+
+ onWindowStageDestroy(): void {
+ // Main window is destroyed, release UI related resources
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
+ }
+
+ onForeground(): void {
+ // Ability has brought to foreground
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground');
+ }
+
+ onBackground(): void {
+ // Ability has back to background
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground');
+ }
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0a97e21bd7a15599af76a806695860ff1eb0ebfe
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit';
+
+const DOMAIN = 0x0000;
+
+export default class EntryBackupAbility extends BackupExtensionAbility {
+ async onBackup() {
+ hilog.info(DOMAIN, 'testTag', 'onBackup ok');
+ await Promise.resolve();
+ }
+
+ async onRestore(bundleVersion: BundleVersion) {
+ hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion));
+ await Promise.resolve();
+ }
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/ets/pages/Index.ets b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/ets/pages/Index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1e890454bdc4688737cf45e637f27d9374e54e1e
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/ets/pages/Index.ets
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import testNapi from 'libentry.so';
+
+export function SetTimeout(): Promise {
+ return new Promise((resolve) => {
+ setTimeout(() => {
+ resolve(42);
+ }, 1000);
+ })
+}
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'Hello World';
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize($r('app.float.page_text_font_size'))
+ .fontWeight(FontWeight.Bold)
+ Button($r('app.string.Call_ArkTSAsync'))
+ .onClick(() => {
+ try {
+ this.message = 'Result: napiMethodPromiseSuccess';
+ testNapi.callArkTSAsync(SetTimeout);
+ } catch (e) {
+ this.message = 'Failed';
+ }
+ })
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/module.json5 b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/module.json5
new file mode 100644
index 0000000000000000000000000000000000000000..4144486d1af4c03b0d767cce1cda86fc0d697f91
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/module.json5
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "description": "$string:module_desc",
+ "mainElement": "EntryAbility",
+ "deviceTypes": [
+ "default",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "abilities": [
+ {
+ "name": "EntryAbility",
+ "srcEntry": "./ets/entryability/EntryAbility.ets",
+ "description": "$string:EntryAbility_desc",
+ "icon": "$media:layered_image",
+ "label": "$string:EntryAbility_label",
+ "startWindowIcon": "$media:startIcon",
+ "startWindowBackground": "$color:start_window_background",
+ "exported": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ],
+ "extensionAbilities": [
+ {
+ "name": "EntryBackupAbility",
+ "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets",
+ "type": "backup",
+ "exported": false,
+ "metadata": [
+ {
+ "name": "ohos.extension.backup",
+ "resource": "$profile:backup_config"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/element/color.json b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/element/color.json
@@ -0,0 +1,8 @@
+{
+ "color": [
+ {
+ "name": "start_window_background",
+ "value": "#FFFFFF"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/element/float.json b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/element/float.json
new file mode 100644
index 0000000000000000000000000000000000000000..33ea22304f9b1485b5f22d811023701b5d4e35b6
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/element/float.json
@@ -0,0 +1,8 @@
+{
+ "float": [
+ {
+ "name": "page_text_font_size",
+ "value": "50fp"
+ }
+ ]
+}
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/element/string.json b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..6215241caffccab986d7b7173e28c2c7a40ce16b
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,20 @@
+{
+ "string": [
+ {
+ "name": "module_desc",
+ "value": "module description"
+ },
+ {
+ "name": "EntryAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "EntryAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "Call_ArkTSAsync",
+ "value": "Call"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/background.png b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/background.png
new file mode 100644
index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f
Binary files /dev/null and b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/background.png differ
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/foreground.png b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/foreground.png
new file mode 100644
index 0000000000000000000000000000000000000000..97014d3e10e5ff511409c378cd4255713aecd85f
Binary files /dev/null and b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/foreground.png differ
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/layered_image.json b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/layered_image.json
new file mode 100644
index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/layered_image.json
@@ -0,0 +1,7 @@
+{
+ "layered-image":
+ {
+ "background" : "$media:background",
+ "foreground" : "$media:foreground"
+ }
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/startIcon.png b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/startIcon.png
new file mode 100644
index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b
Binary files /dev/null and b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/media/startIcon.png differ
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/profile/backup_config.json b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/profile/backup_config.json
new file mode 100644
index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/profile/backup_config.json
@@ -0,0 +1,3 @@
+{
+ "allowToBackupRestore": true
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/profile/main_pages.json b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/Index"
+ ]
+}
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/dark/element/color.json b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/dark/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..79b11c2747aec33e710fd3a7b2b3c94dd9965499
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/main/resources/dark/element/color.json
@@ -0,0 +1,8 @@
+{
+ "color": [
+ {
+ "name": "start_window_background",
+ "value": "#000000"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/ets/test/Ability.test.ets b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/ets/test/Ability.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0f8ce9a2c012f8fe36114cef65216ef0b6254f41
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/ets/test/Ability.test.ets
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+
+export default function abilityTest() {
+ describe('ActsAbilityTest', () => {
+ // Defines a test suite. Two parameters are supported: test suite name and test suite function.
+ beforeAll(() => {
+ // Presets an action, which is performed only once before all test cases of the test suite start.
+ // This API supports only one parameter: preset action function.
+ })
+ beforeEach(() => {
+ // Presets an action, which is performed before each unit test case starts.
+ // The number of execution times is the same as the number of test cases defined by **it**.
+ // This API supports only one parameter: preset action function.
+ })
+ afterEach(() => {
+ // Presets a clear action, which is performed after each unit test case ends.
+ // The number of execution times is the same as the number of test cases defined by **it**.
+ // This API supports only one parameter: clear action function.
+ })
+ afterAll(() => {
+ // Presets a clear action, which is performed after all test cases of the test suite end.
+ // This API supports only one parameter: clear action function.
+ })
+ it('assertContain', 0, () => {
+ // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
+ hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
+ let a = 'abc';
+ let b = 'b';
+ // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
+ expect(a).assertContain(b);
+ expect(a).assertEqual(a);
+ })
+ })
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/ets/test/List.test.ets b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/ets/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..4b35dc5c250a4c008fdef4027c2481f93ae4f22e
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/ets/test/List.test.ets
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import nodeAPIMethodPromiseTest from './NodeAPIMethodPromise.test';
+
+export default function testsuite() {
+ nodeAPIMethodPromiseTest();
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/ets/test/NodeAPIMethodPromise.test.ets b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/ets/test/NodeAPIMethodPromise.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..4b95e558c6db126f5b795e12e7ff42c704e0b610
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/ets/test/NodeAPIMethodPromise.test.ets
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { describe, it, expect, beforeAll } from '@ohos/hypium';
+// 导入测试依赖kit
+import { abilityDelegatorRegistry, Driver, ON } from '@kit.TestKit';
+import { UIAbility, Want } from '@kit.AbilityKit';
+
+const delegator: abilityDelegatorRegistry.AbilityDelegator = abilityDelegatorRegistry.getAbilityDelegator();
+const bundleName = abilityDelegatorRegistry.getArguments().bundleName;
+let want: Want;
+
+export default function nodeAPIMethodPromiseTest() {
+ describe('nodeAPIMethodPromiseTest', () => {
+ /**
+ * 打开应用
+ */
+ beforeAll(async () => {
+ want = {
+ bundleName: bundleName,
+ abilityName: 'EntryAbility'
+ };
+ await delegator.startAbility(want);
+ const driver = Driver.create();
+ await driver.delayMs(1000);
+ const ability: UIAbility = await delegator.getCurrentTopAbility();
+ console.info('get top ability');
+ await driver.delayMs(1000);
+ expect(ability.context.abilityInfo.name).assertEqual('EntryAbility');
+ })
+
+ /**
+ * 点击按钮,调用异步的ArkTS接口
+ */
+ it('testNodeAPIMethodPromise001', 0, async (done: Function) => {
+ console.info('uitest: testNodeAPIMethodPromise001 begin');
+ const driver = Driver.create();
+ await driver.delayMs(1000);
+ const text = await driver.findComponent(ON.text('Hello World'));
+ await driver.delayMs(1000);
+ await text.click();
+ await driver.delayMs(1000);
+ await driver.assertComponentExist(ON.text('Result: napiMethodPromiseSuccess'));
+ console.info('uitest: testNodeAPIMethodPromise001 end');
+ done();
+ })
+ })
+}
\ No newline at end of file
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/module.json5 b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/module.json5
new file mode 100644
index 0000000000000000000000000000000000000000..c3fd9dda3040d888d9d8b0b62bcb5d3b6fbeb614
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/entry/src/ohosTest/module.json5
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "module": {
+ "name": "entry_test",
+ "type": "feature",
+ "deviceTypes": [
+ "default",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false
+ }
+}
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/hvigor/hvigor-config.json5 b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/hvigor/hvigor-config.json5
new file mode 100644
index 0000000000000000000000000000000000000000..abba3f8bb5fd7ae3ea4626a345f3f557ce010ccc
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/hvigor/hvigor-config.json5
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "modelVersion": "5.1.0",
+ "dependencies": {
+ },
+ "execution": {
+ // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */
+ // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
+ // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
+ // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
+ // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
+ },
+ "logging": {
+ // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
+ },
+ "debugging": {
+ // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
+ },
+ "nodeOptions": {
+ // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/
+ // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/
+ }
+}
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/hvigorfile.ts b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/hvigorfile.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2a5e543f190732c159beb574dfc9fa37bc94e156
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/hvigorfile.ts
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { appTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+ system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+}
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/oh-package.json5 b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/oh-package.json5
new file mode 100644
index 0000000000000000000000000000000000000000..776afe9eb3d822abcfd3e4273f23581af1d1acc1
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/oh-package.json5
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{
+ "modelVersion": "5.1.0",
+ "description": "Please describe the basic information.",
+ "dependencies": {
+ },
+ "devDependencies": {
+ "@ohos/hypium": "1.0.21",
+ "@ohos/hamock": "1.0.0"
+ }
+}
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/ohosTest.md b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/ohosTest.md
new file mode 100644
index 0000000000000000000000000000000000000000..227537d7a40d43e478e56ec7d23628101751d0fd
--- /dev/null
+++ b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/ohosTest.md
@@ -0,0 +1,8 @@
+# 使用Node-API调用返回值为promise的ArkTS方法
+
+## 用例表
+
+| 测试功能 | 预置条件 | 输入 | 预期输出 | 测试结果 |
+| ----------------------------------------- | ------------ | --------------------------------- | ------------------------------------------------------------------------ | -------- |
+| 拉起应用 | 设备正常运行 | | 成功拉起应用 | Pass |
+| ArkTS端成功调用native侧callArkTSAsync接口 | 位于主页 | 点击文本为'Hello World'的文本组件 | 成功调用函数输出日志,页面顶端文本变为'Result: napiMethodPromiseSuccess' | Pass |
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/screenshots/NodeAPIMethodPromise1.png b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/screenshots/NodeAPIMethodPromise1.png
new file mode 100644
index 0000000000000000000000000000000000000000..3713324a500848d974a964308a2016b196205044
Binary files /dev/null and b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/screenshots/NodeAPIMethodPromise1.png differ
diff --git a/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/screenshots/NodeAPIMethodPromise2.png b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/screenshots/NodeAPIMethodPromise2.png
new file mode 100644
index 0000000000000000000000000000000000000000..f35f5312f846f3875cd06646b1a7bbc018cfee4e
Binary files /dev/null and b/code/DocsSample/ArkTS/NodeAPI/NodeAPIUse/NodeAPIMethodPromise/screenshots/NodeAPIMethodPromise2.png differ