From 1b1622ed03551e844ea22afa76d1b851916127ea Mon Sep 17 00:00:00 2001 From: chuanstudy Date: Tue, 9 Sep 2025 08:49:46 +0000 Subject: [PATCH 1/4] overl Signed-off-by: chuanstudy --- api/@ohos.PiPWindow.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/api/@ohos.PiPWindow.d.ts b/api/@ohos.PiPWindow.d.ts index 206fc082fe..f5ae5ba7d8 100644 --- a/api/@ohos.PiPWindow.d.ts +++ b/api/@ohos.PiPWindow.d.ts @@ -1099,7 +1099,7 @@ declare namespace PiPWindow { * @atomicservice * @since 12 */ - on(type: 'stateChange', callback: (state: PiPState, reason: string) => void): void; + onStateChange(callback: (state: PiPState, reason: string) => void): void; /** * Unregister picture-in-picture lifecycle event listener. @@ -1114,7 +1114,7 @@ declare namespace PiPWindow { * @atomicservice * @since 12 */ - off(type: 'stateChange'): void; + offStateChange(): void; /** * Register picture-in-picture control event listener. @@ -1132,7 +1132,7 @@ declare namespace PiPWindow { * @atomicservice * @since 12 */ - on(type: 'controlPanelActionEvent', callback: ControlPanelActionEventCallback): void; + onControlPanelActionEvent(callback: ControlPanelActionEventCallback): void; /** * Unregister picture-in-picture lifecycle event listener @@ -1147,7 +1147,7 @@ declare namespace PiPWindow { * @atomicservice * @since 12 */ - off(type: 'controlPanelActionEvent'): void; + offControlPanelActionEvent(): void; /** * Register picture-in-picture control event listener. @@ -1158,7 +1158,7 @@ declare namespace PiPWindow { * @atomicservice * @since 12 */ - on(type: 'controlEvent', callback: Callback): void; + onControlEvent(callback: Callback): void; /** * Unregister picture-in-picture control event listener @@ -1168,7 +1168,7 @@ declare namespace PiPWindow { * @atomicservice * @since 12 */ - off(type: 'controlEvent', callback?: Callback): void; + offControlEvent(callback?: Callback): void; /** * Register picture-in-picture window size change event listener @@ -1185,7 +1185,7 @@ declare namespace PiPWindow { * @atomicservice * @since 15 */ - on(type: 'pipWindowSizeChange', callback: Callback): void; + onPipWindowSizeChange(callback: Callback): void; /** * Unregister picture-in-picture window size change event listener @@ -1202,7 +1202,7 @@ declare namespace PiPWindow { * @atomicservice * @since 15 */ - off(type: 'pipWindowSizeChange', callback?: Callback): void; + offPipWindowSizeChange(callback?: Callback): void; /** * Returns a Boolean value that indicates whether picture-in-picture is supported -- Gitee From 031329ba54870491dbdf4bcf6db2505a4319bb26 Mon Sep 17 00:00:00 2001 From: chuanstudy Date: Thu, 11 Sep 2025 11:33:03 +0000 Subject: [PATCH 2/4] add overload Signed-off-by: chuanstudy --- api/@ohos.PiPWindow.d.ts | 110 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 102 insertions(+), 8 deletions(-) diff --git a/api/@ohos.PiPWindow.d.ts b/api/@ohos.PiPWindow.d.ts index f5ae5ba7d8..45f5455e79 100644 --- a/api/@ohos.PiPWindow.d.ts +++ b/api/@ohos.PiPWindow.d.ts @@ -1097,7 +1097,17 @@ declare namespace PiPWindow { * @param { function } callback - Used to handle {'stateChange'} command * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 12 + * @since 12 dynamic + */ + on(type: 'stateChange', callback: (state: PiPState, reason: string) => void): void; + + /** + * Register picture-in-picture control event listener. + * @param { 'stateChange' } type - Registration type, PiP lifecycle state change, 'stateChange' + * @param { function } callback - Used to handle {'stateChange'} command + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static */ onStateChange(callback: (state: PiPState, reason: string) => void): void; @@ -1112,7 +1122,16 @@ declare namespace PiPWindow { * @param { 'stateChange' } type - Used to unregister listener for {'stateChange'} command * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 12 + * @since 12 dynamic + */ + off(type: 'stateChange'): void; + + /** + * Unregister picture-in-picture lifecycle event listener. + * @param { 'stateChange' } type - Used to unregister listener for {'stateChange'} command + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static */ offStateChange(): void; @@ -1130,7 +1149,18 @@ declare namespace PiPWindow { * @param { ControlPanelActionEventCallback } callback - Used to handle {'controlPanelActionEvent'} command. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 12 + * @since 12 dynamic + */ + on(type: 'controlPanelActionEvent', callback: ControlPanelActionEventCallback): void; + + /** + * Register picture-in-picture control event listener. + * + * @param { 'controlPanelActionEvent' } type - Registration type, user action event, 'controlPanelActionEvent' + * @param { ControlPanelActionEventCallback } callback - Used to handle {'controlPanelActionEvent'} command. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static */ onControlPanelActionEvent(callback: ControlPanelActionEventCallback): void; @@ -1145,7 +1175,16 @@ declare namespace PiPWindow { * @param { 'controlPanelActionEvent' } type - Used to unregister listener for {'controlPanelActionEvent'} command * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 12 + * @since 12 dynamic + */ + off(type: 'controlPanelActionEvent'): void; + + /** + * Unregister picture-in-picture lifecycle event listener + * @param { 'controlPanelActionEvent' } type - Used to unregister listener for {'controlPanelActionEvent'} command + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static */ offControlPanelActionEvent(): void; @@ -1156,7 +1195,18 @@ declare namespace PiPWindow { * @param { Callback } callback - Used to handle {'controlEvent'} command. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 12 + * @since 12 dynamic + */ + on(type: 'controlEvent', callback: Callback): void; + + /** + * Register picture-in-picture control event listener. + * + * @param { 'controlEvent' } type - Registration type, user action event, 'controlEvent' + * @param { Callback } callback - Used to handle {'controlEvent'} command. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static */ onControlEvent(callback: Callback): void; @@ -1166,7 +1216,17 @@ declare namespace PiPWindow { * @param { Callback } callback - Used to handle {'controlEvent'} command. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 12 + * @since 12 static + */ + off(type: 'controlEvent', callback?: Callback): void; + + /** + * Unregister picture-in-picture control event listener + * @param { 'controlEvent' } type - Used to unregister listener for {'controlEvent'} command + * @param { Callback } callback - Used to handle {'controlEvent'} command. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 dynamic */ offControlEvent(callback?: Callback): void; @@ -1183,7 +1243,24 @@ declare namespace PiPWindow { * @throws { BusinessError } 1300014 - PiP internal error. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 15 + * @since 15 dynamic + */ + on(type: 'pipWindowSizeChange', callback: Callback): void; + + /** + * Register picture-in-picture window size change event listener + * + * @param { 'pipWindowSizeChange' } type - The value is fixed at 'pipWindowSizeChange', indicating the picture-in-picture + * window size change event. + * @param { Callback } callback - Callback used to return the picture-in-picture window size. + * @throws { BusinessError } 401 - Params error. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300014 - PiP internal error. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 dynamic */ onPipWindowSizeChange(callback: Callback): void; @@ -1200,7 +1277,24 @@ declare namespace PiPWindow { * @throws { BusinessError } 1300014 - PiP internal error. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 15 + * @since 15 dynamic + */ + off(type: 'pipWindowSizeChange', callback?: Callback): void; + + /** + * Unregister picture-in-picture window size change event listener + * + * @param { 'pipWindowSizeChange' } type - The value is fixed at 'pipWindowSizeChange', indicating the picture-in-picture + * window size change event. + * @param { Callback } callback - Callback used to return the picture-in-picture window size. + * @throws { BusinessError } 401 - Params error. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300014 - PiP internal error. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static */ offPipWindowSizeChange(callback?: Callback): void; -- Gitee From bef6496068a17f4b6eda4ad7c535b5b244066677 Mon Sep 17 00:00:00 2001 From: chuanstudy Date: Thu, 11 Sep 2025 11:38:08 +0000 Subject: [PATCH 3/4] del param Signed-off-by: chuanstudy --- api/@ohos.PiPWindow.d.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/api/@ohos.PiPWindow.d.ts b/api/@ohos.PiPWindow.d.ts index 45f5455e79..bf03f9093f 100644 --- a/api/@ohos.PiPWindow.d.ts +++ b/api/@ohos.PiPWindow.d.ts @@ -1103,7 +1103,6 @@ declare namespace PiPWindow { /** * Register picture-in-picture control event listener. - * @param { 'stateChange' } type - Registration type, PiP lifecycle state change, 'stateChange' * @param { function } callback - Used to handle {'stateChange'} command * @syscap SystemCapability.Window.SessionManager * @atomicservice @@ -1128,7 +1127,6 @@ declare namespace PiPWindow { /** * Unregister picture-in-picture lifecycle event listener. - * @param { 'stateChange' } type - Used to unregister listener for {'stateChange'} command * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 22 static @@ -1156,7 +1154,6 @@ declare namespace PiPWindow { /** * Register picture-in-picture control event listener. * - * @param { 'controlPanelActionEvent' } type - Registration type, user action event, 'controlPanelActionEvent' * @param { ControlPanelActionEventCallback } callback - Used to handle {'controlPanelActionEvent'} command. * @syscap SystemCapability.Window.SessionManager * @atomicservice @@ -1181,7 +1178,6 @@ declare namespace PiPWindow { /** * Unregister picture-in-picture lifecycle event listener - * @param { 'controlPanelActionEvent' } type - Used to unregister listener for {'controlPanelActionEvent'} command * @syscap SystemCapability.Window.SessionManager * @atomicservice * @since 22 static @@ -1202,7 +1198,6 @@ declare namespace PiPWindow { /** * Register picture-in-picture control event listener. * - * @param { 'controlEvent' } type - Registration type, user action event, 'controlEvent' * @param { Callback } callback - Used to handle {'controlEvent'} command. * @syscap SystemCapability.Window.SessionManager * @atomicservice @@ -1216,17 +1211,16 @@ declare namespace PiPWindow { * @param { Callback } callback - Used to handle {'controlEvent'} command. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 12 static + * @since 12 dynamic */ off(type: 'controlEvent', callback?: Callback): void; /** * Unregister picture-in-picture control event listener - * @param { 'controlEvent' } type - Used to unregister listener for {'controlEvent'} command * @param { Callback } callback - Used to handle {'controlEvent'} command. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 22 dynamic + * @since 22 static */ offControlEvent(callback?: Callback): void; @@ -1250,8 +1244,6 @@ declare namespace PiPWindow { /** * Register picture-in-picture window size change event listener * - * @param { 'pipWindowSizeChange' } type - The value is fixed at 'pipWindowSizeChange', indicating the picture-in-picture - * window size change event. * @param { Callback } callback - Callback used to return the picture-in-picture window size. * @throws { BusinessError } 401 - Params error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -1260,7 +1252,7 @@ declare namespace PiPWindow { * @throws { BusinessError } 1300014 - PiP internal error. * @syscap SystemCapability.Window.SessionManager * @atomicservice - * @since 22 dynamic + * @since 22 static */ onPipWindowSizeChange(callback: Callback): void; @@ -1284,8 +1276,6 @@ declare namespace PiPWindow { /** * Unregister picture-in-picture window size change event listener * - * @param { 'pipWindowSizeChange' } type - The value is fixed at 'pipWindowSizeChange', indicating the picture-in-picture - * window size change event. * @param { Callback } callback - Callback used to return the picture-in-picture window size. * @throws { BusinessError } 401 - Params error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. -- Gitee From cbd0c82e6088afb22d7fd34ec35989784187db86 Mon Sep 17 00:00:00 2001 From: chuanstudy Date: Thu, 11 Sep 2025 13:05:15 +0000 Subject: [PATCH 4/4] del 401 Signed-off-by: chuanstudy --- api/@ohos.PiPWindow.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/api/@ohos.PiPWindow.d.ts b/api/@ohos.PiPWindow.d.ts index bf03f9093f..383699ba30 100644 --- a/api/@ohos.PiPWindow.d.ts +++ b/api/@ohos.PiPWindow.d.ts @@ -1277,9 +1277,6 @@ declare namespace PiPWindow { * Unregister picture-in-picture window size change event listener * * @param { Callback } callback - Callback used to return the picture-in-picture window size. - * @throws { BusinessError } 401 - Params error. Possible causes: 1. Mandatory parameters are left unspecified. - * 2. Incorrect parameter types. - * 3. Parameter verification failed. * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. * @throws { BusinessError } 1300014 - PiP internal error. * @syscap SystemCapability.Window.SessionManager -- Gitee