• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16import type { AsyncCallback } from '../basic';
17import ExtensionContext from './ExtensionContext';
18import type accessibility from '../@ohos.accessibility';
19import type { GesturePath } from '../@ohos.accessibility.GesturePath';
20
21/**
22 * The accessibility extension context. Used to configure, query information, and inject gestures.
23 *
24 * @extends ExtensionContext
25 * @syscap SystemCapability.BarrierFree.Accessibility.Core
26 * @since 9
27 */
28export default class AccessibilityExtensionContext extends ExtensionContext {
29  /**
30   * Set the bundle names that is interested in sending the event.
31   *
32   * @param { Array<string> } targetNames The bundle names that are interested in sending the event.
33   * @param { AsyncCallback<void> } callback Indicates the listener.
34   * @throws { BusinessError } 401 - Input parameter error.
35   * @syscap SystemCapability.BarrierFree.Accessibility.Core
36   * @since 9
37   */
38  setTargetBundleName(targetNames: Array<string>, callback: AsyncCallback<void>): void;
39
40  /**
41   * Set the bundle names that is interested in sending the event.
42   *
43   * @param { Array<string> } targetNames The bundle names that are interested in sending the event.
44   * @returns { Promise<void> }
45   * @throws { BusinessError } 401 - Input parameter error.
46   * @syscap SystemCapability.BarrierFree.Accessibility.Core
47   * @since 9
48   */
49  setTargetBundleName(targetNames: Array<string>): Promise<void>;
50
51  /**
52   * Get focus element.
53   *
54   * @param { boolean } isAccessibilityFocus Indicates whether the acquired element has an accessibility focus.
55   * @param { AsyncCallback<AccessibilityElement> } callback Indicates the listener.
56   * @throws { BusinessError } 401 - Input parameter error.
57   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
58   * @syscap SystemCapability.BarrierFree.Accessibility.Core
59   * @since 9
60   */
61  getFocusElement(isAccessibilityFocus: boolean, callback: AsyncCallback<AccessibilityElement>): void;
62
63  /**
64   * Get focus element.
65   *
66   * @param { boolean } isAccessibilityFocus Indicates whether the acquired element has an accessibility focus.
67   * @returns { Promise<AccessibilityElement> }
68   * @throws { BusinessError } 401 - Input parameter error.
69   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
70   * @syscap SystemCapability.BarrierFree.Accessibility.Core
71   * @since 9
72   */
73  getFocusElement(isAccessibilityFocus?: boolean): Promise<AccessibilityElement>;
74
75  /**
76   * Get focus element.
77   * @param { AsyncCallback<AccessibilityElement> } callback Indicates the listener.
78   * @throws { BusinessError } 401 - Input parameter error.
79   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
80   * @syscap SystemCapability.BarrierFree.Accessibility.Core
81   * @since 9
82   */
83  getFocusElement(callback: AsyncCallback<AccessibilityElement>): void;
84
85  /**
86   * Get window root element.
87   *
88   * @param { number } windowId Indicates the window ID.
89   * @param { AsyncCallback<AccessibilityElement> } callback Indicates the listener.
90   * @throws { BusinessError } 401 - Input parameter error.
91   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
92   * @syscap SystemCapability.BarrierFree.Accessibility.Core
93   * @since 9
94   */
95  getWindowRootElement(windowId: number, callback: AsyncCallback<AccessibilityElement>): void;
96
97  /**
98   * Get window root element.
99   *
100   * @param { number } windowId Indicates the window ID.
101   * @returns { Promise<AccessibilityElement> }
102   * @throws { BusinessError } 401 - Input parameter error.
103   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
104   * @syscap SystemCapability.BarrierFree.Accessibility.Core
105   * @since 9
106   */
107  getWindowRootElement(windowId?: number): Promise<AccessibilityElement>;
108
109  /**
110   * Get window root element.
111   * @param { AsyncCallback<AccessibilityElement> } callback Indicates the listener.
112   * @throws { BusinessError } 401 - Input parameter error.
113   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
114   * @syscap SystemCapability.BarrierFree.Accessibility.Core
115   * @since 9
116   */
117  getWindowRootElement(callback: AsyncCallback<AccessibilityElement>): void;
118
119  /**
120   * Get window list.
121   *
122   * @param { number } displayId Indicates the display ID.
123   * @param { AsyncCallback<Array<AccessibilityElement>> } callback Indicates the listener.
124   * @throws { BusinessError } 401 - Input parameter error.
125   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
126   * @syscap SystemCapability.BarrierFree.Accessibility.Core
127   * @since 9
128   */
129  getWindows(displayId: number, callback: AsyncCallback<Array<AccessibilityElement>>): void;
130
131  /**
132   * Get window list.
133   *
134   * @param { number } displayId Indicates the display ID.
135   * @returns { Promise<Array<AccessibilityElement>> }
136   * @throws { BusinessError } 401 - Input parameter error.
137   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
138   * @syscap SystemCapability.BarrierFree.Accessibility.Core
139   * @since 9
140   */
141  getWindows(displayId?: number): Promise<Array<AccessibilityElement>>;
142
143  /**
144   * Get window list.
145   * @param { AsyncCallback<Array<AccessibilityElement>> } callback Indicates the listener.
146   * @throws { BusinessError } 401 - Input parameter error.
147   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
148   * @syscap SystemCapability.BarrierFree.Accessibility.Core
149   * @since 9
150   */
151  getWindows(callback: AsyncCallback<Array<AccessibilityElement>>): void;
152
153  /**
154   * Inject gesture path events.
155   *
156   * @param { GesturePath } gesturePath Indicates the gesture path.
157   * @param { AsyncCallback<void> } callback Indicates the listener.
158   * @throws { BusinessError } 401 - Input parameter error.
159   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
160   * @syscap SystemCapability.BarrierFree.Accessibility.Core
161   * @since 9
162   */
163  injectGesture(gesturePath: GesturePath, callback: AsyncCallback<void>): void;
164
165  /**
166   * Inject gesture path events.
167   *
168   * @param { GesturePath } gesturePath Indicates the gesture path.
169   * @returns { Promise<void> }
170   * @throws { BusinessError } 401 - Input parameter error.
171   * @throws { BusinessError } 9300003 -  Do not have accessibility right for this operation.
172   * @syscap SystemCapability.BarrierFree.Accessibility.Core
173   * @since 9
174   */
175  injectGesture(gesturePath: GesturePath): Promise<void>;
176}
177
178/**
179 * Indicates an accessibility element.
180 * Supports querying element attributes, requesting execution actions, and finding child elements by condition.
181 *
182 * @typedef AccessibilityElement
183 * @syscap SystemCapability.BarrierFree.Accessibility.Core
184 * @since 9
185 */
186declare interface AccessibilityElement {
187  /**
188   * Get a list of attribute names.
189   *
190   * @param { AsyncCallback<Array<T>> } callback Indicates the listener.
191   * @syscap SystemCapability.BarrierFree.Accessibility.Core
192   * @since 9
193   */
194  attributeNames<T extends keyof ElementAttributeValues>(callback: AsyncCallback<Array<T>>): void;
195
196  /**
197   * Get a list of attribute names.
198   * @returns { Promise<Array<T>> }
199   * @syscap SystemCapability.BarrierFree.Accessibility.Core
200   * @since 9
201   */
202  attributeNames<T extends keyof ElementAttributeValues>(): Promise<Array<T>>;
203
204  /**
205   * Get the value of an attribute.
206   *
207   * @param { T } attributeName Indicates the attribute name.
208   * @param { AsyncCallback<ElementAttributeValues[T]> } callback Indicates the listener.
209   * @throws { BusinessError } 401 - Input parameter error.
210   * @throws { BusinessError } 9300004 - This property does not exist.
211   * @syscap SystemCapability.BarrierFree.Accessibility.Core
212   * @since 9
213   */
214  attributeValue<T extends keyof ElementAttributeValues>(
215    attributeName: T,
216    callback: AsyncCallback<ElementAttributeValues[T]>
217  ): void;
218
219  /**
220   * Get the value of an attribute.
221   *
222   * @param { T } attributeName Indicates the attribute name.
223   * @returns { Promise<ElementAttributeValues[T]> }
224   * @throws { BusinessError } 401 - Input parameter error.
225   * @throws { BusinessError } 9300004 - This property does not exist.
226   * @syscap SystemCapability.BarrierFree.Accessibility.Core
227   * @since 9
228   */
229  attributeValue<T extends keyof ElementAttributeValues>(attributeName: T): Promise<ElementAttributeValues[T]>;
230
231  /**
232   * Get a list of supported actions.
233   *
234   * @param { AsyncCallback<Array<string>> } callback Indicates the listener.
235   * @syscap SystemCapability.BarrierFree.Accessibility.Core
236   * @since 9
237   */
238  actionNames(callback: AsyncCallback<Array<string>>): void;
239
240  /**
241   * Get a list of supported actions.
242   *
243   * @param { AsyncCallback<Array<string>> } callback Indicates the listener.
244   * @returns { Promise<Array<string>> }
245   * @syscap SystemCapability.BarrierFree.Accessibility.Core
246   * @since 9
247   */
248  actionNames(): Promise<Array<string>>;
249
250  /**
251   * Perform the specified action.
252   *
253   * @param { string } actionName Indicates the action name.
254   * @param { object } parameters Indicates the parameters needed to execute the action.
255   * @param { AsyncCallback<void> } callback Indicates the listener.
256   * @throws { BusinessError } 401 - Input parameter error.
257   * @throws { BusinessError } 9300005 - This action is not supported.
258   * @syscap SystemCapability.BarrierFree.Accessibility.Core
259   * @since 9
260   */
261  performAction(actionName: string, parameters: object, callback: AsyncCallback<void>): void;
262
263  /**
264   * Perform the specified action.
265   *
266   * @param { string } actionName Indicates the action name.
267   * @param { object } parameters Indicates the parameters needed to execute the action.
268   * @returns { Promise<void> }
269   * @throws { BusinessError } 401 - Input parameter error.
270   * @throws { BusinessError } 9300005 - This action is not supported.
271   * @syscap SystemCapability.BarrierFree.Accessibility.Core
272   * @since 9
273   */
274  performAction(actionName: string, parameters?: object): Promise<void>;
275
276  /**
277   * Perform the specified action.
278   *
279   * @param { string } actionName Indicates the action name.
280   * @param { AsyncCallback<void> } callback Indicates the listener.
281   * @throws { BusinessError } 401 - Input parameter error.
282   * @throws { BusinessError } 9300005 - This action is not supported.
283   * @syscap SystemCapability.BarrierFree.Accessibility.Core
284   * @since 9
285   */
286  performAction(actionName: string, callback: AsyncCallback<void>): void;
287
288  /**
289   * Find elements that match the condition.
290   *
291   * @param { 'content' } type The type of query condition is content.
292   * @param { string } condition Indicates the specific content to be queried.
293   * @param { AsyncCallback<Array<AccessibilityElement>> } callback Indicates the listener.
294   * @throws { BusinessError } 401 - Input parameter error.
295   * @syscap SystemCapability.BarrierFree.Accessibility.Core
296   * @since 9
297   */
298  findElement(type: 'content', condition: string, callback: AsyncCallback<Array<AccessibilityElement>>): void;
299
300  /**
301   * Find elements that match the condition.
302   *
303   * @param { 'content' } type The type of query condition is content.
304   * @param { string } condition Indicates the specific content to be queried.
305   * @returns { Promise<Array<AccessibilityElement>> }
306   * @throws { BusinessError } 401 - Input parameter error.
307   * @syscap SystemCapability.BarrierFree.Accessibility.Core
308   * @since 9
309   */
310  findElement(type: 'content', condition: string): Promise<Array<AccessibilityElement>>;
311
312  /**
313   * Find elements that match the condition.
314   *
315   * @param { 'focusType' } type The type of query condition is focus type.
316   * @param { FocusType } condition Indicates the type of focus to query.
317   * @param { AsyncCallback<AccessibilityElement> } callback Indicates the listener.
318   * @throws { BusinessError } 401 - Input parameter error.
319   * @syscap SystemCapability.BarrierFree.Accessibility.Core
320   * @since 9
321   */
322  findElement(type: 'focusType', condition: FocusType, callback: AsyncCallback<AccessibilityElement>): void;
323
324  /**
325   * Find elements that match the condition.
326   *
327   * @param { 'focusType' } type The type of query condition is focus type.
328   * @param { FocusType } condition Indicates the type of focus to query.
329   * @returns { Promise<AccessibilityElement> }
330   * @throws { BusinessError } 401 - Input parameter error.
331   * @syscap SystemCapability.BarrierFree.Accessibility.Core
332   * @since 9
333   */
334  findElement(type: 'focusType', condition: FocusType): Promise<AccessibilityElement>;
335
336  /**
337   * Find elements that match the condition.
338   *
339   * @param { 'focusDirection' } type The type of query condition is focus direction.
340   * @param { FocusDirection } condition Indicates the direction of search focus to query.
341   * @param { AsyncCallback<AccessibilityElement> } callback Indicates the listener.
342   * @throws { BusinessError } 401 - Input parameter error.
343   * @syscap SystemCapability.BarrierFree.Accessibility.Core
344   * @since 9
345   */
346  findElement(type: 'focusDirection', condition: FocusDirection, callback: AsyncCallback<AccessibilityElement>): void;
347
348  /**
349   * Find elements that match the condition.
350   *
351   * @param { 'focusDirection' } type The type of query condition is focus direction.
352   * @param { FocusDirection } condition Indicates the direction of search focus to query.
353   * @returns { Promise<AccessibilityElement> }
354   * @throws { BusinessError } 401 - Input parameter error.
355   * @syscap SystemCapability.BarrierFree.Accessibility.Core
356   * @since 9
357   */
358  findElement(type: 'focusDirection', condition: FocusDirection): Promise<AccessibilityElement>;
359}
360
361/**
362 * Indicates the possible attributes of the element and the type of the attribute value.
363 *
364 * @syscap SystemCapability.BarrierFree.Accessibility.Core
365 * @since 9
366 */
367type ElementAttributeValues = {
368  /**
369   * Indicates accessibility focus state.
370   *
371   * @syscap SystemCapability.BarrierFree.Accessibility.Core
372   * @since 9
373   */
374  'accessibilityFocused': boolean;
375  /**
376   * Indicates the bundle name to which it belongs.
377   *
378   * @syscap SystemCapability.BarrierFree.Accessibility.Core
379   * @since 9
380   */
381  'bundleName': string;
382  /**
383   * Indicates whether the element is checkable.
384   *
385   * @syscap SystemCapability.BarrierFree.Accessibility.Core
386   * @since 9
387   */
388  'checkable': boolean;
389  /**
390   * Indicates whether the element is checked.
391   *
392   * @syscap SystemCapability.BarrierFree.Accessibility.Core
393   * @since 9
394   */
395  'checked': boolean;
396  /**
397   * Indicates all child elements.
398   *
399   * @syscap SystemCapability.BarrierFree.Accessibility.Core
400   * @since 9
401   */
402  'children': Array<AccessibilityElement>;
403  /**
404   * Indicates whether the element is clickable.
405   *
406   * @syscap SystemCapability.BarrierFree.Accessibility.Core
407   * @since 9
408   */
409  'clickable': boolean;
410  /**
411   * Indicates the component ID to which the element belongs.
412   *
413   * @syscap SystemCapability.BarrierFree.Accessibility.Core
414   * @since 9
415   */
416  'componentId': number;
417  /**
418   * Indicates the component type to which the element belongs.
419   *
420   * @syscap SystemCapability.BarrierFree.Accessibility.Core
421   * @since 9
422   */
423  'componentType': string;
424  /**
425   * Indicates the content.
426   *
427   * @syscap SystemCapability.BarrierFree.Accessibility.Core
428   * @since 9
429   */
430  'contents': Array<string>;
431  /**
432   * Indicates the index of the current item.
433   *
434   * @syscap SystemCapability.BarrierFree.Accessibility.Core
435   * @since 9
436   */
437  'currentIndex': number;
438  /**
439   * Indicates the description of the element.
440   *
441   * @syscap SystemCapability.BarrierFree.Accessibility.Core
442   * @since 9
443   */
444  'description': string;
445  /**
446   * Indicates whether the element is editable.
447   *
448   * @syscap SystemCapability.BarrierFree.Accessibility.Core
449   * @since 9
450   */
451  'editable': boolean;
452  /**
453   * Indicates the list index of the last item displayed on the screen.
454   *
455   * @syscap SystemCapability.BarrierFree.Accessibility.Core
456   * @since 9
457   */
458  'endIndex': number;
459  /**
460   * Indicates the string of error state.
461   *
462   * @syscap SystemCapability.BarrierFree.Accessibility.Core
463   * @since 9
464   */
465  'error': string;
466  /**
467   * Indicates whether the element is focusable.
468   *
469   * @syscap SystemCapability.BarrierFree.Accessibility.Core
470   * @since 9
471   */
472  'focusable': boolean;
473  /**
474   * Indicates the hint text.
475   *
476   * @syscap SystemCapability.BarrierFree.Accessibility.Core
477   * @since 9
478   */
479  'hintText': string;
480  /**
481   * Indicates the type of input text.
482   *
483   * @syscap SystemCapability.BarrierFree.Accessibility.Core
484   * @since 9
485   */
486  'inputType': number;
487  /**
488   * Indicates the inspector key.
489   *
490   * @syscap SystemCapability.BarrierFree.Accessibility.Core
491   * @since 9
492   */
493  'inspectorKey': string;
494  /**
495   * Indicates whether the element is active or not.
496   *
497   * @syscap SystemCapability.BarrierFree.Accessibility.Core
498   * @since 9
499   */
500  'isActive': boolean;
501  /**
502   * Indicates whether the element is enable or not.
503   *
504   * @syscap SystemCapability.BarrierFree.Accessibility.Core
505   * @since 9
506   */
507  'isEnable': boolean;
508  /**
509   * Indicates whether the element is hint state or not.
510   *
511   * @syscap SystemCapability.BarrierFree.Accessibility.Core
512   * @since 9
513   */
514  'isHint': boolean;
515  /**
516   * Indicates whether the element is focused or not.
517   *
518   * @syscap SystemCapability.BarrierFree.Accessibility.Core
519   * @since 9
520   */
521  'isFocused': boolean;
522  /**
523   * Indicates whether the element is password or not.
524   *
525   * @syscap SystemCapability.BarrierFree.Accessibility.Core
526   * @since 9
527   */
528  'isPassword': boolean;
529  /**
530   * Indicates whether the element is visible or not.
531   *
532   * @syscap SystemCapability.BarrierFree.Accessibility.Core
533   * @since 9
534   */
535  'isVisible': boolean;
536  /**
537   * Indicates the total count of the items.
538   *
539   * @syscap SystemCapability.BarrierFree.Accessibility.Core
540   * @since 9
541   */
542  'itemCount': number;
543  /**
544   * Indicates the last content.
545   *
546   * @syscap SystemCapability.BarrierFree.Accessibility.Core
547   * @since 9
548   */
549  'lastContent': string;
550  /**
551   * Indicates the display layer of the element.
552   *
553   * @syscap SystemCapability.BarrierFree.Accessibility.Core
554   * @since 9
555   */
556  'layer': number;
557  /**
558   * Indicates whether the element is long clickable.
559   *
560   * @syscap SystemCapability.BarrierFree.Accessibility.Core
561   * @since 9
562   */
563  'longClickable': boolean;
564  /**
565   * Indicates the page id.
566   *
567   * @syscap SystemCapability.BarrierFree.Accessibility.Core
568   * @since 9
569   */
570  'pageId': number;
571  /**
572   * Indicates the parent of the element.
573   *
574   * @syscap SystemCapability.BarrierFree.Accessibility.Core
575   * @since 9
576   */
577  'parent': AccessibilityElement;
578  /**
579   * Indicates whether the element supports multiple lines of text.
580   *
581   * @syscap SystemCapability.BarrierFree.Accessibility.Core
582   * @since 9
583   */
584  'pluralLineSupported': boolean;
585  /**
586   * Indicates the area of the element.
587   *
588   * @syscap SystemCapability.BarrierFree.Accessibility.Core
589   * @since 9
590   */
591  'rect': Rect;
592  /**
593   * Indicates the resource name of the element.
594   *
595   * @syscap SystemCapability.BarrierFree.Accessibility.Core
596   * @since 9
597   */
598  'resourceName': string;
599  /**
600   * Indicates the root element of the window element.
601   *
602   * @syscap SystemCapability.BarrierFree.Accessibility.Core
603   * @since 9
604   */
605  'rootElement': AccessibilityElement;
606  /**
607   * Indicates the display area of the element.
608   *
609   * @syscap SystemCapability.BarrierFree.Accessibility.Core
610   * @since 9
611   */
612  'screenRect': Rect;
613  /**
614   * Indicates whether the element is scrollable.
615   *
616   * @syscap SystemCapability.BarrierFree.Accessibility.Core
617   * @since 9
618   */
619  'scrollable': boolean;
620  /**
621   * Indicates whether the element is selected.
622   *
623   * @syscap SystemCapability.BarrierFree.Accessibility.Core
624   * @since 9
625   */
626  'selected': boolean;
627  /**
628   * Indicates the list index of the first item displayed on the screen.
629   *
630   * @syscap SystemCapability.BarrierFree.Accessibility.Core
631   * @since 9
632   */
633  'startIndex': number;
634  /**
635   * Indicates the text of the element.
636   *
637   * @syscap SystemCapability.BarrierFree.Accessibility.Core
638   * @since 9
639   */
640  'text': string;
641  /**
642   * Indicates the maximum length limit of the element text.
643   *
644   * @syscap SystemCapability.BarrierFree.Accessibility.Core
645   * @since 9
646   */
647  'textLengthLimit': number;
648  /**
649   * Indicates the unit of movement of the element text as it is read.
650   *
651   * @syscap SystemCapability.BarrierFree.Accessibility.Core
652   * @since 9
653   */
654  'textMoveUnit': accessibility.TextMoveUnit;
655  /**
656   * Indicates the action that triggered the element event.
657   *
658   * @syscap SystemCapability.BarrierFree.Accessibility.Core
659   * @since 9
660   */
661  'triggerAction': accessibility.Action;
662  /**
663   * Indicates the window type of the element.
664   *
665   * @syscap SystemCapability.BarrierFree.Accessibility.Core
666   * @since 9
667   */
668  'type': WindowType;
669  /**
670   * Indicates the maximum value.
671   *
672   * @syscap SystemCapability.BarrierFree.Accessibility.Core
673   * @since 9
674   */
675  'valueMax': number;
676  /**
677   * Indicates the minimum value.
678   *
679   * @syscap SystemCapability.BarrierFree.Accessibility.Core
680   * @since 9
681   */
682  'valueMin': number;
683  /**
684   * Indicates the current value.
685   *
686   * @syscap SystemCapability.BarrierFree.Accessibility.Core
687   * @since 9
688   */
689  'valueNow': number;
690  /**
691   * Indicates the window id.
692   *
693   * @syscap SystemCapability.BarrierFree.Accessibility.Core
694   * @since 9
695   */
696  'windowId': number;
697};
698
699/**
700 * Indicates the direction of the search focus.
701 *
702 * @syscap SystemCapability.BarrierFree.Accessibility.Core
703 * @since 9
704 */
705type FocusDirection = 'up' | 'down' | 'left' | 'right' | 'forward' | 'backward';
706
707/**
708 * Indicates the type of the focus.
709 *
710 * @syscap SystemCapability.BarrierFree.Accessibility.Core
711 * @since 9
712 */
713type FocusType = 'accessibility' | 'normal';
714
715/**
716 * Indicates the type of the window.
717 *
718 * @syscap SystemCapability.BarrierFree.Accessibility.Core
719 * @since 9
720 */
721type WindowType = 'application' | 'system';
722
723/**
724 * Indicates rectangle.
725 *
726 * @typedef Rect
727 * @syscap SystemCapability.BarrierFree.Accessibility.Core
728 * @since 9
729 */
730interface Rect {
731  left: number;
732  top: number;
733  width: number;
734  height: number;
735}
736