diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index ab35bab22f9c72fd3d3f1a899daef11722d14426..a845cf03a286f946d7f74d1c82ed391903efc91f 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7597,11 +7597,21 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 dynamic */ on(type: 'windowEvent', callback: Callback): void; + /** + * Subscribes to the window lifecycle change event. + * + * @param { Callback } callback - Callback used to return the window lifecycle state. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 22 static + */ + onWindowEvent(callback: Callback): void; + /** * Unregister the callback of windowEvent * @@ -7624,11 +7634,22 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 dynamic */ off(type: 'windowEvent', callback?: Callback): void; + /** + * Unsubscribes from the window lifecycle change event. + * + * @param { Callback } [callback] - Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 22 static + */ + offWindowEvent(callback?: Callback): void; + /** * Register the callback of windowStatusChange * @@ -11947,10 +11968,23 @@ declare namespace window { * @StageModelOnly * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 dynamic */ on(eventType: 'windowStageEvent', callback: Callback): void; + + /** + * Subscribes to the window stage lifecycle change event. + * + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300005 - This window stage is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @StageModelOnly + * @crossplatform + * @atomicservice + * @since 22 static + */ + onWindowStageEvent(callback: Callback): void; + /** * Window stage event callback off. * @@ -11993,11 +12027,25 @@ declare namespace window { * @StageModelOnly * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 dynamic */ off(eventType: 'windowStageEvent', callback?: Callback): void; + /** + * Unsubscribes from the window stage lifecycle change event. + * + * @param { Callback } [callback] - Unregister the callback function. + * If not provided, all callbacks for the given event type will be removed. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300005 - This window stage is abnormal. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @StageModelOnly + * @crossplatform + * @atomicservice + * @since 22 static + */ + offWindowStageEvent(callback?: Callback): void; + /** * Subscribes to the window stage lifecycle change event. * @@ -12011,10 +12059,25 @@ declare namespace window { * @throws { BusinessError } 1300005 - This window stage is abnormal. * @syscap SystemCapability.Window.SessionManager * @stagemodelonly - * @since 20 + * @since 20 dynamic */ on(eventType: 'windowStageLifecycleEvent', callback: Callback): void; + /** + * Subscribes to the window stage lifecycle change event. + * + * @param { Callback } callback Callback used to + * return the window stage lifecycle state. + * @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 } 1300005 - This window stage is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @stagemodelonly + * @since 22 static + */ + onWindowStageLifecycleEvent(callback: Callback): void; + /** * Unsubscribes from the window stage lifecycle change event. * @@ -12030,10 +12093,25 @@ declare namespace window { * @throws { BusinessError } 1300005 - This window stage is abnormal. * @syscap SystemCapability.Window.SessionManager * @stagemodelonly - * @since 20 + * @since 20 dynamic */ off(eventType: 'windowStageLifecycleEvent', callback?: Callback): void; + /** + * Unsubscribes from the window stage lifecycle change event. + * + * @param { Callback } [callback] - Unregister the callback function. + * 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 } 1300005 - This window stage is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @stagemodelonly + * @since 20 static + */ + offWindowStageLifecycleEvent(callback?: Callback): void; + /** * Subscribes to the click event on the close button in the three-button navigation bar of the main window. * This event is triggered when the close button in the three-button navigation bar of the main window is clicked.