diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 69d0beedad1e139ad9a900b986a8cdb2fdcf76d0..dab3a6c38a1cd23341f1d8363ff728809f99e000 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -3515,6 +3515,7 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 12 dynamic + * @since 22 static */ function setWindowLayoutMode(mode: WindowLayoutMode, callback: AsyncCallback): void; @@ -3544,6 +3545,7 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 12 dynamic + * @since 22 static */ function setWindowLayoutMode(mode: WindowLayoutMode): Promise; @@ -5256,8 +5258,8 @@ declare namespace window { /** * Move window to the position. * - * @param { number } x - Indicate the X-coordinate of the window. - * @param { number } y - Indicate the Y-coordinate of the window. + * @param { int } x - Indicate the X-coordinate of the window. + * @param { int } y - Indicate the Y-coordinate of the window. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -5269,15 +5271,17 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic + * @since 22 static */ - moveWindowToAsync(x: number, y: number): Promise; + moveWindowToAsync(x: int, y: int): Promise; /** * Move window to the position. * - * @param { number } x - Indicate the X-coordinate of the window. - * @param { number } y - Indicate the Y-coordinate of the window. - * @param { ?MoveConfiguration } moveConfiguration - Indicate the window move configuration. + * @param { int } x - Indicate the X-coordinate of the window. + * @param { int } y - Indicate the Y-coordinate of the window. + * @param { ?MoveConfiguration } [moveConfiguration] - Indicate the window move configuration. + * If not provided, the window stays on the current display. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -5289,14 +5293,15 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 15 dynamic + * @since 22 static */ - moveWindowToAsync(x: number, y: number, moveConfiguration?: MoveConfiguration): Promise; + moveWindowToAsync(x: int, y: int, moveConfiguration?: MoveConfiguration): Promise; /** * Move window to the position relative to current screen. * - * @param { number } x - Indicate the X-coordinate of the window relative to current screen. - * @param { number } y - Indicate the Y-coordinate of the window relative to current screen. + * @param { int } x - Indicate the X-coordinate of the window relative to current screen. + * @param { int } y - Indicate the Y-coordinate of the window relative to current screen. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -5308,15 +5313,17 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 13 dynamic + * @since 22 static */ - moveWindowToGlobal(x: number, y: number): Promise; + moveWindowToGlobal(x: int, y: int): Promise; /** * Move window to the position relative to current screen. * - * @param { number } x - Indicate the X-coordinate of the window relative to current screen. - * @param { number } y - Indicate the Y-coordinate of the window relative to current screen. - * @param { ?MoveConfiguration } moveConfiguration - Indicate the window move configuration. + * @param { int } x - Indicate the X-coordinate of the window relative to current screen. + * @param { int } y - Indicate the Y-coordinate of the window relative to current screen. + * @param { ?MoveConfiguration } [moveConfiguration] - Indicate the window move configuration. + * If not provided, the window stays on the current display. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -5328,14 +5335,15 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 15 dynamic + * @since 22 static */ - moveWindowToGlobal(x: number, y: number, moveConfiguration?: MoveConfiguration): Promise; + moveWindowToGlobal(x: int, y: int, moveConfiguration?: MoveConfiguration): Promise; /** * Move window to the position relative to the main screen. * - * @param { number } x - Indicate the X-coordinate of the window relative to the main screen. - * @param { number } y - Indicate the Y-coordinate of the window relative to the main screen. + * @param { int } x - Indicate the X-coordinate of the window relative to the main screen. + * @param { int } y - Indicate the Y-coordinate of the window relative to the main screen. * @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 } 1300002 - This window state is abnormal. @@ -5344,8 +5352,9 @@ declare namespace window { * @throws { BusinessError } 1300016 - Parameter error. Possible cause: 1.Invalid parameter range. * @syscap SystemCapability.Window.SessionManager * @since 20 dynamic + * @since 22 static */ - moveWindowToGlobalDisplay(x: number, y: number): Promise; + moveWindowToGlobalDisplay(x: int, y: int): Promise; /** * Set the size of a window . @@ -5472,8 +5481,8 @@ declare namespace window { /** * Set the size of a window. * - * @param { number } width - Indicates the width of the window. The width should be greater than 0. - * @param { number } height - Indicates the height of the window. The height should be greater than 0. + * @param { int } width - Indicates the width of the window. The width should be greater than 0. + * @param { int } height - Indicates the height of the window. The height should be greater than 0. * @returns { Promise } Promise that returns no value. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -5485,8 +5494,9 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic + * @since 22 static */ - resizeAsync(width: number, height: number): Promise; + resizeAsync(width: int, height: int): Promise; /** * Set whether to follow parent window layout. Only sub windows and dialogs are available. @@ -5504,6 +5514,7 @@ declare namespace window { * @stagemodelonly * @atomicservice * @since 17 dynamic + * @since 22 static */ setFollowParentWindowLayoutEnabled(enabled: boolean): Promise; @@ -5582,6 +5593,7 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 12 dynamic + * @since 22 static */ setWindowMode(mode: WindowMode): Promise; @@ -5613,6 +5625,7 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 12 dynamic + * @since 22 static */ setWindowMode(mode: WindowMode, callback: AsyncCallback): void; @@ -8851,6 +8864,7 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi * @since 9 dynamic + * @since 22 static */ setForbidSplitMove(isForbidSplitMove: boolean, callback: AsyncCallback): void; @@ -8867,6 +8881,7 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi * @since 9 dynamic + * @since 22 static */ setForbidSplitMove(isForbidSplitMove: boolean): Promise; @@ -9327,7 +9342,7 @@ declare namespace window { /** * Sets the aspect ratio of window * - * @param { number } ratio - The aspect ratio of window except decoration + * @param { double } ratio - The aspect ratio of window except decoration * @param { AsyncCallback } callback - The callback of setAspectRatio. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -9340,7 +9355,7 @@ declare namespace window { /** * Sets the aspect ratio of window * - * @param { number } ratio - The aspect ratio of window except decoration + * @param { double } ratio - The aspect ratio of window except decoration * @param { AsyncCallback } callback - The callback of setAspectRatio. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -9350,13 +9365,14 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 12 dynamic + * @since 22 static */ - setAspectRatio(ratio: number, callback: AsyncCallback): void; + setAspectRatio(ratio: double, callback: AsyncCallback): void; /** * Sets the aspect ratio of window * - * @param { number } ratio - The aspect ratio of window except decoration + * @param { double } ratio - The aspect ratio of window except decoration * @returns { Promise } - The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -9369,7 +9385,7 @@ declare namespace window { /** * Sets the aspect ratio of window * - * @param { number } ratio - The aspect ratio of window except decoration + * @param { double } ratio - The aspect ratio of window except decoration * @returns { Promise } - The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -9379,8 +9395,9 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 12 dynamic + * @since 22 static */ - setAspectRatio(ratio: number): Promise; + setAspectRatio(ratio: double): Promise; /** * Resets the aspect ratio of window @@ -9400,6 +9417,7 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 12 dynamic + * @since 22 static */ resetAspectRatio(callback: AsyncCallback): void; @@ -9421,6 +9439,7 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @atomicservice * @since 12 dynamic + * @since 22 static */ resetAspectRatio(): Promise; @@ -9658,6 +9677,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 14 dynamic + * @since 22 static */ setResizeByDragEnabled(enable: boolean, callback: AsyncCallback): void; @@ -9674,6 +9694,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 14 dynamic + * @since 22 static */ setResizeByDragEnabled(enable: boolean): Promise; @@ -9733,6 +9754,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic + * @since 22 static */ getWindowLimits(): WindowLimits; @@ -9766,6 +9788,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic + * @since 22 static */ setWindowLimits(windowLimits: WindowLimits): Promise; @@ -9785,6 +9808,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 15 dynamic + * @since 22 static */ setWindowLimits(windowLimits: WindowLimits, isForcible: boolean): Promise; @@ -10256,6 +10280,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 15 dynamic + * @since 22 static */ stopMoving(): Promise; @@ -10286,6 +10311,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @since 20 dynamic + * @since 22 static */ enableDrag(enable: boolean): Promise; @@ -10480,8 +10506,8 @@ declare namespace window { /** * Convert the window coordinates to the global coordinates. * - * @param { number } winX - Indicate the X-coordinate of the component relative to the current window. - * @param { number } winY - Indicate the Y-coordinate of the component relative to the current window. + * @param { int } winX - Indicate the X-coordinate of the component relative to the current window. + * @param { int } winY - Indicate the Y-coordinate of the component relative to the current window. * @returns { Promise } Promise used to return the Position. The pair {x, y} represents respectively the X-coordinate * and Y-coordinate of the window relative to the main screen. * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. @@ -10490,14 +10516,15 @@ declare namespace window { * @throws { BusinessError } 1300016 - Parameter error. Possible cause: 1.Invalid parameter range. * @syscap SystemCapability.Window.SessionManager * @since 20 dynamic + * @since 22 static */ - clientToGlobalDisplay(winX: number, winY: number): Promise; + clientToGlobalDisplay(winX: int, winY: int): Promise; /** * Convert the global coordinates to the window coordinates. * - * @param { number } globalDisplayX - Indicate the X-coordinate of the component relative to the main screen. - * @param { number } globalDisplayY - Indicate the Y-coordinate of the component relative to the main screen. + * @param { int } globalDisplayX - Indicate the X-coordinate of the component relative to the main screen. + * @param { int } globalDisplayY - Indicate the Y-coordinate of the component relative to the main screen. * @returns { Promise } Promise used to return the Position. The pair {x, y} represents respectively the X-coordinate * and Y-coordinate of the window relative to the current screen. * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. @@ -10506,8 +10533,9 @@ declare namespace window { * @throws { BusinessError } 1300016 - Parameter error. Possible cause: 1.Invalid parameter range. * @syscap SystemCapability.Window.SessionManager * @since 20 dynamic + * @since 22 static */ - globalDisplayToClient(globalDisplayX: number, globalDisplayY: number): Promise; + globalDisplayToClient(globalDisplayX: int, globalDisplayY: int): Promise; /** * Register the callback of rotation change @@ -10758,6 +10786,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 17 dynamic + * @since 22 static */ setFollowParentMultiScreenPolicy(enabled: boolean): Promise; @@ -12150,6 +12179,7 @@ declare namespace window { * @StageModelOnly * @atomicservice * @since 15 dynamic + * @since 22 static */ setSupportedWindowModes(supportedWindowModes: Array): Promise;