From 18587eab99d3f6d136daae8a1fc5a4f5989ca69e Mon Sep 17 00:00:00 2001 From: TYW Date: Wed, 24 Sep 2025 15:34:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E4=B8=AD=E7=94=BB=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘阳 --- api/@ohos.PiPWindow.d.ts | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/api/@ohos.PiPWindow.d.ts b/api/@ohos.PiPWindow.d.ts index 7ed8033f33..4a9688093a 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 * -- Gitee