harmony(鸿蒙)无障碍子系统JS API变更

  • 2022-08-09
  • 浏览 (833)

无障碍子系统JS API变更

OpenHarmony 3.2 Beta2版本相较于OpenHarmony 3.2 Beta1版本,无障碍子系统的API变更如下:

接口变更

模块名 类名 方法/属性/枚举/常量 变更类型
AccessibilityExtensionContext Rect height: number; 新增
AccessibilityExtensionContext Rect width: number; 新增
AccessibilityExtensionContext Rect top: number; 新增
AccessibilityExtensionContext Rect left: number; 新增
AccessibilityExtensionContext AccessibilityElement findElement(type: ‘content’, condition: string): Promise<Array<AccessibilityElement>>;
findElement(type: ‘content’, condition: string, callback: AsyncCallback<Array<AccessibilityElement>>): void
findElement(type: ‘focusType’, condition: FocusType): Promise<AccessibilityElement>;
findElement(type: ‘focusType’, condition: FocusType, callback: AsyncCallback<AccessibilityElement>): void
findElement(type: ‘focusDirection’, condition: FocusDirection): Promise<AccessibilityElement>;
findElement(type: ‘focusDirection’, condition: FocusDirection, callback: AsyncCallback<AccessibilityElement>): void
新增
AccessibilityExtensionContext AccessibilityElement performAction(actionName: string, parameters?: object): Promise<boolean>;
performAction(actionName: string, callback: AsyncCallback<boolean>): void;
performAction(actionName: string, parameters: object, callback: AsyncCallback<boolean>): void;
新增
AccessibilityExtensionContext AccessibilityElement actionNames(): Promise<Array<string>>;
actionNames(callback: AsyncCallback<Array<string>>): void;
新增
AccessibilityExtensionContext AccessibilityElement “attributeValue<T extends keyof ElementAttributeValues>(attributeName: T): Promise<ElementAttributeValues[T]>;
attributeValue<T extends keyof ElementAttributeValues>(attributeName: T, callback: AsyncCallback<ElementAttributeValues[T]>): void;”
新增
AccessibilityExtensionContext AccessibilityElement attributeNames<T extends keyof ElementAttributeValues>(): Promise<Array<T>>;
attributeNames<T extends keyof ElementAttributeValues>(callback: AsyncCallback<Array<T>>): void;
新增
AccessibilityExtensionContext AccessibilityExtensionContext gestureInject(gesturePath: GesturePath, listener: Callback<boolean>): Promise<boolean>;
gestureInject(gesturePath: GesturePath, listener: Callback<boolean>, callback: AsyncCallback<boolean>): void;
新增
AccessibilityExtensionContext AccessibilityExtensionContext getWindows(displayId?: number): Promise<Array<AccessibilityElement>>;
getWindows(callback: AsyncCallback<Array<AccessibilityElement>>): void;
getWindows(displayId: number, callback: AsyncCallback<Array<AccessibilityElement>>): void;
新增
AccessibilityExtensionContext AccessibilityExtensionContext getWindowRootElement(windowId?: number): Promise<AccessibilityElement>;
getWindowRootElement(callback: AsyncCallback<AccessibilityElement>): void;
getWindowRootElement(windowId: number, callback: AsyncCallback<AccessibilityElement>): void;
新增
AccessibilityExtensionContext AccessibilityExtensionContext getFocusElement(isAccessibilityFocus?: boolean): Promise<AccessibilityElement>;
getFocusElement(callback: AsyncCallback<AccessibilityElement>): void;
getFocusElement(isAccessibilityFocus: boolean, callback: AsyncCallback<AccessibilityElement>): void;
新增
AccessibilityExtensionContext AccessibilityExtensionContext setTargetBundleName(targetNames: Array<string>): Promise<boolean>;
setTargetBundleName(targetNames: Array<string>, callback: AsyncCallback<boolean>): boolean;
新增
AccessibilityExtensionContext AccessibilityExtensionContext setEventTypeFilter(type: Array<accessibility.EventType>): Promise<boolean>;
setEventTypeFilter(type: Array<accessibility.EventType>, callback: AsyncCallback<boolean>): boolean;
新增
ohos.accessibility AccessibilityAbilityInfo readonly targetBundleNames: Array<string>; 新增
ohos.application.AccessibilityExtensionAbility GesturePoint positionY: number; 新增
ohos.application.AccessibilityExtensionAbility GesturePoint positionX: number; 新增
ohos.application.AccessibilityExtensionAbility GesturePath durationTime: number; 新增
ohos.application.AccessibilityExtensionAbility GesturePath points: Array<GesturePoint>; 新增
ohos.application.AccessibilityExtensionAbility AccessibilityEvent timeStamp?: number; 新增
ohos.application.AccessibilityExtensionAbility AccessibilityEvent target?: AccessibilityElement; 新增
ohos.application.AccessibilityExtensionAbility AccessibilityEvent eventType: accessibility.EventType |accessibility.WindowUpdateType |TouchGuideType |GestureType |PageUpdateType; 新增
ohos.application.AccessibilityExtensionAbility AccessibilityExtensionAbility onKeyEvent(keyEvent: inputEventClient.KeyEvent): boolean; 新增
ohos.application.AccessibilityExtensionAbility AccessibilityExtensionAbility onAccessibilityEvent(event: AccessibilityEvent): void; 新增
ohos.application.AccessibilityExtensionAbility AccessibilityExtensionAbility onDisconnect(): void; 新增
ohos.application.AccessibilityExtensionAbility AccessibilityExtensionAbility onConnect(): void; 新增
ohos.application.AccessibilityExtensionAbility AccessibilityExtensionAbility context: AccessibilityExtensionContext; 新增

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)OpenHarmony启用应用沙箱机制-适配指导

harmony(鸿蒙)3.2 beta2相对3.2 beta1变更详细说明

harmony(鸿蒙)元能力子系统JS API变更

harmony(鸿蒙)帐号子系统JS API变更

harmony(鸿蒙)ArkUI子系统JS API变更

harmony(鸿蒙)包管理子系统JS API变更

harmony(鸿蒙)基础通信子系统JS API变更

harmony(鸿蒙)公共基础库子系统JS API变更

harmony(鸿蒙)DFX子系统JS API变更

harmony(鸿蒙)分布式数据管理子系统JS API变更

0  赞