From 655f5805ba0e31f7f41fa5a001501d914699667a Mon Sep 17 00:00:00 2001 From: TYW Date: Sat, 13 Sep 2025 12:36:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=94=BB=E4=B8=AD=E7=94=BB=E6=96=B0?= =?UTF-8?q?=E5=A2=9EAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘阳 --- api/@ohos.PiPWindow.d.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/api/@ohos.PiPWindow.d.ts b/api/@ohos.PiPWindow.d.ts index 7ed8033f33..b83a0bfd0f 100644 --- a/api/@ohos.PiPWindow.d.ts +++ b/api/@ohos.PiPWindow.d.ts @@ -173,6 +173,17 @@ declare namespace PiPWindow { */ navigationId?: string; + /** + * Indicates the page ID. + * + * @type { ?number } The page ID to which the PiP needs to restore. + * @default -1 + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 20 + */ + handleId?: number; + /** * Picture-in-picture template type. * @@ -266,6 +277,17 @@ declare namespace PiPWindow { defaultWindowSizeType?: number; } + /** + * Describe picture-in-picture state change reason. + * + * @typedef { 'panelActionDelete' | 'panelActionRestore' | 'dradDelete' | 'requestDelete' | 'requestStart' | 'autoStart' | 'other' } + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 20 + */ + type PiPStateChangeReason = 'panelActionDelete' | 'panelActionRestore' | 'dradDelete' | 'requestDelete' | 'requestStart' | 'autoStart' | 'other'; + + /** * The picture-in-picture window size * @@ -1110,7 +1132,7 @@ declare namespace PiPWindow { * @atomicservice * @since 12 */ - on(type: 'stateChange', callback: (state: PiPState, reason: string) => void): void; + on(type: 'stateChange', callback: (state: PiPState, reason: string, reasonType?: PiPStateChangeReason) => void): void; /** * Unregister picture-in-picture lifecycle event listener. -- Gitee From f5ca77eecbc02dee65029a32a4787fc45552dae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E9=98=B3?= Date: Wed, 24 Sep 2025 07:32:26 +0000 Subject: [PATCH 2/3] update README_zh.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘阳 --- README_zh.md | 104 +++++++++++++++++++++++++-------------------------- 1 file changed, 51 insertions(+), 53 deletions(-) diff --git a/README_zh.md b/README_zh.md index 5ce254cc1a..dff829a626 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,55 +1,53 @@ -# API声明文件公共仓 + /** + * 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; -## 简介 - -JS/TS API 公共仓,用来提交 API d.ts 声明文件以及API相关工具。 - -## 目录 - -```| -├─api -| ├─@internal -│ | ├─component -│ | | └─ets #基于TS扩展的声明式开发范式组件声明文件 -| | └─ets -| ├─config #基于JS扩展的类Web范式 -| ├─form #JS服务卡片 -| ├─@ohos.×××.d.ts #API声明文件 -| └─@system.×××.d.ts #标记为停止维护的接口 -├─build-tools - ├─api_check_plugin #检查API规范的工具 - | ├─config - | ├─plugin - | ├─src - | └─test - └─cllect_application_api #解析应用到的API的工具(旧) - | ├─deps - | └─src - └─api_collector #解析应用到的API的工具的工具(新) - | ├─scripts - | ├─src - | └─test - └─api_diff #比较两个版本sdk差异的工具(旧) - | ├─src - | └─version_diff_collection - └─collect_api #解析d.ts文件接口的基本信息的工具 - | └─collect_base_api.js - └─diff_api #比较两个版本sdk差异工具(新) - | └─src - └─dts_parser #解析d.ts文件的工具 - | ├─src - | └─test - └─jsdoc_format_plugin #检查并修复jsdoc规范错误的工具 - | ├─loader - | ├─src - | └─test - └─permissions_converter #从config文件提取权限信息,为DevEco Studio提供权限的联想和校验 - | └─convert.js - └─sdk_upgrade_assistance_plugin #SDK升级辅助工具,帮助开发者快速解决SDK升级导致的API不兼容问题 - | └─src -``` - -## 相关仓 - -[interface-sdk_js](https://gitee.com/openharmony/interface_sdk-js/tree/master) + /** + * 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; \ No newline at end of file -- Gitee From d099cef0ffd14737267a36bbba9123a2a8722aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E9=98=B3?= Date: Wed, 24 Sep 2025 07:33:25 +0000 Subject: [PATCH 3/3] update README_zh.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘阳 --- README_zh.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README_zh.md b/README_zh.md index dff829a626..dc8cab40ce 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,4 +1,21 @@ - /** + + /** + * 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' -- Gitee