diff --git a/api/@ohos.PiPWindow.d.ts b/api/@ohos.PiPWindow.d.ts index 81ebbcadcb6e558ee34462d59dfd6a787a8dbac4..338f71f3f2d202e0006fcf5ee49c9b1bba1e97f2 100644 --- a/api/@ohos.PiPWindow.d.ts +++ b/api/@ohos.PiPWindow.d.ts @@ -243,6 +243,16 @@ declare namespace PiPWindow { * @since 12 */ customUIController?: NodeController; + + /** + * Describes the default position of the picture-in-picture in four corners or last position. + * + * @type { ?boolean } + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 20 + */ + autoAvoidance?: boolean; } /** @@ -1195,6 +1205,42 @@ declare namespace PiPWindow { * @test */ isPiPSupported(): boolean; + + /** + * Register picture-in-picture window active status change event listener + * + * @param { 'pipActiveStatusChange' } type - The value is fixed at 'pipActiveStatusChange', indicating the picture-in-picture + * window active status change event. + * @param { Callback } callback - Callback used to return the picture-in-picture window active status. + * @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. + * function on('pipActiveStatusChange', callback) can not work correctly due to limited device capabilities. + * @throws { BusinessError } 1300014 - PiP internal error. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 20 + */ + on(type: 'pipActiveStatusChange', callback: Callback): void; + + /** + * Unregister picture-in-picture window active status change event listener + * + * @param { 'pipActiveStatusChange' } type - The value is fixed at 'pipActiveStatusChange', indicating the picture-in-picture + * window active status change event. + * @param { Callback } callback - Callback used to return the picture-in-picture window active status. + * @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. + * 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 + */ + off(type: 'pipActiveStatusChange', callback: Callback): void; } }