From 84c57d399f9db488b3d36c4ce99cd910589b2bc6 Mon Sep 17 00:00:00 2001 From: dengbing Date: Wed, 10 Sep 2025 09:54:23 +0800 Subject: [PATCH 1/8] overload Signed-off-by: dengbing --- api/@ohos.window.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index d410a54531..59d895ddd7 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7601,7 +7601,6 @@ declare namespace window { * This event is triggered only when the user clicks the system-provided close button in the upper right corner to close the child window. * It is not triggered when the child window is closed in other ways. * - * @param { 'subWindowClose' } type - Event type. The value is fixed at 'subWindowClose', indicating the child window close event. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the child window is clicked. * The internal logic of the callback function requires a return value of the Boolean type. * The return value determines whether to continue to close the child window. @@ -7616,12 +7615,11 @@ declare namespace window { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'subWindowClose', callback: Callback): void; + onSubWindowClose(callback: Callback): void; /** * Unsubscribes from the event indicating that the child window is closed. * - * @param { 'subWindowClose' } type - Event type. The value is fixed at 'subWindowClose', indicating the child window close event. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the child window is clicked. * The internal logic of the callback function requires a return value of the Boolean type. * The return value determines whether to continue to close the child window. @@ -7638,7 +7636,7 @@ declare namespace window { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'subWindowClose', callback?: Callback): void; + offSubWindowClose(callback?: Callback): void; /** * Subscribes to the event indicating that the main window or child window will be closed. -- Gitee From 1b0cdcc27ca917b75cf47b9c915ef2856dec7276 Mon Sep 17 00:00:00 2001 From: dengbing Date: Wed, 10 Sep 2025 10:06:10 +0800 Subject: [PATCH 2/8] overload Signed-off-by: dengbing --- api/@ohos.window.d.ts | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 59d895ddd7..0ea1b8edb0 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7643,7 +7643,6 @@ declare namespace window { * This event is triggered only when the user clicks the close button in the system-provided title bar to close the window. * It is not triggered when the window is closed in other ways. * - * @param { 'windowWillClose' } type - Event type. The value is fixed at 'windowWillClose', indicating the window close event. * @param { Callback> } callback - Callback used to when the close button in the upper right corner of the window is clicked. * The internal logic of the callback function requires a return value of the Promise type. * In the returned Promise function, resolve(true) means not to close the window, @@ -7658,12 +7657,11 @@ declare namespace window { * @since arkts {'1.1':'15', '1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'windowWillClose', callback: Callback>): void; + onWindowWillClose(callback: Callback>): void; /** * Unsubscribes from the event indicating that the main window or child window will be closed. * - * @param { 'windowWillClose' } type - Event type. The value is fixed at 'windowWillClose', indicating the window close event. * @param { Callback> } callback - Callback used to when the close button in the upper right corner of the window is clicked. * The internal logic of the callback function requires a return value of the Promise type. * It does not return any parameter. In the returned Promise function, @@ -7679,7 +7677,7 @@ declare namespace window { * @since arkts {'1.1':'15', '1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'windowWillClose', callback?: Callback>): void; + offWindowWillClose(callback?: Callback>): void; /** * Register the callback of window highlight state change @@ -10369,7 +10367,6 @@ declare namespace window { /** * Register the callback of title buttons area change. * - * @param { 'windowTitleButtonRectChange' } type - The value is fixed at 'windowTitleButtonRectChange', indicating the title buttons area change event. * @param { Callback } callback - Callback used to return the current title buttons area. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -10382,8 +10379,6 @@ declare namespace window { /** * Subscribes to the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. * - * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', - * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. * @param { Callback } callback - Callback used to return the new rectangle. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -10395,12 +10390,11 @@ declare namespace window { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'windowTitleButtonRectChange', callback: Callback): void; + onWindowTitleButtonRectChange(callback: Callback): void; /** * Unregister the callback of title buttons area change. * - * @param { 'windowTitleButtonRectChange' } type - The value is fixed at 'windowTitleButtonRectChange', indicating the title buttons area change event. * @param { Callback } callback - Callback used to return the current title buttons area. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; * 2. Parameter verification failed. @@ -10412,8 +10406,6 @@ declare namespace window { /** * Unsubscribes from the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. * - * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', - * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. * @param { Callback } callback - Callback used to return the new rectangle. 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; @@ -10425,7 +10417,7 @@ declare namespace window { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'windowTitleButtonRectChange', callback?: Callback): void; + offWindowTitleButtonRectChange(callback?: Callback): void; /** * Set the window mask of window @@ -11927,8 +11919,6 @@ declare namespace window { * 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. * - * @param { 'windowStageClose' } eventType - Event type. The value is fixed at 'windowStageClose', - * indicating that the close button in the three-button navigation bar of the main window is clicked. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. * The return value determines whether to continue to close the main window. * The value true means not to close the main window, and false means to continue to close the main window. @@ -11943,13 +11933,11 @@ declare namespace window { * @since arkts {'1.1':'14', '1.2':'20'} * @arkts 1.1&1.2 */ - on(eventType: 'windowStageClose', callback: Callback): void; + onWindowStageClose(callback: Callback): void; /** * Unsubscribes from the event indicating that the main window is closed. * - * @param { 'windowStageClose' } eventType - Event type. The value is fixed at 'windowStageClose', - * indicating that the close button in the three-button navigation bar of the main window is clicked. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. * 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. @@ -11964,7 +11952,7 @@ declare namespace window { * @since arkts {'1.1':'14', '1.2':'20'} * @arkts 1.1&1.2 */ - off(eventType: 'windowStageClose', callback?: Callback): void; + offWindowStageClose(callback?: Callback): void; /** * Disable window decoration. It must be called before loadContent. -- Gitee From 0a0a10c2db53e2991e13552c720b7b1ec5330af4 Mon Sep 17 00:00:00 2001 From: dengbing Date: Thu, 11 Sep 2025 21:32:14 +0800 Subject: [PATCH 3/8] =?UTF-8?q?overload=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dengbing --- api/@ohos.window.d.ts | 176 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 170 insertions(+), 6 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 0ea1b8edb0..2f984c8e7e 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7601,6 +7601,29 @@ declare namespace window { * This event is triggered only when the user clicks the system-provided close button in the upper right corner to close the child window. * It is not triggered when the child window is closed in other ways. * + * @param { 'subWindowClose' } type - Event type. The value is fixed at 'subWindowClose', indicating the child window close event. + * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the child window is clicked. + * The internal logic of the callback function requires a return value of the Boolean type. + * The return value determines whether to continue to close the child window. + * The value true means not to close the child window, and false means to continue to close the child window. + * @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 } 1300004 - Unauthorized operation. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + on(type: 'subWindowClose', 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. + * It is not triggered when the child window is closed in other ways. + * + * @param { 'subWindowClose' } type - Event type. The value is fixed at 'subWindowClose', indicating the child window close event. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the child window is clicked. * The internal logic of the callback function requires a return value of the Boolean type. * The return value determines whether to continue to close the child window. @@ -7620,6 +7643,29 @@ declare namespace window { /** * Unsubscribes from the event indicating that the child window is closed. * + * @param { 'subWindowClose' } type - Event type. The value is fixed at 'subWindowClose', indicating the child window close event. + * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the child window is clicked. + * The internal logic of the callback function requires a return value of the Boolean type. + * The return value determines whether to continue to close the child window. + * The value true means not to close the child window, and false means to continue to close the child window. + * 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 } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300004 - Unauthorized operation. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + off(type: 'subWindowClose', callback?: Callback): void; + + /** + * Unsubscribes from the event indicating that the child window is closed. + * + * @param { 'subWindowClose' } type - Event type. The value is fixed at 'subWindowClose', indicating the child window close event. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the child window is clicked. * The internal logic of the callback function requires a return value of the Boolean type. * The return value determines whether to continue to close the child window. @@ -7659,6 +7705,47 @@ declare namespace window { */ onWindowWillClose(callback: Callback>): void; + /** + * Subscribes to the event indicating that the main window or child window will be closed. + * This event is triggered only when the user clicks the close button in the system-provided title bar to close the window. + * It is not triggered when the window is closed in other ways. + * + * @param { Callback> } callback - Callback used to when the close button in the upper right corner of the window is clicked. + * The internal logic of the callback function requires a return value of the Promise type. + * In the returned Promise function, resolve(true) means not to close the window, + * and resolve(false) or reject means to continue to close the window. + * @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 } 1300004 - Unauthorized operation. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 + */ + on(type: 'windowWillClose', callback: Callback>): void; + + /** + * Unsubscribes from the event indicating that the main window or child window will be closed. + * @param { 'windowWillClose' } type - Event type. The value is fixed at 'windowWillClose', indicating the window close event. + * @param { Callback> } callback - Callback used to when the close button in the upper right corner of the window is clicked. + * The internal logic of the callback function requires a return value of the Promise type. + * It does not return any parameter. In the returned Promise function, + * resolve(true) means not to close the window, + * and resolve(false) or reject means to continue to close the window. + * @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 } 1300004 - Unauthorized operation. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 + */ + offWindowWillClose(callback?: Callback>): void; + /** * Unsubscribes from the event indicating that the main window or child window will be closed. * @@ -10366,7 +10453,8 @@ declare namespace window { /** * Register the callback of title buttons area change. - * + * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', + * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. * @param { Callback } callback - Callback used to return the current title buttons area. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -10378,7 +10466,25 @@ declare namespace window { */ /** * Subscribes to the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. - * + * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', + * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. + * @param { Callback } callback - Callback used to return the new rectangle. + * @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. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + on(type: 'windowTitleButtonRectChange', callback: Callback): void; + + /** + * Subscribes to the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. + * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', + * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. * @param { Callback } callback - Callback used to return the new rectangle. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -10394,7 +10500,8 @@ declare namespace window { /** * Unregister the callback of title buttons area change. - * + * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', + * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. * @param { Callback } callback - Callback used to return the current title buttons area. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; * 2. Parameter verification failed. @@ -10405,7 +10512,23 @@ declare namespace window { */ /** * Unsubscribes from the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. - * + * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', + * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. + * @param { Callback } callback - Callback used to return the new rectangle. 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 } 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 + * @atomicservice + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + offWindowTitleButtonRectChange(callback?: Callback): void; + + /** + * Unsubscribes from the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. * @param { Callback } callback - Callback used to return the new rectangle. 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; @@ -11918,7 +12041,29 @@ declare namespace window { /** * 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. - * + * @param { 'windowStageClose' } eventType - Event type. The value is fixed at 'windowStageClose', + * indicating that the close button in the three-button navigation bar of the main window is clicked. + * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. + * The return value determines whether to continue to close the main window. + * The value true means not to close the main window, and false means to continue to close the main window. + * @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. + * @syscap SystemCapability.Window.SessionManager + * @stagemodelonly + * @atomicservice + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 + */ + on(eventType: 'windowStageClose', 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. + * @param { 'windowStageClose' } eventType - Event type. The value is fixed at 'windowStageClose', + * indicating that the close button in the three-button navigation bar of the main window is clicked. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. * The return value determines whether to continue to close the main window. * The value true means not to close the main window, and false means to continue to close the main window. @@ -11937,7 +12082,26 @@ declare namespace window { /** * Unsubscribes from the event indicating that the main window is closed. - * + * @param { 'windowStageClose' } eventType - Event type. The value is fixed at 'windowStageClose', + * indicating that the close button in the three-button navigation bar of the main window is clicked. + * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. + * 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. 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. + * @syscap SystemCapability.Window.SessionManager + * @stagemodelonly + * @atomicservice + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 + */ + off(eventType: 'windowStageClose', callback?: Callback): void; + + /** + * Unsubscribes from the event indicating that the main window is closed. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. * 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. -- Gitee From 4040a3e6ba083a5ed7b883e1553186ba456f2f72 Mon Sep 17 00:00:00 2001 From: dengbing Date: Thu, 11 Sep 2025 21:45:38 +0800 Subject: [PATCH 4/8] =?UTF-8?q?overload=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dengbing --- api/@ohos.window.d.ts | 44 +++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 2f984c8e7e..618afd965a 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7613,7 +7613,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} + * @since arkts {'1.1':'12', '1.2':'20' * @arkts 1.1&1.2 */ on(type: 'subWindowClose', callback: Callback): void; @@ -7623,7 +7623,6 @@ declare namespace window { * This event is triggered only when the user clicks the system-provided close button in the upper right corner to close the child window. * It is not triggered when the child window is closed in other ways. * - * @param { 'subWindowClose' } type - Event type. The value is fixed at 'subWindowClose', indicating the child window close event. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the child window is clicked. * The internal logic of the callback function requires a return value of the Boolean type. * The return value determines whether to continue to close the child window. @@ -7657,7 +7656,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} + * @since arkts {'1.1':'12', '1.2':'20' * @arkts 1.1&1.2 */ off(type: 'subWindowClose', callback?: Callback): void; @@ -7665,7 +7664,6 @@ declare namespace window { /** * Unsubscribes from the event indicating that the child window is closed. * - * @param { 'subWindowClose' } type - Event type. The value is fixed at 'subWindowClose', indicating the child window close event. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the child window is clicked. * The internal logic of the callback function requires a return value of the Boolean type. * The return value determines whether to continue to close the child window. @@ -7689,6 +7687,7 @@ declare namespace window { * This event is triggered only when the user clicks the close button in the system-provided title bar to close the window. * It is not triggered when the window is closed in other ways. * + * @param { 'windowWillClose' } type - Event type. The value is fixed at 'windowWillClose', indicating the window close event. * @param { Callback> } callback - Callback used to when the close button in the upper right corner of the window is clicked. * The internal logic of the callback function requires a return value of the Promise type. * In the returned Promise function, resolve(true) means not to close the window, @@ -7700,10 +7699,10 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'15', '1.2':'20'} + * @since arkts {'1.1':'15', '1.2':'20' * @arkts 1.1&1.2 */ - onWindowWillClose(callback: Callback>): void; + on(type: 'windowWillClose', callback: Callback>): void; /** * Subscribes to the event indicating that the main window or child window will be closed. @@ -7724,10 +7723,11 @@ declare namespace window { * @since arkts {'1.1':'15', '1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'windowWillClose', callback: Callback>): void; + onWindowWillClose(callback: Callback>): void; /** * Unsubscribes from the event indicating that the main window or child window will be closed. + * * @param { 'windowWillClose' } type - Event type. The value is fixed at 'windowWillClose', indicating the window close event. * @param { Callback> } callback - Callback used to when the close button in the upper right corner of the window is clicked. * The internal logic of the callback function requires a return value of the Promise type. @@ -7741,10 +7741,10 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'15', '1.2':'20'} + * @since arkts {'1.1':'15', '1.2':'20' * @arkts 1.1&1.2 */ - offWindowWillClose(callback?: Callback>): void; + off(type: 'windowWillClose', callback?: Callback>): void; /** * Unsubscribes from the event indicating that the main window or child window will be closed. @@ -10453,8 +10453,8 @@ declare namespace window { /** * Register the callback of title buttons area change. - * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', - * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. + * + * @param { 'windowTitleButtonRectChange' } type - The value is fixed at 'windowTitleButtonRectChange', indicating the title buttons area change event. * @param { Callback } callback - Callback used to return the current title buttons area. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -10466,6 +10466,7 @@ declare namespace window { */ /** * Subscribes to the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. + * * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. * @param { Callback } callback - Callback used to return the new rectangle. @@ -10476,15 +10477,14 @@ declare namespace window { * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} + * @since arkts {'1.1':'12', '1.2':'20' * @arkts 1.1&1.2 */ on(type: 'windowTitleButtonRectChange', callback: Callback): void; /** * Subscribes to the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. - * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', - * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. + * * @param { Callback } callback - Callback used to return the new rectangle. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -10500,8 +10500,8 @@ declare namespace window { /** * Unregister the callback of title buttons area change. - * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', - * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. + * + * @param { 'windowTitleButtonRectChange' } type - The value is fixed at 'windowTitleButtonRectChange', indicating the title buttons area change event. * @param { Callback } callback - Callback used to return the current title buttons area. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Incorrect parameter types; * 2. Parameter verification failed. @@ -10512,6 +10512,7 @@ declare namespace window { */ /** * Unsubscribes from the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. + * * @param { 'windowTitleButtonRectChange' } type - Event type. The value is fixed at 'windowTitleButtonRectChange', * indicating that the change event of the rectangle that holds the minimize, maximize, and close buttons. * @param { Callback } callback - Callback used to return the new rectangle. If a value is passed in, the corresponding subscription is canceled. @@ -10525,10 +10526,11 @@ declare namespace window { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - offWindowTitleButtonRectChange(callback?: Callback): void; + off(type: 'windowTitleButtonRectChange', callback?: Callback): void; /** * Unsubscribes from the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. + * * @param { Callback } callback - Callback used to return the new rectangle. 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; @@ -12041,6 +12043,7 @@ declare namespace window { /** * 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. + * * @param { 'windowStageClose' } eventType - Event type. The value is fixed at 'windowStageClose', * indicating that the close button in the three-button navigation bar of the main window is clicked. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. @@ -12062,8 +12065,7 @@ declare namespace window { /** * 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. - * @param { 'windowStageClose' } eventType - Event type. The value is fixed at 'windowStageClose', - * indicating that the close button in the three-button navigation bar of the main window is clicked. + * * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. * The return value determines whether to continue to close the main window. * The value true means not to close the main window, and false means to continue to close the main window. @@ -12082,6 +12084,7 @@ declare namespace window { /** * Unsubscribes from the event indicating that the main window is closed. + * * @param { 'windowStageClose' } eventType - Event type. The value is fixed at 'windowStageClose', * indicating that the close button in the three-button navigation bar of the main window is clicked. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. @@ -12095,13 +12098,14 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @stagemodelonly * @atomicservice - * @since arkts {'1.1':'14', '1.2':'20'} + * @since arkts {'1.1':'14', '1.2':'20' * @arkts 1.1&1.2 */ off(eventType: 'windowStageClose', callback?: Callback): void; /** * Unsubscribes from the event indicating that the main window is closed. + * * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. * 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. -- Gitee From b365422db8bc76e365b6f5091013fb3d23f1ac05 Mon Sep 17 00:00:00 2001 From: dengbing Date: Thu, 11 Sep 2025 21:51:37 +0800 Subject: [PATCH 5/8] =?UTF-8?q?overload=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dengbing --- api/@ohos.window.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 618afd965a..3473ba32bc 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -12043,7 +12043,7 @@ declare namespace window { /** * 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. - * + * * @param { 'windowStageClose' } eventType - Event type. The value is fixed at 'windowStageClose', * indicating that the close button in the three-button navigation bar of the main window is clicked. * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. -- Gitee From dee01957f90adf1a07cad45d806a3600b4c75897 Mon Sep 17 00:00:00 2001 From: dengbing Date: Thu, 11 Sep 2025 22:23:05 +0800 Subject: [PATCH 6/8] =?UTF-8?q?overload=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dengbing --- api/@ohos.window.d.ts | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 57f23c9eed..bc5840694d 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7588,7 +7588,6 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 12 dynamic * @since 20 static */ on(type: 'subWindowClose', callback: Callback): void; @@ -7609,7 +7608,6 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 12 dynamic * @since 20 static */ onSubWindowClose(callback: Callback): void; @@ -7632,7 +7630,6 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'subWindowClose', callback?: Callback): void; @@ -7652,8 +7649,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 static */ offSubWindowClose(callback?: Callback): void; @@ -7675,7 +7671,6 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 15 dynamic - * @since 20 static */ on(type: 'windowWillClose', callback: Callback>): void; @@ -7695,8 +7690,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'15', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 static */ onWindowWillClose(callback: Callback>): void; @@ -7717,7 +7711,6 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 15 dynamic - * @since 20 static */ off(type: 'windowWillClose', callback?: Callback>): void; @@ -7736,8 +7729,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'15', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 static */ offWindowWillClose(callback?: Callback>): void; @@ -10447,7 +10439,6 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'windowTitleButtonRectChange', callback: Callback): void; @@ -10462,8 +10453,7 @@ declare namespace window { * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 static */ onWindowTitleButtonRectChange(callback: Callback): void; @@ -10493,14 +10483,13 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'windowTitleButtonRectChange', callback?: Callback): void; /** * Unsubscribes from the change event of the rectangle that holds the minimize, maximize, and close buttons on the title bar of the window. * - * @param { Callback } callback - Callback used to return the new rectangle. If a value is passed in, the corresponding subscription is canceled. + * @param { Callback } [callback] - Callback used to return the new rectangle. 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. @@ -10508,7 +10497,6 @@ declare namespace window { * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 12 dynamic * @since 20 static */ offWindowTitleButtonRectChange(callback?: Callback): void; @@ -12023,7 +12011,6 @@ declare namespace window { * @stagemodelonly * @atomicservice * @since 14 dynamic - * @since 20 static */ on(eventType: 'windowStageClose', callback: Callback): void; @@ -12031,7 +12018,7 @@ declare namespace window { * 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. * - * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. + * @param { Callback } [callback] - Callback invoked when the close button in the upper right corner of the main window is clicked. * The return value determines whether to continue to close the main window. * The value true means not to close the main window, and false means to continue to close the main window. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; @@ -12042,8 +12029,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @stagemodelonly * @atomicservice - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 static */ onWindowStageClose(callback: Callback): void; @@ -12063,15 +12049,14 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @stagemodelonly * @atomicservice - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 dynamic */ off(eventType: 'windowStageClose', callback?: Callback): void; /** * Unsubscribes from the event indicating that the main window is closed. * - * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. + * @param { Callback } [callback] - Callback invoked when the close button in the upper right corner of the main window is clicked. * 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. Mandatory parameters are left unspecified; @@ -12082,8 +12067,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @stagemodelonly * @atomicservice - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 static */ offWindowStageClose(callback?: Callback): void; -- Gitee From 33d6b78e7a6b9eab08b5127dbfe5cc50464f2e51 Mon Sep 17 00:00:00 2001 From: dengbing Date: Thu, 11 Sep 2025 22:28:15 +0800 Subject: [PATCH 7/8] =?UTF-8?q?overload=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dengbing --- api/@ohos.window.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index bc5840694d..899afcd756 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7588,7 +7588,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 20 static + * @since 12 dynamic */ on(type: 'subWindowClose', callback: Callback): void; @@ -7608,7 +7608,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 20 static + * @since 22 static */ onSubWindowClose(callback: Callback): void; @@ -7636,7 +7636,7 @@ declare namespace window { /** * Unsubscribes from the event indicating that the child window is closed. * - * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the child window is clicked. + * @param { Callback } [callback ]- Callback invoked when the close button in the upper right corner of the child window is clicked. * The internal logic of the callback function requires a return value of the Boolean type. * The return value determines whether to continue to close the child window. * The value true means not to close the child window, and false means to continue to close the child window. @@ -7649,7 +7649,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 20 static + * @since 22 static */ offSubWindowClose(callback?: Callback): void; @@ -7717,7 +7717,7 @@ declare namespace window { /** * Unsubscribes from the event indicating that the main window or child window will be closed. * - * @param { Callback> } callback - Callback used to when the close button in the upper right corner of the window is clicked. + * @param { Callback> } [callback] - Callback used to when the close button in the upper right corner of the window is clicked. * The internal logic of the callback function requires a return value of the Promise type. * It does not return any parameter. In the returned Promise function, * resolve(true) means not to close the window, @@ -7729,7 +7729,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 20 static + * @since 22 static */ offWindowWillClose(callback?: Callback>): void; @@ -10453,7 +10453,7 @@ declare namespace window { * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 20 static + * @since 22 static */ onWindowTitleButtonRectChange(callback: Callback): void; @@ -10497,7 +10497,7 @@ declare namespace window { * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 20 static + * @since 22 static */ offWindowTitleButtonRectChange(callback?: Callback): void; @@ -12018,7 +12018,7 @@ declare namespace window { * 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. * - * @param { Callback } [callback] - Callback invoked when the close button in the upper right corner of the main window is clicked. + * @param { Callback } callback - Callback invoked when the close button in the upper right corner of the main window is clicked. * The return value determines whether to continue to close the main window. * The value true means not to close the main window, and false means to continue to close the main window. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; @@ -12029,7 +12029,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @stagemodelonly * @atomicservice - * @since 20 static + * @since 22 static */ onWindowStageClose(callback: Callback): void; @@ -12067,7 +12067,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @stagemodelonly * @atomicservice - * @since 20 static + * @since 22 static */ offWindowStageClose(callback?: Callback): void; -- Gitee From f31853d6fc55502ebe4d2e034c1dc38b61a03925 Mon Sep 17 00:00:00 2001 From: dengbing Date: Fri, 12 Sep 2025 11:33:48 +0800 Subject: [PATCH 8/8] =?UTF-8?q?overload=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dengbing --- api/@ohos.window.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 899afcd756..974759caa6 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7690,7 +7690,7 @@ declare namespace window { * @throws { BusinessError } 1300004 - Unauthorized operation. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 20 static + * @since 22 static */ onWindowWillClose(callback: Callback>): void; -- Gitee