From 40df14a9e81ac428b55afb3c64ea245d623f12d1 Mon Sep 17 00:00:00 2001 From: Mupceet Date: Thu, 21 Jul 2022 17:17:02 +0800 Subject: [PATCH] update return value type Signed-off-by: Mupceet --- .../kits/js/AccessibilityExtensionContext.d.ts | 13 ++++++++----- .../src/napi_accessibility_extension_context.cpp | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/interfaces/kits/js/AccessibilityExtensionContext.d.ts b/interfaces/kits/js/AccessibilityExtensionContext.d.ts index b0aa7ee7..8b2e6ba0 100644 --- a/interfaces/kits/js/AccessibilityExtensionContext.d.ts +++ b/interfaces/kits/js/AccessibilityExtensionContext.d.ts @@ -19,11 +19,14 @@ import accessibility from "../@ohos.accessibility"; import { GesturePath } from "../@ohos.application.AccessibilityExtensionAbility"; export default class AccessibilityExtensionContext extends ExtensionContext { - setEventTypeFilter(type: Array, callback: AsyncCallback): boolean; - setEventTypeFilter(type: Array): Promise; - - setTargetBundleName(targetNames: Array, callback: AsyncCallback): boolean; - setTargetBundleName(targetNames: Array): Promise; + setEventTypeFilter(type: Array, callback: AsyncCallback): void; + setEventTypeFilter(type: Array): Promise; + /** + * Set the name of the bundle name that is interested in sending the event. + * @param targetNames + */ + setTargetBundleName(targetNames: Array): Promise; + setTargetBundleName(targetNames: Array, callback: AsyncCallback): void; getFocusElement(callback: AsyncCallback): void; getFocusElement(isAccessibilityFocus: boolean, callback: AsyncCallback): void; diff --git a/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp b/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp index 16514050..0d5d2a58 100644 --- a/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp +++ b/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp @@ -167,7 +167,7 @@ private: } bool ret = context->SetEventTypeFilter(filter); if (ret) { - task.Resolve(engine, engine.CreateBoolean(ret)); + task.Resolve(engine, engine.CreateUndefined()); } else { HILOG_ERROR("set event type failed. ret: %{public}d.", ret); task.Reject(engine, CreateJsError(engine, RESULT_ERROR, "set event type failed.")); @@ -208,7 +208,7 @@ private: bool ret = context->SetTargetBundleName(targetBundleNames); if (ret) { - task.Resolve(engine, engine.CreateBoolean(ret)); + task.Resolve(engine, engine.CreateUndefined()); } else { HILOG_ERROR("set target bundle name failed. ret: %{public}d.", ret); task.Reject(engine, CreateJsError(engine, RESULT_ERROR, "set target bundle name failed."));