From 4614368c66699839f8247b1e2a90d112448b8c83 Mon Sep 17 00:00:00 2001 From: chen828 Date: Fri, 4 Jul 2025 06:40:33 +0000 Subject: [PATCH 1/3] update api/@ohos.UiTest.d.ts. Signed-off-by: chen828 --- api/@ohos.UiTest.d.ts | 223 +++++++++++++++++++++--------------------- 1 file changed, 110 insertions(+), 113 deletions(-) diff --git a/api/@ohos.UiTest.d.ts b/api/@ohos.UiTest.d.ts index a9dde47585..719b6c2765 100755 --- a/api/@ohos.UiTest.d.ts +++ b/api/@ohos.UiTest.d.ts @@ -1078,14 +1078,14 @@ /** * The x-coordinate of the coordinate point. * - * @type { number } + * @type { int } * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice * @since arkts {'1.1':'20','1.2':'20'} * @arkts 1.1&1.2 */ - x: number; + x: int; /** * The y-coordinate of the coordinate point. * @@ -1116,14 +1116,14 @@ /** * The y-coordinate of the coordinate point. * - * @type { number } + * @type { int } * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice * @since arkts {'1.1':'20','1.2':'20'} * @arkts 1.1&1.2 */ - y: number; + y: int; } /** @@ -1182,14 +1182,14 @@ /** * The x-coordinate of the top left corner of the rectangle. * - * @type { number } + * @type { int } * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice * @since arkts {'1.1':'20','1.2':'20'} * @arkts 1.1&1.2 */ - left: number; + left: int; /** * The y-coordinate of the top left corner of the rectangle. * @@ -1220,14 +1220,14 @@ /** * The y-coordinate of the top left corner of the rectangle. * - * @type { number } + * @type { int } * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice * @since arkts {'1.1':'20','1.2':'20'} * @arkts 1.1&1.2 */ - top: number; + top: int; /** * The x-coordinate at the bottom right corner of the rectangle. * @@ -1258,14 +1258,14 @@ /** * The x-coordinate at the bottom right corner of the rectangle. * - * @type { number } + * @type { int } * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice * @since arkts {'1.1':'20','1.2':'20'} * @arkts 1.1&1.2 */ - right: number; + right: int; /** * The y-coordinate at the bottom right corner of the rectangle. * @@ -1296,14 +1296,14 @@ /** * The y-coordinate at the bottom right corner of the rectangle. * - * @type { number } + * @type { int } * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice * @since arkts {'1.1':'20','1.2':'20'} * @arkts 1.1&1.2 */ - bottom: number; + bottom: int; } /** @@ -1389,7 +1389,6 @@ * * @type { ?boolean } * @syscap SystemCapability.Test.UiTest - * @since 11 * @deprecated since 11 * @useinstead ohos.UiTest.WindowFilter#active */ @@ -1778,14 +1777,14 @@ /** * Speed(pixels per second) of touchpad multi-finger swipe, default is 2000, the value ranges from 200 to 40000,set it 2000 if out of range. - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Test.UiTest * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @test * @arkts 1.1&1.2 */ - speed?: number; + speed?: int; } /** @@ -3009,7 +3008,7 @@ /** * Scroll on this {@link Component} to the top,applicable to scrollable one. * - * @param { number } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000.Set it default 600 if out of range or null or undefined. + * @param { int } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000.Set it default 600 if out of range or null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3021,7 +3020,7 @@ * @test * @arkts 1.1&1.2 */ - scrollToTop(speed?: number): Promise; + scrollToTop(speed?: int): Promise; /** * Scroll on this {@link Component} to the bottom,applicable to scrollable one. @@ -3051,7 +3050,7 @@ /** * Scroll on this {@link Component} to the bottom,applicable to scrollable one. * - * @param { number } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. + * @param { int } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3063,7 +3062,7 @@ * @test * @arkts 1.1&1.2 */ - scrollToBottom(speed?: number): Promise; + scrollToBottom(speed?: int): Promise; /** * Get the bounds rect of this {@link Component}. @@ -3180,7 +3179,7 @@ /** * Pinch enlarge this {@link Component} to the target scale. * - * @param { number } scale - the scale of the pinch enlarge this {@link Component}'s size, ranges greater than 1. + * @param { double } scale - the scale of the pinch enlarge this {@link Component}'s size, ranges greater than 1. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3192,7 +3191,7 @@ * @test * @arkts 1.1&1.2 */ - pinchOut(scale: number): Promise; + pinchOut(scale: double): Promise; /** * Pinch shrink this {@link Component} to the target scale. @@ -3209,7 +3208,7 @@ /** * Pinch shrink this {@link Component} to the target scale. * - * @param { number } scale - the scale of the pinch shrink this {@link Component}'s size, ranges from 0 to 1. + * @param { double } scale - the scale of the pinch shrink this {@link Component}'s size, ranges from 0 to 1. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3221,7 +3220,7 @@ * @test * @arkts 1.1&1.2 */ - pinchIn(scale: number): Promise; + pinchIn(scale: double): Promise; /** * Get the description attribute value. @@ -3290,7 +3289,7 @@ * @test */ scrollSearch(on: On): Promise; - + /** * Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one. * @@ -3307,7 +3306,6 @@ * @arkts 1.2 */ scrollSearch(on: On): Promise; - /** * Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one. * @@ -3330,7 +3328,7 @@ * * @param { On } on - the attribute requirements of the target {@link Component}. * @param { boolean } [vertical] - Whether the swipe direction is vertical, default is true. - * @param { number } [offset] - Offset from the swipe start/end point to the component border, default is 80. + * @param { int } [offset] - Offset from the swipe start/end point to the component border, default is 80. * @returns { Promise } the found result,or null if not found. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3341,7 +3339,7 @@ * @test * @arkts 1.2 */ - scrollSearch(on: On, vertical?: boolean, offset?: number): Promise; + scrollSearch(on: On, vertical?: boolean, offset?: int): Promise; } /** @@ -3432,7 +3430,7 @@ /** * Delay with specified duration. * - * @param { number } duration - the delay duration in milliseconds, not less than 0. + * @param { int } duration - the delay duration in milliseconds, not less than 0. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3443,7 +3441,7 @@ * @test * @arkts 1.1&1.2 */ - delayMs(duration: number): Promise; + delayMs(duration: int): Promise; /** * Find the first matched {@link Component} on current UI. @@ -3566,7 +3564,7 @@ * Find the first matched {@link Component} on current UI during the time given. * * @param { On } on - the attribute requirements of the target {@link Component}. - * @param { number } time - duration of finding in milliseconds, not less than 0. + * @param { int } time - duration of finding in milliseconds, not less than 0. * @returns { Promise } the first matched {@link Component} or undefined. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3576,7 +3574,7 @@ * @test * @arkts 1.2 */ - waitForComponent(on: On, time: number): Promise; + waitForComponent(on: On, time: int): Promise; /** * Find all the matched {@link Component}s on current UI. @@ -3720,7 +3718,7 @@ /** * Press the specified key. * - * @param { number } keyCode - the target keyCode. + * @param { int } keyCode - the target keyCode. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3731,7 +3729,7 @@ * @test * @arkts 1.1&1.2 */ - triggerKey(keyCode: number): Promise; + triggerKey(keyCode: int): Promise; /** * Press two or three key combinations @@ -3749,9 +3747,9 @@ /** * Press two or three key combinations * - * @param { number } key0 - the first keyCode. - * @param { number } key1 - the second keyCode. - * @param { number } [key2] - the third keyCode,set it default 0 if null or undefined. + * @param { int } key0 - the first keyCode. + * @param { int } key1 - the second keyCode. + * @param { int } [key2] - the third keyCode,set it default 0 if null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3762,7 +3760,7 @@ * @test * @arkts 1.1&1.2 */ - triggerCombineKeys(key0: number, key1: number, key2?: number): Promise; + triggerCombineKeys(key0: int, key1: int, key2?: int): Promise; /** * Click on the specified location on the screen. @@ -3792,8 +3790,8 @@ /** * Click on the specified location on the screen. * - * @param { number } x - the x-coordinate, not less than 0. - * @param { number } y - the y-coordinate, not less than 0. + * @param { int } x - the x-coordinate, not less than 0. + * @param { int } y - the y-coordinate, not less than 0. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3804,7 +3802,7 @@ * @test * @arkts 1.1&1.2 */ - click(x: number, y: number): Promise; + click(x: int, y: int): Promise; /** * DoubleClick on the specified location on the screen. @@ -3834,8 +3832,8 @@ /** * DoubleClick on the specified location on the screen. * - * @param { number } x - the x-coordinate, not less than 0. - * @param { number } y - the y-coordinate, not less than 0. + * @param { int } x - the x-coordinate, not less than 0. + * @param { int } y - the y-coordinate, not less than 0. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3846,7 +3844,7 @@ * @test * @arkts 1.1&1.2 */ - doubleClick(x: number, y: number): Promise; + doubleClick(x: int, y: int): Promise; /** * LongClick on the specified location on the screen. @@ -3876,8 +3874,8 @@ /** * LongClick on the specified location on the screen. * - * @param { number } x - the x-coordinate, not less than 0. - * @param { number } y - the y-coordinate, not less than 0. + * @param { int } x - the x-coordinate, not less than 0. + * @param { int } y - the y-coordinate, not less than 0. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3888,7 +3886,7 @@ * @test * @arkts 1.1&1.2 */ - longClick(x: number, y: number): Promise; + longClick(x: int, y: int): Promise; /** * Swipe on the screen between the specified points. @@ -3924,11 +3922,11 @@ /** * Swipe on the screen between the specified points. * - * @param { number } startx - the x-coordinate of the starting point, not less than 0. - * @param { number } starty - the y-coordinate of the starting point, not less than 0. - * @param { number } endx - the x-coordinate of the ending point, not less than 0. - * @param { number } endy - the y-coordinate of the ending point, not less than 0. - * @param { number } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. + * @param { int } startx - the x-coordinate of the starting point, not less than 0. + * @param { int } starty - the y-coordinate of the starting point, not less than 0. + * @param { int } endx - the x-coordinate of the ending point, not less than 0. + * @param { int } endy - the y-coordinate of the ending point, not less than 0. + * @param { int } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3939,7 +3937,7 @@ * @test * @arkts 1.1&1.2 */ - swipe(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise; + swipe(startx: int, starty: int, endx: int, endy: int, speed?: int): Promise; /** * Drag on the screen between the specified points. @@ -3959,11 +3957,11 @@ /** * Drag on the screen between the specified points. * - * @param { number } startx - the x-coordinate of the starting point, not less than 0. - * @param { number } starty - the y-coordinate of the starting point, not less than 0. - * @param { number } endx - the x-coordinate of the ending point, not less than 0. - * @param { number } endy - the y-coordinate of the ending point, not less than 0. - * @param { number } [speed] the speed of drag(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. + * @param { int } startx - the x-coordinate of the starting point, not less than 0. + * @param { int } starty - the y-coordinate of the starting point, not less than 0. + * @param { int } endx - the x-coordinate of the ending point, not less than 0. + * @param { int } endy - the y-coordinate of the ending point, not less than 0. + * @param { int } [speed] the speed of drag(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3973,7 +3971,7 @@ * @test * @arkts 1.1&1.2 */ - drag(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise; + drag(startx: int, starty: int, endx: int, endy: int, speed?: int): Promise; /** * Capture current screen and save as picture which PNG format. @@ -4178,8 +4176,8 @@ /** * Wait for the UI become idle. * - * @param { number } idleTime - the threshold of UI idle time, in millisecond, not less than 0. - * @param { number } timeout - the maximum time to wait for idle, in millisecond, not less than 0. + * @param { int } idleTime - the threshold of UI idle time, in millisecond, not less than 0. + * @param { int } timeout - the maximum time to wait for idle, in millisecond, not less than 0. * @returns { Promise } true if wait for idle succeed in the timeout, false otherwise. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4189,7 +4187,7 @@ * @test * @arkts 1.1&1.2 */ - waitForIdle(idleTime: number, timeout: number): Promise; + waitForIdle(idleTime: int, timeout: int): Promise; /** * Inject fling on the device display. @@ -4225,8 +4223,8 @@ * * @param { Point } from - the coordinate point where the finger touches the screen. * @param { Point } to - the coordinate point where the finger leaves the screen. - * @param { number } stepLen - the length of each step, in pixels. - * @param { number } [speed] - the speed of fling(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. + * @param { int } stepLen - the length of each step, in pixels. + * @param { int } [speed] - the speed of fling(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4237,7 +4235,7 @@ * @test * @arkts 1.1&1.2 */ - fling(from: Point, to: Point, stepLen: number, speed: number): Promise; + fling(from: Point, to: Point, stepLen: int, speed: int): Promise; /** * Inject multi-pointer action on the device display. @@ -4255,7 +4253,7 @@ * Inject multi-pointer action on the device display. * * @param { PointerMatrix } pointers - the two-dimensional array of pointers to inject. - * @param { number } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. + * @param { int } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. * @returns { Promise } true if the operation finished, false * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4266,7 +4264,7 @@ * @test * @arkts 1.1&1.2 */ - injectMultiPointerAction(pointers: PointerMatrix, speed?: number): Promise; + injectMultiPointerAction(pointers: PointerMatrix, speed?: int): Promise; /** * Inject fling on the device display. @@ -4297,7 +4295,7 @@ * Inject fling on the device display. * * @param { UiDirection } direction - the direction of this action. - * @param { number } speed - the speed of fling (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range. + * @param { int } speed - the speed of fling (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4308,7 +4306,7 @@ * @test * @arkts 1.1&1.2 */ - fling(direction: UiDirection, speed: number): Promise; + fling(direction: UiDirection, speed: int): Promise; /** * Click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. @@ -4329,8 +4327,8 @@ * * @param { Point } p - the coordinate of the specified location. * @param { MouseButton } btnId - the button of Mouse. - * @param { number } [key1] - the first keyCode,set it default 0 if null or undefined. - * @param { number } [key2] - the second keyCode,set it default 0 if null or undefined. + * @param { int } [key1] - the first keyCode,set it default 0 if null or undefined. + * @param { int } [key2] - the second keyCode,set it default 0 if null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4340,7 +4338,7 @@ * @test * @arkts 1.1&1.2 */ - mouseClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise; + mouseClick(p: Point, btnId: MouseButton, key1?: int, key2?: int): Promise; /** * Move the mouse cursor to the specified location. @@ -4388,9 +4386,9 @@ * * @param { Point } p - the coordinate of the specified location. * @param { boolean } down - whether the mouse wheel rolls down. - * @param { number } d - the number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels. - * @param { number } [key1] - the first keyCode,set it default 0 if null or undefined. - * @param { number } [key2] - the second keyCode,set it default 0 if null or undefined. + * @param { int } d - the number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels. + * @param { int } [key1] - the first keyCode,set it default 0 if null or undefined. + * @param { int } [key2] - the second keyCode,set it default 0 if null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4400,17 +4398,17 @@ * @test * @arkts 1.1&1.2 */ - mouseScroll(p: Point, down: boolean, d: number, key1?: number, key2?: number): Promise; + mouseScroll(p: Point, down: boolean, d: int, key1?: int, key2?: int): Promise; /** * The mouse wheel scrolls the specified cell at the specified position, and press the specified key simultaneously if necessary. * * @param { Point } p - the coordinate of the specified location. * @param { boolean } down - whether the mouse wheel rolls down. - * @param { number } d - the number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels. - * @param { number } [key1] - the first keyCode,set it default 0 if null or undefined. - * @param { number } [key2] - the second keyCode,set it default 0 if null or undefined. - * @param { number } [speed] - The Speed of mouse wheel rolls(cells per second),ranges from 1 to 500.Set it default 20 if out of range or null or undefined. + * @param { int } d - the number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels. + * @param { int } [key1] - the first keyCode,set it default 0 if null or undefined. + * @param { int } [key2] - the second keyCode,set it default 0 if null or undefined. + * @param { int } [speed] - The Speed of mouse wheel rolls(cells per second),ranges from 1 to 500.Set it default 20 if out of range or null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4420,7 +4418,7 @@ * @test * @arkts 1.1&1.2 */ - mouseScroll(p: Point, down: boolean, d: number, key1?: number, key2?: number, speed?: number): Promise; + mouseScroll(p: Point, down: boolean, d: int, key1?: int, key2?: int, speed?: int): Promise; /** * Capture the specified area of current screen and save as picture which PNG format. @@ -4477,8 +4475,8 @@ * * @param { Point } p - the coordinate of the specified location. * @param { MouseButton } btnId - the button of Mouse. - * @param { number } [key1] - the first keyCode,set it default 0 if null or undefined. - * @param { number } [key2] - the second keyCode,set it default 0 if null or undefined. + * @param { int } [key1] - the first keyCode,set it default 0 if null or undefined. + * @param { int } [key2] - the second keyCode,set it default 0 if null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4488,15 +4486,15 @@ * @test * @arkts 1.1&1.2 */ - mouseDoubleClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise; + mouseDoubleClick(p: Point, btnId: MouseButton, key1?: int, key2?: int): Promise; /** * Long click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. * * @param { Point } p - the coordinate of the specified location. * @param { MouseButton } btnId - the button of Mouse. - * @param { number } [key1] - the first keyCode,set it default 0 if null or undefined. - * @param { number } [key2] - the second keyCode,set it default 0 if null or undefined. + * @param { int } [key1] - the first keyCode,set it default 0 if null or undefined. + * @param { int } [key2] - the second keyCode,set it default 0 if null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4506,14 +4504,14 @@ * @test * @arkts 1.1&1.2 */ - mouseLongClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise; + mouseLongClick(p: Point, btnId: MouseButton, key1?: int, key2?: int): Promise; /** * Swipe on the screen between the specified points with mouse. * * @param { Point } from - the starting point. * @param { Point } to - the ending point. - * @param { number } [speed] - speed of swipe (pixels per second),the value ranges from 200 to 40000.Set it default 600 if out of range or null or undefined. + * @param { int } [speed] - speed of swipe (pixels per second),the value ranges from 200 to 40000.Set it default 600 if out of range or null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4523,14 +4521,14 @@ * @test * @arkts 1.1&1.2 */ - mouseMoveWithTrack(from: Point, to: Point, speed?: number): Promise; + mouseMoveWithTrack(from: Point, to: Point, speed?: int): Promise; /** * Hold down the left mouse button and drag on the screen between the specified points. * * @param { Point } from - the starting point. * @param { Point } to - the ending point. - * @param { number } [speed] - speed of drag (pixels per second),the value ranges from 200 to 40000,Set it default 600 if out of range or null or undefined. + * @param { int } [speed] - speed of drag (pixels per second),the value ranges from 200 to 40000,Set it default 600 if out of range or null or undefined. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4540,7 +4538,7 @@ * @test * @arkts 1.1&1.2 */ - mouseDrag(from: Point, to: Point, speed?: number): Promise; + mouseDrag(from: Point, to: Point, speed?: int): Promise; /** * Inject text on the specified location. @@ -4560,7 +4558,7 @@ /** * Simulate touchpad multi-finger swipe gestures. - * @param { number } fingers Finger count of touchpad multi-finger swipe, ranges from 3 to 4. + * @param { int } fingers Finger count of touchpad multi-finger swipe, ranges from 3 to 4. * @param { UiDirection } direction Direction of touchpad multi-finger swipe. * @param { TouchPadSwipeOptions } [options] Additional options touchpad multi-finger swipe gestures, set its parameters to default values if null or undefined. * @returns { Promise } @@ -4573,7 +4571,7 @@ * @test * @arkts 1.1&1.2 */ - touchPadMultiFingerSwipe(fingers: number, direction: UiDirection, options?: TouchPadSwipeOptions): Promise; + touchPadMultiFingerSwipe(fingers: int, direction: UiDirection, options?: TouchPadSwipeOptions): Promise; /** * Simulate pen click operation. @@ -4592,7 +4590,7 @@ /** * Simulate pen long click operation. * @param { Point } point Coordinate of the specified location. - * @param { number } [pressure] Pressure of pen long click operation, default is 1.0, the value ranges from 0.0 to 1.0. + * @param { double } [pressure] Pressure of pen long click operation, default is 1.0, the value ranges from 0.0 to 1.0. * @returns { Promise } * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 The async function is not called with await. @@ -4602,7 +4600,7 @@ * @test * @arkts 1.1&1.2 */ - penLongClick(point: Point, pressure?: number): Promise; + penLongClick(point: Point, pressure?: double): Promise; /** * Simulate pen double click operation. @@ -4622,8 +4620,8 @@ * Simulate pen swipe operation. * @param { Point } startPoint Coordinate of the specified location. * @param { Point } endPoint Coordinate of the specified location. - * @param { number } [speed] Speed(pixels per second) of pen swipe, default is 600,the value ranges from 200 to 40000,set it 600 if out of range. - * @param { number } [pressure] Pressure of pen swipe operation, default is 1.0, the value ranges from 0.0 to 1.0. + * @param { int } [speed] Speed(pixels per second) of pen swipe, default is 600,the value ranges from 200 to 40000,set it 600 if out of range. + * @param { double } [pressure] Pressure of pen swipe operation, default is 1.0, the value ranges from 0.0 to 1.0. * @returns { Promise } * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 The async function is not called with await. @@ -4633,13 +4631,13 @@ * @test * @arkts 1.1&1.2 */ - penSwipe(startPoint: Point, endPoint: Point, speed?: number, pressure?: number): Promise; + penSwipe(startPoint: Point, endPoint: Point, speed?: int, pressure?: double): Promise; /** * Inject pen multi-pointer action on the device display. * @param { PointerMatrix } pointers The two-dimensional array of pointers to inject. - * @param { number } [speed] Speed(pixels per second) of inject pen pointer action, default is 600,the value ranges from 200 to 40000,set it 600 if out of range. - * @param { number } [pressure] Pressure of inject pen pointer action operation, default is 1.0, the value ranges from 0.0 to 1.0. + * @param { int } [speed] Speed(pixels per second) of inject pen pointer action, default is 600,the value ranges from 200 to 40000,set it 600 if out of range. + * @param { double } [pressure] Pressure of inject pen pointer action operation, default is 1.0, the value ranges from 0.0 to 1.0. * @returns { Promise } * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 The async function is not called with await. @@ -4649,7 +4647,7 @@ * @test * @arkts 1.1&1.2 */ - injectPenPointerAction(pointers: PointerMatrix, speed?: number, pressure?: number): Promise; + injectPenPointerAction(pointers: PointerMatrix, speed?: int, pressure?: double): Promise; } /** @@ -4805,7 +4803,6 @@ * @throws { BusinessError } 17000002 - The async function is not called with await. * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. * @syscap SystemCapability.Test.UiTest - * @since 11 * @deprecated since 11 * @useinstead ohos.UiTest.UiWindow#isActive * @test @@ -4853,8 +4850,8 @@ /** * Move this {@link UiWindow} to the specified points. * - * @param { number } x - the x coordinate of destination, not less than 0. - * @param { number } y - the y coordinate of destination, not less than 0. + * @param { int } x - the x coordinate of destination, not less than 0. + * @param { int } y - the y coordinate of destination, not less than 0. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -4866,7 +4863,7 @@ * @test * @arkts 1.1&1.2 */ - moveTo(x: number, y: number): Promise; + moveTo(x: int, y: int): Promise; /** * Resize this {@link UiWindow} to the specified size for the specified direction. @@ -4886,8 +4883,8 @@ /** * Resize this {@link UiWindow} to the specified size for the specified direction. * - * @param { number } wide - the expected wide of the window after resizing. - * @param { number } height - the expected height of the window after resizing. + * @param { int } wide - the expected wide of the window after resizing. + * @param { int } height - the expected height of the window after resizing. * @param { ResizeDirection } direction - the expected direction of the window after resizing. * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. @@ -4900,7 +4897,7 @@ * @test * @arkts 1.1&1.2 */ - resize(wide: number, height: number, direction: ResizeDirection): Promise; + resize(wide: int, height: int, direction: ResizeDirection): Promise; /** * Change this {@link UiWindow} into split screen mode. @@ -5081,8 +5078,8 @@ /** * Create an {@link PointerMatrix} object. * - * @param { number } fingers - The number of fingers, ranges from 1 to 10. - * @param { number } steps - The number of steps of each finger trace, ranges from 1 to 1000. + * @param { int } fingers - The number of fingers, ranges from 1 to 10. + * @param { int } steps - The number of steps of each finger trace, ranges from 1 to 1000. * @returns { PointerMatrix } the {@link PointerMatrix} object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Test.UiTest @@ -5092,7 +5089,7 @@ * @test * @arkts 1.1&1.2 */ - static create(fingers: number, steps: number): PointerMatrix; + static create(fingers: int, steps: int): PointerMatrix; /** * Set the point value of an element in the PointerMatrix. @@ -5108,8 +5105,8 @@ /** * Set the point value of an element in the PointerMatrix. * - * @param { number } finger - the index of target finger to set. - * @param { number } step - the index of target step to set. + * @param { int } finger - the index of target finger to set. + * @param { int } step - the index of target step to set. * @param { Point } point - the coordinate of target step to set. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Test.UiTest @@ -5119,7 +5116,7 @@ * @test * @arkts 1.1&1.2 */ - setPoint(finger: number, step: number, point: Point): void; + setPoint(finger: int, step: int, point: Point): void; } /** -- Gitee From 82133157d92c34ae8fbc8611b03a93863ac442fd Mon Sep 17 00:00:00 2001 From: chen828 Date: Fri, 4 Jul 2025 07:59:04 +0000 Subject: [PATCH 2/3] update api/@ohos.UiTest.d.ts. Signed-off-by: chen828 --- api/@ohos.UiTest.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/@ohos.UiTest.d.ts b/api/@ohos.UiTest.d.ts index 719b6c2765..be6f387dfc 100755 --- a/api/@ohos.UiTest.d.ts +++ b/api/@ohos.UiTest.d.ts @@ -1389,6 +1389,7 @@ * * @type { ?boolean } * @syscap SystemCapability.Test.UiTest + * @since 11 * @deprecated since 11 * @useinstead ohos.UiTest.WindowFilter#active */ @@ -4803,6 +4804,7 @@ * @throws { BusinessError } 17000002 - The async function is not called with await. * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. * @syscap SystemCapability.Test.UiTest + * @since 11 * @deprecated since 11 * @useinstead ohos.UiTest.UiWindow#isActive * @test -- Gitee From e7111c68321f15ee2065b9b936e91a8bff60ffdf Mon Sep 17 00:00:00 2001 From: chen828 Date: Fri, 4 Jul 2025 10:07:30 +0000 Subject: [PATCH 3/3] update api/@ohos.UiTest.d.ts. Signed-off-by: chen828 --- api/@ohos.UiTest.d.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/api/@ohos.UiTest.d.ts b/api/@ohos.UiTest.d.ts index be6f387dfc..49b2b4d875 100755 --- a/api/@ohos.UiTest.d.ts +++ b/api/@ohos.UiTest.d.ts @@ -3300,8 +3300,6 @@ * @throws { BusinessError } 17000002 - The async function is not called with await. * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. * @syscap SystemCapability.Test.UiTest - * @crossplatform - * @atomicservice * @since 20 * @test * @arkts 1.2 @@ -3335,7 +3333,6 @@ * @throws { BusinessError } 17000002 - The async function is not called with await. * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. * @syscap SystemCapability.Test.UiTest - * @atomicservice * @since 20 * @test * @arkts 1.2 @@ -3489,7 +3486,6 @@ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest - * @atomicservice * @since 20 * @test * @arkts 1.2 @@ -3528,7 +3524,6 @@ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest - * @atomicservice * @since 20 * @test * @arkts 1.2 @@ -3570,7 +3565,6 @@ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest - * @atomicservice * @since 20 * @test * @arkts 1.2 @@ -3623,7 +3617,6 @@ * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest - * @atomicservice * @since 20 * @test * @arkts 1.2 -- Gitee