diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 69d0beedad1e139ad9a900b986a8cdb2fdcf76d0..76d6d981cbddbf8b985600842b1c7742c053f547 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -6733,10 +6733,20 @@ declare namespace window { * @crossplatform * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'windowSizeChange', callback: Callback): void; + /** + * Register the callback of windowSizeChange + * + * @param { Callback } callback - Callback used to return the window size. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 22 static + */ + onWindowSizeChange(callback: Callback): void; + /** * Unregister the callback of windowSizeChange * @@ -6762,17 +6772,29 @@ declare namespace window { * Unregister the callback of windowSizeChange * * @param { 'windowSizeChange' } type - The value is fixed at 'windowSizeChange', indicating the window size change event. - * @param { Callback } callback - Callback used to return the window size. + * @param { Callback } [callback] - Callback used to return the window size. + * If not provided, all callbacks for the given event type will be removed. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; * 2. Parameter verification failed. * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'windowSizeChange', callback?: Callback): void; + /** + * Unregister the callback of windowSizeChange + * + * @param { Callback } [callback] - Callback used to return the window size. + * If not provided, all callbacks for the given event type will be removed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 22 static + */ + offWindowSizeChange(callback?: Callback): void; + /** * Register the callback of systemAvoidAreaChange * @@ -7505,10 +7527,23 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @crossplatform * @atomicservice - * @since 20 dynamic&static + * @since 20 dynamic */ on(type: 'windowStatusChange', callback: Callback): void; + /** + * Register the callback of windowStatusChange + * + * @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. + * @syscap SystemCapability.Window.SessionManager + * @crossplatform + * @atomicservice + * @since 22 static + */ + onWindowStatusChange(callback: Callback): void; + /** * Unregister the callback of windowStatusChange * @@ -7536,17 +7571,32 @@ declare namespace window { * Unregister the callback of windowStatusChange * * @param { 'windowStatusChange' } type - The value is fixed at 'windowStatusChange', indicating the window status change event. - * @param { Callback } callback - Callback used to return the window status. + * @param { Callback } [callback] - Callback used to return the window status. + * If not provided, all callbacks for the given event type will be removed. * @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 20 dynamic&static + * @since 20 dynamic */ off(type: 'windowStatusChange', callback?: Callback): void; + /** + * Unregister the callback of windowStatusChange + * + * @param { Callback } [callback] - Callback used to return the window status. + * If not provided, all callbacks for the given event type will be removed. + * @throws { BusinessError } 801 - Capability not supported. + * Failed to call the API due to limited device capabilities. + * @syscap SystemCapability.Window.SessionManager + * @crossplatform + * @atomicservice + * @since 22 static + */ + offWindowStatusChange(callback?: Callback): void; + /** * Register the callback of windowStatusDidChange * @@ -7559,11 +7609,24 @@ declare namespace window { */ 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 static + */ + onWindowStatusDidChange(callback: Callback): void; + /** * Unregister the callback of windowStatusDidChange * * @param { 'windowStatusDidChange' } type - The value is fixed at 'windowStatusDidChange', indicating the window status change event. * @param { Callback } [callback] - Callback used to return the window status. + * If not provided, all callbacks for the given event type will be removed. * @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 @@ -7571,6 +7634,19 @@ declare namespace window { */ off(type: 'windowStatusDidChange', callback?: Callback): void; + /** + * Unregister the callback of windowStatusDidChange + * + * @param { Callback } [callback] - Callback used to return the window status. + * If not provided, all callbacks for the given event type will be removed. + * @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 static + */ + offWindowStatusDidChange(callback?: Callback): void; + /** * Subscribes to the event indicating that the child window is closed. * This event is triggered only when the user clicks the system-provided close button in the upper right corner to close the child window. @@ -10430,15 +10506,29 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'windowRectChange', callback: Callback): void; + /** + * Register the callback of windowRectChange + * + * @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 + * @atomicservice + * @since 22 static + */ + 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 { Callback } callback - Callback used to return the RectChangeOptions. + * @param { Callback } [callback] - Callback used to return the RectChangeOptions. + * If not provided, all callbacks for the given event type will be removed. * @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. @@ -10447,10 +10537,24 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'windowRectChange', callback?: Callback): void; + /** + * Unregister the callback of windowRectChange + * + * @param { Callback } [callback] - Callback used to return the RectChangeOptions. + * If not provided, all callbacks for the given event type will be removed. + * @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 static + */ + offWindowRectChange(callback?: Callback): void; + /** * Register the callback of rectChangeInGlobalDisplay * @@ -10464,11 +10568,25 @@ declare namespace window { */ 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 22 static + */ + onRectChangeInGlobalDisplay(callback: Callback): void; + /** * Unregister the callback of rectChangeInGlobalDisplay * * @param { 'rectChangeInGlobalDisplay' } type - The value is fixed at 'rectChangeInGlobalDisplay', indicating the window global rect change event. * @param { Callback } [callback] - Callback used to return the RectChangeOptions. + * If not provided, all callbacks for the given event type will be removed. * @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. @@ -10477,6 +10595,19 @@ declare namespace window { */ off(type: 'rectChangeInGlobalDisplay', callback?: Callback): void; + /** + * Unregister the callback of rectChangeInGlobalDisplay + * + * @param { Callback } [callback] - Callback used to return the RectChangeOptions. + * If not provided, all callbacks for the given event type will be removed. + * @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 static + */ + offRectChangeInGlobalDisplay(callback?: Callback): void; + /** * Convert the window coordinates to the global coordinates. *