mirror of
https://gitee.com/openharmony/accessibility
synced 2024-11-27 09:01:34 +00:00
!267 extension接口返回值变更为Promise<void>
Merge pull request !267 from Mupceet/release_0721_return_type
This commit is contained in:
commit
b248590efa
@ -25,11 +25,14 @@ import { GesturePath } from "../@ohos.application.AccessibilityExtensionAbility"
|
||||
* @syscap SystemCapability.BarrierFree.Accessibility.Core
|
||||
*/
|
||||
export default class AccessibilityExtensionContext extends ExtensionContext {
|
||||
setEventTypeFilter(type: Array<accessibility.EventType>, callback: AsyncCallback<boolean>): boolean;
|
||||
setEventTypeFilter(type: Array<accessibility.EventType>): Promise<boolean>;
|
||||
|
||||
setTargetBundleName(targetNames: Array<string>, callback: AsyncCallback<boolean>): boolean;
|
||||
setTargetBundleName(targetNames: Array<string>): Promise<boolean>;
|
||||
setEventTypeFilter(type: Array<accessibility.EventType>, callback: AsyncCallback<void>): void;
|
||||
setEventTypeFilter(type: Array<accessibility.EventType>): Promise<void>;
|
||||
/**
|
||||
* Set the name of the bundle name that is interested in sending the event.
|
||||
* @param targetNames
|
||||
*/
|
||||
setTargetBundleName(targetNames: Array<string>): Promise<void>;
|
||||
setTargetBundleName(targetNames: Array<string>, callback: AsyncCallback<void>): void;
|
||||
|
||||
/**
|
||||
* Get focus element.
|
||||
|
@ -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."));
|
||||
|
Loading…
Reference in New Issue
Block a user