From 6852f2ff929f0ce7c9a53690dffce1626521878c Mon Sep 17 00:00:00 2001 From: yyuehao Date: Wed, 10 Sep 2025 06:29:01 +0000 Subject: [PATCH] =?UTF-8?q?update=20api/@ohos.window.d.ts.=20overload?= =?UTF-8?q?=E6=95=B4=E6=94=B9=E5=87=BD=E6=95=B0=E5=AD=97=E9=9D=A2=E9=87=8F?= =?UTF-8?q?=E5=85=A5=E5=8F=82=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yyuehao --- api/@ohos.window.d.ts | 144 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 127 insertions(+), 17 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 6dc429c950..8c0f2035cc 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7664,7 +7664,23 @@ declare namespace window { * @since arkts {'1.1':'20', '1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'windowStatusChange', callback: Callback): void; + /** + * Register the callback of windowStatusChange + * + * @param { Callback } callback - Callback used to return the window status. + * @throws { BusinessError } 401 - Parameter error. Possible cause: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. + * @syscap SystemCapability.Window.SessionManager + * @crossplatform + * @atomicservice + * @since 22 + * @arkts 1.1&1.2 + */ + onWindowStatusChange(callback: Callback): void; /** * Unregister the callback of windowStatusChange @@ -7703,7 +7719,22 @@ declare namespace window { * @since arkts {'1.1':'20', '1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'windowStatusChange', callback?: Callback): void; + /** + * Unregister the callback of windowStatusChange + * + * @param { Callback } callback - Callback used to return the window status. + * @throws { BusinessError } 401 - Parameter error. Possible cause: + * 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. + * @syscap SystemCapability.Window.SessionManager + * @crossplatform + * @atomicservice + * @since 22 + * @arkts 1.1&1.2 + */ + offWindowStatusChange(callback?: Callback): void; /** * Register the callback of windowStatusDidChange @@ -7715,7 +7746,17 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @since 20 */ - on(type: 'windowStatusDidChange', callback: Callback): void; + /** + * Register the callback of windowStatusDidChange + * + * @param { Callback } callback - Callback used to return the window status. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @since 22 + */ + onWindowStatusDidChange(callback: Callback): void; /** * Unregister the callback of windowStatusDidChange @@ -7727,7 +7768,16 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @since 20 */ - off(type: 'windowStatusDidChange', callback?: Callback): void; + /** + * Unregister the callback of windowStatusDidChange + * + * @param { Callback } [callback] - Callback used to return the window status. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @since 22 + */ + offWindowStatusDidChange(callback?: Callback): void; /** * Subscribes to the event indicating that the child window is closed. @@ -10556,12 +10606,15 @@ declare namespace window { /** * Register the callback of windowRectChange * - * @param { 'windowRectChange' } type - The value is fixed at 'windowRectChange', indicating the window rect change event. + * @param { 'windowRectChange' } type - The value is fixed at 'windowRectChange', + * indicating the window rect change event. * @param { Callback } callback - Callback used to return the RectChangeOptions. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; - * 3. Parameter verification failed. - * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 401 - Parameter error. Possible cause: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager @@ -10569,16 +10622,36 @@ declare namespace window { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'windowRectChange', callback: Callback): void; + /** + * Register the callback of windowRectChange + * + * @param { Callback } callback - Callback used to return the RectChangeOptions. + * @throws { BusinessError } 401 - Parameter error. Possible cause: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 + * @arkts 1.1&1.2 + */ + onWindowRectChange(callback: Callback): void; /** * Unregister the callback of windowRectChange * - * @param { 'windowRectChange' } type - The value is fixed at 'windowRectChange', indicating the window rect change event. + * @param { 'windowRectChange' } type - The value is fixed at 'windowRectChange', + * indicating the window rect change event. * @param { Callback } callback - Callback used to return the RectChangeOptions. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; - * 2. Parameter verification failed. - * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 401 - Parameter error. Possible cause: + * 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager @@ -10586,7 +10659,23 @@ declare namespace window { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'windowRectChange', callback?: Callback): void; + /** + * Unregister the callback of windowRectChange + * + * @param { Callback } callback - Callback used to return the RectChangeOptions. + * @throws { BusinessError } 401 - Parameter error. Possible cause: + * 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 + * @arkts 1.1&1.2 + */ + offWindowRectChange(callback?: Callback): void; /** * Register the callback of rectChangeInGlobalDisplay @@ -10599,7 +10688,18 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @since 20 */ - on(type: 'rectChangeInGlobalDisplay', callback: Callback): void; + /** + * Register the callback of rectChangeInGlobalDisplay + * + * @param { Callback } callback - Callback used to return the RectChangeOptions. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @since 20 + */ + onRectChangeInGlobalDisplay(callback: Callback): void; /** * Unregister the callback of rectChangeInGlobalDisplay @@ -10612,7 +10712,17 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @since 20 */ - off(type: 'rectChangeInGlobalDisplay', callback?: Callback): void; + /** + * Unregister the callback of rectChangeInGlobalDisplay + * + * @param { Callback } [callback] - Callback used to return the RectChangeOptions. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @since 22 + */ + offRectChangeInGlobalDisplay(callback?: Callback): void; /** * Convert the window coordinates to the global coordinates. -- Gitee