From 655f5805ba0e31f7f41fa5a001501d914699667a Mon Sep 17 00:00:00 2001 From: TYW Date: Sat, 13 Sep 2025 12:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E4=B8=AD=E7=94=BB=E6=96=B0=E5=A2=9EAP?= =?UTF-8?q?I?= 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