From dea46fe53461373c71588163a2a15d1070854f16 Mon Sep 17 00:00:00 2001 From: wuyunxun Date: Fri, 11 Jul 2025 16:58:32 +0800 Subject: [PATCH] =?UTF-8?q?sdk=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuyunxun Change-Id: Id9aa55064d045fd14345457be383d260add62245 --- api/@ohos.sensor.d.ts | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/api/@ohos.sensor.d.ts b/api/@ohos.sensor.d.ts index 7bd2714df1..5dd83ed7bc 100644 --- a/api/@ohos.sensor.d.ts +++ b/api/@ohos.sensor.d.ts @@ -583,6 +583,20 @@ declare namespace sensor { function on(type: 'ORIENTATION', callback: Callback, options?: Options): void; + /** + * Subscribe to orientation sensor data. + * @param { 'orientationChange' } type - Indicate the sensor type to listen for, {@code SensorId.ORIENTATION}. + * @param { Callback } callback - callback orientation data. + * @param { Options } [options] - Optional parameters specifying the interval at which sensor data is reported, + *
{@code Options}. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 14500101 - Service exception. + * @syscap SystemCapability.Sensors.Sensor + * @since 20 + * @arkts 1.2 + */ + function on(type: 'orientationChange', callback: Callback, options?: Options): void; + /** * Subscribe to pedometer sensor data. * @permission ohos.permission.ACTIVITY_MOTION @@ -1449,7 +1463,18 @@ declare namespace sensor { * @since 19 */ function off(type: SensorId.ORIENTATION, sensorInfoParam?: SensorInfoParam, callback?: Callback): void; - + + /** + * Unsubscribe to orientation sensor data. + * @param { 'orientationChange' } type - Indicate the sensor type to listen for, {@code SensorId.ORIENTATION}. + * @param { Callback } [callback] - callback orientation data. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Sensors.Sensor + * @since 20 + * @arkts 1.2 + */ + function off(type: 'orientationChange', callback?: Callback): void; + /** * Unsubscribe to orientation sensor data. * @param { 'ORIENTATION' } type - Indicate the sensor type to listen for, {@code SensorId.ORIENTATION}. -- Gitee