diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 69d0beedad1e139ad9a900b986a8cdb2fdcf76d0..da5f60b4c7348c1c9a2246bed635755f3d47361f 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -6908,17 +6908,31 @@ 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. + * @param { Callback } [callback] - Unregister the callback function. If not provided, + * all callbacks for the given event type will be removed. * @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 * @atomicservice * @since 12 dynamic - * @since 20 static */ on(type: 'keyboardHeightChange', callback: Callback): void; + /** + * Register the callback of keyboardHeightChange + * + * @param { Callback } [callback] - Unregister the callback function. If not provided, + * all callbacks for the given event type will be removed. + * @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 + * @atomicservice + * @since 22 static + */ + onKeyboardHeightChange(callback: Callback): void; + /** * Unregister the callback of keyboardHeightChange * @@ -6935,23 +6949,35 @@ 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. + * @param { Callback } [callback] - Unregister the callback function. 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 * @atomicservice * @since 12 dynamic - * @since 20 static */ off(type: 'keyboardHeightChange', callback?: Callback): void; + /** + * Unregister the callback of keyboardHeightChange + * + * @param { Callback } [callback] - Unregister the callback function. 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 + * @atomicservice + * @since 22 static + */ + 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. + * @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. Function keyboardWillShow can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager @@ -6960,11 +6986,25 @@ declare namespace window { */ on(type: 'keyboardWillShow', callback: Callback): void; + /** + * Register the callback of keyboardWillShow + * + * @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. Function keyboardWillShow can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + 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. + * @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. Function keyboardWillShow can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager @@ -6973,11 +7013,25 @@ declare namespace window { */ off(type: 'keyboardWillShow', callback?: Callback): void; + /** + * Unregister the callback of keyboardWillShow + * + * @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. Function keyboardWillShow can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + 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. + * @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. Function keyboardWillHide can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager @@ -6986,11 +7040,25 @@ declare namespace window { */ on(type: 'keyboardWillHide', callback: Callback): void; + /** + * Register the callback of keyboardWillHide + * + * @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. Function keyboardWillHide can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + 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. + * @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. Function keyboardWillHide can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager @@ -6999,62 +7067,127 @@ declare namespace window { */ off(type: 'keyboardWillHide', callback?: Callback): void; + /** + * Unregister the callback of keyboardWillHide + * + * @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. Function keyboardWillHide can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + 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. + * @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. Function keyboardDidShow can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 18 dynamic - * @since 20 static */ on(type: 'keyboardDidShow', callback: Callback): void; + /** + * Register the callback of keyboardDidShow + * + * @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. Function keyboardDidShow can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + onKeyboardDidShow(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. + * @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. Function keyboardDidShow can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 18 dynamic - * @since 20 static */ off(type: 'keyboardDidShow', callback?: Callback): void; + /** + * Unregister the callback of keyboardDidShow + * + * @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. Function keyboardDidShow can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + 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. + * @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. Function keyboardDidHide can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 18 dynamic - * @since 20 static */ on(type: 'keyboardDidHide', callback: Callback): void; + /** + * Register the callback of keyboardDidHide + * + * @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. Function keyboardDidHide can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + onKeyboardDidHide(callback: Callback): void; + /** * Unregister 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. + * @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. Function keyboardDidHide can not work correctly due to limited device capabilities. * @throws { BusinessError } 1300002 - This window state is abnormal. * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 18 dynamic - * @since 20 static */ off(type: 'keyboardDidHide', callback?: Callback): void; + /** + * Unregister the callback of keyboardDidHide + * + * @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. Function keyboardDidHide can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + offKeyboardDidHide(callback?: Callback): void; + /** * Subscribes to the touch event outside this window. * @@ -10514,8 +10647,8 @@ declare namespace window { * * @param { 'rotationChange' } type - The value is fixed at 'rotationChange', * indicating the window rotation change event. - * @param { RotationChangeCallback } callback - - * Callback used to return the rotation change result. + * @param { RotationChangeCallback } [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. @@ -10529,20 +10662,17 @@ declare namespace window { /** * Register the callback of rotation change * - * @param { 'rotationChange' } type - The value is fixed at 'rotationChange', - * indicating the window rotation change event. - * @param { RotationChangeCallback } callback - - * Callback used to return the rotation change result. + * @param { RotationChangeCallback } [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 } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 20 static + * @since 22 static */ - on(type: 'rotationChange', callback: RotationChangeCallback): - void; + onRotationChange(callback: RotationChangeCallback): void; /** * Unregister the callback of rotationChange @@ -10550,7 +10680,7 @@ declare namespace window { * @param { 'rotationChange' } type - The value is fixed at 'rotationChange', * indicating the window rotation change event. * @param { RotationChangeCallback } [callback] - - * Callback used to return the RectChangeOptions. + * 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. @@ -10565,20 +10695,18 @@ declare namespace window { /** * Unregister the callback of rotationChange * - * @param { 'rotationChange' } type - The value is fixed at 'rotationChange', - * indicating the window rotation change event. * @param { RotationChangeCallback } [callback] - - * Callback used to return the RectChangeOptions. + * 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 } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 20 static + * @since 22 static */ - off(type: 'rotationChange', - callback?: RotationChangeCallback): void; + offRotationChange(callback?: RotationChangeCallback): + void; /** * UIExtension in window secure limit change callback on.