diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 32a2d4b1df4530746bf92259f9f5922449e29054..6f9ccd84aaef795c57b63bd2e4edd103b11abaeb 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -1422,7 +1422,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'cameraStatus', callback: AsyncCallback): void; @@ -1442,7 +1441,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'cameraStatus', callback?: AsyncCallback): void; @@ -1465,7 +1463,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'foldStatusChange', callback: AsyncCallback): void; @@ -1485,7 +1482,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'foldStatusChange', callback?: AsyncCallback): void; @@ -1507,7 +1503,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic - * @since 20 static */ on(type: 'cameraMute', callback: AsyncCallback): void; @@ -1529,10 +1524,33 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic - * @since 20 static */ off(type: 'cameraMute', callback?: AsyncCallback): void; + /** + * Subscribes control center status change event callback. + * + * @param { 'controlCenterStatusChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the control center status change. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 dynamic + */ + on(type: 'controlCenterStatusChange', callback: AsyncCallback): void; + + /** + * Unsubscribes control center status change event callback. + * + * @param { 'controlCenterStatusChange' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to get the control center status change. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 dynamic + */ + off(type: 'controlCenterStatusChange', callback?: AsyncCallback): void; + /** * Determines whether the camera device supports prelaunch. * This function must be called in prior to the setPrelaunchConfig and prelaunch functions. @@ -1774,7 +1792,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'torchStatusChange', callback: AsyncCallback): void; @@ -1794,9 +1811,127 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'torchStatusChange', callback?: AsyncCallback): void; + + /** + * 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 + * @since 22 static + */ + onCameraStatus(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 { 'foldStatusChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the fold status change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + onFoldStatusChange(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 22 static + */ + onCameraMute(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 + * @since 22 static + */ + onTorchStatusChange(callback: AsyncCallback): void; + + /** + * Subscribes control center status change event callback. + * + * @param { 'controlCenterStatusChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the control center status change. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + onControlCenterStatusChange(callback: AsyncCallback): void; + + /** + * 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 + * @since 22 static + */ + offCameraStatus(callback?: AsyncCallback): void; + + /** + * Unsubscribes from fold status change event callback. + * + * @param { 'foldStatusChange' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to get the fold status change. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + offFoldStatusChange(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 22 static + */ + offCameraMute(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 + * @since 22 static + */ + offTorchStatusChange(callback?: AsyncCallback): void; + + /** + * Unsubscribes control center status change event callback. + * + * @param { 'controlCenterStatusChange' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to get the control center status change. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + offControlCenterStatusChange(callback?: AsyncCallback): void; } /** @@ -2892,7 +3027,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; @@ -2914,7 +3048,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'error', camera: CameraDevice, callback?: ErrorCallback): void; @@ -2927,7 +3060,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ on(type: 'cameraOcclusionDetection', callback: AsyncCallback): void; @@ -2940,10 +3072,59 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ off(type: 'cameraOcclusionDetection', callback?: AsyncCallback): void; + /** + * 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 + * @since 22 static + */ + onError(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 22 static + */ + onCameraOcclusionDetection(callback: AsyncCallback): void; + + /** + * 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 + * @since 22 static + */ + offError(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 22 static + */ + offCameraOcclusionDetection(callback?: AsyncCallback): void; + /** * Sets the camera to be used as a camera at the specified position. * @@ -7897,7 +8078,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'error', callback: ErrorCallback): void; @@ -7917,7 +8097,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'error', callback?: ErrorCallback): void; @@ -7941,7 +8120,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'focusStateChange', callback: AsyncCallback): void; @@ -7961,7 +8139,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'focusStateChange', callback?: AsyncCallback): void; @@ -7985,7 +8162,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'smoothZoomInfoAvailable', callback: AsyncCallback): void; @@ -8005,7 +8181,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; @@ -8018,7 +8193,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 11 dynamic - * @since 20 static */ on(type: 'macroStatusChanged', callback: AsyncCallback): void; @@ -8031,7 +8205,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 11 dynamic - * @since 20 static */ off(type: 'macroStatusChanged', callback?: AsyncCallback): void; @@ -8045,7 +8218,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ on(type: 'featureDetection', featureType: SceneFeatureType, callback: AsyncCallback): void; @@ -8059,7 +8231,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ off(type: 'featureDetection', featureType: SceneFeatureType, callback?: AsyncCallback): void; @@ -8071,7 +8242,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ on(type: 'effectSuggestionChange', callback: AsyncCallback): void; @@ -8083,7 +8253,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ off(type: 'effectSuggestionChange', callback?: AsyncCallback): void; @@ -8107,7 +8276,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback): void; @@ -8127,7 +8295,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback): void; @@ -8140,7 +8307,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic - * @since 20 static */ on(type: 'lcdFlashStatus', callback: AsyncCallback): void; @@ -8153,10 +8319,241 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic - * @since 20 static */ off(type: 'lcdFlashStatus', callback?: AsyncCallback): void; + /** + * Subscribes to system pressure level event callback. + * + * @param { 'systemPressureLevelChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 20 dynamic + */ + on(type: 'systemPressureLevelChange', callback: AsyncCallback): void; + + /** + * Unsubscribes to system pressure level event callback. + * + * @param { 'systemPressureLevelChange' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 20 dynamic + */ + off(type: 'systemPressureLevelChange', callback?: AsyncCallback): void; + + /** + * 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 + * @since 22 static + */ + onError(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 + * @since 22 static + */ + onFocusStateChange(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 + * @since 22 static + */ + onSmoothZoomInfoAvailable(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 22 static + */ + onMacroStatusChanged(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 22 static + */ + onFeatureDetection(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 22 static + */ + onEffectSuggestionChange(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 + * @since 22 static + */ + onAutoDeviceSwitchStatusChange(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 22 static + */ + onLcdFlashStatus(callback: AsyncCallback): void; + + /** + * Subscribes to system pressure level event callback. + * + * @param { 'systemPressureLevelChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + onSystemPressureLevelChange(callback: AsyncCallback): void; + + /** + * 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 + * @since 22 static + */ + offError(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 + * @since 22 static + */ + offFocusStateChange(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 + * @since 22 static + */ + offSmoothZoomInfoAvailable(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 22 static + */ + offMacroStatusChanged(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 22 static + */ + offFeatureDetection(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 22 static + */ + offEffectSuggestionChange(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 + * @since 22 static + */ + offAutoDeviceSwitchStatusChange(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 22 static + */ + offLcdFlashStatus(callback?: AsyncCallback): void; + + /** + * Unsubscribes to system pressure level event callback. + * + * @param { 'systemPressureLevelChange' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + offSystemPressureLevelChange(callback?: AsyncCallback): void; + /** * Gets session functions. * @@ -8717,6 +9114,63 @@ declare namespace camera { off(type: 'lightStatusChange', callback?: AsyncCallback): void; } + /** + * Enumerates the system pressure levels of the current camera session. When the system pressure increases, + * you are advised to reduce the load of the current camera session. + * @enum { int } + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + enum SystemPressureLevel { + /** + * Normal level. This level indicates that the system pressure is normal. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + SYSTEM_PRESSURE_NORMAL = 0, + + /** + * Low level. This level indicates that the system pressure is slightly increased. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + SYSTEM_PRESSURE_MILD = 1, + + /** + * Severity level. This level indicates that the system pressure is severely increased. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + SYSTEM_PRESSURE_SEVERE = 2, + + /** + * Critical level. This level indicates that the system pressure has reached a critical threshold. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + SYSTEM_PRESSURE_CRITICAL = 3, + + /** + * Shutdown level. This level indicates that the system pressure is fatal, and the camera session will be + * shut down soon. + * @syscap SystemCapability.Multimedia.Camera.Core + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + SYSTEM_PRESSURE_SHUTDOWN = 4 + } + /** * Enum for the camera light status. *