From 7409376d41557de707a45717942567dfde90f4fe Mon Sep 17 00:00:00 2001 From: yanxinyu7 Date: Tue, 9 Sep 2025 19:29:26 +0800 Subject: [PATCH] overload Signed-off-by: yanxinyu7 --- api/@ohos.window.d.ts | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 6dc429c950..c6516db340 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -7054,7 +7054,6 @@ declare namespace window { /** * Register the callback of keyboardHeightChange * - * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. * @param { Callback } callback - Callback used to return the current keyboard height, which is an integer, in px. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -7065,7 +7064,6 @@ declare namespace window { /** * Register the callback of keyboardHeightChange * - * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. * @param { Callback } callback - Callback used to return the current keyboard height, which is an integer, in px. * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -7075,7 +7073,7 @@ declare namespace window { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'keyboardHeightChange', callback: Callback): void; + onKeyboardHeightChange(callback: Callback): void; /** * Unregister the callback of keyboardHeightChange @@ -7092,7 +7090,6 @@ declare namespace window { /** * Unregister the callback of keyboardHeightChange * - * @param { 'keyboardHeightChange' } type - The value is fixed at 'keyboardHeightChange', indicating the keyboard height change event. * @param { Callback } callback - Callback used to return the current keyboard height, which is an integer, in px. * 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. @@ -7103,12 +7100,11 @@ declare namespace window { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'keyboardHeightChange', callback?: Callback): void; + offKeyboardHeightChange(callback?: Callback): void; /** * Register the callback of keyboardWillShow * - * @param { 'keyboardWillShow' } type - The value is fixed at 'keyboardWillShow', indicating the start of the keyboard show animation event. * @param { Callback } callback - Callback invoked before the keyboard show animation start. * @throws { BusinessError } 801 - Capability not supported. Function keyboardWillShow can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. @@ -7116,12 +7112,11 @@ declare namespace window { * @atomicservice * @since 20 */ - on(type: 'keyboardWillShow', callback: Callback): void; + onKeyboardWillShow(callback: Callback): void; /** * Unregister the callback of keyboardWillShow * - * @param { 'keyboardWillShow' } type - The value is fixed at 'keyboardWillShow', indicating the start of the keyboard show animation event. * @param { Callback } callback - Callback invoked before the keyboard show animation start. * @throws { BusinessError } 801 - Capability not supported. Function keyboardWillShow can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. @@ -7129,12 +7124,11 @@ declare namespace window { * @atomicservice * @since 20 */ - off(type: 'keyboardWillShow', callback?: Callback): void; + offKeyboardWillShow(callback?: Callback): void; /** * Register the callback of keyboardWillHide * - * @param { 'keyboardWillHide' } type - The value is fixed at 'keyboardWillHide', indicating the start of the keyboard hide animation event. * @param { Callback } callback - Callback invoked before the keyboard hide animation start. * @throws { BusinessError } 801 - Capability not supported. Function keyboardWillHide can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. @@ -7142,12 +7136,11 @@ declare namespace window { * @atomicservice * @since 20 */ - on(type: 'keyboardWillHide', callback: Callback): void; + onKeyboardWillHide(callback: Callback): void; /** * Unregister the callback of keyboardWillHide * - * @param { 'keyboardWillHide' } type - The value is fixed at 'keyboardWillHide', indicating the start of the keyboard hide animation event. * @param { Callback } callback - Callback invoked before the keyboard hide animation start. * @throws { BusinessError } 801 - Capability not supported. Function keyboardWillHide can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. @@ -7155,12 +7148,11 @@ declare namespace window { * @atomicservice * @since 20 */ - off(type: 'keyboardWillHide', callback?: Callback): void; + offKeyboardWillHide(callback?: Callback): void; /** * Register the callback of keyboardDidShow * - * @param { 'keyboardDidShow' } type - The value is fixed at 'keyboardDidShow', indicating the completion of the keyboard show animation event. * @param { Callback } callback - Callback invoked when the keyboard show animation is completed. * @throws { BusinessError } 801 - Capability not supported. Function keyboardDidShow can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. @@ -7169,12 +7161,11 @@ declare namespace window { * @since arkts {'1.1':'18', '1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'keyboardDidShow', callback: Callback): void; + onKeyboardDidShow(type: 'keyboardDidShow', callback: Callback): void; /** * Unregister the callback of keyboardDidShow * - * @param { 'keyboardDidShow' } type - The value is fixed at 'keyboardDidShow', indicating the completion of the keyboard show animation event. * @param { Callback } callback - Callback invoked when the keyboard show animation is completed. * @throws { BusinessError } 801 - Capability not supported. Function keyboardDidShow can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. @@ -7183,12 +7174,11 @@ declare namespace window { * @since arkts {'1.1':'18', '1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'keyboardDidShow', callback?: Callback): void; + offKeyboardDidShow(callback?: Callback): void; /** * Register the callback of keyboardDidHide * - * @param { 'keyboardDidHide' } type - The value is fixed at 'keyboardDidHide', indicating the completion of the keyboard hide animation event. * @param { Callback } callback - Callback invoked when the keyboard hide animation is completed. * @throws { BusinessError } 801 - Capability not supported. Function keyboardDidHide can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. @@ -7197,7 +7187,7 @@ declare namespace window { * @since arkts {'1.1':'18', '1.2':'20'} * @arkts 1.1&1.2 */ - on(type: 'keyboardDidHide', callback: Callback): void; + onKeyboardDidHide(callback: Callback): void; /** * Unregister the callback of keyboardDidHide @@ -7211,7 +7201,7 @@ declare namespace window { * @since arkts {'1.1':'18', '1.2':'20'} * @arkts 1.1&1.2 */ - off(type: 'keyboardDidHide', callback?: Callback): void; + offKeyboardDidHide(callback?: Callback): void; /** * Subscribes to the touch event outside this window. -- Gitee