diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index a8d27470139d527f40b57b4ab97abdd095d7dace..994be25c9253a058377c93678fa441e7db281a2d 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -1023,8 +1023,7 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ createCameraInput(camera: CameraDevice): CameraInput; @@ -1069,11 +1068,59 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ createCameraInput(position: CameraPosition, type: CameraType): CameraInput; + /** + * @since 20 + * @arkts 1.2 + */ + overload createCameraInput { createCameraInputWithCamera, createCameraInputWithPositionType }; + + /** + * Creates a CameraInput instance by camera. + * + * Before using this interface, first through the getSupportedCameras interface to query the current list of camera + * devices supported by the device, the developer needs to be based on specific scenarios to choose the camera device + * that meets the needs of the developer, and then use this interface to create a CameraInput instance. + * + * @permission ohos.permission.CAMERA + * @param { CameraDevice } camera - Camera device used to create the instance. + * @returns { CameraInput } Returns a CameraInput instance. Failure of an interface call returns the corresponding + * error code, which is of type CameraErrorCode. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + createCameraInputWithCamera(camera: CameraDevice): CameraInput; + + /** + * Creates a CameraInput instance by camera position and type. + * + * @permission ohos.permission.CAMERA + * @param { CameraPosition } position - Camera position, first get the supported camera device + * objects through the getSupportedCameras interface, and then get the device position information + * based on the returned camera device objects. + * @param { CameraType } type - camera type, first get the supported camera device object through + * the getSupportedCameras interface, then get the device type information based on the returned + * camera device object. + * @returns { CameraInput } Returns a CameraInput instance. Failure of an interface call returns + * the corresponding error code, which is of type CameraErrorCode. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + createCameraInputWithPositionType(position: CameraPosition, type: CameraType): CameraInput; + /** * Creates a PreviewOutput instance. * @@ -1106,8 +1153,7 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput; @@ -1134,11 +1180,48 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ createPreviewOutput(surfaceId: string): PreviewOutput; + /** + * @since 20 + * @arkts 1.2 + */ + overload createPreviewOutput { createPreviewOutputWithProfileSurfaceId, createPreviewOutputWithSurfaceId }; + + /** + * Creates a PreviewOutput instance. + * + * @param { Profile } profile - Supported preview configuration information, + * obtained through the getSupportedOutputCapability API. + * @param { string } surfaceId - Surface object id used in camera photo output. + * @returns { PreviewOutput } The PreviewOutput instance. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + createPreviewOutputWithProfileSurfaceId(profile: Profile, surfaceId: string): PreviewOutput; + + /** + * Creates a PreviewOutput instance without profile. + * You can use this method to create a preview output instance without a profile, This instance can + * only be used in a preconfiged session. + * + * @param { string } surfaceId - Surface object id used in camera preview output. + * @returns { PreviewOutput } The PreviewOutput instance. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + createPreviewOutputWithSurfaceId(surfaceId: string): PreviewOutput; + /** * Creates a PhotoOutput instance. * @@ -1231,8 +1314,7 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput; @@ -1259,11 +1341,48 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ createVideoOutput(surfaceId: string): VideoOutput; + /** + * @since 20 + * @arkts 1.2 + */ + overload createVideoOutput { createVideoOutputWithProfileSurfaceId, createVideoOutputWithSurfaceId }; + + /** + * Creates a VideoOutput instance. + * + * @param { VideoProfile } profile - Supported recording configuration information, + * obtained through the getSupportedOutputCapability API. + * @param { string } surfaceId - Surface object id used in camera video output. + * @returns { VideoOutput } The VideoOutput instance. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + createVideoOutputWithProfileSurfaceId(profile: VideoProfile, surfaceId: string): VideoOutput; + + /** + * Creates a VideoOutput instance without profile. + * You can use this method to create a video output instance without a profile, This instance can + * only be used in a preconfiged session. + * + * @param { string } surfaceId - Surface object id used in camera video output. + * @returns { VideoOutput } The VideoOutput instance. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + createVideoOutputWithSurfaceId(surfaceId: string): VideoOutput; + /** * Creates a MetadataOutput instance. * @@ -1419,8 +1538,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to get the camera status change. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ on(type: 'cameraStatus', callback: AsyncCallback): void; @@ -1439,8 +1557,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to get the camera status change. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ off(type: 'cameraStatus', callback?: AsyncCallback): void; @@ -1462,8 +1579,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to get the fold status change. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ on(type: 'foldStatusChange', callback: AsyncCallback): void; @@ -1482,8 +1598,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to get the fold status change. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ off(type: 'foldStatusChange', callback?: AsyncCallback): void; @@ -1504,8 +1619,7 @@ declare namespace camera { * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ on(type: 'cameraMute', callback: AsyncCallback): void; @@ -1526,8 +1640,7 @@ declare namespace camera { * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ off(type: 'cameraMute', callback?: AsyncCallback): void; @@ -1771,8 +1884,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to return the torch status change * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ on(type: 'torchStatusChange', callback: AsyncCallback): void; @@ -1791,10 +1903,130 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to return the torch status change * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ off(type: 'torchStatusChange', callback?: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload on { onCameraStatus, onFoldStatusChange, onCameraMute, onTorchStatusChange }; + + /** + * Camera state callback to get the state change of the camera by registering a callback + * function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'cameraStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the camera status change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onCameraStatus(type: 'cameraStatus', callback: AsyncCallback): void; + + /** + * Registers a listener for fold state changes. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'foldStatusChanged' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the fold status change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onFoldStatusChange(type: 'foldStatusChange', callback: AsyncCallback): void; + + /** + * Subscribes camera mute change event callback. + * + * @param { 'cameraMute' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the camera mute change. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + onCameraMute(type: 'cameraMute', callback: AsyncCallback): void; + + /** + * Registers a listener for flashlight state changes to get flashlight state change by registering + * a callback function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'torchStatusChange' } type - Event type + * @param { AsyncCallback } callback - Callback used to return the torch status change + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onTorchStatusChange(type: 'torchStatusChange', callback: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload off { offCameraStatus, offFoldStatusChange, offCameraMute, offTorchStatusChange }; + + /** + * Unsubscribes from camera status change event callback. + * + * @param { 'cameraStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the camera status change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + offCameraStatus(type: 'cameraStatus', callback?: AsyncCallback): void; + + /** + * Unsubscribes from fold status change event callback. + * + * @param { 'foldStatusChanged' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the fold status change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + offFoldStatusChange(type: 'foldStatusChange', callback?: AsyncCallback): void; + + /** + * Unsubscribes from camera mute change event callback. + * + * @param { 'cameraMute' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the camera mute change. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + offCameraMute(type: 'cameraMute', callback?: AsyncCallback): void; + + /** + * Unsubscribes torch status change event callback. + * + * @param { 'torchStatusChange' } type - Event type + * @param { AsyncCallback } callback - Callback used to return the torch status change + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + offTorchStatusChange(type: 'torchStatusChange', callback?: AsyncCallback): void; } /** @@ -2727,8 +2959,7 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ open(callback: AsyncCallback): void; @@ -2753,8 +2984,7 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ open(): Promise; @@ -2780,27 +3010,33 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ open(isSecureEnabled: boolean): Promise; /** - * Open camera with specified concurrent type. + * @since 20 + * @arkts 1.2 + */ + overload open { openWithCallback, openReturnsPromise, openWithisSecureEnabledReturnsPromiseofBigint }; + + /** + * Open camera. * - * @param { CameraConcurrentType } type - Camera concurrent type. - * @returns { Promise } Promise used to return the result. - * @throws { BusinessError } 7400102 - Operation not allowed. + * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core - * @since 18 + * @atomicservice + * @since 20 + * @arkts 1.2 */ + openWithCallback(callback: AsyncCallback): void; + /** - * Open camera with specified concurrent type. + * Open camera. * - * @param { CameraConcurrentType } type - Camera concurrent type. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 7400102 - Operation not allowed. * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. @@ -2808,12 +3044,56 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since 19 + * @since 20 + * @arkts 1.2 */ - open(type: CameraConcurrentType): Promise; + openReturnsPromise(): Promise; /** - * Close camera. + * Open camera. + * + * @param { boolean } isSecureEnabled - Setting true enables the camera to be opened in a safe way, + * setting false does the opposite. Failure of an interface call returns an error code of type CameraErrorCode. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. + * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + openWithisSecureEnabledReturnsPromiseofBigint(isSecureEnabled: boolean): Promise; + + /** + * Open camera with specified concurrent type. + * + * @param { CameraConcurrentType } type - Camera concurrent type. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. + * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 18 + */ + /** + * Open camera with specified concurrent type. + * + * @param { CameraConcurrentType } type - Camera concurrent type. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400107 - Can not use camera cause of conflict. + * @throws { BusinessError } 7400108 - Camera disabled cause of security reason. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 19 + */ + open(type: CameraConcurrentType): Promise; + + /** + * Close camera. * * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 7400201 - Camera service fatal error. @@ -2827,8 +3107,7 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ close(callback: AsyncCallback): void; @@ -2847,11 +3126,40 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ close(): Promise; + /** + * @since 20 + * @arkts 1.2 + */ + overload close { closeWithCallback, closeReturnsPromise }; + + /** + * Close camera. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + closeWithCallback(callback: AsyncCallback): void; + + /** + * Close camera. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + closeReturnsPromise(): Promise; + /** * Delay close camera. * @@ -2888,8 +3196,7 @@ declare namespace camera { * @param { ErrorCallback } callback - Callback used to get the camera input errors. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; @@ -2910,8 +3217,7 @@ declare namespace camera { * @param { ErrorCallback } callback - Callback used to get the camera input errors. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ off(type: 'error', camera: CameraDevice, callback?: ErrorCallback): void; @@ -2923,8 +3229,7 @@ declare namespace camera { * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ on(type: 'cameraOcclusionDetection', callback: AsyncCallback): void; @@ -2936,11 +3241,78 @@ declare namespace camera { * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ off(type: 'cameraOcclusionDetection', callback?: AsyncCallback): void; + /** + * @since 20 + * @arkts 1.2 + */ + overload on { onError, onCameraOcclusionDetection } + + /** + * Registers a listener for CameraInput error events to get the result by registering + * a callback function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'error' } type - Event type. + * @param { CameraDevice } camera - Camera device. + * @param { ErrorCallback } callback - Callback used to get the camera input errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onError(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; + + /** + * Subscribes to camera occlusion detection results. + * + * @param { 'cameraOcclusionDetection' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get detection results. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + onCameraOcclusionDetection(type: 'cameraOcclusionDetection', callback: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload off { offError, offCameraOcclusionDetection } + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { CameraDevice } camera - Camera device. + * @param { ErrorCallback } callback - Callback used to get the camera input errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + offError(type: 'error', camera: CameraDevice, callback?: ErrorCallback): void; + + /** + * Unsubscribes from camera occlusion detection results. + * + * @param { 'cameraOcclusionDetection' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get detection results. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + offCameraOcclusionDetection(type: 'cameraOcclusionDetection', callback?: AsyncCallback): void; + /** * Sets the camera to be used as a camera at the specified position. * @@ -6409,8 +6781,7 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ commitConfig(callback: AsyncCallback): void; @@ -6431,11 +6802,42 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ commitConfig(): Promise; + /** + * @since 20 + * @arkts 1.2 + */ + overload commitConfig {commitConfigWithCallback, commitConfigReturnsPromise }; + + /** + * Commit capture session config. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + commitConfigWithCallback(callback: AsyncCallback): void; + + /** + * Commit capture session config. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + commitConfigReturnsPromise(): Promise; + /** * Determines whether the camera input can be added into the session. * This method is valid between Session.beginConfig() and Session.commitConfig(). @@ -6704,8 +7106,7 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ start(callback: AsyncCallback): void; @@ -6737,11 +7138,44 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ start(): Promise; + /** + * @since 20 + * @arkts 1.2 + */ + overload start { startWithCallback, startReturnsPromise }; + + /** + * Starts capture session. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + startWithCallback(callback: AsyncCallback): void; + + /** + * Starts capture session. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400102 - Operation not allowed. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + startReturnsPromise(): Promise; + /** * Stops capture session. * @@ -6757,8 +7191,7 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ stop(callback: AsyncCallback): void; @@ -6777,11 +7210,40 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ stop(): Promise; + /** + * @since 20 + * @arkts 1.2 + */ + overload stop { stopWithCallback, stopReturnsPromise }; + + /** + * Stops capture session. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + stopWithCallback(callback: AsyncCallback): void; + + /** + * Stops capture session. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + stopReturnsPromise(): Promise; + /** * Release capture session instance. * @@ -6797,8 +7259,7 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ release(callback: AsyncCallback): void; @@ -6817,11 +7278,40 @@ declare namespace camera { * @throws { BusinessError } 7400201 - Camera service fatal error. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ release(): Promise; + /** + * @since 20 + * @arkts 1.2 + */ + overload release { releaseWithCallback, releaseReturnsPromise }; + + /** + * Release capture session instance. + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + releaseWithCallback(callback: AsyncCallback): void; + + /** + * Release capture session instance. + * + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + releaseReturnsPromise(): Promise; + /** * Set usage for the capture session. * @@ -7908,8 +8398,7 @@ declare namespace camera { * @param { ErrorCallback } callback - Callback used to get the capture session errors. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ on(type: 'error', callback: ErrorCallback): void; @@ -7928,8 +8417,7 @@ declare namespace camera { * @param { ErrorCallback } callback - Callback used to get the capture session errors. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ off(type: 'error', callback?: ErrorCallback): void; @@ -7952,8 +8440,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to get the focus state change. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ on(type: 'focusStateChange', callback: AsyncCallback): void; @@ -7972,8 +8459,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to get the focus state change. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ off(type: 'focusStateChange', callback?: AsyncCallback): void; @@ -7996,8 +8482,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to get the zoom info. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; @@ -8016,8 +8501,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to get the zoom info. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; @@ -8029,8 +8513,7 @@ declare namespace camera { * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ on(type: 'macroStatusChanged', callback: AsyncCallback): void; @@ -8042,8 +8525,7 @@ declare namespace camera { * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ off(type: 'macroStatusChanged', callback?: AsyncCallback): void; @@ -8056,8 +8538,7 @@ declare namespace camera { * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ on(type: 'featureDetection', featureType: SceneFeatureType, callback: AsyncCallback): void; @@ -8070,8 +8551,7 @@ declare namespace camera { * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ off(type: 'featureDetection', featureType: SceneFeatureType, callback?: AsyncCallback): void; @@ -8082,8 +8562,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ on(type: 'effectSuggestionChange', callback: AsyncCallback): void; @@ -8094,8 +8573,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ off(type: 'effectSuggestionChange', callback?: AsyncCallback): void; @@ -8118,8 +8596,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ on(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback): void; @@ -8138,8 +8615,7 @@ declare namespace camera { * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ off(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback): void; @@ -8151,8 +8627,7 @@ declare namespace camera { * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ on(type: 'lcdFlashStatus', callback: AsyncCallback): void; @@ -8164,11 +8639,240 @@ declare namespace camera { * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ off(type: 'lcdFlashStatus', callback?: AsyncCallback): void; + /** + * @since 20 + * @arkts 1.2 + */ + overload on { onError, onFocusStateChange, onSmoothZoomInfoAvailable, onMacroStatusChanged, onFeatureDetection, + onEffectSuggestionChange, onAutoDeviceSwitchStatusChange, onLcdFlashStatus }; + + /** + * Registers a listener for error events from a normal video session to get the result by registering + * a callback function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onError(type: 'error', callback: ErrorCallback): void; + + /** + * Registers a listener for camera focus state changes to get the result by registering + * a callback function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onFocusStateChange(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Registers a listener for state changes in the camera's smooth zoom to get the result by registering + * a callback function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onSmoothZoomInfoAvailable(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; + + /** + * Subscribes camera macro status event callback. + * + * @param { 'macroStatusChanged' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + onMacroStatusChanged(type: 'macroStatusChanged', callback: AsyncCallback): void; + + /** + * Subscribes to feature detection results. + * + * @param { 'featureDetection' } type - Event type. + * @param { SceneFeatureType } featureType - Feature type. + * @param { AsyncCallback } callback - Callback used to get the detection result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + onFeatureDetection(type: 'featureDetection', featureType: SceneFeatureType, callback: AsyncCallback): void; + + /** + * Subscribes to effect suggestion event callback. + * + * @param { 'effectSuggestionChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + onEffectSuggestionChange(type: 'effectSuggestionChange', callback: AsyncCallback): void; + + /** + * Registers a listener for the camera's automatic lens switching state changes to get the result + * by registering a callback function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'autoDeviceSwitchStatusChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onAutoDeviceSwitchStatusChange(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback): void; + + /** + * Subscribes to lcd flash status. + * + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + onLcdFlashStatus(type: 'lcdFlashStatus', callback: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload off { offError, offFocusStateChange, offSmoothZoomInfoAvailable, offMacroStatusChanged, + offFeatureDetection, offEffectSuggestionChange, offAutoDeviceSwitchStatusChange, offLcdFlashStatus }; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + offError(type: 'error', callback?: ErrorCallback): void; + + /** + * Unsubscribes from focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + offFocusStateChange(type: 'focusStateChange', callback?: AsyncCallback): void; + + /** + * Unsubscribes from zoom info event callback. + * + * @param { 'smoothZoomInfoAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the zoom info. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + offSmoothZoomInfoAvailable(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; + + /** + * Unsubscribes camera macro status event callback. + * + * @param { 'macroStatusChanged' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + offMacroStatusChanged(type: 'macroStatusChanged', callback?: AsyncCallback): void; + + /** + * Unsubscribes from feature detection result. + * + * @param { 'featureDetection' } type - Event type. + * @param { SceneFeatureType } featureType - Feature type. + * @param { AsyncCallback } callback - Callback used to get the detection result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + offFeatureDetection(type: 'featureDetection', featureType: SceneFeatureType, callback?: AsyncCallback): void; + + /** + * Unsubscribes from effect suggestion event callback. + * + * @param { 'effectSuggestionChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + offEffectSuggestionChange(type: 'effectSuggestionChange', callback?: AsyncCallback): void; + + /** + * Unsubscribes to auto device switch status event callback. + * + * @param { 'autoDeviceSwitchStatusChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + offAutoDeviceSwitchStatusChange(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback): void; + + /** + * Unsubscribes from lcd flash status. + * + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.2 + */ + offLcdFlashStatus(type: 'lcdFlashStatus', callback?: AsyncCallback): void; + /** * Gets session functions. *