From 324803b4874ccd8ba719a0dbaf3c27e16816a532 Mon Sep 17 00:00:00 2001 From: tangjie <1402602435@qq.com> Date: Wed, 24 Jul 2024 15:33:55 +0800 Subject: [PATCH] =?UTF-8?q?avsessionkit=E6=89=93=E5=85=83=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tangjie <1402602435@qq.com> --- api/@ohos.multimedia.avsession.d.ts | 1285 +++++++++++++++++++++ api/@ohos.multimodalInput.inputEvent.d.ts | 43 + api/@ohos.multimodalInput.keyEvent.d.ts | 150 +++ api/@ohos.wantAgent.d.ts | 8 + 4 files changed, 1486 insertions(+) diff --git a/api/@ohos.multimedia.avsession.d.ts b/api/@ohos.multimedia.avsession.d.ts index a1a606d39..36296a531 100644 --- a/api/@ohos.multimedia.avsession.d.ts +++ b/api/@ohos.multimedia.avsession.d.ts @@ -998,6 +998,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Set the ability to start the session corresponding to + * @param { WantAgent } ability - The WantAgent for launch the ability + * @returns { Promise } void promise when executed successfully + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Parameter verification failed. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ setLaunchAbility(ability: WantAgent): Promise; /** @@ -1026,6 +1038,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Dispatch the session event of this session. + * @param { string } event - Session event name to dispatch + * @param { object } args - The parameters of session event + * @returns { Promise } void promise when executed successfully + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. 3.Parameter verification failed. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ dispatchSessionEvent(event: string, args: {[key: string]: Object}): Promise; /** @@ -1052,6 +1077,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Set the playlist of queueItem. Identifies the content of the playlist presented by this session. + * @param { Array } items - An array of the AVQueueItem + * @returns { Promise } void promise when executed successfully + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Parameter verification failed. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ setAVQueueItems(items: Array): Promise; /** @@ -1078,6 +1115,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Set the name of the playlist presented by this session. + * @param { string } title - The name of the playlist + * @returns { Promise } void promise when executed successfully + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Parameter verification failed. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ setAVQueueTitle(title: string): Promise; /** @@ -1104,6 +1153,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Set the custom media packets for this session. + * @param { object } extras - The custom media packets + * @returns { Promise } void promise when executed successfully + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Parameter verification failed. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ setExtras(extras: {[key: string]: Object}): Promise; /** @@ -1124,6 +1185,15 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the current session's own controller + * @returns { Promise } Promise for the AVSessionController + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getController(): Promise; /** @@ -1195,6 +1265,15 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get output device information + * @returns { OutputDeviceInfo } the OutputDeviceInfo + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getOutputDeviceSync(): OutputDeviceInfo; /** @@ -1203,6 +1282,7 @@ declare namespace avSession { * @throws { BusinessError } 6600101 - Session service exception. * @throws { BusinessError } 6600102 - The session does not exist. * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast + * @atomicservice * @since 12 */ getAllCastDisplays(): Promise>; @@ -1223,6 +1303,23 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register play command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * When canceling the callback, need to update the supported commands list. + * Each playback command only supports registering one callback, + * and the new callback will replace the previous one. + * @param { 'play' } type - Command to register 'play'. + * @param { function } callback - Used to handle ('play') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'play', callback: () => void): void; /** @@ -1241,6 +1338,23 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register pause command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * When canceling the callback, need to update the supported commands list. + * Each playback command only supports registering one callback, + * and the new callback will replace the previous one. + * @param { 'pause' } type - Command to register 'pause'. + * @param { function } callback - Used to handle ('pause') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'pause', callback: () => void): void; /** @@ -1259,6 +1373,23 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register stop command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * When canceling the callback, need to update the supported commands list. + * Each playback command only supports registering one callback, + * and the new callback will replace the previous one. + * @param { 'stop' } type - Command to register 'stop'. + * @param { function } callback - Used to handle ('stop') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'stop', callback: () => void): void; /** @@ -1277,6 +1408,23 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register playNext command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * When canceling the callback, need to update the supported commands list. + * Each playback command only supports registering one callback, + * and the new callback will replace the previous one. + * @param { 'playNext' } type - Command to register 'playNext'. + * @param { function } callback - Used to handle ('playNext') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'playNext', callback: () => void): void; /** @@ -1295,6 +1443,23 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register playPrevious command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * When canceling the callback, need to update the supported commands list. + * Each playback command only supports registering one callback, + * and the new callback will replace the previous one. + * @param { 'playPrevious' } type - Command to register 'playPrevious'. + * @param { function } callback - Used to handle ('playPrevious') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'playPrevious', callback: () => void): void; /** @@ -1313,6 +1478,23 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register fastForward command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * When canceling the callback, need to update the supported commands list. + * Each playback command only supports registering one callback, + * and the new callback will replace the previous one. + * @param { 'fastForward' } type - Command to register 'fastForward'. + * @param { function } callback - Used to handle ('fastForward') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'fastForward', callback: (time ?: number) => void): void; /** @@ -1331,6 +1513,23 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register rewind command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * When canceling the callback, need to update the supported commands list. + * Each playback command only supports registering one callback, + * and the new callback will replace the previous one. + * @param { 'rewind' } type - Command to register 'rewind'. + * @param { function } callback - Used to handle ('rewind') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'rewind', callback: (time ?: number) => void): void; /** @@ -1345,6 +1544,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister play command callback. + * When canceling the callback, need to update the supported commands list. + * @param { 'play' } type - Command to register 'play'. + * @param { function } callback - Used to handle ('play') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'play', callback?: () => void): void; /** @@ -1359,6 +1571,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister pause command callback. + * When canceling the callback, need to update the supported commands list. + * @param { 'pause' } type - Command to register 'pause'. + * @param { function } callback - Used to handle ('pause') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'pause', callback?: () => void): void; /** @@ -1373,6 +1598,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister stop command callback. + * When canceling the callback, need to update the supported commands list. + * @param { 'stop' } type - Command to register 'stop'. + * @param { function } callback - Used to handle ('stop') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'stop', callback?: () => void): void; /** @@ -1387,6 +1625,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister playNext command callback. + * When canceling the callback, need to update the supported commands list. + * @param { 'playNext' } type - Command to register 'playNext'. + * @param { function } callback - Used to handle ('playNext') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'playNext', callback?: () => void): void; /** @@ -1401,6 +1652,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister playPrevious command callback. + * When canceling the callback, need to update the supported commands list. + * @param { 'playPrevious' } type - Command to register 'playPrevious'. + * @param { function } callback - Used to handle ('playPrevious') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'playPrevious', callback?: () => void): void; /** @@ -1415,6 +1679,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister fastForward command callback. + * When canceling the callback, need to update the supported commands list. + * @param { 'fastForward' } type - Command to register 'fastForward'. + * @param { function } callback - Used to handle ('fastForward') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'fastForward', callback?: () => void): void; /** @@ -1429,6 +1706,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister rewind command callback. + * When canceling the callback, need to update the supported commands list. + * @param { 'rewind' } type - Command to register 'rewind'. + * @param { function } callback - Used to handle ('rewind') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'rewind', callback?: () => void): void; /** @@ -1447,6 +1737,23 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Register playFromAssetId command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * When canceling the callback, need to update the supported commands list. + * Each playback command only supports registering one callback, + * and the new callback will replace the previous one. + * @param { 'playFromAssetId' } type - Command to register 'playFromAssetId'. + * @param { function } callback - Used to handle ('playFromAssetId') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'playFromAssetId', callback: (assetId: number) => void): void; /** @@ -1460,6 +1767,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Unregister playFromAssetId command callback. + * @param { 'playFromAssetId' } type - Command to register 'playFromAssetId'. + * @param { function } callback - Used to handle ('playFromAssetId') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'playFromAssetId', callback?: (assetId: number) => void): void; /** @@ -1473,6 +1792,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register seek command callback + * @param { 'seek' } type - Registration Type 'seek' + * @param { function } callback - Used to handle seek command.The callback provides the seek time(ms) + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'seek', callback: (time: number) => void): void; /** @@ -1486,6 +1817,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister seek command callback + * @param { 'seek' } type - Registration Type 'seek' + * @param { function } callback - Used to handle seek command.The callback provides the seek time(ms) + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'seek', callback?: (time: number) => void): void; /** @@ -1499,6 +1842,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register setSpeed command callback + * @param { 'setSpeed' } type - Registration Type 'setSpeed' + * @param { function } callback - Used to handle setSpeed command.The callback provides the speed value + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'setSpeed', callback: (speed: number) => void): void; /** @@ -1512,6 +1867,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister setSpeed command callback + * @param { 'setSpeed' } type - Registration Type 'setSpeed' + * @param { function } callback - Used to handle setSpeed command.The callback provides the speed value + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'setSpeed', callback?: (speed: number) => void): void; /** @@ -1525,6 +1892,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register setLoopMode command callback + * @param { 'setLoopMode' } type - Registration Type 'setLoopMode' + * @param { function } callback - Used to handle setLoopMode command.The callback provides the {@link LoopMode} + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void; /** @@ -1538,6 +1917,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister setLoopMode command callback + * @param { 'setLoopMode' } type - Registration Type 'setLoopMode' + * @param { function } callback - Used to handle setLoopMode command.The callback provides the {@link LoopMode} + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void; /** @@ -1552,6 +1943,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register toggle favorite command callback + * @param { 'toggleFavorite' } type - Registration Type 'toggleFavorite' + * @param { function } callback - Used to handle toggleFavorite command.The callback provides + * the assetId for which the favorite status needs to be switched. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'toggleFavorite', callback: (assetId: string) => void): void; /** @@ -1566,6 +1970,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister toggle favorite command callback + * @param { 'toggleFavorite' } type - Registration Type 'toggleFavorite' + * @param { function } callback - Used to handle toggleFavorite command.The callback provides + * the assetId for which the favorite status needs to be switched. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'toggleFavorite', callback?: (assetId: string) => void): void; /** @@ -1579,6 +1996,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register media key handling callback + * @param { 'handleKeyEvent' } type - Registration Type 'handleKeyEvent' + * @param { function } callback - Used to handle key events.The callback provides the KeyEvent + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void; /** @@ -1592,6 +2021,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister media key handling callback + * @param { 'handleKeyEvent' } type - Registration Type 'handleKeyEvent' + * @param { function } callback - Used to handle key events.The callback provides the KeyEvent + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void; /** @@ -1660,6 +2101,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register session custom command change callback + * @param { 'commonCommand' } type - Registration Type 'commonCommand' + * @param { function } callback - Used to handle event when the common command is received + * The callback provide the command name and command args + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'commonCommand', callback: (command: string, args: {[key: string]: Object}) => void): void; /** @@ -1674,6 +2128,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister session custom command change callback + * @param { 'commonCommand' } type - Registration Type 'commonCommand' + * @param { function } callback - Used to cancel a specific listener + * The callback provide the command name and command args + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'commonCommand', callback?: (command: string, args: {[key: string]: Object}) => void): void; /** @@ -1688,6 +2155,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register the item to play from the playlist change callback + * @param { 'skipToQueueItem' } type - Registration Type 'skipToQueueItem' + * @param { function } callback - Used to handle the item to be played. + * The callback provide the new device info {@link OutputDeviceInfo} + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'skipToQueueItem', callback: (itemId: number) => void): void; /** @@ -1702,6 +2182,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister the item to play from the playlist change callback + * @param { 'skipToQueueItem' } type - Registration Type 'skipToQueueItem' + * @param { function } callback - Used to handle the item to be played. + * The callback provide the new device info {@link OutputDeviceInfo} + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'skipToQueueItem', callback?: (itemId: number) => void): void; /** @@ -1717,6 +2210,20 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Register answer command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * @param { 'answer' } type - Command to register 'answer'. + * @param { Callback } callback - Used to handle ('answer') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'answer', callback: Callback): void; /** @@ -1730,6 +2237,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Unregister answer command callback. + * @param { 'answer' } type - Command to register 'answer'. + * @param { Callback } callback - Used to handle ('answer') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'answer', callback?: Callback): void; /** @@ -1745,6 +2264,20 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Register hangUp command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * @param { 'hangUp' } type - Command to register 'hangUp'. + * @param { Callback } callback - Used to handle ('hangUp') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'hangUp', callback: Callback): void; /** @@ -1758,6 +2291,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Unregister hangUp command callback. + * @param { 'hangUp' } type - Command to register 'hangUp'. + * @param { Callback } callback - Used to handle ('hangUp') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'hangUp', callback?: Callback): void; /** @@ -1773,6 +2318,20 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Register toggleCallMute command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * @param { 'toggleCallMute' } type - Command to register 'toggleCallMute'. + * @param { Callback } callback - Used to handle ('toggleCallMute') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'toggleCallMute', callback: Callback): void; /** @@ -1785,6 +2344,17 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Unregister toggleCallMute command callback. + * @param { 'toggleCallMute' } type - Command to register 'toggleCallMute'. + * @param { Callback } callback - Used to handle ('toggleCallMute') command + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'toggleCallMute', callback?: Callback): void; /** @@ -1796,6 +2366,7 @@ declare namespace avSession { * @throws { BusinessError } 6600101 - Session service exception * @throws { BusinessError } 6600102 - The session does not exist * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast + * @atomicservice * @since 12 */ on(type: 'castDisplayChange', callback: Callback): void; @@ -1809,6 +2380,7 @@ declare namespace avSession { * @throws { BusinessError } 6600101 - Session service exception * @throws { BusinessError } 6600102 - The session does not exist * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast + * @atomicservice * @since 12 */ off(type: 'castDisplayChange', callback?: Callback): void; @@ -2744,6 +3316,7 @@ declare namespace avSession { * Define the information for extended display screen. * @typedef CastDisplayInfo * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast + * @atomicservice * @since 12 */ interface CastDisplayInfo { @@ -2752,6 +3325,7 @@ declare namespace avSession { * The application can get more display information based on the same id from display interface. * @type { number } * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast + * @atomicservice * @since 12 */ id: number; @@ -2760,6 +3334,7 @@ declare namespace avSession { * Display name. * @type { string } * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast + * @atomicservice * @since 12 */ name: string; @@ -2768,6 +3343,7 @@ declare namespace avSession { * The state of display. * @type { CastDisplayState } * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast + * @atomicservice * @since 12 */ state: CastDisplayState; @@ -2776,6 +3352,7 @@ declare namespace avSession { * Display width, in pixels. * @type { number } * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast + * @atomicservice * @since 12 */ width: number; @@ -2784,6 +3361,7 @@ declare namespace avSession { * Display height, in pixels. * @type { number } * @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast + * @atomicservice * @since 12 */ height: number; @@ -3844,6 +4422,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * The metadata of the current call. + * @typedef CallMetadata + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ interface CallMetadata { /** * The displayed user name of current call. @@ -3851,6 +4436,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * The displayed user name of current call. + * @type { ?string } + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ name?: string; /** @@ -3859,6 +4451,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * The phone number of current call. + * @type { ?string } + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ phoneNumber?: string; /** @@ -3867,6 +4466,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * The displayed picture that represents a particular user. + * @type { ?image.PixelMap } + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ avatar?: image.PixelMap; } @@ -3876,6 +4482,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Used to indicate the call state of the current call. + * @typedef AVCallState + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ interface AVCallState { /** * Current call state. See {@link CallState} @@ -3883,6 +4496,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Current call state. See {@link CallState} + * @type { CallState } + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ state: CallState; /** @@ -3891,6 +4511,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Current muted status. + * @type { boolean } + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ muted: boolean; } @@ -3900,12 +4527,25 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Enumeration of current call state + * @enum { number } + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ enum CallState { /** * Idle state. * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Idle state. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ CALL_STATE_IDLE = 0, /** @@ -3913,6 +4553,12 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Incoming state. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ CALL_STATE_INCOMING = 1, /** @@ -3920,6 +4566,12 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Active state in calling. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ CALL_STATE_ACTIVE = 2, /** @@ -3927,6 +4579,12 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Dialing state. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ CALL_STATE_DIALING = 3, /** @@ -3934,6 +4592,12 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Waiting state. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ CALL_STATE_WAITING = 4, /** @@ -3941,6 +4605,12 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Holding state. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ CALL_STATE_HOLDING = 5, /** @@ -3948,6 +4618,12 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Disconnecting state. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ CALL_STATE_DISCONNECTING = 6, } @@ -4582,6 +5258,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Session controller,used to control media playback and get media information + * @typedef AVSessionController + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ interface AVSessionController { /** * Unique session Id @@ -4589,6 +5272,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unique session Id + * @type { string } + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ readonly sessionId: string; /** @@ -4611,6 +5301,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the playback status of the current session + * @returns { Promise } (AVPlaybackState) returned through promise + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getAVPlaybackState(): Promise; /** @@ -4622,6 +5322,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the playback status of the current session + * @returns { AVPlaybackState } (AVPlaybackState) returned + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getAVPlaybackStateSync(): AVPlaybackState; /** @@ -4644,6 +5354,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the metadata of the current session + * @returns { Promise } (AVMetadata) returned through promise + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getAVMetadata(): Promise; /** @@ -4655,6 +5375,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the metadata of the current session + * @returns { AVMetadata } (AVMetadata) returned + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getAVMetadataSync(): AVMetadata; /** @@ -4721,6 +5451,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the name of the playlist of the current session + * @returns { Promise } (string) returned through promise + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getAVQueueTitle(): Promise; /** @@ -4732,6 +5472,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the name of the playlist of the current session + * @returns { string } (string) returned + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getAVQueueTitleSync(): string; /** @@ -4754,6 +5504,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the playlist of the current session + * @returns { Promise> } (Array) returned through promise + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getAVQueueItems(): Promise>; /** @@ -4765,6 +5525,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the playlist of the current session + * @returns { Array } (Array) returned + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getAVQueueItemsSync(): Array; /** @@ -4793,6 +5563,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Set the item in the playlist to be played + * @param { number } itemId - The serial number of the item to be played + * @returns { Promise } void promise when executed successfully + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Parameter verification failed. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ skipToQueueItem(itemId: number): Promise; /** @@ -4813,6 +5596,15 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get output device information + * @returns { Promise } (OutputDeviceInfo) returned through promise + * @throws { BusinessError } 600101 - Session service exception. + * @throws { BusinessError } 600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getOutputDevice(): Promise; /** @@ -4823,6 +5615,15 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get output device information + * @returns { OutputDeviceInfo } (OutputDeviceInfo) returned + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getOutputDeviceSync(): OutputDeviceInfo; /** @@ -4855,6 +5656,21 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Send media key event to this session + * @param { KeyEvent } event - The KeyEvent + * @returns { Promise } void promise when executed successfully + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Parameter verification failed. + * @throws { BusinessError } 600101 - Session service exception. + * @throws { BusinessError } 600102 - The session does not exist. + * @throws { BusinessError } 600103 - The session controller does not exist. + * @throws { BusinessError } 600105 - Invalid session command. + * @throws { BusinessError } 600106 - The session is not activated. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ sendAVKeyEvent(event: KeyEvent): Promise; /** @@ -4877,6 +5693,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the {@link WantAgent} of this session that can launch the session ability + * @returns { Promise } WantAgent promise + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getLaunchAbility(): Promise; /** @@ -4888,6 +5714,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get the adjusted playback position. The time automatically calculated by the system + * taking into account factors such as playback status, playback speed, and application update time. + * @returns { number } current playback position in ms.Note that the returns value of each call will be different. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getRealPlaybackPositionSync(): number; /** @@ -4910,6 +5746,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Check if the current session is active + * @returns { Promise } boolean promise + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ isActive(): Promise; /** @@ -4921,6 +5767,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Check if the current session is active + * @returns { boolean } boolean + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ isActiveSync(): boolean; /** @@ -4941,6 +5797,15 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Destroy the server controller + * @returns { Promise } void promise when executed successfully + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ destroy(): Promise; /** @@ -4963,6 +5828,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get commands supported by the current session + * @returns { Promise> } array of AVControlCommandType promise + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getValidCommands(): Promise>; /** @@ -4974,6 +5849,16 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get commands supported by the current session + * @returns {Array } array of AVControlCommandType + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getValidCommandsSync(): Array; /** @@ -5008,6 +5893,22 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Send control commands to this session + * @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand} + * @returns { Promise } void promise when executed successfully + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Parameter verification failed. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @throws { BusinessError } 6600105 - Invalid session command. + * @throws { BusinessError } 6600106 - The session is not activated. + * @throws { BusinessError } 6600107 - Too many commands or events. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ sendControlCommand(command: AVControlCommand): Promise; /** @@ -5044,6 +5945,23 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Send common commands to this session + * @param { string } command - The command name to be sent. + * @param { object } args - The parameters of session event + * @returns { Promise } void promise when executed successfully + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Parameter verification failed. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @throws { BusinessError } 6600105 - Invalid session command. + * @throws { BusinessError } 6600106 - The session is not activated. + * @throws { BusinessError } 6600107 - Too many commands or events. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ sendCommonCommand(command: string, args: {[key: string]: Object}): Promise; /** @@ -5074,6 +5992,20 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Get custom media packets provided by the corresponding session + * @returns { Promise<{[key: string]: Object}> } the parameters of extras + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. 3.Parameter verification failed. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @throws { BusinessError } 6600105 - Invalid session command. + * @throws { BusinessError } 6600107 - Too many commands or events. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ getExtras(): Promise<{[key: string]: Object}>; /** @@ -5090,6 +6022,21 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register metadata changed callback + * @param { 'metadataChange' } type + * @param { Array | 'all' } filter - The properties of {@link AVMetadata} that you cared about + * @param { function } callback - The callback used to handle metadata changed event. + * The callback function provides the {@link AVMetadata} parameter. + * It only contains the properties set in the filter. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'metadataChange', filter: Array | 'all', callback: (data: AVMetadata) => void); /** @@ -5105,6 +6052,20 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister metadata changed callback + * @param { 'metadataChange' } type + * @param { function } callback - The callback used to handle metadata changed event. + * The callback function provides the {@link AVMetadata} parameter. + * It only contains the properties set in the filter. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'metadataChange', callback?: (data: AVMetadata) => void); /** @@ -5120,6 +6081,20 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register playback state changed callback + * @param { 'playbackStateChange' } type + * @param { Array | 'all' } filter - The properties of {@link AVPlaybackState} that you cared about + * @param { function } callback - The callback used to handle playback state changed event. + * The callback function provides the {@link AVPlaybackState} parameter. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'playbackStateChange', filter: Array | 'all', callback: (state: AVPlaybackState) => void); /** @@ -5134,6 +6109,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister playback state changed callback + * @param { 'playbackStateChange' } type + * @param { function } callback - The callback used to handle playback state changed event. + * The callback function provides the {@link AVPlaybackState} parameter. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void); /** @@ -5150,6 +6138,21 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Register call metadata changed callback + * @param { 'callMetadataChange' } type - 'callMetadataChange' + * @param { Array | 'all' } filter - The properties of {@link CallMetadata} that you cared about + * @param { Callback } callback - The callback used to handle call metadata changed event. + * The callback function provides the {@link CallMetadata} parameter. + * It only contains the properties set in the filter. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'callMetadataChange', filter: Array | 'all', callback: Callback): void; /** @@ -5165,6 +6168,20 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Unregister call metadata changed callback + * @param { 'callMetadataChange' } type - 'callMetadataChange' + * @param { Callback } callback - The callback used to handle call metadata changed event. + * The callback function provides the {@link CallMetadata} parameter. + * It only contains the properties set in the filter. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'callMetadataChange', callback?: Callback): void; /** @@ -5180,6 +6197,20 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Register call state changed callback + * @param { 'callStateChange' } type - 'callStateChange' + * @param { Array | 'all' } filter - The properties of {@link AVCallState} that you cared about + * @param { Callback } callback - The callback used to handle call state changed event. + * The callback function provides the {@link AVCallState} parameter. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'callStateChange', filter: Array | 'all', callback: Callback): void; /** @@ -5194,6 +6225,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * Unregister playback state changed callback + * @param { 'callStateChange' } type - 'callStateChange' + * @param { Callback } callback - The callback used to handle call state changed event. + * The callback function provides the {@link AVCallState} parameter. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'callStateChange', callback?: Callback): void; /** @@ -5207,6 +6251,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register current session destroyed callback + * @param { 'sessionDestroy' } type + * @param { function } callback - The callback used to handle current session destroyed event. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'sessionDestroy', callback: () => void); /** @@ -5220,6 +6276,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister current session destroyed callback + * @param { 'sessionDestroy' } type - 'sessionDestroy' + * @param { function } callback - The callback used to handle current session destroyed event. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'sessionDestroy', callback?: () => void); /** @@ -5234,6 +6302,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register the active state of this session changed callback + * @param { 'activeStateChange' } type - 'activeStateChange' + * @param { function } callback - The callback used to handle the active state of this session changed event. + * The callback function provides the changed session state. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'activeStateChange', callback: (isActive: boolean) => void); /** @@ -5248,6 +6329,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister the active state of this session changed callback + * @param { 'activeStateChange' } type - 'activeStateChange' + * @param { function } callback - The callback used to handle the active state of this session changed event. + * The callback function provides the changed session state. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'activeStateChange', callback?: (isActive: boolean) => void); /** @@ -5262,6 +6356,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register the valid commands of the session changed callback + * @param { 'validCommandChange' } type - 'validCommandChange' + * @param { function } callback - The callback used to handle the changes. + * The callback function provides an array of AVControlCommandType. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'validCommandChange', callback: (commands: Array) => void); /** @@ -5276,6 +6383,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister the valid commands of the session changed callback + * @param { 'validCommandChange' } type - 'validCommandChange' + * @param { function } callback - The callback used to handle the changes. + * The callback function provides an array of AVControlCommandType. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'validCommandChange', callback?: (commands: Array) => void); /** @@ -5290,6 +6410,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register session output device change callback + * @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange' + * @param { function } callback - Used to handle output device changed. + * The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception + * @throws { BusinessError } 6600103 - The session controller does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'outputDeviceChange', callback: (state: ConnectionState, device: OutputDeviceInfo) => void): void; /** @@ -5304,6 +6437,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister session output device change callback + * @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange' + * @param { function } callback - Used to handle output device changed. + * The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception + * @throws { BusinessError } 6600103 - The session controller does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'outputDeviceChange', callback?: (state: ConnectionState, device: OutputDeviceInfo) => void): void; /** @@ -5318,6 +6464,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register session event callback + * @param { 'sessionEvent' } type - 'sessionEvent' + * @param { function } callback - The callback used to handle session event changed event. + * The callback function provides the event string and key-value pair parameters. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'sessionEvent', callback: (sessionEvent: string, args: {[key: string]: Object}) => void): void; /** @@ -5332,6 +6491,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister session event callback + * @param { 'sessionEvent' } type - 'sessionEvent' + * @param { function } callback - Used to cancel a specific listener + * The callback function provides the event string and key-value pair parameters. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'sessionEvent', callback?: (sessionEvent: string, args: {[key: string]: Object}) => void): void; /** @@ -5346,6 +6518,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register session playlist change callback + * @param { 'queueItemsChange' } type - Registration Type 'queueItemsChange' + * @param { function } callback - Used to handle playlist changed. + * The callback provides the new array of AVQueueItem {@link AVQueueItem} + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'queueItemsChange', callback: (items: Array) => void): void; /** @@ -5360,6 +6545,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister session playlist change callback + * @param { 'queueItemsChange' } type - Registration Type 'queueItemsChange' + * @param { function } callback - Used to handle playlist changed. + * The callback provides the new array of AVQueueItem {@link AVQueueItem} + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'queueItemsChange', callback?: (items: Array) => void): void; /** @@ -5374,6 +6572,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register the name of session playlist change callback + * @param { 'queueTitleChange' } type - Registration Type 'queueTitleChange' + * @param { function } callback - Used to handle name of playlist changed. + * The callback provides the new name. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'queueTitleChange', callback: (title: string) => void): void; /** @@ -5388,6 +6599,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister the name of session playlist change callback + * @param { 'queueTitleChange' } type - Registration Type 'queueTitleChange' + * @param { function } callback - Used to handle name of playlist changed. + * The callback provides the new name. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'queueTitleChange', callback?: (title: string) => void): void; /** @@ -5402,6 +6626,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Register the custom media packets change callback + * @param { 'extrasChange' } type - Registration Type 'extrasChange' + * @param { function } callback - Used to handle custom media packets changed. + * The callback provides the new media packets. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ on(type: 'extrasChange', callback: (extras: {[key: string]: Object}) => void): void; /** @@ -5416,6 +6653,19 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * Unregister the custom media packets change callback + * @param { 'extrasChange' } type - Registration Type 'extrasChange' + * @param { function } callback - Used to handle custom media packets changed. + * The callback provides the new media packets. + * @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified. + * 2.Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600103 - The session controller does not exist. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ off(type: 'extrasChange', callback?: (extras: {[key: string]: Object}) => void): void; } @@ -5434,6 +6684,15 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 11 */ + /** + * The type of control command, add new support 'playFromAssetId' | 'answer' | 'hangUp' | 'toggleCallMute' + * @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' | + * 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'playFromAssetId' | 'answer' | 'hangUp' | + * 'toggleCallMute' } AVControlCommandType + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ type AVControlCommandType = 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'playFromAssetId' | 'answer' | 'hangUp' | 'toggleCallMute'; @@ -5443,6 +6702,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * The definition of command to be sent to the session + * @typedef AVControlCommand + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ interface AVControlCommand { /** * The command value {@link AVControlCommandType} @@ -5450,6 +6716,13 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * The command value {@link AVControlCommandType} + * @type { AVControlCommandType } + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ command: AVControlCommandType; /** @@ -5463,6 +6736,18 @@ declare namespace avSession { * @syscap SystemCapability.Multimedia.AVSession.Core * @since 10 */ + /** + * parameter of the command. Whether this command requires parameters, see {@link AVSessionCommand} + * seek command requires a number parameter + * setSpeed command requires a number parameter + * setLoopMode command requires a {@link LoopMode} parameter. + * toggleFavorite command requires assetId {@link AVMetadata.assetId} parameter + * other commands need no parameter + * @type { ?(LoopMode | string | number) } + * @syscap SystemCapability.Multimedia.AVSession.Core + * @atomicservice + * @since 12 + */ parameter?: LoopMode | string | number; } diff --git a/api/@ohos.multimodalInput.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts index 9eef511e8..65053adb0 100644 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -25,6 +25,14 @@ * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ +/** + * InputEvent + * + * @typedef InputEvent + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ export declare interface InputEvent { /** * Unique event ID generated by the server @@ -32,6 +40,13 @@ export declare interface InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Unique event ID generated by the server + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ id: number; /** @@ -40,6 +55,13 @@ export declare interface InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * ID of the device that reports the input event + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ deviceId: number; /** @@ -48,6 +70,13 @@ export declare interface InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Occurrence time of the input event + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ actionTime: number; /** @@ -56,6 +85,13 @@ export declare interface InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * ID of the target screen + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ screenId: number; /** @@ -64,5 +100,12 @@ export declare interface InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * ID of the target window + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ windowId: number; } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index 892c66f01..ad6826357 100644 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -27,6 +27,14 @@ import type { KeyCode } from './@ohos.multimodalInput.keyCode'; * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ +/** + * Action + * + * @enum { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ export declare enum Action { /** * Cancel key @@ -34,6 +42,13 @@ export declare enum Action { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Cancel key + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ CANCEL = 0, /** @@ -42,6 +57,13 @@ export declare enum Action { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Down key + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ DOWN = 1, /** @@ -50,6 +72,13 @@ export declare enum Action { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Up key + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ UP = 2 } @@ -60,6 +89,14 @@ export declare enum Action { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ +/** + * Key + * + * @typedef Key + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ export declare interface Key { /** * Key code @@ -67,6 +104,13 @@ export declare interface Key { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Key code + * @type { KeyCode } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ code: KeyCode; /** @@ -75,6 +119,13 @@ export declare interface Key { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Time when the key is pressed + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ pressedTime: number; /** @@ -83,6 +134,13 @@ export declare interface Key { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Device to which the key belongs + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ deviceId: number; } @@ -93,6 +151,14 @@ export declare interface Key { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ +/** + * KeyEvent + * + * @typedef KeyEvent + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ export declare interface KeyEvent extends InputEvent { /** * Key action @@ -100,6 +166,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Key action + * @type { Action } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ action: Action; /** @@ -108,6 +181,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Key that has changed + * @type { Key } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ key: Key; /** @@ -116,6 +196,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Unicode character corresponding to the key + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ unicodeChar: number; /** @@ -124,6 +211,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * List of pressed keys + * @type { Key[] } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ keys: Key[]; /** @@ -132,6 +226,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Whether ctrlKey is being pressed + * @type { boolean } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ ctrlKey: boolean; /** @@ -140,6 +241,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Whether altKey is being pressed + * @type { boolean } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ altKey: boolean; /** @@ -148,6 +256,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Whether shiftKey is being pressed + * @type { boolean } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ shiftKey: boolean; /** @@ -156,6 +271,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Whether logoKey is being pressed + * @type { boolean } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ logoKey: boolean; /** @@ -164,6 +286,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Whether fnKey is being pressed + * @type { boolean } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ fnKey: boolean; /** @@ -172,6 +301,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Whether capsLock is active + * @type { boolean } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ capsLock: boolean; /** @@ -180,6 +316,13 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Whether numLock is active + * @type { boolean } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ numLock: boolean; /** @@ -188,5 +331,12 @@ export declare interface KeyEvent extends InputEvent { * @syscap SystemCapability.MultimodalInput.Input.Core * @since 9 */ + /** + * Whether scrollLock is active + * @type { boolean } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @atomicservice + * @since 12 + */ scrollLock: boolean; } \ No newline at end of file diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index b78cce49d..350b5d2c9 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -446,6 +446,14 @@ declare namespace wantAgent { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 7 */ +/** + * WantAgent object. + * + * @typedef { object } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @atomicservice + * @since 12 + */ export type WantAgent = object; export default wantAgent;