From 47609b7fe3b7ccdc8249d49015186eacf1b59911 Mon Sep 17 00:00:00 2001 From: yichengzhao Date: Fri, 30 Sep 2022 12:56:19 +0800 Subject: [PATCH 1/2] errorcode for accessibility Signed-off-by: yichengzhao Change-Id: I3402b21a833ae02b28cefb73146462ed7f2a5498 --- api/@ohos.accessibility.config.d.ts | 20 ++- api/@ohos.accessibility.d.ts | 149 ++++++++++++++++-- .../AccessibilityExtensionContext.d.ts | 24 ++- 3 files changed, 177 insertions(+), 16 deletions(-) diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts index 2dfac6d56a..4d20da8a42 100644 --- a/api/@ohos.accessibility.config.d.ts +++ b/api/@ohos.accessibility.config.d.ts @@ -77,6 +77,10 @@ declare namespace config { * Enable the accessibility extension ability. * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. * @param capability Indicates the ability. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. + * @throws { BusinessError } 9300002 - Target ability already enabled. */ function enableAbility(name: string, capability: Array): Promise; function enableAbility(name: string, capability: Array, callback: AsyncCallback): void; @@ -84,6 +88,9 @@ declare namespace config { /** * Disable the accessibility extension ability. * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300001 - Extension name is incorrect. */ function disableAbility(name: string): Promise; function disableAbility(name: string, callback: AsyncCallback): void; @@ -92,15 +99,17 @@ declare namespace config { * Register the listener that watches for changes in the enabled status of accessibility extensions. * @param type Indicates the enableAbilityListsStateChanged type. * @param callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. */ - function on(type: 'enableAbilityListsStateChanged', callback: Callback): void; + function on(type: 'enabledAccessibilityExtensionListChange', callback: Callback): void; /** * Deregister listener that watches for changes in the enabled status of accessibility extensions. * @param type Indicates the enableAbilityListsStateChanged type. * @param callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. */ - function off(type: 'enableAbilityListsStateChanged', callback?: Callback): void; + function off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback): void; /** * Indicates setting, getting, and listening to changes in configuration. @@ -109,12 +118,16 @@ declare namespace config { /** * Setting configuration value. * @param value Indicates the value. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. */ set(value: T): Promise; set(value: T, callback: AsyncCallback): void; /** * Getting configuration value. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. */ get(): Promise; get(callback: AsyncCallback): void; @@ -122,12 +135,15 @@ declare namespace config { /** * Register the listener to listen for configuration changes. * @param callback Indicates the listener. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. */ on(callback: Callback): void; /** * Deregister the listener to listen for configuration changes. * @param callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. */ off(callback?: Callback): void; } diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index 50f45c0251..0333942128 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -24,13 +24,19 @@ import { Callback } from './basic'; * @import basic,abilityInfo */ declare namespace accessibility { - /** * The type of the Ability app. + * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' } * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ - type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual'; + /** + * The type of the Ability app. + * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all' } + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all'; /** * The action that the ability can execute. @@ -95,52 +101,78 @@ declare namespace accessibility { /** * Checks whether accessibility ability is enabled. * @since 7 + * @deprecated since 9 * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. - */ + */ function isOpenAccessibility(callback: AsyncCallback): void; function isOpenAccessibility(): Promise; + /** + * Checks whether accessibility ability is enabled. + * @since 9 + * @param callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. + */ + function isAccessibilityExtensionEnabled(callback: AsyncCallback): void; + function isAccessibilityExtensionEnabled(): Promise; + /** * Checks touch browser ability (which is used by talkback) is enabled. * @since 7 + * @deprecated since 9 * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. - */ + */ function isOpenTouchGuide(callback: AsyncCallback): void; function isOpenTouchGuide(): Promise; + /** + * Checks touch browser ability is enabled. + * @since 9 + * @param callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Vision + * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. + */ + function isScreenReaderEnabled(callback: AsyncCallback): void; + function isScreenReaderEnabled(): Promise; + /** * Queries the list of accessibility abilities. * @since 7 + * @deprecated since 9 * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns the list of abilityInfos. - */ + */ function getAbilityLists(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void; function getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise>; + /** * Queries the list of accessibility abilities. * @since 9 - * @param abilityType The all type of the accessibility ability. + * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns the list of abilityInfos. - */ - function getAbilityLists(abilityType: 'all', stateType: AbilityState, - callback: AsyncCallback>): void; - function getAbilityLists(abilityType: 'all', - stateType: AbilityState): Promise>; + * @throws { BusinessError } 401 - Input parameter error. + */ + function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState): Promise>; + function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void; /** * Send accessibility Event. * @since 7 + * @deprecated since 9 * @param event The object of the accessibility {@code EventInfo} . * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core @@ -149,9 +181,22 @@ declare namespace accessibility { function sendEvent(event: EventInfo, callback: AsyncCallback): void; function sendEvent(event: EventInfo): Promise; + /** + * Send accessibility event. + * @since 9 + * @param event The object of the accessibility {@code EventInfo} . + * @param callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @return Returns {@code true} if success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. + */ + function sendAccessibilityEvent(event: EventInfo, callback: AsyncCallback): void; + function sendAccessibilityEvent(event: EventInfo): Promise; + /** * Register the observe of the accessibility state changed. * @since 7 + * @deprecated since 9 * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core @@ -159,9 +204,21 @@ declare namespace accessibility { */ function on(type: 'accessibilityStateChange', callback: Callback): void; + /** + * Register the observe of the accessibility extension enable state changed. + * @since 9 + * @param type state event type. + * @param callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. + */ + function on(type: 'accessibilityExtensionEnableStateChange', callback: Callback): void; + /** * Register the observe of the touchGuide state changed. * @since 7 + * @deprecated since 9 * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision @@ -169,9 +226,21 @@ declare namespace accessibility { */ function on(type: 'touchGuideStateChange', callback: Callback): void; + /** + * Register the observe of the screen reader enable state changed. + * @since 9 + * @param type state event type. + * @param callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Vision + * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. + */ + function on(type: 'screenReaderEnableStateChange', callback: Callback): void; + /** * Deregister the observe of the accessibility state changed. * @since 7 + * @deprecated since 9 * @param type state event type * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core @@ -179,15 +248,38 @@ declare namespace accessibility { */ function off(type: 'accessibilityStateChange', callback?: Callback): void; + + /** + * Deregister the observe of the accessibility extension enable state changed. + * @since 9 + * @param type state event type + * @param callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. + */ + function off(type: 'accessibilityExtensionEnableStateChange', callback?: Callback): void; + /** * Deregister the observe of the touchGuide state changed. * @since 7 + * @deprecated since 9 * @param type state event type * @param callback Asynchronous callback interface. * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. */ function off(type: 'touchGuideStateChange', callback?: Callback): void; + /** + * Deregister the observe of the screen reader enable state changed. + * @since 9 + * @param type state event type + * @param callback Asynchronous callback interface. + * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. + */ + function off(type: 'screenReaderEnableStateChange', callback?: Callback): void; + /** * Get the captions manager. * @syscap SystemCapability.BarrierFree.Accessibility.Hearing @@ -213,20 +305,55 @@ declare namespace accessibility { /** * Register the observe of the enable state. + * @deprecated since 9 */ on(type: 'enableChange', callback: Callback): void; + + /** + * Register the observe of the enable state. + * @since 9 + * @throws { BusinessError } 401 - Input parameter error. + */ + on(type: 'enableStateChange', callback: Callback): void; + /** * Register the observer of the style. + * @deprecated since 9 */ on(type: 'styleChange', callback: Callback): void; + + /** + * Register the observer of the style. + * @since 9 + * @throws { BusinessError } 401 - Input parameter error. + */ + on(type: 'captionsStyleChange', callback: Callback): void; + /** * Deregister the observe of the enable state. + * @deprecated since 9 */ off(type: 'enableChange', callback?: Callback): void; + + /** + * Deregister the observe of the enable state. + * @since 9 + * @throws { BusinessError } 401 - Input parameter error. + */ + off(type: 'enableStateChange', callback?: Callback): void; + /** * Deregister the observer of the style. + * @deprecated since 9 */ off(type: 'styleChange', callback?: Callback): void; + + /** + * Deregister the observer of the style. + * @since 9 + * @throws { BusinessError } 401 - Input parameter error. + */ + off(type: 'captionsStyleChange', callback?: Callback): void; } /** diff --git a/api/application/AccessibilityExtensionContext.d.ts b/api/application/AccessibilityExtensionContext.d.ts index 76ee1b0e0b..f6b195863a 100644 --- a/api/application/AccessibilityExtensionContext.d.ts +++ b/api/application/AccessibilityExtensionContext.d.ts @@ -28,6 +28,7 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Set the name of the bundle name that is interested in sending the event. * @param targetNames + * @throws { BusinessError } 401 - Input parameter error. */ setTargetBundleName(targetNames: Array): Promise; setTargetBundleName(targetNames: Array, callback: AsyncCallback): void; @@ -35,6 +36,8 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get focus element. * @param isAccessibilityFocus Indicates whether the acquired element has an accessibility focus. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getFocusElement(isAccessibilityFocus?: boolean): Promise; getFocusElement(callback: AsyncCallback): void; @@ -43,6 +46,8 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get window root element. * @param windowId Indicates the window ID. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getWindowRootElement(windowId?: number): Promise; getWindowRootElement(callback: AsyncCallback): void; @@ -51,6 +56,8 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get window list. * @param displayId Indicates the display ID. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getWindows(displayId?: number): Promise>; getWindows(callback: AsyncCallback>): void; @@ -59,6 +66,8 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Inject gesture path events. * @param gesturePath Indicates the gesture path. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ injectGesture(gesturePath: GesturePath): Promise; injectGesture(gesturePath: GesturePath, callback: AsyncCallback): void; @@ -74,6 +83,7 @@ export default class AccessibilityExtensionContext extends ExtensionContext { declare interface AccessibilityElement { /** * Get a list of attribute names. + * @throws { BusinessError } 401 - Input parameter error. */ attributeNames(): Promise>; attributeNames(callback: AsyncCallback>): void; @@ -81,6 +91,8 @@ declare interface AccessibilityElement { /** * Get the value of an attribute. * @param attributeName Indicates the attribute name. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300004 - This property does not exist. */ attributeValue(attributeName: T): Promise; attributeValue(attributeName: T, @@ -88,6 +100,7 @@ declare interface AccessibilityElement { /** * Get a list of supported actions. + * @throws { BusinessError } 401 - Input parameter error. */ actionNames(): Promise>; actionNames(callback: AsyncCallback>): void; @@ -96,15 +109,18 @@ declare interface AccessibilityElement { * Perform the specified action. * @param actionName Indicates the action name. * @param parameters Indicates the parameters needed to execute the action. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300005 - This action is not supported. */ - performAction(actionName: string, parameters?: object): Promise; - performAction(actionName: string, callback: AsyncCallback): void; - performAction(actionName: string, parameters: object, callback: AsyncCallback): void; + performAction(actionName: string, parameters?: object): Promise; + performAction(actionName: string, callback: AsyncCallback): void; + performAction(actionName: string, parameters: object, callback: AsyncCallback): void; /** * Find elements that match the condition. * @param type The type of query condition is content. * @param condition Indicates the specific content to be queried. + * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'content', condition: string): Promise>; findElement(type: 'content', condition: string, callback: AsyncCallback>): void @@ -113,6 +129,7 @@ declare interface AccessibilityElement { * Find elements that match the condition. * @param type The type of query condition is focus type. * @param condition Indicates the type of focus to query. + * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'focusType', condition: FocusType): Promise; findElement(type: 'focusType', condition: FocusType, callback: AsyncCallback): void @@ -121,6 +138,7 @@ declare interface AccessibilityElement { * Find elements that match the condition. * @param type The type of query condition is focus direction. * @param condition Indicates the direction of search focus to query. + * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'focusDirection', condition: FocusDirection): Promise; findElement(type: 'focusDirection', condition: FocusDirection, callback: AsyncCallback): void -- Gitee From d9ac110b82957ce521467bc9551ea200b69a2877 Mon Sep 17 00:00:00 2001 From: laiguizhong Date: Mon, 10 Oct 2022 20:18:12 +0800 Subject: [PATCH 2/2] Remove content that does not need to be changed Signed-off-by: laiguizhong Change-Id: Ib519c9e80d80350576c51fbd916691a9406ffe7a --- api/@ohos.accessibility.config.d.ts | 6 +- api/@ohos.accessibility.d.ts | 112 ++---------------- .../AccessibilityExtensionContext.d.ts | 2 - 3 files changed, 10 insertions(+), 110 deletions(-) diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts index 4d20da8a42..ef7836ae17 100644 --- a/api/@ohos.accessibility.config.d.ts +++ b/api/@ohos.accessibility.config.d.ts @@ -97,7 +97,7 @@ declare namespace config { /** * Register the listener that watches for changes in the enabled status of accessibility extensions. - * @param type Indicates the enableAbilityListsStateChanged type. + * @param type Indicates the type of event. * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. */ @@ -105,7 +105,7 @@ declare namespace config { /** * Deregister listener that watches for changes in the enabled status of accessibility extensions. - * @param type Indicates the enableAbilityListsStateChanged type. + * @param type Indicates the type of event. * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. */ @@ -127,7 +127,6 @@ declare namespace config { /** * Getting configuration value. * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - Input parameter error. */ get(): Promise; get(callback: AsyncCallback): void; @@ -143,7 +142,6 @@ declare namespace config { /** * Deregister the listener to listen for configuration changes. * @param callback Indicates the listener. - * @throws { BusinessError } 401 - Input parameter error. */ off(callback?: Callback): void; } diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index 0333942128..b30723953d 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -101,7 +101,6 @@ declare namespace accessibility { /** * Checks whether accessibility ability is enabled. * @since 7 - * @deprecated since 9 * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. @@ -109,21 +108,9 @@ declare namespace accessibility { function isOpenAccessibility(callback: AsyncCallback): void; function isOpenAccessibility(): Promise; - /** - * Checks whether accessibility ability is enabled. - * @since 9 - * @param callback Asynchronous callback interface. - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. - * @throws { BusinessError } 401 - Input parameter error. - */ - function isAccessibilityExtensionEnabled(callback: AsyncCallback): void; - function isAccessibilityExtensionEnabled(): Promise; - /** * Checks touch browser ability (which is used by talkback) is enabled. * @since 7 - * @deprecated since 9 * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. @@ -131,17 +118,6 @@ declare namespace accessibility { function isOpenTouchGuide(callback: AsyncCallback): void; function isOpenTouchGuide(): Promise; - /** - * Checks touch browser ability is enabled. - * @since 9 - * @param callback Asynchronous callback interface. - * @syscap SystemCapability.BarrierFree.Accessibility.Vision - * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. - * @throws { BusinessError } 401 - Input parameter error. - */ - function isScreenReaderEnabled(callback: AsyncCallback): void; - function isScreenReaderEnabled(): Promise; - /** * Queries the list of accessibility abilities. * @since 7 @@ -196,89 +172,45 @@ declare namespace accessibility { /** * Register the observe of the accessibility state changed. * @since 7 - * @deprecated since 9 - * @param type state event type. - * @param callback Asynchronous callback interface. - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. - */ - function on(type: 'accessibilityStateChange', callback: Callback): void; - - /** - * Register the observe of the accessibility extension enable state changed. - * @since 9 * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. * @throws { BusinessError } 401 - Input parameter error. */ - function on(type: 'accessibilityExtensionEnableStateChange', callback: Callback): void; + function on(type: 'accessibilityStateChange', callback: Callback): void; /** * Register the observe of the touchGuide state changed. * @since 7 - * @deprecated since 9 - * @param type state event type. - * @param callback Asynchronous callback interface. - * @syscap SystemCapability.BarrierFree.Accessibility.Vision - * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. - */ - function on(type: 'touchGuideStateChange', callback: Callback): void; - - /** - * Register the observe of the screen reader enable state changed. - * @since 9 * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. * @throws { BusinessError } 401 - Input parameter error. */ - function on(type: 'screenReaderEnableStateChange', callback: Callback): void; + function on(type: 'touchGuideStateChange', callback: Callback): void; /** * Deregister the observe of the accessibility state changed. * @since 7 - * @deprecated since 9 - * @param type state event type - * @param callback Asynchronous callback interface. - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. - */ - function off(type: 'accessibilityStateChange', callback?: Callback): void; - - - /** - * Deregister the observe of the accessibility extension enable state changed. - * @since 9 * @param type state event type * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. * @throws { BusinessError } 401 - Input parameter error. */ - function off(type: 'accessibilityExtensionEnableStateChange', callback?: Callback): void; + function off(type: 'accessibilityStateChange', callback?: Callback): void; /** * Deregister the observe of the touchGuide state changed. * @since 7 - * @deprecated since 9 - * @param type state event type - * @param callback Asynchronous callback interface. - * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. - */ - function off(type: 'touchGuideStateChange', callback?: Callback): void; - - /** - * Deregister the observe of the screen reader enable state changed. - * @since 9 * @param type state event type * @param callback Asynchronous callback interface. * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. * @throws { BusinessError } 401 - Input parameter error. */ - function off(type: 'screenReaderEnableStateChange', callback?: Callback): void; + function off(type: 'touchGuideStateChange', callback?: Callback): void; /** * Get the captions manager. @@ -305,55 +237,27 @@ declare namespace accessibility { /** * Register the observe of the enable state. - * @deprecated since 9 - */ - on(type: 'enableChange', callback: Callback): void; - - /** - * Register the observe of the enable state. - * @since 9 * @throws { BusinessError } 401 - Input parameter error. */ - on(type: 'enableStateChange', callback: Callback): void; - - /** - * Register the observer of the style. - * @deprecated since 9 - */ - on(type: 'styleChange', callback: Callback): void; + on(type: 'enableChange', callback: Callback): void; /** * Register the observer of the style. - * @since 9 * @throws { BusinessError } 401 - Input parameter error. */ - on(type: 'captionsStyleChange', callback: Callback): void; - - /** - * Deregister the observe of the enable state. - * @deprecated since 9 - */ - off(type: 'enableChange', callback?: Callback): void; + on(type: 'styleChange', callback: Callback): void; /** * Deregister the observe of the enable state. - * @since 9 * @throws { BusinessError } 401 - Input parameter error. */ - off(type: 'enableStateChange', callback?: Callback): void; - - /** - * Deregister the observer of the style. - * @deprecated since 9 - */ - off(type: 'styleChange', callback?: Callback): void; + off(type: 'enableChange', callback?: Callback): void; /** * Deregister the observer of the style. - * @since 9 * @throws { BusinessError } 401 - Input parameter error. */ - off(type: 'captionsStyleChange', callback?: Callback): void; + off(type: 'styleChange', callback?: Callback): void; } /** diff --git a/api/application/AccessibilityExtensionContext.d.ts b/api/application/AccessibilityExtensionContext.d.ts index f6b195863a..b550948577 100644 --- a/api/application/AccessibilityExtensionContext.d.ts +++ b/api/application/AccessibilityExtensionContext.d.ts @@ -83,7 +83,6 @@ export default class AccessibilityExtensionContext extends ExtensionContext { declare interface AccessibilityElement { /** * Get a list of attribute names. - * @throws { BusinessError } 401 - Input parameter error. */ attributeNames(): Promise>; attributeNames(callback: AsyncCallback>): void; @@ -100,7 +99,6 @@ declare interface AccessibilityElement { /** * Get a list of supported actions. - * @throws { BusinessError } 401 - Input parameter error. */ actionNames(): Promise>; actionNames(callback: AsyncCallback>): void; -- Gitee