diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index d3fffd2bfdf4f893ed5642514928fd3f6958885b..274dd84f307fe85a1ba2e85d9243f6224c5f4f31 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -10182,11 +10182,27 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 + * */ startMoving(): Promise; + /** + * Starts moving this window. This API uses a promise to return the result. + * The window moves along with the cursor only when this API is called in the callback function of onTouch, where the event type is TouchType.Down. + * + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300001 - Repeated operation. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @throws { BusinessError } 1300004 - Unauthorized operation. + * @syscap SystemCapability.Window.SessionManager + * @since 20 + * @arkts 1.2 + */ + startMovingWithNoArgs(): Promise; + /** * Specifies the cursor position within the window and moves the window. It first adjusts the window to the cursor position before starting to move the window. * The window moves along with the cursor only when this API is called in the callback function of onTouch, where the event type is TouchType.Down. @@ -10207,11 +10223,41 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'15', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 + * */ startMoving(offsetX: int, offsetY: int): Promise; + /** + * Specifies the cursor position within the window and moves the window. It first adjusts the window to the cursor position before starting to move the window. + * The window moves along with the cursor only when this API is called in the callback function of onTouch, where the event type is TouchType.Down. + * + * @param { number } offsetX - X-axis offset of the cursor position relative to the upper left corner of the window during movement, measured in px. + * This parameter only accepts integer values; any floating-point input will be rounded down. + * Negative values or values exceeding the window width are invalid. The window width can be obtained from WindowProperties. + * @param { number } offsetY - Y-axis offset of the cursor position relative to the upper left corner of the window during movement, measured in px. + * This parameter only accepts integer values; any floating-point input will be rounded down. + * Negative values or values exceeding the window height are invalid. The window height can be obtained from WindowProperties. + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300001 - Repeated operation. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @throws { BusinessError } 1300004 - Unauthorized operation. + * @syscap SystemCapability.Window.SessionManager + * @since 20 + * @arkts 1.2 + */ + startMovingWithOffsetXOffsetY(offsetX: number, offsetY: number): Promise; + + /** + * @since 20 + * @arkts 1.2 + */ + overload startMoving { startMovingWithNoArgs, startMovingWithOffsetXOffsetY }; + /** * Stops window movement when a window is being dragged. This API uses a promise to return the result. *