diff --git a/api/@ohos.PiPWindow.d.ts b/api/@ohos.PiPWindow.d.ts index 7ed8033f3377114695523a55dce5ae7c0dd1c5b0..4a9688093a168989c0b3a5a7314335647c74b4a6 100644 --- a/api/@ohos.PiPWindow.d.ts +++ b/api/@ohos.PiPWindow.d.ts @@ -1214,6 +1214,60 @@ declare namespace PiPWindow { */ off(type: 'pipWindowSizeChange', callback?: Callback): void; + /** + * Register picture-in-picture active status change listener. + * + * @param { 'activeStatusChange' } type - Registration type, active status change, 'activeStatusChange' + * @param { Callback } callback - Used to handle {'activeStatusChange'} command. + * @throws { BusinessError } 801 - Capability not supported. + * function off('pipActiveStatusChange', callback) can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300014 - PiP internal error. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 20 dynamic + */ + on(type: 'activeStatusChange', callback: Callback): void; + + /** + * Register picture-in-picture active status change listener. + * + * @param { 'activeStatusChange' } type - Registration type, active status change, 'activeStatusChange' + * @param { Callback } callback - Used to handle {'activeStatusChange'} command. + * @throws { BusinessError } 801 - Capability not supported. + * function off('pipActiveStatusChange', callback) can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300014 - PiP internal error. + * @syscap SystemCapability.Window.SessionManager + * @since 22 static + */ + onActiveStatusChange(calback: Callback): void; + + /** + * Unregister picture-in-picture active status change listener + * @param { 'activeStatusChange' } type - Registration type, active status change, 'activeStatusChange' + * @param { Callback } callback - Used to handle {'activeStatusChange'} command. If not provided, + * all callbacks for the given event type will be removed. + * @throws { BusinessError } 801 - Capability not supported. + * function off('pipActiveStatusChange', callback) can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300014 - PiP internal error. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 20 dynamic + */ + off(type: 'controlEvent', callback?: Callback): void; + + /** + * Unregister picture-in-picture active status change listener + * @param { 'activeStatusChange' } type - Registration type, active status change, 'activeStatusChange' + * @param { Callback } callback - Used to handle {'activeStatusChange'} command. If not provided, + * all callbacks for the given event type will be removed. + * @throws { BusinessError } 801 - Capability not supported. + * function off('pipActiveStatusChange', callback) can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300014 - PiP internal error. + * @syscap SystemCapability.Window.SessionManager + * @since 22 static + */ + offActiveStatusChange(callback?: Callback): void; + /** * Returns a Boolean value that indicates whether picture-in-picture is supported *