1/* 2 * Copyright (C) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit AccessibilityKit 19 */ 20 21import type { AsyncCallback } from './@ohos.base'; 22import type { Callback } from './@ohos.base'; 23 24/** 25 * Accessibility 26 * 27 * @namespace accessibility 28 * @syscap SystemCapability.BarrierFree.Accessibility.Core 29 * @since 7 30 */ 31/** 32 * Accessibility 33 * 34 * @namespace accessibility 35 * @syscap SystemCapability.BarrierFree.Accessibility.Core 36 * @atomicservice 37 * @since 11 38 */ 39declare namespace accessibility { 40 /** 41 * The type of the Ability app. 42 * 43 *{ 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' } 44 * @syscap SystemCapability.BarrierFree.Accessibility.Core 45 * @since 7 46 */ 47 /** 48 * The type of the Ability app. 49 * 50 * { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all' } 51 * @syscap SystemCapability.BarrierFree.Accessibility.Core 52 * @since 9 53 */ 54 type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all'; 55 56 /** 57 * The action that the ability can execute. 58 * value range: { 'accessibilityFocus' | 'clearAccessibilityFocus' | 'focus' | 'clearFocus' | 'clearSelection' | 59 * 'click' | 'longClick' | 'cut' | 'copy' | 'paste' | 'select' | 'setText' | 'delete' | 60 * 'scrollForward' | 'scrollBackward' | 'setSelection' } 61 * 62 * @syscap SystemCapability.BarrierFree.Accessibility.Core 63 * @since 7 64 */ 65 /** 66 * The action that the ability can execute. 67 * value range: { 'accessibilityFocus' | 'clearAccessibilityFocus' | 'focus' | 'clearFocus' | 'clearSelection' | 68 * 'click' | 'longClick' | 'cut' | 'copy' | 'paste' | 'select' | 'setText' | 'delete' | 69 * 'scrollForward' | 'scrollBackward' | 'setSelection' | 'setCursorPosition' | 'home' | 70 * 'back' | 'recentTask' | 'notificationCenter' | 'controlCenter' | 'common' } 71 * 72 * @syscap SystemCapability.BarrierFree.Accessibility.Core 73 * @since 12 74 */ 75 type Action = 'accessibilityFocus' | 'clearAccessibilityFocus' | 'focus' | 'clearFocus' | 'clearSelection' | 76 'click' | 'longClick' | 'cut' | 'copy' | 'paste' | 'select' | 'setText' | 'delete' | 77 'scrollForward' | 'scrollBackward' | 'setSelection' | 'setCursorPosition' | 'home' | 78 'back' | 'recentTask' | 'notificationCenter' | 'controlCenter' | 'common'; 79 80 /** 81 * The type of the accessibility event. 82 * windowsChange/windowContentChange/windowStateChange/announcement/notificationChange/textTraversedAtMove 83 * value range: { 'accessibilityFocus' | 'accessibilityFocusClear' | 84 * 'click' | 'longClick' | 'focus' | 'select' | 'hoverEnter' | 'hoverExit' | 85 * 'textUpdate' | 'textSelectionUpdate' | 'scroll' } 86 * 87 * @syscap SystemCapability.BarrierFree.Accessibility.Core 88 * @since 7 89 */ 90 /** 91 * The type of the accessibility event. 92 * windowsChange/windowContentChange/windowStateChange/announcement/notificationChange/textTraversedAtMove 93 * value range: { 'accessibilityFocus' | 'accessibilityFocusClear' | 94 * 'click' | 'longClick' | 'focus' | 'select' | 'hoverEnter' | 'hoverExit' | 95 * 'textUpdate' | 'textSelectionUpdate' | 'scroll' | 'requestFocusForAccessibility'| 96 * 'announceForAccessibility' } 97 * 98 * @syscap SystemCapability.BarrierFree.Accessibility.Core 99 * @since 12 100 */ 101 type EventType = 'accessibilityFocus' | 'accessibilityFocusClear' | 102 'click' | 'longClick' | 'focus' | 'select' | 'hoverEnter' | 'hoverExit' | 103 'textUpdate' | 'textSelectionUpdate' | 'scroll' | 'requestFocusForAccessibility'| 104 'announceForAccessibility'; 105 106 /** 107 * The change type of the windowsChange event. 108 * It's used when received the {@code windowsChange} event. 109 * 110 * @syscap SystemCapability.BarrierFree.Accessibility.Core 111 * @since 7 112 */ 113 type WindowUpdateType = 'add' | 'remove' | 'bounds' | 'active' | 'focus'; 114 115 /** 116 * The type of the ability state. 117 * 118 * @syscap SystemCapability.BarrierFree.Accessibility.Core 119 * @since 7 120 */ 121 type AbilityState = 'enable' | 'disable' | 'install'; 122 123 /** 124 * The ability that accessibility subsystem support. 125 * touchExplorer: Describes the capability to talkback. 126 * magnification: Describes the capability to request to control the display magnification. 127 * gesturesSimulation: Describes the capability to request to simulate the gesture. 128 * windowContent: Describes the capability to search for the content of the active window. 129 * filterKeyEvents: Describes the capability to request to filter key events. 130 * fingerprintGesture: Describes the capability to request to fingerprint gesture. 131 * 132 * @syscap SystemCapability.BarrierFree.Accessibility.Core 133 * @since 7 134 */ 135 type Capability = 'retrieve' | 'touchGuide' | 'keyEventObserver' | 'zoom' | 'gesture'; 136 137 /** 138 * The granularity of text move. 139 * 140 * @syscap SystemCapability.BarrierFree.Accessibility.Core 141 * @since 7 142 */ 143 type TextMoveUnit = 'char' | 'word' | 'line' | 'page' | 'paragraph'; 144 145 /** 146 * Checks whether accessibility ability is enabled. 147 * 148 * @param { AsyncCallback<boolean> } callback Asynchronous callback interface. 149 * @syscap SystemCapability.BarrierFree.Accessibility.Core 150 * @since 7 151 * @deprecated since 10 152 * @useinstead ohos.accessibility#isOpenAccessibilitySync 153 */ 154 function isOpenAccessibility(callback: AsyncCallback<boolean>): void; 155 156 /** 157 * Checks whether accessibility ability is enabled. 158 * 159 * @returns { Promise<boolean> } Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. 160 * @syscap SystemCapability.BarrierFree.Accessibility.Core 161 * @since 7 162 * @deprecated since 10 163 * @useinstead ohos.accessibility#isOpenAccessibilitySync 164 */ 165 function isOpenAccessibility(): Promise<boolean>; 166 167 /** 168 * Checks whether accessibility ability is enabled. 169 * 170 * @returns { boolean } Returns true if the accessibility is enabled; returns false otherwise. 171 * @syscap SystemCapability.BarrierFree.Accessibility.Core 172 * @since 10 173 */ 174 /** 175 * Checks whether accessibility ability is enabled. 176 * 177 * @returns { boolean } Returns true if the accessibility is enabled; returns false otherwise. 178 * @syscap SystemCapability.BarrierFree.Accessibility.Core 179 * @atomicservice 180 * @since 11 181 */ 182 function isOpenAccessibilitySync(): boolean; 183 184 /** 185 * Checks touch browser ability (which is used by talkback) is enabled. 186 * 187 * @param { AsyncCallback<boolean> } callback Asynchronous callback interface. 188 * @syscap SystemCapability.BarrierFree.Accessibility.Vision 189 * @since 7 190 * @deprecated since 10 191 * @useinstead ohos.accessibility#isOpenTouchGuideSync 192 */ 193 function isOpenTouchGuide(callback: AsyncCallback<boolean>): void; 194 195 /** 196 * Checks touch browser ability (which is used by talkback) is enabled. 197 * 198 * @returns { Promise<boolean> } Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. 199 * @syscap SystemCapability.BarrierFree.Accessibility.Vision 200 * @since 7 201 * @deprecated since 10 202 * @useinstead ohos.accessibility#isOpenTouchGuideSync 203 */ 204 function isOpenTouchGuide(): Promise<boolean>; 205 206 /** 207 * Checks touch browser ability (which is used by talkback) is enabled. 208 * 209 * @returns { boolean } Returns true if the touch browser is enabled; returns false otherwise. 210 * @syscap SystemCapability.BarrierFree.Accessibility.Vision 211 * @since 10 212 */ 213 /** 214 * Checks touch browser ability (which is used by talkback) is enabled. 215 * 216 * @returns { boolean } Returns true if the touch browser is enabled; returns false otherwise. 217 * @syscap SystemCapability.BarrierFree.Accessibility.Vision 218 * @atomicservice 219 * @since 11 220 */ 221 function isOpenTouchGuideSync(): boolean; 222 223 /** 224 * Queries the list of accessibility abilities. 225 * 226 * @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken 227 * @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed 228 * @param { AsyncCallback<Array<AccessibilityAbilityInfo>> } callback 229 * @syscap SystemCapability.BarrierFree.Accessibility.Core 230 * @since 7 231 * @deprecated since 9 232 * @useinstead ohos.accessibility#getAccessibilityExtensionList 233 */ 234 function getAbilityLists( 235 abilityType: AbilityType, 236 stateType: AbilityState, 237 callback: AsyncCallback<Array<AccessibilityAbilityInfo>> 238 ): void; 239 240 /** 241 * Queries the list of accessibility abilities. 242 * 243 * @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken 244 * @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed 245 * @returns { Promise<Array<AccessibilityAbilityInfo>> } Returns the list of abilityInfos. 246 * @syscap SystemCapability.BarrierFree.Accessibility.Core 247 * @since 7 248 * @deprecated since 9 249 * @useinstead ohos.accessibility#getAccessibilityExtensionList 250 */ 251 function getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise<Array<AccessibilityAbilityInfo>>; 252 253 /** 254 * Queries the list of accessibility abilities. 255 * 256 * @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken 257 * @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed 258 * @returns { Promise<Array<AccessibilityAbilityInfo>> } Returns the list of abilityInfos. 259 * @throws { BusinessError } 401 - Input parameter error. 260 * @syscap SystemCapability.BarrierFree.Accessibility.Core 261 * @since 9 262 */ 263 function getAccessibilityExtensionList( 264 abilityType: AbilityType, 265 stateType: AbilityState 266 ): Promise<Array<AccessibilityAbilityInfo>>; 267 268 /** 269 * Queries the list of accessibility abilities. 270 * 271 * @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken 272 * @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed 273 * @param { AsyncCallback<Array<AccessibilityAbilityInfo>> } callback 274 * @throws { BusinessError } 401 - Input parameter error. 275 * @syscap SystemCapability.BarrierFree.Accessibility.Core 276 * @since 9 277 */ 278 function getAccessibilityExtensionList( 279 abilityType: AbilityType, 280 stateType: AbilityState, 281 callback: AsyncCallback<Array<AccessibilityAbilityInfo>> 282 ): void; 283 284 /** 285 * Queries the list of accessibility abilities. 286 * 287 * @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken 288 * @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed 289 * @returns { Array<AccessibilityAbilityInfo> } Returns the list of abilityInfos. 290 * @syscap SystemCapability.BarrierFree.Accessibility.Core 291 * @since 12 292 */ 293 function getAccessibilityExtensionListSync( 294 abilityType: AbilityType, 295 stateType: AbilityState 296 ): Array<AccessibilityAbilityInfo>; 297 298 /** 299 * Send accessibility Event. 300 * 301 * @param { EventInfo } event The object of the accessibility {@code EventInfo} . 302 * @param { AsyncCallback<void> } callback Asynchronous callback interface. 303 * @syscap SystemCapability.BarrierFree.Accessibility.Core 304 * @since 7 305 * @deprecated since 9 306 * @useinstead ohos.accessibility#sendAccessibilityEvent 307 */ 308 function sendEvent(event: EventInfo, callback: AsyncCallback<void>): void; 309 310 /** 311 * Send accessibility Event. 312 * 313 * @param { EventInfo } event The object of the accessibility {@code EventInfo} . 314 * @returns { Promise<void> } Returns {@code true} if success ; returns {@code false} otherwise. 315 * @syscap SystemCapability.BarrierFree.Accessibility.Core 316 * @since 7 317 * @deprecated since 9 318 * @useinstead ohos.accessibility#sendAccessibilityEvent 319 */ 320 function sendEvent(event: EventInfo): Promise<void>; 321 322 /** 323 * Send accessibility event. 324 * 325 * @param { EventInfo } event The object of the accessibility {@code EventInfo} . 326 * @param { AsyncCallback<void> } callback Asynchronous callback interface. 327 * @throws { BusinessError } 401 - Input parameter error. 328 * @syscap SystemCapability.BarrierFree.Accessibility.Core 329 * @since 9 330 */ 331 function sendAccessibilityEvent(event: EventInfo, callback: AsyncCallback<void>): void; 332 333 /** 334 * Send accessibility event. 335 * 336 * @param { EventInfo } event The object of the accessibility {@code EventInfo} . 337 * @returns { Promise<void> } Returns {@code true} if success ; returns {@code false} otherwise. 338 * @throws { BusinessError } 401 - Input parameter error. 339 * @syscap SystemCapability.BarrierFree.Accessibility.Core 340 * @since 9 341 */ 342 function sendAccessibilityEvent(event: EventInfo): Promise<void>; 343 344 /** 345 * Register the observe of the accessibility state changed. 346 * 347 * @param { 'accessibilityStateChange' } type state event type. 348 * @param { Callback<boolean> } callback Asynchronous callback interface. 349 * @throws { BusinessError } 401 - Input parameter error. 350 * @syscap SystemCapability.BarrierFree.Accessibility.Core 351 * @since 7 352 */ 353 function on(type: 'accessibilityStateChange', callback: Callback<boolean>): void; 354 355 /** 356 * Register the observe of the touchGuide state changed. 357 * 358 * @param { 'touchGuideStateChange' } type state event type. 359 * @param { Callback<boolean> } callback Asynchronous callback interface. 360 * @throws { BusinessError } 401 - Input parameter error. 361 * @syscap SystemCapability.BarrierFree.Accessibility.Vision 362 * @since 7 363 */ 364 function on(type: 'touchGuideStateChange', callback: Callback<boolean>): void; 365 366 /** 367 * Unregister the observe of the accessibility state changed. 368 * 369 * @param { 'accessibilityStateChange' } type state event type 370 * @param { Callback<boolean> } callback Asynchronous callback interface. 371 * @throws { BusinessError } 401 - Input parameter error. 372 * @syscap SystemCapability.BarrierFree.Accessibility.Core 373 * @since 7 374 */ 375 function off(type: 'accessibilityStateChange', callback?: Callback<boolean>): void; 376 377 /** 378 * Unregister the observe of the touchGuide state changed. 379 * 380 * @param { 'touchGuideStateChange' } type state event type 381 * @param { Callback<boolean> } callback Asynchronous callback interface. 382 * @throws { BusinessError } 401 - Input parameter error. 383 * @syscap SystemCapability.BarrierFree.Accessibility.Core 384 * @since 7 385 */ 386 function off(type: 'touchGuideStateChange', callback?: Callback<boolean>): void; 387 388 /** 389 * Get the captions manager. 390 * 391 * @returns { CaptionsManager } Returns the captions manager. 392 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 393 * @since 8 394 */ 395 function getCaptionsManager(): CaptionsManager; 396 397 /** 398 * Indicates the captions manager. 399 * 400 * @typedef CaptionsManager 401 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 402 * @since 8 403 */ 404 interface CaptionsManager { 405 /** 406 * Indicates whether captions are enabled. 407 * 408 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 409 * @since 8 410 */ 411 enabled: boolean; 412 /** 413 * Indicates the style of captions. 414 * 415 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 416 * @since 8 417 */ 418 style: CaptionsStyle; 419 420 /** 421 * Register the observe of the enable state. 422 * 423 * @param { 'enableChange' } type 424 * @param { Callback<boolean> } callback 425 * @throws { BusinessError } 401 - Input parameter error. 426 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 427 * @since 8 428 */ 429 on(type: 'enableChange', callback: Callback<boolean>): void; 430 431 /** 432 * Register the observer of the style. 433 * 434 * @param { 'styleChange' } type 435 * @param { Callback<CaptionsStyle> } callback 436 * @throws { BusinessError } 401 - Input parameter error. 437 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 438 * @since 8 439 */ 440 on(type: 'styleChange', callback: Callback<CaptionsStyle>): void; 441 442 /** 443 * Unregister the observe of the enable state. 444 * 445 * @param { 'enableChange' } type 446 * @param { Callback<boolean> } callback 447 * @throws { BusinessError } 401 - Input parameter error. 448 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 449 * @since 8 450 */ 451 off(type: 'enableChange', callback?: Callback<boolean>): void; 452 453 /** 454 * Unregister the observer of the style. 455 * 456 * @param { 'styleChange' } type 457 * @param { Callback<CaptionsStyle> } callback 458 * @throws { BusinessError } 401 - Input parameter error. 459 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 460 * @since 8 461 */ 462 off(type: 'styleChange', callback?: Callback<CaptionsStyle>): void; 463 } 464 465 /** 466 * Indicates the edge type of the captions font. 467 * 468 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 469 * @since 8 470 */ 471 type CaptionsFontEdgeType = 'none' | 'raised' | 'depressed' | 'uniform' | 'dropShadow'; 472 /** 473 * Indicates the font family of captions. 474 * 475 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 476 * @since 8 477 */ 478 type CaptionsFontFamily = 'default' | 'monospacedSerif' | 'serif' | 479 'monospacedSansSerif' | 'sansSerif' | 'casual' | 'cursive' | 'smallCapitals'; 480 /** 481 * Indicates the style of captions. 482 * 483 * @typedef CaptionsStyle 484 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 485 * @since 8 486 */ 487 interface CaptionsStyle { 488 /** 489 * Indicates the font family of captions. 490 * 491 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 492 * @since 8 493 */ 494 fontFamily: CaptionsFontFamily; 495 /** 496 * Indicates the font scaling of captions. 497 * 498 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 499 * @since 8 500 */ 501 fontScale: number; 502 /** 503 * Indicates the font color of captions. 504 * 505 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 506 * @since 8 507 */ 508 fontColor: number | string; 509 /** 510 * Indicates the edge type of the captions font. 511 * 512 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 513 * @since 8 514 */ 515 fontEdgeType: CaptionsFontEdgeType; 516 /** 517 * Indicates the background color of captions. 518 * 519 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 520 * @since 8 521 */ 522 backgroundColor: number | string; 523 /** 524 * Indicates the window color of captions. 525 * 526 * @syscap SystemCapability.BarrierFree.Accessibility.Hearing 527 * @since 8 528 */ 529 windowColor: number | string; 530 } 531 532 /** 533 * Indicates the info of accessibility. 534 * 535 * @typedef AccessibilityAbilityInfo 536 * @syscap SystemCapability.BarrierFree.Accessibility.Core 537 * @since 7 538 */ 539 interface AccessibilityAbilityInfo { 540 /** 541 * The ability id. 542 * 543 * @syscap SystemCapability.BarrierFree.Accessibility.Core 544 * @since 7 545 */ 546 readonly id: string; 547 548 /** 549 * The ability name. 550 * 551 * @syscap SystemCapability.BarrierFree.Accessibility.Core 552 * @since 7 553 */ 554 readonly name: string; 555 556 /** 557 * The bundle name of the ability. 558 * 559 * @syscap SystemCapability.BarrierFree.Accessibility.Core 560 * @since 7 561 */ 562 readonly bundleName: string; 563 /** 564 * The target bundle name for the observation. 565 * 566 * @syscap SystemCapability.BarrierFree.Accessibility.Core 567 * @since 9 568 */ 569 readonly targetBundleNames: Array<string>; 570 571 /** 572 * The type of the ability. 573 * 574 * @syscap SystemCapability.BarrierFree.Accessibility.Core 575 * @since 7 576 */ 577 readonly abilityTypes: Array<AbilityType>; 578 579 /** 580 * The capabilities of the ability. 581 * 582 * @syscap SystemCapability.BarrierFree.Accessibility.Core 583 * @since 7 584 */ 585 readonly capabilities: Array<Capability>; 586 587 /** 588 * The description of the ability. 589 * 590 * @syscap SystemCapability.BarrierFree.Accessibility.Core 591 * @since 7 592 */ 593 readonly description: string; 594 595 /** 596 * The events which the accessibility ability wants to observe. 597 * 598 * @syscap SystemCapability.BarrierFree.Accessibility.Core 599 * @since 7 600 */ 601 readonly eventTypes: Array<EventType>; 602 603 /** 604 * Indicates whether the extended service needs to be hidden. 605 * 606 * @syscap SystemCapability.BarrierFree.Accessibility.Core 607 * @since 12 608 */ 609 readonly needHide: boolean; 610 } 611 612 /** 613 * Indicates the info of events. 614 * 615 * @syscap SystemCapability.BarrierFree.Accessibility.Core 616 * @since 7 617 */ 618 class EventInfo { 619 /** 620 * A constructor used to create a EventInfo object. 621 * 622 * @param jsonObject - Character string in JSON format required for creating an object. 623 * @syscap SystemCapability.BarrierFree.Accessibility.Core 624 * @since 7 625 */ 626 constructor(jsonObject); 627 /** 628 * A constructor used to create a EventInfo object. 629 * 630 * @param { EventType } type - The type of the accessibility event. 631 * @param { string } bundleName - The name of the bundle. 632 * @param { Action } triggerAction - The action that the ability can execute. 633 * @syscap SystemCapability.BarrierFree.Accessibility.Core 634 * @since 11 635 */ 636 constructor(type: EventType, bundleName: string, triggerAction: Action); 637 /** 638 * The type of an accessibility event. 639 * 640 * @syscap SystemCapability.BarrierFree.Accessibility.Core 641 * @since 7 642 */ 643 type: EventType; 644 645 /** 646 * The type of the window change event. 647 * 648 * @syscap SystemCapability.BarrierFree.Accessibility.Core 649 * @since 7 650 */ 651 windowUpdateType?: WindowUpdateType; 652 653 /** 654 * The bundle name of the target application. 655 * 656 * @syscap SystemCapability.BarrierFree.Accessibility.Core 657 * @since 7 658 */ 659 bundleName: string; 660 661 /** 662 * The type of the event source component,such as button, chart. 663 * 664 * @syscap SystemCapability.BarrierFree.Accessibility.Core 665 * @since 7 666 */ 667 componentType?: string; 668 669 /** 670 * The page id of the event source. 671 * 672 * @syscap SystemCapability.BarrierFree.Accessibility.Core 673 * @since 7 674 */ 675 pageId?: number; 676 677 /** 678 * The accessibility event description. 679 * 680 * @syscap SystemCapability.BarrierFree.Accessibility.Core 681 * @since 7 682 */ 683 description?: string; 684 685 /** 686 * The action that triggers the accessibility event, for example, clicking or focusing a view. 687 * 688 * @syscap SystemCapability.BarrierFree.Accessibility.Core 689 * @since 7 690 */ 691 triggerAction: Action; 692 693 /** 694 * The movement step used for reading texts. 695 * 696 * @syscap SystemCapability.BarrierFree.Accessibility.Core 697 * @since 7 698 */ 699 textMoveUnit?: TextMoveUnit; 700 701 /** 702 * The content list. 703 * 704 * @syscap SystemCapability.BarrierFree.Accessibility.Core 705 * @since 7 706 */ 707 contents?: Array<string>; 708 709 /** 710 * The content changed before. 711 * 712 * @syscap SystemCapability.BarrierFree.Accessibility.Core 713 * @since 7 714 */ 715 lastContent?: string; 716 717 /** 718 * The start index of listed items on the screen. 719 * 720 * @syscap SystemCapability.BarrierFree.Accessibility.Core 721 * @since 7 722 */ 723 beginIndex?: number; 724 725 /** 726 * The index of the current item on the screen. 727 * 728 * @syscap SystemCapability.BarrierFree.Accessibility.Core 729 * @since 7 730 */ 731 currentIndex?: number; 732 733 /** 734 * The end index of listed items on the screen. 735 * 736 * @syscap SystemCapability.BarrierFree.Accessibility.Core 737 * @since 7 738 */ 739 endIndex?: number; 740 741 /** 742 * The total of the items, talkback used it when scroll. 743 * 744 * @syscap SystemCapability.BarrierFree.Accessibility.Core 745 * @since 7 746 */ 747 itemCount?: number; 748 749 /** 750 * The id of element. 751 * 752 * @syscap SystemCapability.BarrierFree.Accessibility.Core 753 * @since 12 754 */ 755 elementId?: number; 756 757 /** 758 * The content of announce accessibility text. 759 * 760 * @syscap SystemCapability.BarrierFree.Accessibility.Core 761 * @since 12 762 */ 763 textAnnouncedForAccessibility?: string; 764 } 765} 766export default accessibility; 767