diff --git a/api/@ohos.PiPWindow.d.ts b/api/@ohos.PiPWindow.d.ts index 206fc082fef20a9d2743812b3aae8673c5eb9ba6..383699ba3066a6cbbd94b113941dec186b04cb43 100644 --- a/api/@ohos.PiPWindow.d.ts +++ b/api/@ohos.PiPWindow.d.ts @@ -1097,10 +1097,19 @@ 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 { function } callback - Used to handle {'stateChange'} command + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + onStateChange(callback: (state: PiPState, reason: string) => void): void; + /** * Unregister picture-in-picture lifecycle event listener. * @param { 'stateChange' } type - Used to unregister listener for {'stateChange'} command @@ -1112,10 +1121,18 @@ 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. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + offStateChange(): void; + /** * Register picture-in-picture control event listener. * @param { 'controlPanelActionEvent' } type - Registration type, user action event, 'controlPanelActionEvent' @@ -1130,10 +1147,20 @@ 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 { ControlPanelActionEventCallback } callback - Used to handle {'controlPanelActionEvent'} command. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + onControlPanelActionEvent(callback: ControlPanelActionEventCallback): void; + /** * Unregister picture-in-picture lifecycle event listener * @param { 'controlPanelActionEvent' } type - Used to unregister listener for {'controlPanelActionEvent'} command @@ -1145,10 +1172,18 @@ 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 + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + offControlPanelActionEvent(): void; + /** * Register picture-in-picture control event listener. * @@ -1156,20 +1191,39 @@ 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 { Callback } callback - Used to handle {'controlEvent'} command. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + onControlEvent(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 12 + * @since 12 dynamic */ off(type: 'controlEvent', callback?: Callback): void; + /** + * Unregister picture-in-picture control event listener + * @param { Callback } callback - Used to handle {'controlEvent'} command. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 22 static + */ + offControlEvent(callback?: Callback): void; + /** * Register picture-in-picture window size change event listener * @@ -1183,10 +1237,25 @@ 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 { 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 + */ + onPipWindowSizeChange(callback: Callback): void; + /** * Unregister picture-in-picture window size change event listener * @@ -1200,10 +1269,22 @@ 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 { Callback } callback - Callback used to return the picture-in-picture window size. + * @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; + /** * Returns a Boolean value that indicates whether picture-in-picture is supported *