“3fc08321d858041dcf3d5632dd9109b596f47060”上不存在“examples/Cpp/PaddleNLP/bert/bert_server.py”
提交 549a6129 编写于 作者: W wusongqing

updated against against 5489

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 0729632e
# Media Query # Media Query
> ![icon-note.gif](public_sys-resources/icon-note.gif)**NOTE** > **NOTE**
>
> The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
``` ```js
import mediaquery from '@ohos.mediaquery' import mediaquery from '@ohos.mediaquery'
``` ```
...@@ -22,19 +23,19 @@ matchMediaSync(condition: string): MediaQueryListener ...@@ -22,19 +23,19 @@ matchMediaSync(condition: string): MediaQueryListener
Sets the media query criteria and returns the corresponding listening handle. Sets the media query criteria and returns the corresponding listening handle.
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | --------- | ------ | ---- | ---------- |
| condition | string | Yes| Matching condition of a media event.| | condition | string | Yes | Matching condition of a media event.|
- Return value **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------------------ | ---------------------- |
| MediaQueryListener | Listening handle to a media event, which is used to register or unregister the listening callback.| | MediaQueryListener | Listening handle to a media event, which is used to register or unregister the listening callback.|
- Example **Example**
``` ```js
listener = mediaquery.matchMediaSync('(orientation: landscape)'); // Listen for landscape events. listener = mediaquery.matchMediaSync('(orientation: landscape)'); // Listen for landscape events.
``` ```
...@@ -45,10 +46,10 @@ Media query handle, including the first query result when the handle is applied ...@@ -45,10 +46,10 @@ Media query handle, including the first query result when the handle is applied
### Attributes ### Attributes
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------- | ------- | ---- | ---- | ---------- |
| matches | boolean | Yes| No| Whether the match condition is met.| | matches | boolean | Yes | No | Whether the match condition is met. |
| media | string | Yes| No| Matching condition of a media event.| | media | string | Yes | No | Matching condition of a media event.|
### on ### on
...@@ -57,13 +58,13 @@ on(type: 'change', callback: Callback&lt;MediaQueryResult&gt;): void ...@@ -57,13 +58,13 @@ on(type: 'change', callback: Callback&lt;MediaQueryResult&gt;): void
Registers a callback with the corresponding query condition by using the handle. This callback is triggered when the media attributes change. Registers a callback with the corresponding query condition by using the handle. This callback is triggered when the media attributes change.
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------------------------------- | ---- | ---------------- |
| type | string | Yes| Must enter the string **change**.| | type | string | Yes | Must enter the string **change**.|
| callback | Callback&lt;MediaQueryResult&gt; | Yes| Callback registered with media query.| | callback | Callback&lt;MediaQueryResult&gt; | Yes | Callback registered with media query. |
- Example **Example**
For details, see [off Example](#off). For details, see [off Example](#off).
...@@ -72,14 +73,14 @@ Registers a callback with the corresponding query condition by using the handle. ...@@ -72,14 +73,14 @@ Registers a callback with the corresponding query condition by using the handle.
off(type: 'change', callback?: Callback&lt;MediaQueryResult&gt;): void off(type: 'change', callback?: Callback&lt;MediaQueryResult&gt;): void
Unregisters a callback with the corresponding query condition by using the handle, so that no callback is triggered when the media attributes change. Unregisters a callback with the corresponding query condition by using the handle, so that no callback is triggered when the media attributes change.
- Parameters **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | -------------------------------- | ---- | ----------------------------- |
| type | boolean | Yes| Must enter the string **change**.| | type | boolean | Yes | Must enter the string **change**. |
| callback | Callback&lt;MediaQueryResult&gt; | No| Callback to be unregistered. If the default value is used, all callbacks of the handle are unregistered.| | callback | Callback&lt;MediaQueryResult&gt; | No | Callback to be unregistered. If the default value is used, all callbacks of the handle are unregistered.|
- Example **Example**
``` ```js
import mediaquery from '@ohos.mediaquery' import mediaquery from '@ohos.mediaquery'
listener = mediaquery.matchMediaSync('(orientation: landscape)'); // Listen for landscape events. listener = mediaquery.matchMediaSync('(orientation: landscape)'); // Listen for landscape events.
...@@ -90,8 +91,8 @@ Unregisters a callback with the corresponding query condition by using the handl ...@@ -90,8 +91,8 @@ Unregisters a callback with the corresponding query condition by using the handl
// do something here // do something here
} }
} }
this.listener.on('change', this.onPortrait) // Registration callback. listener.on('change', onPortrait) // Register a callback.
this.listener.off('change', this.onPortrait) // Deregistration callback. listener.off('change', onPortrait) // Unregister a callback.
``` ```
...@@ -100,15 +101,15 @@ Unregisters a callback with the corresponding query condition by using the handl ...@@ -100,15 +101,15 @@ Unregisters a callback with the corresponding query condition by using the handl
### Attributes ### Attributes
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------- | ------- | ---- | ---- | ---------- |
| matches | boolean | Yes| No| Whether the match condition is met.| | matches | boolean | Yes | No | Whether the match condition is met. |
| media | string | Yes| No| Matching condition of a media event.| | media | string | Yes | No | Matching condition of a media event.|
### Example ### Example
``` ```js
import mediaquery from '@ohos.mediaquery' import mediaquery from '@ohos.mediaquery'
let portraitFunc = null let portraitFunc = null
......
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
import sensor from '@ohos.sensor'; import sensor from '@ohos.sensor';
``` ```
## sensor.on
## sensor.on(SensorType.SENSOR_TYPE_ID_ACCELEROMETER) ### ACCELEROMETER
on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;AccelerometerResponse&gt;,options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;AccelerometerResponse&gt;,options?: Options): void
...@@ -41,8 +42,7 @@ Subscribes to data changes of the acceleration sensor. If this API is called mul ...@@ -41,8 +42,7 @@ Subscribes to data changes of the acceleration sensor. If this API is called mul
); );
``` ```
### LINEAR_ACCELERATION
## sensor.on(SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION)
on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;LinearAccelerometerResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;LinearAccelerometerResponse&gt;, options?: Options): void
...@@ -70,8 +70,7 @@ Subscribes to data changes of the linear acceleration sensor. If this API is cal ...@@ -70,8 +70,7 @@ Subscribes to data changes of the linear acceleration sensor. If this API is cal
); );
``` ```
### ACCELEROMETER_UNCALIBRATED
## sensor.on(SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED)
on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback: Callback&lt;AccelerometerUncalibratedResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback: Callback&lt;AccelerometerUncalibratedResponse&gt;, options?: Options): void
...@@ -102,8 +101,7 @@ Subscribes to data changes of the uncalibrated acceleration sensor. If this API ...@@ -102,8 +101,7 @@ Subscribes to data changes of the uncalibrated acceleration sensor. If this API
); );
``` ```
### GRAVITY
## sensor.on(SensorType.SENSOR_TYPE_ID_GRAVITY)
on(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback&lt;GravityResponse&gt;,options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback&lt;GravityResponse&gt;,options?: Options): void
...@@ -129,8 +127,7 @@ Subscribes to data changes of the gravity sensor. If this API is called multiple ...@@ -129,8 +127,7 @@ Subscribes to data changes of the gravity sensor. If this API is called multiple
); );
``` ```
### GYROSCOPE
## sensor.on(SensorType.SENSOR_TYPE_ID_GYROSCOPE)
on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback&lt;GyroscopeResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback&lt;GyroscopeResponse&gt;, options?: Options): void
...@@ -158,8 +155,7 @@ Subscribes to data changes of the gyroscope sensor. If this API is called multip ...@@ -158,8 +155,7 @@ Subscribes to data changes of the gyroscope sensor. If this API is called multip
); );
``` ```
### GYROSCOPE_UNCALIBRATED
## sensor.on(SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED)
on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:Callback&lt;GyroscopeUncalibratedResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:Callback&lt;GyroscopeUncalibratedResponse&gt;, options?: Options): void
...@@ -190,8 +186,7 @@ Subscribes to data changes of the uncalibrated gyroscope sensor. If this API is ...@@ -190,8 +186,7 @@ Subscribes to data changes of the uncalibrated gyroscope sensor. If this API is
); );
``` ```
### SIGNIFICANT_MOTION
## sensor.on(SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION)
on(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback&lt;SignificantMotionResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback&lt;SignificantMotionResponse&gt;, options?: Options): void
...@@ -215,8 +210,7 @@ Subscribes to data changes of the significant motion sensor. If this API is call ...@@ -215,8 +210,7 @@ Subscribes to data changes of the significant motion sensor. If this API is call
); );
``` ```
### PEDOMETER_DETECTION
## sensor.on(SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION)
on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback&lt;PedometerDetectionResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback&lt;PedometerDetectionResponse&gt;, options?: Options): void
...@@ -242,8 +236,7 @@ Subscribes to data changes of the pedometer detection sensor. If this API is cal ...@@ -242,8 +236,7 @@ Subscribes to data changes of the pedometer detection sensor. If this API is cal
); );
``` ```
### PEDOMETER
## sensor.on(SensorType.SENSOR_TYPE_ID_PEDOMETER)
on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback&lt;PedometerResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback&lt;PedometerResponse&gt;, options?: Options): void
...@@ -269,8 +262,7 @@ Subscribes to data changes of the pedometer sensor. If this API is called multip ...@@ -269,8 +262,7 @@ Subscribes to data changes of the pedometer sensor. If this API is called multip
); );
``` ```
### AMBIENT_TEMPERATURE
## sensor.on(SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE)
on(type:SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:Callback&lt;AmbientTemperatureResponse&gt;, options?: Options): void on(type:SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:Callback&lt;AmbientTemperatureResponse&gt;, options?: Options): void
...@@ -294,8 +286,7 @@ Subscribes to data changes of the ambient temperature sensor. If this API is cal ...@@ -294,8 +286,7 @@ Subscribes to data changes of the ambient temperature sensor. If this API is cal
); );
``` ```
### MAGNETIC_FIELD
## sensor.on(SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD)
on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback&lt;MagneticFieldResponse&gt;,options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback&lt;MagneticFieldResponse&gt;,options?: Options): void
...@@ -321,8 +312,7 @@ Subscribes to data changes of the magnetic field sensor. If this API is called m ...@@ -321,8 +312,7 @@ Subscribes to data changes of the magnetic field sensor. If this API is called m
); );
``` ```
### MAGNETIC_FIELD_UNCALIBRATED
## sensor.on(SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED)
on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback: Callback&lt;MagneticFieldUncalibratedResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback: Callback&lt;MagneticFieldUncalibratedResponse&gt;, options?: Options): void
...@@ -351,8 +341,7 @@ Subscribes to data changes of the uncalibrated magnetic field sensor. If this AP ...@@ -351,8 +341,7 @@ Subscribes to data changes of the uncalibrated magnetic field sensor. If this AP
); );
``` ```
### PROXIMITY
## sensor.on(SensorType.SENSOR_TYPE_ID_PROXIMITY)
on(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback&lt;ProximityResponse&gt;,options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback&lt;ProximityResponse&gt;,options?: Options): void
...@@ -376,8 +365,7 @@ Subscribes to data changes of the proximity sensor. If this API is called multip ...@@ -376,8 +365,7 @@ Subscribes to data changes of the proximity sensor. If this API is called multip
); );
``` ```
### HUMIDITY
## sensor.on(SensorType.SENSOR_TYPE_ID_HUMIDITY)
on(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback&lt;HumidityResponse&gt;,options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback&lt;HumidityResponse&gt;,options?: Options): void
...@@ -401,8 +389,7 @@ Subscribes to data changes of the humidity sensor. If this API is called multipl ...@@ -401,8 +389,7 @@ Subscribes to data changes of the humidity sensor. If this API is called multipl
); );
``` ```
### BAROMETER
## sensor.on(SensorType.SENSOR_TYPE_ID_BAROMETER)
on(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback&lt;BarometerResponse&gt;,options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback&lt;BarometerResponse&gt;,options?: Options): void
...@@ -426,8 +413,7 @@ Subscribes to data changes of the barometer sensor. If this API is called multip ...@@ -426,8 +413,7 @@ Subscribes to data changes of the barometer sensor. If this API is called multip
); );
``` ```
### HALL
## sensor.on(SensorType.SENSOR_TYPE_ID_HALL)
on(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback&lt;HallResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback&lt;HallResponse&gt;, options?: Options): void
...@@ -451,8 +437,7 @@ Subscribes to data changes of the Hall effect sensor. If this API is called mult ...@@ -451,8 +437,7 @@ Subscribes to data changes of the Hall effect sensor. If this API is called mult
); );
``` ```
### AMBIENT_LIGHT
## sensor.on(SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT)
on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback&lt;LightResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback&lt;LightResponse&gt;, options?: Options): void
...@@ -476,8 +461,7 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu ...@@ -476,8 +461,7 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu
); );
``` ```
### ORIENTATION
## sensor.on(SensorType.SENSOR_TYPE_ID_ORIENTATION)
on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback&lt;OrientationResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback&lt;OrientationResponse&gt;, options?: Options): void
...@@ -503,7 +487,7 @@ Subscribes to data changes of the orientation sensor. If this API is called mult ...@@ -503,7 +487,7 @@ Subscribes to data changes of the orientation sensor. If this API is called mult
); );
``` ```
## sensor.on(SensorType.SENSOR_TYPE_ID_HEART_RATE) ### HEART_RATE
on(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback&lt;HeartRateResponse&gt;, options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback&lt;HeartRateResponse&gt;, options?: Options): void
...@@ -530,7 +514,7 @@ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE,function(data){ ...@@ -530,7 +514,7 @@ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE,function(data){
); );
``` ```
## sensor.on(SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR) ### ROTATION_VECTOR
on(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback: Callback&lt;RotationVectorResponse&gt;,options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback: Callback&lt;RotationVectorResponse&gt;,options?: Options): void
...@@ -557,8 +541,7 @@ Subscribes to data changes of the rotation vector sensor. If this API is called ...@@ -557,8 +541,7 @@ Subscribes to data changes of the rotation vector sensor. If this API is called
); );
``` ```
### WEAR_DETECTION
## sensor.on(SensorType.SENSOR_TYPE_ID_WEAR_DETECTION)
on(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback&lt;WearDetectionResponse&gt;,options?: Options): void on(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback&lt;WearDetectionResponse&gt;,options?: Options): void
...@@ -582,8 +565,9 @@ Subscribes to data changes of the wear detection sensor. If this API is called m ...@@ -582,8 +565,9 @@ Subscribes to data changes of the wear detection sensor. If this API is called m
); );
``` ```
## sensor.once
## sensor.once(SensorType.SENSOR_TYPE_ID_ACCELEROMETER) ### ACCELEROMETER
once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;AccelerometerResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;AccelerometerResponse&gt;): void
...@@ -609,8 +593,7 @@ Subscribes to only one data change of the acceleration sensor. ...@@ -609,8 +593,7 @@ Subscribes to only one data change of the acceleration sensor.
); );
``` ```
### LINEAR_ACCELERATION
## sensor.once(SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION)
once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;LinearAccelerometerResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;LinearAccelerometerResponse&gt;): void
...@@ -636,8 +619,7 @@ Subscribes to only one data change of the linear acceleration sensor. ...@@ -636,8 +619,7 @@ Subscribes to only one data change of the linear acceleration sensor.
); );
``` ```
### ACCELEROMETER_UNCALIBRATED
## sensor.once(SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED)
once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback: Callback&lt;AccelerometerUncalibratedResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback: Callback&lt;AccelerometerUncalibratedResponse&gt;): void
...@@ -666,8 +648,7 @@ Subscribes to only one data change of the uncalibrated acceleration sensor. ...@@ -666,8 +648,7 @@ Subscribes to only one data change of the uncalibrated acceleration sensor.
); );
``` ```
### GRAVITY
## sensor.once(SensorType.SENSOR_TYPE_ID_GRAVITY)
once(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback&lt;GravityResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback&lt;GravityResponse&gt;): void
...@@ -691,8 +672,7 @@ Subscribes to only one data change of the gravity sensor. ...@@ -691,8 +672,7 @@ Subscribes to only one data change of the gravity sensor.
); );
``` ```
### GYROSCOPE
## sensor.once(SensorType.SENSOR_TYPE_ID_GYROSCOPE)
once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback&lt;GyroscopeResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback&lt;GyroscopeResponse&gt;): void
...@@ -718,8 +698,7 @@ Subscribes to only one data change of the gyroscope sensor. ...@@ -718,8 +698,7 @@ Subscribes to only one data change of the gyroscope sensor.
); );
``` ```
### GYROSCOPE_UNCALIBRATED
## sensor.once(SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED)
once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback: Callback&lt;GyroscopeUncalibratedResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback: Callback&lt;GyroscopeUncalibratedResponse&gt;): void
...@@ -748,8 +727,7 @@ Subscribes to only one data change of the uncalibrated gyroscope sensor. ...@@ -748,8 +727,7 @@ Subscribes to only one data change of the uncalibrated gyroscope sensor.
); );
``` ```
### SIGNIFICANT_MOTION
## sensor.once(SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION)
once(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,callback: Callback&lt;SignificantMotionResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,callback: Callback&lt;SignificantMotionResponse&gt;): void
...@@ -771,8 +749,7 @@ Subscribes to only one data change of the significant motion sensor. ...@@ -771,8 +749,7 @@ Subscribes to only one data change of the significant motion sensor.
); );
``` ```
### PEDOMETER_DETECTION
## sensor.once(SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION)
once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,callback: Callback&lt;PedometerDetectionResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,callback: Callback&lt;PedometerDetectionResponse&gt;): void
...@@ -796,8 +773,7 @@ Subscribes to only one data change of the pedometer detection sensor. ...@@ -796,8 +773,7 @@ Subscribes to only one data change of the pedometer detection sensor.
); );
``` ```
### PEDOMETER
## sensor.once(SensorType.SENSOR_TYPE_ID_PEDOMETER)
once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback&lt;PedometerResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback&lt;PedometerResponse&gt;): void
...@@ -821,8 +797,7 @@ Subscribes to only one data change of the pedometer sensor. ...@@ -821,8 +797,7 @@ Subscribes to only one data change of the pedometer sensor.
); );
``` ```
### AMBIENT_TEMPERATURE
## sensor.once(SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE)
once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback: Callback&lt;AmbientTemperatureResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback: Callback&lt;AmbientTemperatureResponse&gt;): void
...@@ -844,8 +819,7 @@ Subscribes to only one data change of the ambient temperature sensor. ...@@ -844,8 +819,7 @@ Subscribes to only one data change of the ambient temperature sensor.
); );
``` ```
### MAGNETIC_FIELD
## sensor.once(SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD)
once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback&lt;MagneticFieldResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback&lt;MagneticFieldResponse&gt;): void
...@@ -869,8 +843,7 @@ Subscribes to only one data change of the magnetic field sensor. ...@@ -869,8 +843,7 @@ Subscribes to only one data change of the magnetic field sensor.
); );
``` ```
### MAGNETIC_FIELD_UNCALIBRATED
## sensor.once(SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED)
once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback: Callback&lt;MagneticFieldUncalibratedResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback: Callback&lt;MagneticFieldUncalibratedResponse&gt;): void
...@@ -897,8 +870,7 @@ Subscribes to only one data change of the uncalibrated magnetic field sensor. ...@@ -897,8 +870,7 @@ Subscribes to only one data change of the uncalibrated magnetic field sensor.
); );
``` ```
### PROXIMITY
## sensor.once(SensorType.SENSOR_TYPE_ID_PROXIMITY)
once(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback&lt;ProximityResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback&lt;ProximityResponse&gt;): void
...@@ -924,8 +896,7 @@ Subscribes to only one data change of the proximity sensor. ...@@ -924,8 +896,7 @@ Subscribes to only one data change of the proximity sensor.
); );
``` ```
### HUMIDITY
## sensor.once(SensorType.SENSOR_TYPE_ID_HUMIDITY)
once(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback&lt;HumidityResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback&lt;HumidityResponse&gt;): void
...@@ -947,8 +918,7 @@ Subscribes to only one data change of the humidity sensor. ...@@ -947,8 +918,7 @@ Subscribes to only one data change of the humidity sensor.
); );
``` ```
### BAROMETER
## sensor.once(SensorType.SENSOR_TYPE_ID_BAROMETER)
once(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback&lt;BarometerResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback&lt;BarometerResponse&gt;): void
...@@ -970,8 +940,7 @@ Subscribes to only one data change of the barometer sensor. ...@@ -970,8 +940,7 @@ Subscribes to only one data change of the barometer sensor.
); );
``` ```
### HALL
## sensor.once(SensorType.SENSOR_TYPE_ID_HALL)
once(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback&lt;HallResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback&lt;HallResponse&gt;): void
...@@ -993,8 +962,7 @@ Subscribes to only one data change of the Hall effect sensor. ...@@ -993,8 +962,7 @@ Subscribes to only one data change of the Hall effect sensor.
); );
``` ```
### AMBIENT_LIGHT
## sensor.once(SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT)
once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback&lt;LightResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback&lt;LightResponse&gt;): void
...@@ -1016,8 +984,7 @@ Subscribes to only one data change of the ambient light sensor. ...@@ -1016,8 +984,7 @@ Subscribes to only one data change of the ambient light sensor.
); );
``` ```
### ORIENTATION
## sensor.once(SensorType.SENSOR_TYPE_ID_ORIENTATION)
once(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback&lt;OrientationResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback&lt;OrientationResponse&gt;): void
...@@ -1041,8 +1008,7 @@ Subscribes to only one data change of the orientation sensor. ...@@ -1041,8 +1008,7 @@ Subscribes to only one data change of the orientation sensor.
); );
``` ```
### ROTATION_VECTOR
## sensor.once(SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR)
once(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback&lt;RotationVectorResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback&lt;RotationVectorResponse&gt;): void
...@@ -1067,8 +1033,7 @@ Subscribes to only one data change of the rotation vector sensor. ...@@ -1067,8 +1033,7 @@ Subscribes to only one data change of the rotation vector sensor.
); );
``` ```
### HEART_RATE
## sensor.once(SensorType.SENSOR_TYPE_ID_HEART_RATE)
once(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback&lt;HeartRateResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback&lt;HeartRateResponse&gt;): void
...@@ -1092,8 +1057,7 @@ Subscribes to only one data change of the heart rate sensor. ...@@ -1092,8 +1057,7 @@ Subscribes to only one data change of the heart rate sensor.
); );
``` ```
### WEAR_DETECTION
## sensor.once(SensorType.SENSOR_TYPE_ID_WEAR_DETECTION)
once(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback&lt;WearDetectionResponse&gt;): void once(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback&lt;WearDetectionResponse&gt;): void
...@@ -1115,7 +1079,9 @@ Subscribes to only one data change of the wear detection sensor. ...@@ -1115,7 +1079,9 @@ Subscribes to only one data change of the wear detection sensor.
); );
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_ACCELEROMETER) ## sensor.off
### ACCELEROMETER
off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback?: Callback&lt;AccelerometerResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback?: Callback&lt;AccelerometerResponse&gt;): void
...@@ -1143,7 +1109,7 @@ function callback(data) { ...@@ -1143,7 +1109,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED) ### ACCELEROMETER_UNCALIBRATED
off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback?: Callback&lt;AccelerometerUncalibratedResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback?: Callback&lt;AccelerometerUncalibratedResponse&gt;): void
...@@ -1174,7 +1140,7 @@ function callback(data) { ...@@ -1174,7 +1140,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT) ### AMBIENT_LIGHT
off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback?: Callback&lt;LightResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback?: Callback&lt;LightResponse&gt;): void
...@@ -1198,7 +1164,7 @@ function callback(data) { ...@@ -1198,7 +1164,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE) ### AMBIENT_TEMPERATURE
off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback?: Callback&lt;AmbientTemperatureResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback?: Callback&lt;AmbientTemperatureResponse&gt;): void
...@@ -1222,7 +1188,7 @@ function callback(data) { ...@@ -1222,7 +1188,7 @@ function callback(data) {
sensor.off( sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback); sensor.off( sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE) ### AMBIENT_TEMPERATURE
off(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback?: Callback&lt;BarometerResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback?: Callback&lt;BarometerResponse&gt;): void
...@@ -1246,7 +1212,7 @@ function callback(data) { ...@@ -1246,7 +1212,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_GRAVITY) ### GRAVITY
off(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback?: Callback&lt;GravityResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback?: Callback&lt;GravityResponse&gt;): void
...@@ -1272,7 +1238,7 @@ function callback(data) { ...@@ -1272,7 +1238,7 @@ function callback(data) {
sensor.off( sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback); sensor.off( sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_GYROSCOPE) ### GYROSCOPE
off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback?: Callback&lt;GyroscopeResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback?: Callback&lt;GyroscopeResponse&gt;): void
...@@ -1300,7 +1266,7 @@ function callback(data) { ...@@ -1300,7 +1266,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED) ### GYROSCOPE_UNCALIBRATED
off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback&lt;GyroscopeUncalibratedResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback&lt;GyroscopeUncalibratedResponse&gt;): void
...@@ -1328,7 +1294,7 @@ function callback(data) { ...@@ -1328,7 +1294,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_HALL) ### HALL
off(type: SensorType.SENSOR_TYPE_ID_HALL, callback?: Callback&lt;HallResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_HALL, callback?: Callback&lt;HallResponse&gt;): void
...@@ -1352,7 +1318,7 @@ function callback(data) { ...@@ -1352,7 +1318,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HALL, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HALL, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_HEART_RATE) ### HEART_RATE
off(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback?: Callback&lt;HeartRateResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback?: Callback&lt;HeartRateResponse&gt;): void
...@@ -1378,7 +1344,7 @@ function callback(data) { ...@@ -1378,7 +1344,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_HUMIDITY) ### HUMIDITY
off(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback?: Callback&lt;HumidityResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback?: Callback&lt;HumidityResponse&gt;): void
...@@ -1404,7 +1370,7 @@ function callback(data) { ...@@ -1404,7 +1370,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION) ### LINEAR_ACCELERATION
off(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback?: Callback&lt;LinearAccelerometerResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback?: Callback&lt;LinearAccelerometerResponse&gt;): void
...@@ -1432,7 +1398,7 @@ function callback(data) { ...@@ -1432,7 +1398,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD) ### MAGNETIC_FIELD
off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback?: Callback&lt;MagneticFieldResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback?: Callback&lt;MagneticFieldResponse&gt;): void
...@@ -1460,7 +1426,7 @@ function callback(data) { ...@@ -1460,7 +1426,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED) ### MAGNETIC_FIELD_UNCALIBRATED
off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback?: Callback&lt;MagneticFieldUncalibratedResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback?: Callback&lt;MagneticFieldUncalibratedResponse&gt;): void
...@@ -1489,7 +1455,7 @@ function callback(data) { ...@@ -1489,7 +1455,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_ORIENTATION) ### ORIENTATION
off(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback?: Callback&lt;OrientationResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback?: Callback&lt;OrientationResponse&gt;): void
...@@ -1515,7 +1481,7 @@ function callback(data) { ...@@ -1515,7 +1481,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_PEDOMETER) ### PEDOMETER
off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback?: Callback&lt;PedometerResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback?: Callback&lt;PedometerResponse&gt;): void
...@@ -1539,7 +1505,7 @@ function callback(data) { ...@@ -1539,7 +1505,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION) ### PEDOMETER_DETECTION
off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback?: Callback&lt;PedometerDetectionResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback?: Callback&lt;PedometerDetectionResponse&gt;): void
...@@ -1565,7 +1531,7 @@ function callback(data) { ...@@ -1565,7 +1531,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_PROXIMITY) ### PROXIMITY
off(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback?: Callback&lt;ProximityResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback?: Callback&lt;ProximityResponse&gt;): void
...@@ -1589,7 +1555,7 @@ function callback(data) { ...@@ -1589,7 +1555,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR) ### ROTATION_VECTOR
off(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback?: Callback&lt;RotationVectorResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback?: Callback&lt;RotationVectorResponse&gt;): void
...@@ -1616,7 +1582,7 @@ function callback(data) { ...@@ -1616,7 +1582,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION) ### SIGNIFICANT_MOTION
off(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback?: Callback&lt;SignificantMotionResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback?: Callback&lt;SignificantMotionResponse&gt;): void
...@@ -1640,7 +1606,7 @@ function callback(data) { ...@@ -1640,7 +1606,7 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback);
``` ```
## sensor.off(SensorType.SENSOR_TYPE_ID_WEAR_DETECTION) ### WEAR_DETECTION
off(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback?: Callback&lt;WearDetectionResponse&gt;): void off(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback?: Callback&lt;WearDetectionResponse&gt;): void
...@@ -1773,10 +1739,9 @@ Obtains the geomagnetic field of a geographic location. This API uses a promise ...@@ -1773,10 +1739,9 @@ Obtains the geomagnetic field of a geographic location. This API uses a promise
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ------- | | ---------------------------------------- | ------- |
| Promise&lt;[GeomagneticResponse](#geomagneticresponse)&gt; | Promise used to return the geomagnetic field.| | Promise&lt;[GeomagneticResponse](#geomagneticresponse)&gt; | Promise used to return the geomagnetic field. |
**Example** **Example**
```js ```js
const promise = sensor.getGeomagneticField({latitude:80, longitude:0, altitude:0}, 1580486400000); const promise = sensor.getGeomagneticField({latitude:80, longitude:0, altitude:0}, 1580486400000);
promise.then((data) => { promise.then((data) => {
...@@ -1936,7 +1901,7 @@ Obtains the angle change between two rotation matrices. This API uses a callback ...@@ -1936,7 +1901,7 @@ Obtains the angle change between two rotation matrices. This API uses a callback
} }
console.info("SensorJsAPI--->Successed to get getAngleModifiy interface get data: " + data.x); console.info("SensorJsAPI--->Successed to get getAngleModifiy interface get data: " + data.x);
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info(LABEL + "data[" + i + "]: " + data[i]); console.info("data[" + i + "]: " + data[i]);
} }
}) })
``` ```
...@@ -1970,10 +1935,10 @@ Obtains the angle change between two rotation matrices. This API uses a promise ...@@ -1970,10 +1935,10 @@ Obtains the angle change between two rotation matrices. This API uses a promise
promise.then((data) => { promise.then((data) => {
console.info('getAngleModifiy_promise success'); console.info('getAngleModifiy_promise success');
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info(LABEL + "data[" + i + "]: " + data[i]); console.info("data[" + i + "]: " + data[i]);
} }
}).catch((reason) => { }).catch((reason) => {
console.info(LABEL + "promise::catch", reason); console.info("promise::catch", reason);
}) })
``` ```
...@@ -2004,7 +1969,7 @@ Converts a rotation vector into a rotation matrix. This API uses a callback to r ...@@ -2004,7 +1969,7 @@ Converts a rotation vector into a rotation matrix. This API uses a callback to r
} }
console.info("SensorJsAPI--->Successed to get createRotationMatrix interface get data: " + data.x); console.info("SensorJsAPI--->Successed to get createRotationMatrix interface get data: " + data.x);
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info(LABEL + "data[" + i + "]: " + data[i]); console.info("data[" + i + "]: " + data[i]);
} }
}) })
``` ```
...@@ -2037,10 +2002,10 @@ Converts a rotation vector into a rotation matrix. This API uses a promise to re ...@@ -2037,10 +2002,10 @@ Converts a rotation vector into a rotation matrix. This API uses a promise to re
promise.then((data) => { promise.then((data) => {
console.info('createRotationMatrix_promise success'); console.info('createRotationMatrix_promise success');
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info(LABEL + "data[" + i + "]: " + data[i]); console.info("data[" + i + "]: " + data[i]);
} }
}).catch((reason) => { }).catch((reason) => {
console.info(LABEL + "promise::catch", reason); console.info("promise::catch", reason);
}) })
``` ```
...@@ -2071,7 +2036,7 @@ Converts a rotation vector into a quaternion. This API uses a callback to return ...@@ -2071,7 +2036,7 @@ Converts a rotation vector into a quaternion. This API uses a callback to return
} }
console.info("SensorJsAPI--->Successed to get createQuaternion interface get data: " + data.x); console.info("SensorJsAPI--->Successed to get createQuaternion interface get data: " + data.x);
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info(LABEL + "data[" + i + "]: " + data[i]); console.info("data[" + i + "]: " + data[i]);
} }
}) })
``` ```
...@@ -2136,7 +2101,7 @@ Obtains the device direction based on the rotation matrix. This API uses a callb ...@@ -2136,7 +2101,7 @@ Obtains the device direction based on the rotation matrix. This API uses a callb
err.message); err.message);
return; return;
} }
console.info("SensorJsAPI--->Successed to get getDirection interface get data: " + data.x); console.info("SensorJsAPI--->Successed to get getDirection interface get data: " + data);
for (var i = 1; i < data.length; i++) { for (var i = 1; i < data.length; i++) {
console.info("sensor_getDirection_callback" + data[i]); console.info("sensor_getDirection_callback" + data[i]);
} }
...@@ -2169,7 +2134,7 @@ Obtains the device direction based on the rotation matrix. This API uses a promi ...@@ -2169,7 +2134,7 @@ Obtains the device direction based on the rotation matrix. This API uses a promi
```js ```js
const promise = sensor.getDirection([1, 0, 0, 0, 1, 0, 0, 0, 1]); const promise = sensor.getDirection([1, 0, 0, 0, 1, 0, 0, 0, 1]);
promise.then((data) => { promise.then((data) => {
console.info('sensor_getAltitude_Promise success', data.x); console.info('sensor_getAltitude_Promise success', data);
for (var i = 1; i < data.length; i++) { for (var i = 1; i < data.length; i++) {
console.info("sensor_getDirection_promise" + data[i]); console.info("sensor_getDirection_promise" + data[i]);
} }
...@@ -2240,7 +2205,7 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th ...@@ -2240,7 +2205,7 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th
promise.then((data) => { promise.then((data) => {
console.info('createRotationMatrix_promise successed'); console.info('createRotationMatrix_promise successed');
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info(LABEL + "data[" + i + "]: " + data[i]); console.info("data[" + i + "]: " + data[i]);
} }
}).catch((err) => { }).catch((err) => {
console.info('promise failed'); console.info('promise failed');
...@@ -2358,10 +2323,10 @@ Describes the orientation sensor data. It extends from [Response](#response). ...@@ -2358,10 +2323,10 @@ Describes the orientation sensor data. It extends from [Response](#response).
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
| ----- | ------ | ---- | ---- | ------------------------ | | ----- | ------ | ---- | ---- | ----------------- |
| alpha | number | Yes | Yes | Rotation angle of the device around the z-axis, in rad.| | alpha | number | Yes | Yes | Rotation angle of the device around the z-axis, in degrees.|
| beta | number | Yes | Yes | Rotation angle of the device around the x-axis, in rad. | | beta | number | Yes | Yes | Rotation angle of the device around the x-axis, in degrees.|
| gamma | number | Yes | Yes | Rotation angle of the device around the y-axis, in rad. | | gamma | number | Yes | Yes | Rotation angle of the device around the y-axis, in degrees.|
## RotationVectorResponse ## RotationVectorResponse
......
# Prompt # Prompt
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
> >
> - The APIs of this module are no longer maintained since API version 8. You are advised to use ['@ohos.prompt](js-apis-prompt.md)' instead. > - The APIs of this module are no longer maintained since API version 8. You are advised to use [`@ohos.prompt`](js-apis-prompt.md) instead.
> >
> >
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
## Modules to Import ## Modules to Import
``` ```js
import prompt from '@system.prompt'; import prompt from '@system.prompt';
``` ```
...@@ -26,12 +26,12 @@ Shows the toast. ...@@ -26,12 +26,12 @@ Shows the toast.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | ------------------------------------- | --------- | ------------------------------ | | ------- | ------------------------------------- | ---- | --------------- |
| options | [ShowToastOptions](#showtoastoptions) | Yes | Options for showing the toast. | | options | [ShowToastOptions](#showtoastoptions) | Yes | Options for showing the toast.|
**Example** **Example**
``` ```js
export default { export default {
showToast() { showToast() {
prompt.showToast({ prompt.showToast({
...@@ -54,13 +54,13 @@ Shows the dialog box. ...@@ -54,13 +54,13 @@ Shows the dialog box.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | --------------------------------------- | --------- | ----------------------------------- | | ------- | --------------------------------------- | ---- | ----------- |
| options | [ShowDialogOptions](#showdialogoptions) | Yes | Options for showing the dialog box. | | options | [ShowDialogOptions](#showdialogoptions) | Yes | Options for showing the dialog box.|
**Example** **Example**
``` ```js
export default { export default {
showDialog() { showDialog() {
prompt.showDialog({ prompt.showDialog({
...@@ -94,13 +94,13 @@ Shows the action menu. ...@@ -94,13 +94,13 @@ Shows the action menu.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | ---------------------------------------- | --------- | ------------------------------------ | | ------- | ---------------------------------------- | ---- | -------------------- |
| options | [ShowActionMenuOptions](#showactionmenuoptions) | Yes | Options for showing the action menu. | | options | [ShowActionMenuOptions](#showactionmenuoptions) | Yes | Options for showing the action menu.|
**Example** **Example**
``` ```js
export default { export default {
showActionMenu() { showActionMenu() {
prompt.showActionMenu({ prompt.showActionMenu({
...@@ -115,11 +115,11 @@ export default { ...@@ -115,11 +115,11 @@ export default {
color: '#000000', color: '#000000',
}, },
], ],
success: function(data) { success: function(tapIndex) {
console.log('dialog success callback, click button : ' + data.tapIndex); console.log('dialog success callback, click button : ' + data.tapIndex);
}, },
fail: function(data) { fail: function(errMsg) {
console.log('dialog fail callback' + data.errMsg); console.log('dialog fail callback' + errMsg);
}, },
}); });
} }
...@@ -132,10 +132,10 @@ Describes the options for showing the toast. ...@@ -132,10 +132,10 @@ Describes the options for showing the toast.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------------- | -------------- | --------- | ---------------------------------------- | | ------------------- | -------------- | ---- | ---------------------------------------- |
| message | string | Yes | Text to display. | | message | string | Yes | Text to display. |
| duration | number | No | Duration that the toast will remain on the screen. The default value is 1500 ms. The recommended value range is 1500 ms to 10000 ms. If a value less than 1500 ms is set, the default value is used. | | duration | number | No | Duration that the toast will remain on the screen. The default value is 1500 ms. The recommended value range is 1500 ms to 10000 ms. If a value less than 1500 ms is set, the default value is used.|
| bottom<sup>5+</sup> | string\|number | No | Distance between the toast frame and the bottom of the screen. | | bottom<sup>5+</sup> | string\|number | No | Distance between the toast border and the bottom of the screen. |
## Button ## Button
...@@ -144,9 +144,9 @@ Defines the prompt information of a button. ...@@ -144,9 +144,9 @@ Defines the prompt information of a button.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ------ | --------- | ----------------------------- | | ----- | ------ | ---- | ------- |
| text | string | Yes | Text displayed on the button. | | text | string | Yes | Text displayed on the button.|
| color | string | Yes | Color of the button. | | color | string | Yes | Color of the button.|
## ShowDialogSuccessResponse ## ShowDialogSuccessResponse
...@@ -155,8 +155,8 @@ Defines the dialog box response result. ...@@ -155,8 +155,8 @@ Defines the dialog box response result.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ------ | --------- | ----------- | | ----- | ------ | ---- | ---------- |
| index | number | Yes | Data index. | | index | number | Yes | Data index.|
## ShowDialogOptions ## ShowDialogOptions
...@@ -165,10 +165,10 @@ Describes the options for showing the dialog box. ...@@ -165,10 +165,10 @@ Describes the options for showing the dialog box.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | --------- | ---------------------------------------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| title | string | No | Title of the text to display. | | title | string | No | Title of the text to display. |
| message | string | No | Text body. | | message | string | No | Text body. |
| buttons | [[Button](#button), [Button](#button)?, [Button](#button)?] | No | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. One to six buttons are supported. If there are more than six buttons, extra buttons will not be displayed. | | buttons | [[Button](#button), [Button](#button)?, [Button](#button)?] | No | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. One to six buttons are supported. If there are more than six buttons, extra buttons will not be displayed.|
| success | (data: [ShowDialogSuccessResponse](#showdialogsuccessresponse)) => void | No | Callback upon success. | | success | (data: [ShowDialogSuccessResponse](#showdialogsuccessresponse)) => void | No | Callback upon success. |
| cancel | (data: string, code: string) => void | No | Callback upon failure. | | cancel | (data: string, code: string) => void | No | Callback upon failure. |
| complete | (data: string) => void | No | Called when the API call is complete. | | complete | (data: string) => void | No | Called when the API call is complete. |
...@@ -180,9 +180,9 @@ Describes the options for showing the action menu. ...@@ -180,9 +180,9 @@ Describes the options for showing the action menu.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | --------- | ---------------------------------------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| title | string | No | Title of the text to display. | | title | string | No | Title of the text to display. |
| buttons | [[Button](#button), [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?] | Yes | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. One to six buttons are supported. | | buttons | [[Button](#button), [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?] | Yes | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. One to six buttons are supported.|
| success | (tapIndex: number, errMsg: string) => void | No | Invoked when a dialog box is displayed. | | success | (tapIndex: number, errMsg: string) => void | No | Invoked when a dialog box is displayed. |
| fail | (errMsg: string) => void | No | Callback upon failure. | | fail | (errMsg: string) => void | No | Callback upon failure. |
| complete | (data: string) => void | No | Invoked when a dialog box is closed. | | complete | (data: string) => void | No | Invoked when a dialog box is closed. |
# Page Routing # Page Routing
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
> >
> - The APIs of this module are no longer maintained since API version 8. You are advised to use [`@ohos.router`](js-apis-router.md) instead. > - The APIs of this module are no longer maintained since API version 8. You are advised to use [`@ohos.router`](js-apis-router.md) instead.
> >
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
## Modules to Import ## Modules to Import
``` ```js
import router from '@system.router'; import router from '@system.router';
``` ```
...@@ -31,7 +31,7 @@ Navigates to a specified page in the application. ...@@ -31,7 +31,7 @@ Navigates to a specified page in the application.
**Example** **Example**
``` ```js
// Current page // Current page
export default { export default {
pushPage() { pushPage() {
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
``` ```
``` ```js
// routerpage2 page // routerpage2 page
export default { export default {
data: { data: {
...@@ -85,7 +85,7 @@ Replaces the current page with another one in the application and destroys the c ...@@ -85,7 +85,7 @@ Replaces the current page with another one in the application and destroys the c
**Example** **Example**
``` ```js
// Current page // Current page
export default { export default {
replacePage() { replacePage() {
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
``` ```
``` ```js
// detail page // detail page
export default { export default {
data: { data: {
...@@ -128,7 +128,7 @@ Returns to the previous page or a specified page. ...@@ -128,7 +128,7 @@ Returns to the previous page or a specified page.
**Example** **Example**
``` ```js
// index page // index page
export default { export default {
indexPushPage() { indexPushPage() {
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
``` ```
``` ```js
// detail page // detail page
export default { export default {
detailPushPage() { detailPushPage() {
...@@ -152,7 +152,7 @@ export default { ...@@ -152,7 +152,7 @@ export default {
``` ```
``` ```js
// Navigate from the mall page to the detail page through router.back(). // Navigate from the mall page to the detail page through router.back().
export default { export default {
mallBackPage() { mallBackPage() {
...@@ -162,7 +162,7 @@ export default { ...@@ -162,7 +162,7 @@ export default {
``` ```
``` ```js
// Navigate from the detail page to the index page through router.back(). // Navigate from the detail page to the index page through router.back().
export default { export default {
defaultBack() { defaultBack() {
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
``` ```
``` ```js
// Return to the detail page through router.back(). // Return to the detail page through router.back().
export default { export default {
backToDetail() { backToDetail() {
...@@ -208,7 +208,7 @@ Clears all historical pages in the stack and retains only the current page at th ...@@ -208,7 +208,7 @@ Clears all historical pages in the stack and retains only the current page at th
**Example** **Example**
``` ```js
export default { export default {
clearPage() { clearPage() {
router.clear(); router.clear();
...@@ -232,7 +232,7 @@ Obtains the number of pages in the current stack. ...@@ -232,7 +232,7 @@ Obtains the number of pages in the current stack.
**Example** **Example**
``` ```js
export default { export default {
getLength() { getLength() {
var size = router.getLength(); var size = router.getLength();
...@@ -257,7 +257,7 @@ Obtains state information about the current page. ...@@ -257,7 +257,7 @@ Obtains state information about the current page.
**Example** **Example**
``` ```js
export default { export default {
getState() { getState() {
var page = router.getState(); var page = router.getState();
...@@ -284,7 +284,7 @@ Enables the display of a confirm dialog box before returning to the previous pag ...@@ -284,7 +284,7 @@ Enables the display of a confirm dialog box before returning to the previous pag
**Example** **Example**
``` ```js
export default { export default {
enableAlertBeforeBackPage() { enableAlertBeforeBackPage() {
router.enableAlertBeforeBackPage({ router.enableAlertBeforeBackPage({
...@@ -292,8 +292,8 @@ export default { ...@@ -292,8 +292,8 @@ export default {
success: function() { success: function() {
console.log('success'); console.log('success');
}, },
fail: function() { cancel: function() {
console.log('fail'); console.log('cancel');
}, },
}); });
} }
...@@ -316,15 +316,15 @@ Disables the display of a confirm dialog box before returning to the previous pa ...@@ -316,15 +316,15 @@ Disables the display of a confirm dialog box before returning to the previous pa
**Example** **Example**
``` ```js
export default { export default {
disableAlertBeforeBackPage() { disableAlertBeforeBackPage() {
router.disableAlertBeforeBackPage({ router.disableAlertBeforeBackPage({
success: function() { success: function() {
console.log('success'); console.log('success');
}, },
fail: function() { cancel: function() {
console.log('fail'); console.log('cancel');
}, },
}); });
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册