From 136854ffd2b0a34b2fc8bfd7419dcd861f158f74 Mon Sep 17 00:00:00 2001 From: laiguizhong Date: Sat, 30 Jul 2022 11:56:11 +0800 Subject: [PATCH] add ax config api Signed-off-by: laiguizhong Change-Id: I295d299f559951a2e989c23b2e6302973806ed57 --- api/@ohos.accessibility.config.d.ts | 104 +++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 3 deletions(-) diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts index d7d3632e72..2dfac6d56a 100644 --- a/api/@ohos.accessibility.config.d.ts +++ b/api/@ohos.accessibility.config.d.ts @@ -14,7 +14,7 @@ */ import accessibility from './@ohos.accessibility'; -import { AsyncCallback } from './basic'; +import { AsyncCallback, Callback } from './basic'; /** * Configuration of the accessibility. @@ -25,7 +25,56 @@ import { AsyncCallback } from './basic'; */ declare namespace config { /** - * Enable the acceessibility extension ability. + * Indicates the configuration of high-contrast text. + */ + var highContrastText: Config; + /** + * Indicates the configuration of invert color. + */ + var invertColor: Config; + /** + * Indicates the configuration of daltonization color filter. + */ + var daltonizationColorFilter: Config; + /** + * Indicates the configuration of content timeout. + */ + var contentTimeout: Config; + /** + * Indicates the configuration of animation state. + */ + var animationOff: Config; + /** + * Indicates the configuration of brightness discount. + */ + var brightnessDiscount: Config; + /** + * Indicates the configuration of mouse key state. + */ + var mouseKey: Config; + /** + * Indicates the configuration of mouse auto click. + */ + var mouseAutoClick: Config; + /** + * Indicates the configuration of short key state. + */ + var shortkey: Config; + /** + * Indicates the configuration of short key target. + */ + var shortkeyTarget: Config; + /** + * Indicates the configuration of captions state. + */ + var captions: Config; + /** + * Indicates the configuration of captions style. + */ + var captionsStyle: Config; + + /** + * Enable the accessibility extension ability. * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. * @param capability Indicates the ability. */ @@ -33,10 +82,59 @@ declare namespace config { function enableAbility(name: string, capability: Array, callback: AsyncCallback): void; /** - * Disable the acceessibility extension ability. + * Disable the accessibility extension ability. * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. */ function disableAbility(name: string): Promise; function disableAbility(name: string, callback: AsyncCallback): void; + + /** + * 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. + */ + function on(type: 'enableAbilityListsStateChanged', 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. + */ + function off(type: 'enableAbilityListsStateChanged', callback?: Callback): void; + + /** + * Indicates setting, getting, and listening to changes in configuration. + */ + interface Config { + /** + * Setting configuration value. + * @param value Indicates the value. + */ + set(value: T): Promise; + set(value: T, callback: AsyncCallback): void; + + /** + * Getting configuration value. + */ + get(): Promise; + get(callback: AsyncCallback): void; + + /** + * Register the listener to listen for configuration changes. + * @param callback Indicates the listener. + */ + on(callback: Callback): void; + + /** + * Deregister the listener to listen for configuration changes. + * @param callback Indicates the listener. + */ + off(callback?: Callback): void; + } + + /** + * Indicates the type of daltonization color filter. + */ + type DaltonizationColorFilter = 'Normal' | 'Protanomaly' | 'Deuteranomaly' | 'Tritanomaly'; } export default config; \ No newline at end of file -- Gitee