diff --git a/interfaces/kits/js/AccessibilityExtensionContext.d.ts b/interfaces/kits/js/AccessibilityExtensionContext.d.ts index b631c6b1d..7af4681b8 100644 --- a/interfaces/kits/js/AccessibilityExtensionContext.d.ts +++ b/interfaces/kits/js/AccessibilityExtensionContext.d.ts @@ -26,51 +26,56 @@ import { GesturePath } from "../@ohos.accessibility.GesturePath"; */ export default class AccessibilityExtensionContext extends ExtensionContext { /** - * Set the name of the bundle name that is interested in sending the event. - * @param targetNames + * Set the bundle names that is interested in sending the event. + * @param targetNames The bundle names that are interested in sending the event. + * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. */ - setTargetBundleName(targetNames: Array): Promise; setTargetBundleName(targetNames: Array, callback: AsyncCallback): void; + setTargetBundleName(targetNames: Array): Promise; /** * Get focus element. * @param isAccessibilityFocus Indicates whether the acquired element has an accessibility focus. + * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ + getFocusElement(isAccessibilityFocus: boolean, callback: AsyncCallback): void; getFocusElement(isAccessibilityFocus?: boolean): Promise; getFocusElement(callback: AsyncCallback): void; - getFocusElement(isAccessibilityFocus: boolean, callback: AsyncCallback): void; /** * Get window root element. * @param windowId Indicates the window ID. + * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ + getWindowRootElement(windowId: number, callback: AsyncCallback): void; getWindowRootElement(windowId?: number): Promise; getWindowRootElement(callback: AsyncCallback): void; - getWindowRootElement(windowId: number, callback: AsyncCallback): void; /** * Get window list. * @param displayId Indicates the display ID. + * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ + getWindows(displayId: number, callback: AsyncCallback>): void; getWindows(displayId?: number): Promise>; getWindows(callback: AsyncCallback>): void; - getWindows(displayId: number, callback: AsyncCallback>): void; /** * Inject gesture path events. * @param gesturePath Indicates the gesture path. + * @param callback Indicates the listener. * @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; + injectGesture(gesturePath: GesturePath): Promise; } /** @@ -83,63 +88,70 @@ export default class AccessibilityExtensionContext extends ExtensionContext { declare interface AccessibilityElement { /** * Get a list of attribute names. + * @param callback Indicates the listener. */ - attributeNames(): Promise>; attributeNames(callback: AsyncCallback>): void; + attributeNames(): Promise>; /** * Get the value of an attribute. * @param attributeName Indicates the attribute name. + * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. * @throws { BusinessError } 9300004 - This property does not exist. */ - attributeValue(attributeName: T): Promise; attributeValue(attributeName: T, callback: AsyncCallback): void; + attributeValue(attributeName: T): Promise; /** * Get a list of supported actions. + * @param callback Indicates the listener. */ - actionNames(): Promise>; actionNames(callback: AsyncCallback>): void; + actionNames(): Promise>; /** * Perform the specified action. * @param actionName Indicates the action name. * @param parameters Indicates the parameters needed to execute the action. + * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. * @throws { BusinessError } 9300005 - This action is not supported. */ + 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. + * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. */ - findElement(type: 'content', condition: string): Promise>; findElement(type: 'content', condition: string, callback: AsyncCallback>): void - + findElement(type: 'content', condition: string): Promise>; + /** * 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. + * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. */ - findElement(type: 'focusType', condition: FocusType): Promise; findElement(type: 'focusType', condition: FocusType, callback: AsyncCallback): void + findElement(type: 'focusType', condition: FocusType): Promise; /** * 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. + * @param callback Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. */ - findElement(type: 'focusDirection', condition: FocusDirection): Promise; findElement(type: 'focusDirection', condition: FocusDirection, callback: AsyncCallback): void + findElement(type: 'focusDirection', condition: FocusDirection): Promise; } /**