From a94e5a75d356ed42487995c6a76d4e6077113204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=95=AC=E6=9D=BE?= <18328528985@163.com> Date: Thu, 11 Sep 2025 19:26:51 +0800 Subject: [PATCH] fb on/off API overrride --- api/@ohos.window.floatingBall.d.ts | 66 +++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/api/@ohos.window.floatingBall.d.ts b/api/@ohos.window.floatingBall.d.ts index 3b42af0c20..78cb3e7d83 100644 --- a/api/@ohos.window.floatingBall.d.ts +++ b/api/@ohos.window.floatingBall.d.ts @@ -141,23 +141,50 @@ declare namespace floatingBall { * @throws { BusinessError } 1300023 - Floating ball internal error. * @throws { BusinessError } 1300024 - The floating ball window state is abnormal. * @syscap SystemCapability.Window.SessionManager - * @since 20 + * @since 20 dynamic */ on(type: 'stateChange', callback: Callback): void; + /** + * Register floating ball stateChange event listener. + * + * @param { Callback } callback - Used to handle {'stateChange'} command. + * @throws { BusinessError } 1300019 - Wrong parameters for operating the floating ball. + * @throws { BusinessError } 1300022 - Repeated floating ball operation. + * @throws { BusinessError } 1300023 - Floating ball internal error. + * @throws { BusinessError } 1300024 - The floating ball window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @since 22 static + */ + onStateChange(callback: Callback): void; + /** * Unregister floating ball lifecycle event listener. * * @param { 'stateChange' } type - Used to unregister listener for {'stateChange'} command. - * @param { Callback } [callback] - Indicates the callback function. + * @param { Callback } [callback] - Indicates the callback function. If not provided, + * all callbacks for the given event type will be removed. * @throws { BusinessError } 1300019 - Wrong parameters for operating the floating ball. * @throws { BusinessError } 1300023 - Floating ball internal error. * @throws { BusinessError } 1300024 - The floating ball window state is abnormal. * @syscap SystemCapability.Window.SessionManager - * @since 20 + * @since 20 dynamic */ off(type: 'stateChange', callback?: Callback): void; + /** + * Unregister floating ball stateChange event listener. + * + * @param { Callback } [callback] - Indicates the callback function. If not provided, + * all callbacks for the given event type will be removed. + * @throws { BusinessError } 1300019 - Wrong parameters for operating the floating ball. + * @throws { BusinessError } 1300023 - Floating ball internal error. + * @throws { BusinessError } 1300024 - The floating ball window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @since 22 static + */ + offStateChange(callback?: Callback): void; + /** * Register floating ball click event listener. * @@ -168,23 +195,50 @@ declare namespace floatingBall { * @throws { BusinessError } 1300023 - Floating ball internal error. * @throws { BusinessError } 1300024 - The floating ball window state is abnormal. * @syscap SystemCapability.Window.SessionManager - * @since 20 + * @since 20 dynamic */ on(type: 'click', callback: Callback): void; + /** + * Register floating ball click event listener. + * + * @param { Callback } callback - Used to handle {'click'} command. + * @throws { BusinessError } 1300019 - Wrong parameters for operating the floating ball. + * @throws { BusinessError } 1300022 - Repeated floating ball operation. + * @throws { BusinessError } 1300023 - Floating ball internal error. + * @throws { BusinessError } 1300024 - The floating ball window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @since 22 static + */ + onClick(callback: Callback): void; + /** * Unregister floating ball click event listener. * * @param { 'click' } type - Used to unregister listener for {'click'} command. - * @param { Callback } [callback] - Indicates the callback function. + * @param { Callback } [callback] - Indicates the callback function. If not provided, + * all callbacks for the given event type will be removed. * @throws { BusinessError } 1300019 - Wrong parameters for operating the floating ball. * @throws { BusinessError } 1300023 - Floating ball internal error. * @throws { BusinessError } 1300024 - The floating ball window state is abnormal. * @syscap SystemCapability.Window.SessionManager - * @since 20 + * @since 20 dynamic */ off(type: 'click', callback?: Callback): void; + /** + * Unregister floating ball click event listener. + * + * @param { Callback } [callback] - Indicates the callback function. If not provided, + * all callbacks for the given event type will be removed. + * @throws { BusinessError } 1300019 - Wrong parameters for operating the floating ball. + * @throws { BusinessError } 1300023 - Floating ball internal error. + * @throws { BusinessError } 1300024 - The floating ball window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @since 22 static + */ + offClick(callback?: Callback): void; + /** * Get the info of floating ball window. * -- Gitee