diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts index 45a5ff46c8b557a681328a61e60985ee8ad9ee31..09fea52272c8fda2ba773a0c2301a25d3ea0f5b4 100644 --- a/api/@ohos.accessibility.config.d.ts +++ b/api/@ohos.accessibility.config.d.ts @@ -397,11 +397,26 @@ declare namespace config { * 3. Parameter verification failed. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ set(value: T): Promise; + /** + * Setting configuration value. + * + * @permission ohos.permission.WRITE_ACCESSIBILITY_CONFIG + * @param { T } value Indicates the value. + * @returns { Promise } + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + setReturnsPromise(value: T): Promise; + /** * Setting configuration value. * @@ -417,11 +432,31 @@ declare namespace config { * 3. Parameter verification failed. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ set(value: T, callback: AsyncCallback): void; + /** + * Setting configuration value. + * + * @permission ohos.permission.WRITE_ACCESSIBILITY_CONFIG + * @param { T } value Indicates the value. + * @param { AsyncCallback } callback + * @throws { BusinessError } 201 - Permission verification failed. + * The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + setWithCallback(value: T, callback: AsyncCallback): void; + + /** + * @arkts 1.2 + */ + overload set { setReturnsPromise, setWithCallback }; + /** * Getting configuration value. * @@ -431,11 +466,22 @@ declare namespace config { * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ get(): Promise; + /** + * Getting configuration value. + * + * @returns { Promise } + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + getReturnsPromise(): Promise; + /** * Getting configuration value. * @@ -443,11 +489,27 @@ declare namespace config { * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ get(callback: AsyncCallback): void; + /** + * Getting configuration value. + * + * @param { AsyncCallback } callback + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + getWithCallback(callback: AsyncCallback): void; + + /** + * @arkts 1.2 + */ + overload get { getReturnsPromise, getWithCallback }; + /** * Register the listener to listen for configuration changes. * diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index d85f0d6573772c9b63754f9e64162b1377c0d47f..0f04d961ab1d4bb58decd1c3194d1e161dc7be29 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -1235,11 +1235,21 @@ declare namespace accessibility { * 2. Incorrect parameter types; * 3. Parameter verification failed. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function sendAccessibilityEvent(event: EventInfo, callback: AsyncCallback): void; + /** + * Send accessibility event. + * + * @param { EventInfo } event The object of the accessibility {@code EventInfo} . + * @param { AsyncCallback } callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 20 + * @arkts 1.2 + */ + function sendAccessibilityEventWithCallback(event: EventInfo, callback: AsyncCallback): void; + /** * Send accessibility event. * @@ -1250,11 +1260,26 @@ declare namespace accessibility { * 2. Incorrect parameter types; * 3. Parameter verification failed. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function sendAccessibilityEvent(event: EventInfo): Promise; + /** + * Send accessibility event. + * + * @param { EventInfo } event The object of the accessibility {@code EventInfo} . + * @returns { Promise } Returns {@code true} if success ; returns {@code false} otherwise. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 20 + * @arkts 1.2 + */ + function sendAccessibilityEventReturnsPromise(event: EventInfo): Promise; + + /** + * @arkts 1.2 + */ + overload sendAccessibilityEvent { sendAccessibilityEventWithCallback, sendAccessibilityEventReturnsPromise }; + /** * Gets touch mode type. * @returns { string } Returns touch mode type, include 'singleTouchMode', 'doubleTouchMode', and 'none'. @@ -1287,10 +1312,21 @@ declare namespace accessibility { * @syscap SystemCapability.BarrierFree.Accessibility.Core * @crossplatform * @since 20 - * @arkts 1.1&1.2 */ function on(type: 'accessibilityStateChange', callback: Callback): void; + /** + * Register the observe of the accessibility state changed. + * + * @param { 'accessibilityStateChange' } type state event type. + * @param { Callback } callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function onAccessibilityStateChange(type: 'accessibilityStateChange', callback: Callback): void; + /** * Register the observe of the touchGuide state changed. * @@ -1301,11 +1337,21 @@ declare namespace accessibility { * 2. Incorrect parameter types; * 3. Parameter verification failed. * @syscap SystemCapability.BarrierFree.Accessibility.Vision - * @since arkts {'1.1':'7', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 7 */ function on(type: 'touchGuideStateChange', callback: Callback): void; + /** + * Register the observe of the touchGuide state changed. + * + * @param { 'touchGuideStateChange' } type state event type. + * @param { Callback } callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Vision + * @since 20 + * @arkts 1.2 + */ + function onTouchGuideStateChange(type: 'touchGuideStateChange', callback: Callback): void; + /** * Register the observe of the screen reader state changed. * @param { 'screenReaderStateChange' } type state event type. @@ -1315,11 +1361,25 @@ declare namespace accessibility { * 2. Incorrect parameter types; * 3. Parameter verification failed. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @since arkts {'1.1':'18', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ function on(type: 'screenReaderStateChange', callback: Callback): void; + /** + * Register the observe of the screen reader state changed. + * @param { 'screenReaderStateChange' } type state event type. + * @param { Callback } callback callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 20 + * @arkts 1.2 + */ + function onScreenReaderStateChange(type: 'screenReaderStateChange', callback: Callback): void; + + /** + * @arkts 1.2 + */ + overload on { onAccessibilityStateChange, onTouchGuideStateChange, onScreenReaderStateChange }; + /** * Register the observe of the touch mode changed. * @param { 'touchModeChange' } type touch mode change. @@ -1357,10 +1417,21 @@ declare namespace accessibility { * @syscap SystemCapability.BarrierFree.Accessibility.Core * @crossplatform * @since 20 - * @arkts 1.1&1.2 */ function off(type: 'accessibilityStateChange', callback?: Callback): void; + /** + * Unregister the observe of the accessibility state changed. + * + * @param { 'accessibilityStateChange' } type state event type + * @param { Callback } [callback] Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function offAccessibilityStateChange(type: 'accessibilityStateChange', callback?: Callback): void; + /** * Unregister the observe of the touchGuide state changed. * @@ -1371,11 +1442,21 @@ declare namespace accessibility { * 2. Incorrect parameter types; * 3. Parameter verification failed. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @since arkts {'1.1':'7', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 7 */ function off(type: 'touchGuideStateChange', callback?: Callback): void; + /** + * Unregister the observe of the touchGuide state changed. + * + * @param { 'touchGuideStateChange' } type state event type + * @param { Callback } [callback] Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 20 + * @arkts 1.2 + */ + function offTouchGuideStateChange(type: 'touchGuideStateChange', callback?: Callback): void; + /** * Unregister the observe of the screen reader state changed. * @param { 'screenReaderStateChange' } type state event type @@ -1385,11 +1466,25 @@ declare namespace accessibility { * 2. Incorrect parameter types; * 3. Parameter verification failed. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @since arkts {'1.1':'18', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ function off(type: 'screenReaderStateChange', callback?: Callback): void; + /** + * Unregister the observe of the screen reader state changed. + * @param { 'screenReaderStateChange' } type state event type + * @param { Callback } [callback] callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 20 + * @arkts 1.2 + */ + function offScreenReaderStateChange(type: 'screenReaderStateChange', callback?: Callback): void; + + /** + * @arkts 1.2 + */ + overload off { offAccessibilityStateChange, offTouchGuideStateChange, offScreenReaderStateChange }; + /** * Unregister the observe of the touch mode changed. * @param { 'touchModeChange' } type touch mode change.