diff --git a/api/@ohos.window.floatingBall.d.ts b/api/@ohos.window.floatingBall.d.ts index 3b42af0c20469c4241a25ed47f1d9f0aa542794f..78cb3e7d838e9486ba7c53bc1a1614ee549e8111 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. *