From ccf7ba5495368138b888f90c3314a5cc36991095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=A0=91=E5=B1=B1?= Date: Fri, 12 Sep 2025 18:09:27 +0800 Subject: [PATCH 1/3] arkTS1.2 overload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈树山 --- api/@ohos.window.d.ts | 115 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 105 insertions(+), 10 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index ab35bab22f..d5bda5381e 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7597,11 +7597,24 @@ 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. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 22 static + */ + onWindowEvent(callback: Callback): void; + /** * Unregister the callback of windowEvent * @@ -7619,16 +7632,32 @@ declare namespace window { * @param { Callback } callback - Callback used to return the window lifecycle state. * If a value is passed in, the corresponding subscription is canceled. * If no value is passed in, all subscriptions to the specified event are canceled. + * 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 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 - Callback used to return the window lifecycle state. + * If a value is passed in, the corresponding subscription is canceled. + * If no value is passed in, all subscriptions to the specified event are canceled. + * 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 22 static + */ + offWindowEvent(callback?: Callback): void; + /** * Register the callback of windowStatusChange * @@ -11947,10 +11976,26 @@ 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 } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @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. * @@ -11985,6 +12030,7 @@ declare namespace window { * @param { Callback } callback Callback used to return the window stage lifecycle state. * If a value is passed in, the corresponding subscription is canceled. * If no value is passed in, all subscriptions to the specified event are canceled. + * 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 } 1300002 - This window state is abnormal. @@ -11993,11 +12039,28 @@ 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 Callback used to return the window stage lifecycle state. + * If a value is passed in, the corresponding subscription is canceled. + * If no value is passed in, all subscriptions to the specified event are canceled. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; + * 2. Parameter verification failed. + * @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 +12074,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 +12108,27 @@ 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] Callback used to + * return the window stage lifecycle state. + * If a value is passed in, the corresponding subscription is canceled. + * If no value is passed in, all subscriptions to the specified event are canceled. + * @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. -- Gitee From f298b5f7fa1688f11960f3f723514ab4d5cd5ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=A0=91=E5=B1=B1?= Date: Fri, 12 Sep 2025 18:15:26 +0800 Subject: [PATCH 2/3] arkTS1.2 overload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈树山 --- api/@ohos.window.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index d5bda5381e..dfb6c105a0 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7632,7 +7632,6 @@ declare namespace window { * @param { Callback } callback - Callback used to return the window lifecycle state. * If a value is passed in, the corresponding subscription is canceled. * If no value is passed in, all subscriptions to the specified event are canceled. - * 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 @@ -7648,7 +7647,6 @@ declare namespace window { * @param { Callback } callback - Callback used to return the window lifecycle state. * If a value is passed in, the corresponding subscription is canceled. * If no value is passed in, all subscriptions to the specified event are canceled. - * 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 @@ -12030,7 +12028,6 @@ declare namespace window { * @param { Callback } callback Callback used to return the window stage lifecycle state. * If a value is passed in, the corresponding subscription is canceled. * If no value is passed in, all subscriptions to the specified event are canceled. - * 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 } 1300002 - This window state is abnormal. -- Gitee From 73aaa1e80ce8d9d94b4c0c96ecdc67c65b26cd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=A0=91=E5=B1=B1?= Date: Sat, 13 Sep 2025 11:43:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=A3=80=E8=A7=86=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈树山 --- api/@ohos.window.d.ts | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index dfb6c105a0..a845cf03a2 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7605,9 +7605,6 @@ declare namespace window { * Subscribes to the window lifecycle change event. * * @param { Callback } callback - Callback used to return the window lifecycle state. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; - * 3. Parameter verification failed. * @syscap SystemCapability.WindowManager.WindowManager.Core * @crossplatform * @atomicservice @@ -7644,11 +7641,8 @@ declare namespace window { /** * Unsubscribes from the window lifecycle change event. * - * @param { Callback } callback - Callback used to return the window lifecycle state. - * If a value is passed in, the corresponding subscription is canceled. - * If no value is passed in, all subscriptions to the specified event are canceled. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; - * 2. Parameter verification failed. + * @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 @@ -11981,9 +11975,6 @@ declare namespace window { /** * Subscribes to the window stage lifecycle change event. * - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; - * 3. Parameter verification failed. * @throws { BusinessError } 1300002 - This window state is abnormal. * @throws { BusinessError } 1300005 - This window stage is abnormal. * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -12043,11 +12034,8 @@ declare namespace window { /** * Unsubscribes from the window stage lifecycle change event. * - * @param { Callback } callback Callback used to return the window stage lifecycle state. - * If a value is passed in, the corresponding subscription is canceled. - * If no value is passed in, all subscriptions to the specified event are canceled. - * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; - * 2. Parameter verification failed. + * @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 @@ -12112,10 +12100,8 @@ declare namespace window { /** * Unsubscribes from the window stage lifecycle change event. * - * @param { Callback } [callback] Callback used to - * return the window stage lifecycle state. - * If a value is passed in, the corresponding subscription is canceled. - * If no value is passed in, all subscriptions to the specified event are canceled. + * @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. -- Gitee