未验证 提交 ba1f027d 编写于 作者: O openharmony_ci 提交者: Gitee

!7345 断链修改

Merge pull request !7345 from LiAn/OpenHarmony-3.2-Beta2
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
InputConsumer模块提供对按键事件的监听。 InputConsumer模块提供对按键事件的监听。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > **说明:**
> >
> - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> >
...@@ -32,7 +32,7 @@ on(type: "key", keyOptions: KeyOptions, callback: Callback<KeyOptions>): v ...@@ -32,7 +32,7 @@ on(type: "key", keyOptions: KeyOptions, callback: Callback<KeyOptions>): v
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | 是 | 监听输入事件类型,只支持“key”。 | | type | string | 是 | 监听输入事件类型,只支持“key”。 |
| keyOptions | [keyOptions](#keyOptions) | 是 | 组合键选项,用来指定组合键输入时应该符合的条件。 | | keyOptions | [keyOptions](#keyoptions) | 是 | 组合键选项,用来指定组合键输入时应该符合的条件。 |
| callback | Callback<KeyOptions> | 是 | 回调函数。当满足条件的按键输入产生时,回调到此函数,以传入的KeyOptions为入参。 | | callback | Callback<KeyOptions> | 是 | 回调函数。当满足条件的按键输入产生时,回调到此函数,以传入的KeyOptions为入参。 |
**示例:** **示例:**
...@@ -62,7 +62,7 @@ off(type: "key", keyOptions: KeyOptions, callback?: Callback<KeyOptions>): ...@@ -62,7 +62,7 @@ off(type: "key", keyOptions: KeyOptions, callback?: Callback<KeyOptions>):
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| type | string | 是 | 监听输入事件类型,只支持“key”。 | | type | string | 是 | 监听输入事件类型,只支持“key”。 |
| keyOptions | [keyOptions](#keyOptions) | 是 | 开始监听时传入的keyOptions。 | | keyOptions | [keyOptions](#keyoptions) | 是 | 开始监听时传入的keyOptions。 |
| callback | Callback<KeyOptions> | 是 | 开始监听时与KeyOption一同传入的回调函数 。 | | callback | Callback<KeyOptions> | 是 | 开始监听时与KeyOption一同传入的回调函数 。 |
**示例:** **示例:**
...@@ -77,13 +77,13 @@ inputConsumer.off('key', keyOptions, callback); ...@@ -77,13 +77,13 @@ inputConsumer.off('key', keyOptions, callback);
``` ```
## KeyOption ## KeyOptions
组合键输入事件发生时,组合键满足的选项。 组合键输入事件发生时,组合键满足的选项。
此接口为系统接口。 此接口为系统接口。
**系统能力:**SystemCapability.MultimodalInput.Input.InputConsumer **系统能力:** SystemCapability.MultimodalInput.Input.InputConsumer
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
输入设备管理模块,用于监听输入设备连接、断开和变化,并查看输入设备相关信息。比如监听鼠标插拔,并获取鼠标的id、name和指针移动速度等信息。 输入设备管理模块,用于监听输入设备连接、断开和变化,并查看输入设备相关信息。比如监听鼠标插拔,并获取鼠标的id、name和指针移动速度等信息。
> **说明**:<br> > **说明**:
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
...@@ -28,7 +29,7 @@ on(type: “change”, listener: Callback&lt;DeviceListener&gt;): void ...@@ -28,7 +29,7 @@ on(type: “change”, listener: Callback&lt;DeviceListener&gt;): void
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ----------- | | -------- | ---------------------------------------- | ---- | ----------- |
| type | string | 是 | 输入设备的事件类型。 | | type | string | 是 | 输入设备的事件类型。 |
| listener | Callback&lt;[DeviceListener](#devicelistener<sup>9+</sup>)&gt; | 是 | 可上报的输入设备事件。 | | listener | Callback&lt;[DeviceListener](#devicelistener9)&gt; | 是 | 可上报的输入设备事件。 |
**示例** **示例**
...@@ -63,7 +64,7 @@ off(type: “change”, listener?: Callback&lt;DeviceListener&gt;): void ...@@ -63,7 +64,7 @@ off(type: “change”, listener?: Callback&lt;DeviceListener&gt;): void
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ----------- | | -------- | ---------------------------------------- | ---- | ----------- |
| type | string | 是 | 输入设备的事件类型。 | | type | string | 是 | 输入设备的事件类型。 |
| listener | Callback&lt;[DeviceListener](#devicelistener<sup>9+</sup>)&gt; | 否 | 可上报的输入设备事件。 | | listener | Callback&lt;[DeviceListener](#devicelistener9)&gt; | 否 | 可上报的输入设备事件。 |
**示例** **示例**
...@@ -245,7 +246,7 @@ getKeyboardType(deviceId: number, callback: AsyncCallback&lt;KeyboardType&gt;): ...@@ -245,7 +246,7 @@ getKeyboardType(deviceId: number, callback: AsyncCallback&lt;KeyboardType&gt;):
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------------------------------- | | -------- | ---------------------------------------- | ---- | --------------------------------- |
| deviceId | number | 是 | 输入设备的唯一标识,同一个物理设备反复插拔,其设备id会发生变化。 | | deviceId | number | 是 | 输入设备的唯一标识,同一个物理设备反复插拔,其设备id会发生变化。 |
| callback | AsyncCallback&lt;[KeyboardType](#keyboardtype)&gt; | 是 | 回调函数,异步返回查询结果。 | | callback | AsyncCallback&lt;[KeyboardType](#keyboardtype9)&gt; | 是 | 回调函数,异步返回查询结果。 |
**示例** **示例**
...@@ -268,7 +269,7 @@ getKeyboardType(deviceId: number): Promise&lt;KeyboardType&gt; ...@@ -268,7 +269,7 @@ getKeyboardType(deviceId: number): Promise&lt;KeyboardType&gt;
| 参数 | 说明 | | 参数 | 说明 |
| ---------------------------------------- | ------------------- | | ---------------------------------------- | ------------------- |
| Promise&lt;[KeyboardType](#keyboardtype)&gt; | Promise实例,用于异步获取结果。 | | Promise&lt;[KeyboardType](#keyboardtype9)&gt; | Promise实例,用于异步获取结果。 |
**示例** **示例**
...@@ -336,7 +337,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{ ...@@ -336,7 +337,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
| 名称 | 参数类型 | 说明 | | 名称 | 参数类型 | 说明 |
| ----------------------- | ------------------------- | -------- | | ----------------------- | ------------------------- | -------- |
| source | [SourceType](#sourcetype) | 轴的输入源类型。 | | source | [SourceType](#sourcetype) | 轴的输入源类型。 |
| axis | [AxisType](#axistype) | 轴的类型。 | | axis | [AxisType](#axistype9) | 轴的类型。 |
| max | number | 轴的最大值。 | | max | number | 轴的最大值。 |
| min | number | 轴的最小值。 | | min | number | 轴的最小值。 |
| fuzz<sup>9+</sup> | number | 轴的模糊值。 | | fuzz<sup>9+</sup> | number | 轴的模糊值。 |
...@@ -358,7 +359,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{ ...@@ -358,7 +359,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
| touchpad | string | 表示输入设备是触摸板。 | | touchpad | string | 表示输入设备是触摸板。 |
| joystick | string | 表示输入设备是操纵杆。 | | joystick | string | 表示输入设备是操纵杆。 |
## ChangeType ## ChangedType
定义监听设备热插拔事件。 定义监听设备热插拔事件。
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
本模块提供对输入法框架的管理,包括隐藏输入法、查询已安装的输入法列表和显示输入法选择对话框。 本模块提供对输入法框架的管理,包括隐藏输入法、查询已安装的输入法列表和显示输入法选择对话框。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > **说明:**
>
> 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
...@@ -111,7 +112,7 @@ switchInputMethod(target: InputmethodProperty): Promise&lt;boolean&gt; ...@@ -111,7 +112,7 @@ switchInputMethod(target: InputmethodProperty): Promise&lt;boolean&gt;
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ----------------------------------------- | ---------------------------- | | ----------------------------------------- | ---------------------------- |
| [Promise](#Promise) | 回调返回切换后的输入法。 | | Promise\<boolean> | 回调返回切换后的输入法。 |
**示例:** **示例:**
...@@ -123,7 +124,7 @@ switchInputMethod(target: InputmethodProperty): Promise&lt;boolean&gt; ...@@ -123,7 +124,7 @@ switchInputMethod(target: InputmethodProperty): Promise&lt;boolean&gt;
``` ```
## InputMethodController ## InputMethodController
下列API示例中都需使用[getInputMethodController](#getInputMethodController)回调获取到InputMethodController实例,再通过此实例调用对应方法。 下列API示例中都需使用[getInputMethodController](#getinputmethodcontroller)回调获取到InputMethodController实例,再通过此实例调用对应方法。
### stopInput ### stopInput
...@@ -171,7 +172,7 @@ stopInput(): Promise&lt;boolean&gt; ...@@ -171,7 +172,7 @@ stopInput(): Promise&lt;boolean&gt;
## InputMethodSetting<sup>8+</sup> ## InputMethodSetting<sup>8+</sup>
下列API示例中都需使用[getInputMethodSetting](#getInputMethodSetting)回调获取到InputMethodSetting实例,再通过此实例调用对应方法。 下列API示例中都需使用[getInputMethodSetting](#getinputmethodsetting)回调获取到InputMethodSetting实例,再通过此实例调用对应方法。
### listInputMethod ### listInputMethod
......
# 传感器 # 传感器
## 模块说明
sensor模块提供订阅传感器数据基本能力,包括订阅、取消订阅传感器数据,获取传感器列表,以及通用的传感器算法接口如通过气压值计算海拔高度、通过旋转矩阵计算设备方向等。 sensor模块提供订阅传感器数据基本能力,包括订阅、取消订阅传感器数据,获取传感器列表,以及通用的传感器算法接口如通过气压值计算海拔高度、通过旋转矩阵计算设备方向等。
传感器是指用于侦测环境中所发生事件或变化,并将此消息发送至其他电子设备(如中央处理器)的设备,通常由敏感组件和转换组件组成。传感器是实现物联网智能化的重要基石,为实现全场景智慧化战略,支撑“1+8+N”产品需求,需要构筑统一的传感器管理框架,达到为各产品/业务提供低时延、低功耗的感知数据的目的。根据用途可分为以下六大类: 传感器是指用于侦测环境中所发生事件或变化,并将此消息发送至其他电子设备(如中央处理器)的设备,通常由敏感组件和转换组件组成。传感器是实现物联网智能化的重要基石,为实现全场景智慧化战略,支撑“1+8+N”产品需求,需要构筑统一的传感器管理框架,达到为各产品/业务提供低时延、低功耗的感知数据的目的。根据用途可分为以下六大类:
...@@ -54,12 +52,14 @@ on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;Acceler ...@@ -54,12 +52,14 @@ on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;Acceler
); );
``` ```
### LINEAR_ACCELERATION ### LINEAR_ACCELERATION<sup>deprecated</sup>
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
监听线性加速度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。 监听线性加速度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
从API Version9开始该接口不再维护,推荐使用sensor.on.LINEAR_ACCELEROMETER<sup>9+</sup>
**需要权限**:ohos.permission.ACCELEROMETER ,该权限为系统权限 **需要权限**:ohos.permission.ACCELEROMETER ,该权限为系统权限
**系统能力**:SystemCapability.Sensors.Sensor **系统能力**:SystemCapability.Sensors.Sensor
...@@ -82,6 +82,35 @@ on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;Line ...@@ -82,6 +82,35 @@ on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;Line
); );
``` ```
### LINEAR_ACCELEROMETER<sup>9+</sup>
on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELEROMETER,callback:Callback&lt;LinearAccelerometerResponse&gt;, options?: Options): void
监听线性加速度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
**需要权限**:ohos.permission.ACCELEROMETER,该权限为系统权限
**系统能力**:SystemCapability.Sensors.Sensor
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | 是 | 要订阅的线性加速度传感器类型为SENSOR_TYPE_ID_LINEAR_ACCELEROMETER。 |
| callback | Callback&lt;[LinearAccelerometerResponse](#linearaccelerometerresponse)&gt; | 是 | 注册线性加速度传感器的回调函数,上报的数据类型为LinearAccelerometerResponse。 |
| options | [Options](#options) | 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
**示例:**
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELEROMETER,function(data){
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
},
{interval: 10000000}
);
```
### ACCELEROMETER_UNCALIBRATED ### 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
...@@ -499,12 +528,14 @@ on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback&lt;Orientatio ...@@ -499,12 +528,14 @@ on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback&lt;Orientatio
); );
``` ```
### HEART_RATE ### HEART_RATE<sup>deprecated</sup>
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
监听心率传感器数据变化一次。 监听心率传感器数据变化一次。
从API Version9开始该接口不再维护,推荐使用sensor.on.HEART_BEAT_RATE<sup>9+</sup>
**需要权限**:ohos.permission.READ_HEALTH_DATA **需要权限**:ohos.permission.READ_HEALTH_DATA
**系统能力**:SystemCapability.Sensors.Sensor **系统能力**:SystemCapability.Sensors.Sensor
...@@ -526,6 +557,33 @@ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE,function(data){ ...@@ -526,6 +557,33 @@ sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE,function(data){
); );
``` ```
### HEART_BEAT_RATE<sup>9+</sup>
on(type: SensorType.SENSOR_TYPE_ID_HEART_BEAT_RATE, callback: Callback&lt;HeartRateResponse&gt;, options?: Options): void
监听心率传感器数据变化一次。
**需要权限**:ohos.permission.READ_HEALTH_DATA
**系统能力**:SystemCapability.Sensors.Sensor
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | 是 | 要订阅的心率传感器类型为SENSOR_TYPE_ID_HEART_BEAT_RATE。 |
| callback | Callback&lt;[HeartRateResponse](#heartrateresponse)&gt; | 是 | 注册一次心率传感器的回调函数,上报的数据类型为HeartRateResponse。 |
**示例:**
```js
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HEART_BEAT_RATE,function(data){
console.info("Heart rate: " + data.heartRate);
},
{interval: 10000000}
);
```
### 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
...@@ -605,12 +663,14 @@ once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;Accele ...@@ -605,12 +663,14 @@ once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;Accele
); );
``` ```
### LINEAR_ACCELERATION ### LINEAR_ACCELERATION<sup>deprecated</sup>
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
监听线性加速度传感器数据变化一次。 监听线性加速度传感器数据变化一次。
从API Version9开始该接口不再维护,推荐使用sensor.once.LINEAR_ACCELEROMETER<sup>9+</sup>
**需要权限**:ohos.permission.ACCELEROMETER ,该权限为系统权限 **需要权限**:ohos.permission.ACCELEROMETER ,该权限为系统权限
**系统能力**:SystemCapability.Sensors.Sensor **系统能力**:SystemCapability.Sensors.Sensor
...@@ -631,6 +691,32 @@ once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;Li ...@@ -631,6 +691,32 @@ once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;Li
); );
``` ```
### LINEAR_ACCELEROMETER<sup>9+</sup>
once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELEROMETER,callback:Callback&lt;LinearAccelerometerResponse&gt;): void
订阅一次线性加速度传感器数据。
**需要权限**:ohos.permission.ACCELEROMETER ,该权限为系统权限
**系统能力**:SystemCapability.Sensors.Sensor
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | 是 | 线性加速度传感器类型为SENSOR_TYPE_ID_LINEAR_ACCELEROMETER。 |
| callback | Callback&lt;[LinearAccelerometerResponse](#linearaccelerometerresponse)&gt; | 是 | 注册一次线性加速度传感器的回调函数,上报的数据类型为LinearAccelerometerResponse。 |
**示例:**
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELEROMETER, function(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
}
);
```
### ACCELEROMETER_UNCALIBRATED ### 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
...@@ -1041,12 +1127,14 @@ once(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback&lt;Rota ...@@ -1041,12 +1127,14 @@ once(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback&lt;Rota
); );
``` ```
### HEART_RATE ### HEART_RATE<sup>deprecated</sup>
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
监听心率传感器数据变化一次。 监听心率传感器数据变化一次。
从API Version9开始该接口不再维护,推荐使用sensor.once.HEART_BEAT_RATE<sup>9+</sup>
**需要权限**:ohos.permission.READ_HEALTH_DATA **需要权限**:ohos.permission.READ_HEALTH_DATA
**系统能力**:SystemCapability.Sensors.Sensor **系统能力**:SystemCapability.Sensors.Sensor
...@@ -1065,6 +1153,30 @@ once(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback&lt;HeartRate ...@@ -1065,6 +1153,30 @@ once(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback&lt;HeartRate
); );
``` ```
### HEART_BEAT_RATE<sup>9+</sup>
once(type: SensorType.SENSOR_TYPE_ID_HEART_BEAT_RATE, callback: Callback&lt;HeartRateResponse&gt;): void
订阅一次心率传感器数据。
**需要权限**:ohos.permission.READ_HEALTH_DATA
**系统能力**:SystemCapability.Sensors.Sensor
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | 是 | 心率传感器类型为SENSOR_TYPE_ID_HEART_BEAT_RATE。 |
| callback | Callback&lt;[HeartRateResponse](#heartrateresponse)&gt; | 是 | 注册一次心率传感器的回调函数,上报的数据类型为HeartRateResponse。 |
**示例:**
```js
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HEART_BEAT_RATE, function(data) {
console.info("Heart rate: " + data.heartRate);
}
);
```
### WEAR_DETECTION ### 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
...@@ -1326,12 +1438,14 @@ function callback(data) { ...@@ -1326,12 +1438,14 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HALL, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HALL, callback);
``` ```
### HEART_RATE ### HEART_RATE<sup>deprecated</sup>
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
取消订阅传感器数据。 取消订阅传感器数据。
从API Version9开始该接口不再维护,推荐使用sensor.off.HEART_BEAT_RATE<sup>9+</sup>
**需要权限**:ohos.permission.READ_HEALTH_DATA **需要权限**:ohos.permission.READ_HEALTH_DATA
**系统能力**:SystemCapability.Sensors.Sensor **系统能力**:SystemCapability.Sensors.Sensor
...@@ -1352,6 +1466,32 @@ function callback(data) { ...@@ -1352,6 +1466,32 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback);
``` ```
### HEART_BEAT_RATE<sup>9+</sup>
off(type: SensorType.SENSOR_TYPE_ID_HEART_BEAT_RATE, callback?: Callback&lt;HeartRateResponse&gt;): void
取消订阅传感器数据。
**需要权限**:ohos.permission.READ_HEALTH_DATA
**系统能力**:SystemCapability.Sensors.Sensor
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype)[SensorType](#sensortype) | 是 | 要取消订阅的心率传感器类型为SENSOR_TYPE_ID_HEART_BEAT_RATE。 |
| callback | Callback&lt;[HeartRateResponse](#heartrateresponse)&gt; | 是 | 取消注册一次心率传感器的回调函数,上报的数据类型为HeartRateResponse。 |
**示例:**
```js
function callback(data) {
console.info("Heart rate: " + data.heartRate);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HEART_BEAT_RATE, callback);
```
### 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
...@@ -1376,12 +1516,14 @@ function callback(data) { ...@@ -1376,12 +1516,14 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback);
``` ```
### LINEAR_ACCELERATION ### LINEAR_ACCELERATION<sup>deprecated</sup>
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
取消订阅传感器数据。 取消订阅传感器数据。
从API Version9开始该接口不再维护,推荐使用sensor.off.LINEAR_ACCELEROMETER<sup>9+</sup>
**需要权限**:ohos.permission.ACCELEROMETER,该权限为系统权限 **需要权限**:ohos.permission.ACCELEROMETER,该权限为系统权限
**系统能力**:SystemCapability.Sensors.Sensor **系统能力**:SystemCapability.Sensors.Sensor
...@@ -1404,6 +1546,34 @@ function callback(data) { ...@@ -1404,6 +1546,34 @@ function callback(data) {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback); sensor.off(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback);
``` ```
### LINEAR_ACCELEROMETER<sup>9+</sup>
off(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELEROMETER, callback?: Callback&lt;LinearAccelerometerResponse&gt;): void
取消订阅传感器数据。
**需要权限**:ohos.permission.ACCELEROMETER,该权限为系统权限
**系统能力**:SystemCapability.Sensors.Sensor
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | [SensorType](#sensortype) | 是 | 要取消订阅的线性加速度传感器类型为SENSOR_TYPE_ID_LINEAR_ACCELEROMETER。 |
| callback | Callback&lt;[LinearAccelerometerResponse](#linearaccelerometerresponse)&gt; | 是 | 取消注册性加速度传感器的回调函数,上报的数据类型为LinearAccelerometerResponse。 |
**示例:**
```js
function callback(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELEROMETER, callback);
```
### 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
...@@ -2234,7 +2404,8 @@ createRotationMatrix(gravity: Array&lt;number&gt;, geomagnetic: Array&lt;number& ...@@ -2234,7 +2404,8 @@ createRotationMatrix(gravity: Array&lt;number&gt;, geomagnetic: Array&lt;number&
| SENSOR_TYPE_ID_HUMIDITY | 13 | 湿度传感器。 | | SENSOR_TYPE_ID_HUMIDITY | 13 | 湿度传感器。 |
| SENSOR_TYPE_ID_ORIENTATION | 256 | 方向传感器。 | | SENSOR_TYPE_ID_ORIENTATION | 256 | 方向传感器。 |
| SENSOR_TYPE_ID_GRAVITY | 257 | 重力传感器。 | | SENSOR_TYPE_ID_GRAVITY | 257 | 重力传感器。 |
| SENSOR_TYPE_ID_LINEAR_ACCELERATION | 258 | 线性加速度传感器。 | | SENSOR_TYPE_ID_LINEAR_ACCELERATION<sup>deprecated</sup> | 258 | 线性加速度传感器。 |
| SENSOR_TYPE_ID_LINEAR_ACCELEROMETER | 258 | 线性加速度传感器。 |
| SENSOR_TYPE_ID_ROTATION_VECTOR | 259 | 旋转矢量传感器。 | | SENSOR_TYPE_ID_ROTATION_VECTOR | 259 | 旋转矢量传感器。 |
| SENSOR_TYPE_ID_AMBIENT_TEMPERATURE | 260 | 环境温度传感器。 | | SENSOR_TYPE_ID_AMBIENT_TEMPERATURE | 260 | 环境温度传感器。 |
| SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED | 261 | 未校准磁场传感器。 | | SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED | 261 | 未校准磁场传感器。 |
...@@ -2242,7 +2413,8 @@ createRotationMatrix(gravity: Array&lt;number&gt;, geomagnetic: Array&lt;number& ...@@ -2242,7 +2413,8 @@ createRotationMatrix(gravity: Array&lt;number&gt;, geomagnetic: Array&lt;number&
| SENSOR_TYPE_ID_SIGNIFICANT_MOTION | 264 | 有效运动传感器。 | | SENSOR_TYPE_ID_SIGNIFICANT_MOTION | 264 | 有效运动传感器。 |
| SENSOR_TYPE_ID_PEDOMETER_DETECTION | 265 | 计步检测传感器。 | | SENSOR_TYPE_ID_PEDOMETER_DETECTION | 265 | 计步检测传感器。 |
| SENSOR_TYPE_ID_PEDOMETER | 266 | 计步传感器。 | | SENSOR_TYPE_ID_PEDOMETER | 266 | 计步传感器。 |
| SENSOR_TYPE_ID_HEART_RATE | 278 | 心率传感器。 | | SENSOR_TYPE_ID_HEART_RATE<sup>deprecated</sup> | 278 | 心率传感器。 |
| SENSOR_TYPE_ID_HEART_BEAT_RATE | 278 | 心率传感器。 |
| SENSOR_TYPE_ID_WEAR_DETECTION | 280 | 佩戴检测传感器。 | | SENSOR_TYPE_ID_WEAR_DETECTION | 280 | 佩戴检测传感器。 |
| SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED | 281 | 未校准加速度计传感器。 | | SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED | 281 | 未校准加速度计传感器。 |
......
...@@ -23,7 +23,7 @@ import {UiDriver, BY, MatchPattern, ResizeDirection, WindowMode} from '@ohos.uit ...@@ -23,7 +23,7 @@ import {UiDriver, BY, MatchPattern, ResizeDirection, WindowMode} from '@ohos.uit
## By ## By
UiTest框架通过By类提供了丰富的控件特征描述API,用于进行控件筛选来匹配/查找出目标控件。<br> UiTest框架通过By类提供了丰富的控件特征描述API,用于进行控件筛选来匹配/查找出目标控件。<br>
By提供的API能力具有以下几个特点:<br>1、支持单属性匹配和多属性组合匹配,例如同时指定目标控件text和id。<br>2、控件属性支持多种匹配模式。<br>3、支持控件绝对定位,相对定位,可通过[By.isBefore](#byisbefore)[By.isAfter](#byisafter)等API限定邻近控件特征进行辅助定位。<br>By类提供的所有API均为同步接口,建议使用者通过静态构造器BY来链式创建By对象。 By提供的API能力具有以下几个特点:<br>1、支持单属性匹配和多属性组合匹配,例如同时指定目标控件text和id。<br>2、控件属性支持多种匹配模式。<br>3、支持控件绝对定位,相对定位,可通过[By.isBefore](#isbefore)[By.isAfter](#isafter)等API限定邻近控件特征进行辅助定位。<br>By类提供的所有API均为同步接口,建议使用者通过静态构造器BY来链式创建By对象。
```js ```js
BY.text('123').type('button') BY.text('123').type('button')
...@@ -1566,7 +1566,7 @@ getWindowMode(): Promise\<WindowMode> ...@@ -1566,7 +1566,7 @@ getWindowMode(): Promise\<WindowMode>
| 类型 | 说明 | | 类型 | 说明 |
| ------------------------------------------------ | ------------------------------------- | | ------------------------------------------------ | ------------------------------------- |
| Promise\<[WindowMode](#WindowMode<sup>9+</sup>)> | 以Promise形式返回窗口的窗口模式信息。 | | Promise\<[WindowMode](#windowmode9)> | 以Promise形式返回窗口的窗口模式信息。 |
**示例:** **示例:**
...@@ -1695,7 +1695,7 @@ resize(wide: number, height: number, direction: ResizeDirection): Promise\<bool> ...@@ -1695,7 +1695,7 @@ resize(wide: number, height: number, direction: ResizeDirection): Promise\<bool>
| --------- | ------------------------------------------------ | ---- | ------------------------------------------------------------ | | --------- | ------------------------------------------------ | ---- | ------------------------------------------------------------ |
| wide | number | 是 | 以number的形式传入调整后窗口的宽度。 | | wide | number | 是 | 以number的形式传入调整后窗口的宽度。 |
| height | number | 是 | 以number的形式传入调整后窗口的高度。 | | height | number | 是 | 以number的形式传入调整后窗口的高度。 |
| direction | [ResizeDirection](#resizedirection<sup>9+</sup>) | 是 | 以[ResizeDirection](#ResizeDirection<sup>9+</sup>)的形式传入窗口调整的方向。 | | direction | [ResizeDirection](#resizedirection9) | 是 | 以[ResizeDirection](#resizedirection9)的形式传入窗口调整的方向。 |
**返回值:** **返回值:**
......
...@@ -30,7 +30,7 @@ getOnlineUpdater(upgradeInfo: UpgradeInfo): Updater ...@@ -30,7 +30,7 @@ getOnlineUpdater(upgradeInfo: UpgradeInfo): Updater
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ----------- | --------------------------- | ---- | ---- | | ----------- | --------------------------- | ---- | ------ |
| upgradeInfo | [UpgradeInfo](#upgradeinfo) | 是 | 升级信息对象 | | upgradeInfo | [UpgradeInfo](#upgradeinfo) | 是 | 升级信息对象 |
**返回值:** **返回值:**
...@@ -68,7 +68,7 @@ getRestorer(): Restorer ...@@ -68,7 +68,7 @@ getRestorer(): Restorer
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ------------------- | ---- | | --------------------- | ------ |
| [Restorer](#restorer) | 恢复出厂对象 | | [Restorer](#restorer) | 恢复出厂对象 |
**示例:** **示例:**
...@@ -92,7 +92,7 @@ getLocalUpdater(): LocalUpdater ...@@ -92,7 +92,7 @@ getLocalUpdater(): LocalUpdater
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ------------------- | ---- | | ----------------------------- | ------ |
| [LocalUpdater](#localupdater) | 本地升级对象 | | [LocalUpdater](#localupdater) | 本地升级对象 |
**示例:** **示例:**
...@@ -120,7 +120,7 @@ checkNewVersion(callback: AsyncCallback\<CheckResult>): void ...@@ -120,7 +120,7 @@ checkNewVersion(callback: AsyncCallback\<CheckResult>): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | ---------------------------------------- | ---- | -------------- |
| callback | AsyncCallback\<[CheckResult](#checkresult)> | 是 | 回调函数,返回搜包结果对象。 | | callback | AsyncCallback\<[CheckResult](#checkresult)> | 是 | 回调函数,返回搜包结果对象。 |
**示例:** **示例:**
...@@ -144,7 +144,7 @@ checkNewVersion(): Promise\<CheckResult> ...@@ -144,7 +144,7 @@ checkNewVersion(): Promise\<CheckResult>
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | ------------------------------------- | ------------------- |
| Promise\<[CheckResult](#checkresult)> | Promise对象,返回搜包结果对象。 | | Promise\<[CheckResult](#checkresult)> | Promise对象,返回搜包结果对象。 |
**示例:** **示例:**
...@@ -172,7 +172,7 @@ getNewVersionInfo(callback: AsyncCallback\<NewVersionInfo>): void ...@@ -172,7 +172,7 @@ getNewVersionInfo(callback: AsyncCallback\<NewVersionInfo>): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | ---------------------------------------- | ---- | --------------- |
| callback | AsyncCallback\<[NewVersionInfo](#newversioninfo)> | 是 | 回调函数,返回新版本信息对象。 | | callback | AsyncCallback\<[NewVersionInfo](#newversioninfo)> | 是 | 回调函数,返回新版本信息对象。 |
**示例:** **示例:**
...@@ -197,7 +197,7 @@ getNewVersionInfo(): Promise\<NewVersionInfo> ...@@ -197,7 +197,7 @@ getNewVersionInfo(): Promise\<NewVersionInfo>
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | ---------------------------------------- | -------------------- |
| Promise\<[NewVersionInfo](#newversioninfo)> | Promise对象,返回新版本信息对象。 | | Promise\<[NewVersionInfo](#newversioninfo)> | Promise对象,返回新版本信息对象。 |
**示例:** **示例:**
...@@ -224,7 +224,7 @@ getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOption ...@@ -224,7 +224,7 @@ getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOption
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ------------------ | ---------------------------------------- | ---- | -------------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | 是 | 描述文件选项 | | descriptionOptions | [DescriptionOptions](#descriptionoptions) | 是 | 描述文件选项 |
| callback | AsyncCallback\<Array\<[ComponentDescription](#componentdescription)>>) | 是 | 回调函数,返回新版本描述文件 | | callback | AsyncCallback\<Array\<[ComponentDescription](#componentdescription)>>) | 是 | 回调函数,返回新版本描述文件 |
...@@ -262,14 +262,14 @@ getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOption ...@@ -262,14 +262,14 @@ getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOption
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ------------------ | ---------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | 是 | 描述文件选项 | | descriptionOptions | [DescriptionOptions](#descriptionoptions) | 是 | 描述文件选项 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | ---------------------------------------- | ------------------- |
| Promise\<Array\<[ComponentDescription](#componentdescription)>> | Promise对象,返回新版本描述文件 | | Promise\<Array\<[ComponentDescription](#componentdescription)>> | Promise对象,返回新版本描述文件 |
**示例:** **示例:**
...@@ -306,7 +306,7 @@ getCurrentVersionInfo(callback: AsyncCallback\<CurrentVersionInfo>): void ...@@ -306,7 +306,7 @@ getCurrentVersionInfo(callback: AsyncCallback\<CurrentVersionInfo>): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | ---------------------------------------- | ---- | ---------------- |
| callback | AsyncCallback\<[CurrentVersionInfo](#currentversioninfo)> | 是 | 回调函数,返回当前版本信息对象。 | | callback | AsyncCallback\<[CurrentVersionInfo](#currentversioninfo)> | 是 | 回调函数,返回当前版本信息对象。 |
**示例:** **示例:**
...@@ -332,7 +332,7 @@ getCurrentVersionInfo(): Promise\<CurrentVersionInfo> ...@@ -332,7 +332,7 @@ getCurrentVersionInfo(): Promise\<CurrentVersionInfo>
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | ---------------------------------------- | ------------------- |
| Promise\<[CurrentVersionInfo](#currentversioninfo)> | Promise对象,返回当前版本对象。 | | Promise\<[CurrentVersionInfo](#currentversioninfo)> | Promise对象,返回当前版本对象。 |
**示例:** **示例:**
...@@ -360,7 +360,7 @@ getCurrentVersionDescription(descriptionOptions: DescriptionOptions, callback: A ...@@ -360,7 +360,7 @@ getCurrentVersionDescription(descriptionOptions: DescriptionOptions, callback: A
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ------------------ | ---------------------------------------- | ---- | --------------- |
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | 是 | 描述文件选项 | | descriptionOptions | [DescriptionOptions](#descriptionoptions) | 是 | 描述文件选项 |
| callback | AsyncCallback\<Array\<[ComponentDescription](#componentdescription)>>) | 是 | 回调函数,返回当前版本描述文件 | | callback | AsyncCallback\<Array\<[ComponentDescription](#componentdescription)>>) | 是 | 回调函数,返回当前版本描述文件 |
...@@ -392,13 +392,13 @@ getCurrentVersionDescription(descriptionOptions: DescriptionOptions): Promise\<A ...@@ -392,13 +392,13 @@ getCurrentVersionDescription(descriptionOptions: DescriptionOptions): Promise\<A
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ------------------ | ---------------------------------------- | ---- | ------ |
| descriptionOptions | [DescriptionOptions](#descriptionoptions) | 是 | 描述文件选项 | | descriptionOptions | [DescriptionOptions](#descriptionoptions) | 是 | 描述文件选项 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | ---------------------------------------- | -------------------- |
| Promise\<Array\<[ComponentDescription](#componentdescription)>> | Promise对象,返回当前版本描述文件 | | Promise\<Array\<[ComponentDescription](#componentdescription)>> | Promise对象,返回当前版本描述文件 |
**示例:** **示例:**
...@@ -430,7 +430,7 @@ getTaskInfo(callback: AsyncCallback\<TaskInfo>): void ...@@ -430,7 +430,7 @@ getTaskInfo(callback: AsyncCallback\<TaskInfo>): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | ------------------------------------- | ---- | ---------------- |
| callback | AsyncCallback\<[TaskInfo](#taskinfo)> | 是 | 回调函数,返回升级任务信息对象。 | | callback | AsyncCallback\<[TaskInfo](#taskinfo)> | 是 | 回调函数,返回升级任务信息对象。 |
**示例:** **示例:**
...@@ -454,7 +454,7 @@ getTaskInfo(): Promise\<TaskInfo> ...@@ -454,7 +454,7 @@ getTaskInfo(): Promise\<TaskInfo>
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | ------------------------------- | ------------------- |
| Promise\<[TaskInfo](#taskinfo)> | Promise对象,返回任务信息对象。 | | Promise\<[TaskInfo](#taskinfo)> | Promise对象,返回任务信息对象。 |
**示例:** **示例:**
...@@ -480,7 +480,7 @@ download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions, ...@@ -480,7 +480,7 @@ download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions,
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ---------------------------------- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| downloadOptions | [DownloadOptions](#downloadoptions) | 是 | 下载选项 | | downloadOptions | [DownloadOptions](#downloadoptions) | 是 | 下载选项 |
| callback | AsyncCallback\<void> | 是 | 回调函数。当下载成功时,err为undefined,否则为错误对象。 | | callback | AsyncCallback\<void> | 是 | 回调函数。当下载成功时,err为undefined,否则为错误对象。 |
...@@ -516,14 +516,14 @@ download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions) ...@@ -516,14 +516,14 @@ download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions)
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| downloadOptions | [DownloadOptions](#downloadoptions) | 是 | 下载选项 | | downloadOptions | [DownloadOptions](#downloadoptions) | 是 | 下载选项 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise对象。无返回结果的Promise对象。 | | Promise\<void> | Promise对象。无返回结果的Promise对象。 |
**示例:** **示例:**
...@@ -559,7 +559,7 @@ resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: Resu ...@@ -559,7 +559,7 @@ resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: Resu
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | --------------------- | ---------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| resumeDownloadOptions | [ResumeDownloadOptions](#resumedownloadoptions) | 是 | 恢复下载选项 | | resumeDownloadOptions | [ResumeDownloadOptions](#resumedownloadoptions) | 是 | 恢复下载选项 |
| callback | AsyncCallback\<void> | 是 | 回调函数。当恢复下载成功时,err为undefined,否则为错误对象。 | | callback | AsyncCallback\<void> | 是 | 回调函数。当恢复下载成功时,err为undefined,否则为错误对象。 |
...@@ -594,14 +594,14 @@ resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: Resu ...@@ -594,14 +594,14 @@ resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: Resu
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | --------------------- | ---------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| resumeDownloadOptions | [ResumeDownloadOptions](#resumedownloadoptions) | 是 | 恢复下载选项 | | resumeDownloadOptions | [ResumeDownloadOptions](#resumedownloadoptions) | 是 | 恢复下载选项 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise对象。无返回结果的Promise对象。 | | Promise\<void> | Promise对象。无返回结果的Promise对象。 |
**示例:** **示例:**
...@@ -636,7 +636,7 @@ pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseD ...@@ -636,7 +636,7 @@ pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseD
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | -------------------- | ---------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| pauseDownloadOptions | [PauseDownloadOptions](#pausedownloadoptions) | 是 | 暂停下载选项 | | pauseDownloadOptions | [PauseDownloadOptions](#pausedownloadoptions) | 是 | 暂停下载选项 |
| callback | AsyncCallback\<void> | 是 | 回调函数。当暂停下载成功时,err为undefined,否则为错误对象。 | | callback | AsyncCallback\<void> | 是 | 回调函数。当暂停下载成功时,err为undefined,否则为错误对象。 |
...@@ -671,14 +671,14 @@ pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseD ...@@ -671,14 +671,14 @@ pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseD
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | -------------------- | ---------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| pauseDownloadOptions | [PauseDownloadOptions](#pausedownloadoptions) | 是 | 暂停下载选项 | | pauseDownloadOptions | [PauseDownloadOptions](#pausedownloadoptions) | 是 | 暂停下载选项 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise对象。无返回结果的Promise对象。 | | Promise\<void> | Promise对象。无返回结果的Promise对象。 |
**示例:** **示例:**
...@@ -713,7 +713,7 @@ upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions, ca ...@@ -713,7 +713,7 @@ upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions, ca
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| upgradeOptions | [UpgradeOptions](#upgradeoptions) | 是 | 更新选项 | | upgradeOptions | [UpgradeOptions](#upgradeoptions) | 是 | 更新选项 |
| callback | AsyncCallback\<void> | 是 | 回调函数。当升级执行成功时,err为undefined,否则为错误对象。 | | callback | AsyncCallback\<void> | 是 | 回调函数。当升级执行成功时,err为undefined,否则为错误对象。 |
...@@ -748,14 +748,14 @@ upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions): P ...@@ -748,14 +748,14 @@ upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions): P
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| upgradeOptions | [UpgradeOptions](#upgradeoptions) | 是 | 更新选项 | | upgradeOptions | [UpgradeOptions](#upgradeoptions) | 是 | 更新选项 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise对象。无返回结果的Promise对象。 | | Promise\<void> | Promise对象。无返回结果的Promise对象。 |
**示例:** **示例:**
...@@ -790,7 +790,7 @@ clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions, cal ...@@ -790,7 +790,7 @@ clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions, cal
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ------------------------------------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| clearOptions | [ClearOptions](#clearoptions) | 是 | 清除选项 | | clearOptions | [ClearOptions](#clearoptions) | 是 | 清除选项 |
| callback | AsyncCallback\<void> | 是 | 回调函数。当清除异常成功时,err为undefined,否则为错误对象。 | | callback | AsyncCallback\<void> | 是 | 回调函数。当清除异常成功时,err为undefined,否则为错误对象。 |
...@@ -825,14 +825,14 @@ clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions): Pr ...@@ -825,14 +825,14 @@ clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions): Pr
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | --------------------------------------- | ---- | ------ |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要信息 |
| clearOptions | [ClearOptions](#clearoptions) | 是 | 更新选项 | | clearOptions | [ClearOptions](#clearoptions) | 是 | 更新选项 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise对象。无返回结果的Promise对象。 | | Promise\<void> | Promise对象。无返回结果的Promise对象。 |
**示例:** **示例:**
...@@ -867,7 +867,7 @@ getUpgradePolicy(callback: AsyncCallback\<UpgradePolicy>): void ...@@ -867,7 +867,7 @@ getUpgradePolicy(callback: AsyncCallback\<UpgradePolicy>): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ---------- | | -------- | ---------------------------------------- | ---- | --------------- |
| callback | AsyncCallback\<[UpgradePolicy](#upgradepolicy)> | 是 | 回调函数,返回升级策略信息对象 | | callback | AsyncCallback\<[UpgradePolicy](#upgradepolicy)> | 是 | 回调函数,返回升级策略信息对象 |
**示例:** **示例:**
...@@ -892,7 +892,7 @@ getUpgradePolicy(): Promise\<UpgradePolicy> ...@@ -892,7 +892,7 @@ getUpgradePolicy(): Promise\<UpgradePolicy>
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| --------------------------------------- | ----------------- | | ---------------------------------------- | --------------------- |
| Promise\<[UpgradePolicy](#upgradepolicy)> | Promise对象,返回升级策略信息对象。 | | Promise\<[UpgradePolicy](#upgradepolicy)> | Promise对象,返回升级策略信息对象。 |
**示例:** **示例:**
...@@ -919,7 +919,7 @@ setUpgradePolicy(policy: UpgradePolicy, callback: AsyncCallback\<void>): void ...@@ -919,7 +919,7 @@ setUpgradePolicy(policy: UpgradePolicy, callback: AsyncCallback\<void>): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ---------- | | -------- | ------------------------------- | ---- | ------------- |
| policy | [UpgradePolicy](#upgradepolicy) | 是 | 升级策略 | | policy | [UpgradePolicy](#upgradepolicy) | 是 | 升级策略 |
| callback | AsyncCallback\<void> | 是 | 回调函数,返回设置结果对象 | | callback | AsyncCallback\<void> | 是 | 回调函数,返回设置结果对象 |
...@@ -949,13 +949,13 @@ setUpgradePolicy(policy: UpgradePolicy): Promise\<void> ...@@ -949,13 +949,13 @@ setUpgradePolicy(policy: UpgradePolicy): Promise\<void>
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ----------------------------- | ---- | ------ | | ------ | ------------------------------- | ---- | ---- |
| policy | [UpgradePolicy](#upgradepolicy) | 是 | 升级策略 | | policy | [UpgradePolicy](#upgradepolicy) | 是 | 升级策略 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------- | --------------- | | -------------- | ------------------- |
| Promise\<void> | Promise对象,返回设置结果对象。 | | Promise\<void> | Promise对象,返回设置结果对象。 |
**示例:** **示例:**
...@@ -986,7 +986,7 @@ terminateUpgrade(callback: AsyncCallback\<void>): void ...@@ -986,7 +986,7 @@ terminateUpgrade(callback: AsyncCallback\<void>): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | -------------------- | ---- | -------------------------------------- |
| callback | AsyncCallback\<void> | 是 | 回调函数。当清除升级缓存成功时,err为undefined,否则为错误对象。 | | callback | AsyncCallback\<void> | 是 | 回调函数。当清除升级缓存成功时,err为undefined,否则为错误对象。 |
**示例:** **示例:**
...@@ -1010,7 +1010,7 @@ terminateUpgrade(): Promise\<void> ...@@ -1010,7 +1010,7 @@ terminateUpgrade(): Promise\<void>
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise对象。无返回结果的Promise对象。 | | Promise\<void> | Promise对象。无返回结果的Promise对象。 |
**示例:** **示例:**
...@@ -1034,7 +1034,7 @@ on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): voi ...@@ -1034,7 +1034,7 @@ on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): voi
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | 是 | 事件信息 | | eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | 是 | 事件信息 |
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | 是 | 事件回调 | | taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | 是 | 事件回调 |
...@@ -1061,7 +1061,7 @@ off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): v ...@@ -1061,7 +1061,7 @@ off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): v
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | 是 | 事件信息 | | eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | 是 | 事件信息 |
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | 否 | 事件回调 | | taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | 否 | 事件回调 |
...@@ -1093,7 +1093,7 @@ factoryReset(callback: AsyncCallback\<void>): void ...@@ -1093,7 +1093,7 @@ factoryReset(callback: AsyncCallback\<void>): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | -------------------- | ---- | -------------------------------------- |
| callback | AsyncCallback\<void> | 是 | 回调函数。当恢复出厂执行成功时,err为undefined,否则为错误对象。 | | callback | AsyncCallback\<void> | 是 | 回调函数。当恢复出厂执行成功时,err为undefined,否则为错误对象。 |
**示例:** **示例:**
...@@ -1117,7 +1117,7 @@ factoryReset(): Promise\<void> ...@@ -1117,7 +1117,7 @@ factoryReset(): Promise\<void>
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise对象。无返回结果的Promise对象。 | | Promise\<void> | Promise对象。无返回结果的Promise对象。 |
**示例:** **示例:**
...@@ -1145,7 +1145,7 @@ verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string, callback: Asyn ...@@ -1145,7 +1145,7 @@ verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string, callback: Asyn
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------- | --------------------------- | ---- | ---------------- |
| upgradeFile | [UpgradeFile](#upgradefile) | 是 | 升级文件 | | upgradeFile | [UpgradeFile](#upgradefile) | 是 | 升级文件 |
| certsFile | string | 是 | 证书文件路径 | | certsFile | string | 是 | 证书文件路径 |
| callback | AsyncCallback\<void> | 是 | 回调函数,返回升级包校验结果对象 | | callback | AsyncCallback\<void> | 是 | 回调函数,返回升级包校验结果对象 |
...@@ -1176,14 +1176,14 @@ verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string): Promise\<void ...@@ -1176,14 +1176,14 @@ verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string): Promise\<void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------- | --------------------------- | ---- | ------ |
| upgradeFile | [UpgradeFile](#upgradefile) | 是 | 升级文件 | | upgradeFile | [UpgradeFile](#upgradefile) | 是 | 升级文件 |
| certsFile | string | 是 | 证书文件路径 | | certsFile | string | 是 | 证书文件路径 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | -------------- | ---------------------- |
| Promise\<void> | Promise对象,返回升级包校验结果对象。 | | Promise\<void> | Promise对象,返回升级包校验结果对象。 |
**示例:** **示例:**
...@@ -1212,7 +1212,7 @@ applyNewVersion(upgradeFiles: Array<[UpgradeFile](#upgradefile)>, callback: Asyn ...@@ -1212,7 +1212,7 @@ applyNewVersion(upgradeFiles: Array<[UpgradeFile](#upgradefile)>, callback: Asyn
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------- | ---------------------------------- | ---- | --------------------------------------- |
| upgradeFile | Array<[UpgradeFile](#upgradefile)> | 是 | 升级文件 | | upgradeFile | Array<[UpgradeFile](#upgradefile)> | 是 | 升级文件 |
| callback | AsyncCallback\<void> | 是 | 回调函数。当安装升级包执行成功时,err为undefined,否则为错误对象。 | | callback | AsyncCallback\<void> | 是 | 回调函数。当安装升级包执行成功时,err为undefined,否则为错误对象。 |
...@@ -1242,7 +1242,7 @@ applyNewVersion(upgradeFiles: Array<[UpgradeFile](#upgradefile)>): Promise\<void ...@@ -1242,7 +1242,7 @@ applyNewVersion(upgradeFiles: Array<[UpgradeFile](#upgradefile)>): Promise\<void
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ---------------------------------------- | ---------------- | | -------------- | -------------------------- |
| Promise\<void> | Promise对象。无返回结果的Promise对象。 | | Promise\<void> | Promise对象。无返回结果的Promise对象。 |
**示例:** **示例:**
...@@ -1269,7 +1269,7 @@ on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): voi ...@@ -1269,7 +1269,7 @@ on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): voi
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | 是 | 事件信息 | | eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | 是 | 事件信息 |
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | 是 | 事件回调 | | taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | 是 | 事件回调 |
...@@ -1298,7 +1298,7 @@ off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): v ...@@ -1298,7 +1298,7 @@ off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): v
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | 是 | 事件信息 | | eventClassifyInfo | [EventClassifyInfo](#eventclassifyinfo) | 是 | 事件信息 |
| taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | 是 | 事件回调 | | taskCallback | [UpgradeTaskCallback](#upgradetaskcallback) | 是 | 事件回调 |
...@@ -1324,7 +1324,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1324,7 +1324,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ------------ | ----------------------------- | ---- | ------ |
| upgradeApp | string | 是 | 调用方包名 | | upgradeApp | string | 是 | 调用方包名 |
| businessType | [BusinessType](#businesstype) | 是 | 升级业务类型 | | businessType | [BusinessType](#businesstype) | 是 | 升级业务类型 |
...@@ -1335,7 +1335,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1335,7 +1335,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ------- | ----------------------------------- | ---- | ---- |
| vendor | [BusinessVendor](#businessvendor) | 是 | 供应商 | | vendor | [BusinessVendor](#businessvendor) | 是 | 供应商 |
| subType | [BusinessSubType](#businesssubtype) | 是 | 类型 | | subType | [BusinessSubType](#businesssubtype) | 是 | 类型 |
...@@ -1346,7 +1346,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1346,7 +1346,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ----------------- | --------------------------------- | ---- | ------ |
| isExistNewVersion | bool | 是 | 是否有新版本 | | isExistNewVersion | bool | 是 | 是否有新版本 |
| newVersionInfo | [NewVersionInfo](#newversioninfo) | 否 | 新版本数据 | | newVersionInfo | [NewVersionInfo](#newversioninfo) | 否 | 新版本数据 |
...@@ -1357,7 +1357,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1357,7 +1357,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要 |
| versionComponents | Array\<[VersionComponent](#versioncomponent)> | 是 | 版本组件 | | versionComponents | Array\<[VersionComponent](#versioncomponent)> | 是 | 版本组件 |
...@@ -1368,7 +1368,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1368,7 +1368,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ------------- | ------ | ---- | ---- |
| versionDigest | string | 是 | 版本摘要 | | versionDigest | string | 是 | 版本摘要 |
## VersionComponent ## VersionComponent
...@@ -1378,9 +1378,9 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1378,9 +1378,9 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | --------------- | ----------------------------------- | ---- | -------- |
| componentId | number | 是 | 组件标识 | | componentId | number | 是 | 组件标识 |
| componentType | [ComponentType](#componentyype) | 是 | 组件类型 | | componentType | [ComponentType](#componenttype) | 是 | 组件类型 |
| upgradeAction | [UpgradeAction](#upgradeaction) | 是 | 升级方式 | | upgradeAction | [UpgradeAction](#upgradeaction) | 是 | 升级方式 |
| displayVersion | string | 是 | 显示版本号 | | displayVersion | string | 是 | 显示版本号 |
| innerVersion | string | 是 | 版本号 | | innerVersion | string | 是 | 版本号 |
...@@ -1395,7 +1395,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1395,7 +1395,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | -------- | --------------------------------------- | ---- | ------ |
| format | [DescriptionFormat](#descriptionformat) | 是 | 描述文件格式 | | format | [DescriptionFormat](#descriptionformat) | 是 | 描述文件格式 |
| language | string | 是 | 描述文件语言 | | language | string | 是 | 描述文件语言 |
...@@ -1406,7 +1406,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1406,7 +1406,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | --------------- | ----------------------------------- | ---- | ------ |
| componentId | string | 是 | 组件标识 | | componentId | string | 是 | 组件标识 |
| descriptionInfo | [DescriptionInfo](#descriptioninfo) | 是 | 描述文件信息 | | descriptionInfo | [DescriptionInfo](#descriptioninfo) | 是 | 描述文件信息 |
...@@ -1417,7 +1417,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1417,7 +1417,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | --------------- | ----------------------------------- | ---- | ------ |
| descriptionType | [DescriptionType](#descriptiontype) | 是 | 描述文件类型 | | descriptionType | [DescriptionType](#descriptiontype) | 是 | 描述文件类型 |
| content | string | 是 | 描述文件内容 | | content | string | 是 | 描述文件内容 |
...@@ -1428,10 +1428,10 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1428,10 +1428,10 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ----------------- | ---------------------------------------- | ---- | ----- |
| osVersion | string | 是 | 系统版本号 | | osVersion | string | 是 | 系统版本号 |
| deviceName | string | 是 | 设备名 | | deviceName | string | 是 | 设备名 |
| versionComponents | Array\<[VersionComponent](#vesioncomponent)> | 否 | 版本组件 | | versionComponents | Array\<[VersionComponent](#versioncomponent)> | 否 | 版本组件 |
## DownloadOptions ## DownloadOptions
...@@ -1440,7 +1440,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1440,7 +1440,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ------------ | ------------------- | ---- | ---- |
| allowNetwork | [NetType](#nettype) | 是 | 网络类型 | | allowNetwork | [NetType](#nettype) | 是 | 网络类型 |
| order | [Order](#order) | 是 | 升级指令 | | order | [Order](#order) | 是 | 升级指令 |
...@@ -1451,7 +1451,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1451,7 +1451,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ------------ | ------------------- | ---- | ---- |
| allowNetwork | [NetType](#nettype) | 是 | 网络类型 | | allowNetwork | [NetType](#nettype) | 是 | 网络类型 |
## PauseDownloadOptions ## PauseDownloadOptions
...@@ -1461,7 +1461,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1461,7 +1461,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ----------------- | ---- | ---- | -------- |
| isAllowAutoResume | bool | 是 | 是否允许自动恢复 | | isAllowAutoResume | bool | 是 | 是否允许自动恢复 |
## UpgradeOptions ## UpgradeOptions
...@@ -1471,7 +1471,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1471,7 +1471,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ----- | --------------- | ---- | ---- |
| order | [Order](#order) | 是 | 升级指令 | | order | [Order](#order) | 是 | 升级指令 |
## ClearOptions ## ClearOptions
...@@ -1481,7 +1481,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1481,7 +1481,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ------ | ------------------------------- | ---- | ---- |
| status | [UpgradeStatus](#upgradestatus) | 是 | 异常状态 | | status | [UpgradeStatus](#upgradestatus) | 是 | 异常状态 |
## UpgradePolicy ## UpgradePolicy
...@@ -1491,7 +1491,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1491,7 +1491,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ------------------- | --------------------------------------- | ---- | ------- |
| downloadStrategy | bool | 是 | 自动下载策略 | | downloadStrategy | bool | 是 | 自动下载策略 |
| autoUpgradeStrategy | bool | 是 | 自动升级策略 | | autoUpgradeStrategy | bool | 是 | 自动升级策略 |
| autoUpgradePeriods | Array\<[UpgradePeriod](#upgradeperiod)> | 是 | 自动升级时间段 | | autoUpgradePeriods | Array\<[UpgradePeriod](#upgradeperiod)> | 是 | 自动升级时间段 |
...@@ -1503,7 +1503,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1503,7 +1503,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ----- | ------ | ---- | ---- |
| start | number | 是 | 开始时间 | | start | number | 是 | 开始时间 |
| end | number | 是 | 结束时间 | | end | number | 是 | 结束时间 |
...@@ -1514,7 +1514,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1514,7 +1514,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | --------- | --------------------- | ---- | ------ |
| existTask | bool | 是 | 是否存在任务 | | existTask | bool | 是 | 是否存在任务 |
| taskBody | [TaskBody](#taskinfo) | 是 | 任务数据 | | taskBody | [TaskBody](#taskinfo) | 是 | 任务数据 |
...@@ -1525,7 +1525,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1525,7 +1525,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | -------- | --------------------- | ---- | ---- |
| eventId | [EventId](#eventid) | 是 | 事件ID | | eventId | [EventId](#eventid) | 是 | 事件ID |
| taskBody | [TaskBody](#taskinfo) | 是 | 任务数据 | | taskBody | [TaskBody](#taskinfo) | 是 | 任务数据 |
...@@ -1536,7 +1536,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1536,7 +1536,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ----------------- | ---------------------------------------- | ---- | ---- |
| versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要 | | versionDigestInfo | [VersionDigestInfo](#versiondigestinfo) | 是 | 版本摘要 |
| status | [UpgradeStatus](#upgradestatus) | 是 | 升级状态 | | status | [UpgradeStatus](#upgradestatus) | 是 | 升级状态 |
| subStatus | number | 否 | 子状态 | | subStatus | number | 否 | 子状态 |
...@@ -1552,7 +1552,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1552,7 +1552,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ------------ | ------ | ---- | ---- |
| errorCode | number | 是 | 错误码 | | errorCode | number | 是 | 错误码 |
| errorMessage | string | 是 | 错误描述 | | errorMessage | string | 是 | 错误描述 |
...@@ -1563,7 +1563,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1563,7 +1563,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | ------------- | ------------------------------- | ---- | ---- |
| eventClassify | [EventClassify](#eventclassify) | 是 | 事件类型 | | eventClassify | [EventClassify](#eventclassify) | 是 | 事件类型 |
| extraInfo | string | 是 | 额外信息 | | extraInfo | string | 是 | 额外信息 |
...@@ -1574,7 +1574,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1574,7 +1574,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| ------------------- | --------------------------- | ---- | ------- | | -------- | ------------------------------- | ---- | ---- |
| fileType | [ComponentType](#componenttype) | 是 | 文件类型 | | fileType | [ComponentType](#componenttype) | 是 | 文件类型 |
| filePath | string | 是 | 文件路径 | | filePath | string | 是 | 文件路径 |
...@@ -1587,7 +1587,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1587,7 +1587,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 参数类型 | 必填 | 说明 |
| --------------- | ---------------------------------------- | ---- | ---- | | --------- | ----------------------- | ---- | ---- |
| eventInfo | [EventInfo](#eventinfo) | 是 | 事件信息 | | eventInfo | [EventInfo](#eventinfo) | 是 | 事件信息 |
## BusinessVendor ## BusinessVendor
...@@ -1597,7 +1597,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1597,7 +1597,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | ------ | -------- | ---- |
| PUBLIC | "public" | 开源 | | PUBLIC | "public" | 开源 |
## BusinessSubType ## BusinessSubType
...@@ -1607,7 +1607,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1607,7 +1607,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | -------- | ---- | ---- |
| FIRMWARE | 1 | 固件 | | FIRMWARE | 1 | 固件 |
## ComponentType ## ComponentType
...@@ -1617,7 +1617,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1617,7 +1617,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | ---- | ---- | ---- |
| OTA | 1 | 固件 | | OTA | 1 | 固件 |
## UpgradeAction ## UpgradeAction
...@@ -1627,7 +1627,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1627,7 +1627,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | -------- | ---------- | ---- |
| UPGRADE | "upgrade" | 差分包 | | UPGRADE | "upgrade" | 差分包 |
| RECOVERY | "recovery" | 修复包 | | RECOVERY | "recovery" | 修复包 |
...@@ -1638,7 +1638,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1638,7 +1638,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | ------------- | ---- | ---- |
| COLD | 1 | 冷升级 | | COLD | 1 | 冷升级 |
| LIVE | 2 | 热升级 | | LIVE | 2 | 热升级 |
| LIVE_AND_COLD | 3 | 融合升级 | | LIVE_AND_COLD | 3 | 融合升级 |
...@@ -1650,7 +1650,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1650,7 +1650,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | ------- | ---- | ---- |
| CONTENT | 0 | 内容 | | CONTENT | 0 | 内容 |
| URI | 1 | 链接 | | URI | 1 | 链接 |
...@@ -1661,7 +1661,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1661,7 +1661,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | ---------- | ---- | ---- |
| STANDARD | 0 | 标准格式 | | STANDARD | 0 | 标准格式 |
| SIMPLIFIED | 1 | 简易格式 | | SIMPLIFIED | 1 | 简易格式 |
...@@ -1672,7 +1672,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1672,7 +1672,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | ----------------- | ---- | --------- |
| CELLULAR | 1 | 数据网络 | | CELLULAR | 1 | 数据网络 |
| METERED_WIFI | 2 | 热点WIFI | | METERED_WIFI | 2 | 热点WIFI |
| NOT_METERED_WIFI | 4 | 非热点WIFI | | NOT_METERED_WIFI | 4 | 非热点WIFI |
...@@ -1686,7 +1686,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1686,7 +1686,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | -------------------- | ---- | ----- |
| DOWNLOAD | 1 | 下载 | | DOWNLOAD | 1 | 下载 |
| INSTALL | 2 | 安装 | | INSTALL | 2 | 安装 |
| DOWNLOAD_AND_INSTALL | 3 | 下载并安装 | | DOWNLOAD_AND_INSTALL | 3 | 下载并安装 |
...@@ -1700,7 +1700,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1700,7 +1700,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | ---------------- | ---- | ---- |
| WAITING_DOWNLOAD | 20 | 待下载 | | WAITING_DOWNLOAD | 20 | 待下载 |
| DOWNLOADING | 21 | 下载中 | | DOWNLOADING | 21 | 下载中 |
| DOWNLOAD_PAUSED | 22 | 下载暂停 | | DOWNLOAD_PAUSED | 22 | 下载暂停 |
...@@ -1719,7 +1719,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1719,7 +1719,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | ---- | ---------- | ---- |
| TASK | 0x01000000 | 任务事件 | | TASK | 0x01000000 | 任务事件 |
## EventId ## EventId
...@@ -1729,7 +1729,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate); ...@@ -1729,7 +1729,7 @@ localUpdater.off(eventClassifyInfo, onTaskUpdate);
**系统能力**:SystemCapability.Update.UpdateService **系统能力**:SystemCapability.Update.UpdateService
| 参数名 | 默认值 | 说明 | | 参数名 | 默认值 | 说明 |
| ------------------- | ---- | -------- | | ---------------------- | ---------- | ------ |
| EVENT_TASK_BASE | 0x01000000 | 任务事件 | | EVENT_TASK_BASE | 0x01000000 | 任务事件 |
| EVENT_TASK_RECEIVE | 0x01000001 | 收到任务 | | EVENT_TASK_RECEIVE | 0x01000001 | 收到任务 |
| EVENT_TASK_CANCEL | 0x01000010 | 取消任务 | | EVENT_TASK_CANCEL | 0x01000010 | 取消任务 |
......
...@@ -35,7 +35,7 @@ Image(src: string | PixelMap | Resource) ...@@ -35,7 +35,7 @@ Image(src: string | PixelMap | Resource)
**参数:** **参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| ------ | ------------------------------------------------------------ | ---- | ------ | ------------------------------------------------------------ | | ---- | ---------------------------------------- | ---- | ---- | ---------------------------------------- |
| src | string\|&nbsp;[PixelMap](../apis/js-apis-image.md#pixelmap7)\|&nbsp;[Resource](../../ui/ts-types.md#resource类型) | 是 | - | 图片的数据源,支持本地图片和网络图片。<br/>当使用相对路径引用图片资源时,例如`Image("common/test.jpg")`,不支持该Image组件被跨包/跨模块调用,建议使用`$r`方式来管理需全局使用的图片资源。<br/>\- 支持的图片格式包括png、jpg、bmp、svg和gif。<br/>\- 支持`Base64`字符串。格式`data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data]`, 其中`[base64 data]``Base64`字符串数据。<br/>\- 支持`dataability://`路径前缀的字符串,用于访问通过data&nbsp;ability提供的图片路径。 | | src | string\|&nbsp;[PixelMap](../apis/js-apis-image.md#pixelmap7)\|&nbsp;[Resource](../../ui/ts-types.md#resource类型) | 是 | - | 图片的数据源,支持本地图片和网络图片。<br/>当使用相对路径引用图片资源时,例如`Image("common/test.jpg")`,不支持该Image组件被跨包/跨模块调用,建议使用`$r`方式来管理需全局使用的图片资源。<br/>\- 支持的图片格式包括png、jpg、bmp、svg和gif。<br/>\- 支持`Base64`字符串。格式`data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data]`, 其中`[base64 data]``Base64`字符串数据。<br/>\- 支持`dataability://`路径前缀的字符串,用于访问通过data&nbsp;ability提供的图片路径。 |
## 属性 ## 属性
...@@ -45,7 +45,7 @@ Image(src: string | PixelMap | Resource) ...@@ -45,7 +45,7 @@ Image(src: string | PixelMap | Resource)
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| --------------------- | ---------------------------------------- | ------------------------ | ---------------------------------------- | | --------------------- | ---------------------------------------- | ------------------------ | ---------------------------------------- |
| alt | string \| [Resource](../../ui/ts-types.md#resource类型) | - | 加载时显示的占位图,支持本地图片和网络图片。 | | alt | string \| [Resource](../../ui/ts-types.md#resource类型) | - | 加载时显示的占位图,支持本地图片和网络图片。 |
| objectFit | [ImageFit](#imagefit枚举说明) | ImageFit.Cover | 设置图片的缩放类型。 | | objectFit | ImageFit | ImageFit.Cover | 设置图片的缩放类型。 |
| objectRepeat | [ImageRepeat](ts-appendix-enums.md#imagerepeat) | NoRepeat | 设置图片的重复样式。<br/>> **说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。 | | objectRepeat | [ImageRepeat](ts-appendix-enums.md#imagerepeat) | NoRepeat | 设置图片的重复样式。<br/>> **说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。 |
| interpolation | [ImageInterpolation](#imageinterpolation) | ImageInterpolation.None | 设置图片的插值效果,仅针对图片放大插值。<br/>>&nbsp;**说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。<br/>>&nbsp;-&nbsp;PixelMap资源不支持该属性。 | | interpolation | [ImageInterpolation](#imageinterpolation) | ImageInterpolation.None | 设置图片的插值效果,仅针对图片放大插值。<br/>>&nbsp;**说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。<br/>>&nbsp;-&nbsp;PixelMap资源不支持该属性。 |
| renderMode | [ImageRenderMode](#imagerendermode) | ImageRenderMode.Original | 设置图片渲染的模式。<br/>>&nbsp;**说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。 | | renderMode | [ImageRenderMode](#imagerendermode) | ImageRenderMode.Original | 设置图片渲染的模式。<br/>>&nbsp;**说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。 |
......
...@@ -41,34 +41,20 @@ ohos.permission.INTEGRATED_INTERIOR_WINDOW ...@@ -41,34 +41,20 @@ ohos.permission.INTEGRATED_INTERIOR_WINDOW
## 接口 ## 接口
AbilityComponent(value: {want : Want, controller? : AbilityController}) AbilityComponent(value: {want : Want})
- 参数 - 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 | | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| want | [Want](../../reference/apis/js-apis-application-Want.md) | 是 | - | 默认加载的Ability描述。 | | want | [Want](../../reference/apis/js-apis-application-Want.md) | 是 | - | 默认加载的Ability描述。 |
| controller | [AbilityController](#abilityController) | 否 | - | Ability控制器。 |
## 事件 ## 事件
| 名称 | 功能描述 | | 名称 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| onReady()&nbsp;=&gt;&nbsp;void | AbilityComponent环境启动完成时的回调,之后可使用AbilityComponent的方法。 | | onConnect()&nbsp;=&gt;&nbsp;void | AbilityComponent环境启动完成时的回调,之后可使用AbilityComponent的方法。 |
| onDestroy()&nbsp;=&gt;&nbsp;void | AbilityComponent环境销毁时的回调。 | | onDisconnect()&nbsp;=&gt;&nbsp;void | AbilityComponent环境销毁时的回调。 |
| onAbilityCreated(name:&nbsp;string)&nbsp;=&gt;&nbsp;void | 加载Ability时触发,name为Ability名。 |
| onAbilityMoveToFont()&nbsp;=&gt;&nbsp;void | 当Ability移动到前台时触发。 |
| onAbilityWillRemove()&nbsp;=&gt;&nbsp;void | Ability移除之前触发。 |
## AbilityController
Ability控制器,提供AbilityComponent的控制接口。
| 名称 | 功能描述 |
| --------------------------------------- | ------------------------------------------------------------ |
| startAbility()&nbsp;=&gt;&nbsp;want | 在AbilityComponent内部加载Ability。<br>want:要加载的Ability描述信息。 |
| preformBackPress()&nbsp;=&gt;&nbsp;void | 在AbilityComponent内部执行返回操作。 |
| getStackCount()&nbsp;=&gt;&nbsp;void | 获取AbilityComponent内部任务栈中任务的个数。 |
## 示例 ## 示例
...@@ -78,7 +64,6 @@ Ability控制器,提供AbilityComponent的控制接口。 ...@@ -78,7 +64,6 @@ Ability控制器,提供AbilityComponent的控制接口。
@Entry @Entry
@Component @Component
struct MyComponent { struct MyComponent {
@State controller: AbilityController = new AbilityController()
build() { build() {
Column() { Column() {
...@@ -87,26 +72,12 @@ struct MyComponent { ...@@ -87,26 +72,12 @@ struct MyComponent {
bundleName: '', bundleName: '',
abilityName: '' abilityName: ''
}, },
controller: this.controller
})
.onReady(() => {
console.log('AbilityComponent ready');
}) })
.onDestory(() => { .onConnect(() => {
console.log('AbilityComponent destory'); console.log('AbilityComponent connect');
}) })
Button("Start New") .onDisconnect(() => {
.onClick(() => { console.log('AbilityComponent disconnect');
this.controller.startAbility({
bundleName: '',
abilityName: ''
});
})
Button("Back")
.onClick(() => {
if (this.controller.getStacjCount() > 1) {
this.controller.preformBackPress();
}
}) })
} }
} }
......
...@@ -33,7 +33,7 @@ Column(value:{space?: Length}) ...@@ -33,7 +33,7 @@ Column(value:{space?: Length})
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| alignItems | HorizontalAlign | HorizontalAlign.Center | 设置子组件在水平方向上的对齐格式。 | | alignItems | HorizontalAlign | HorizontalAlign.Center | 设置子组件在水平方向上的对齐格式。 |
| justifyContent8+ | [FlexAlign](ts-container-flex.md) | FlexAlign.Start | 设置子组件在垂直方向上的对齐格式。 | | justifyContent<sup>8+</sup> | [FlexAlign](ts-container-flex.md) | FlexAlign.Start | 设置子组件在垂直方向上的对齐格式。 |
- HorizontalAlign枚举说明 - HorizontalAlign枚举说明
| 名称 | 描述 | | 名称 | 描述 |
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
应用弹性方式布局子组件的容器组件。 应用弹性方式布局子组件的容器组件。
> **说明:** > **说明:**
> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 > - 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
> - Flex组件在设置flexShrink、flexGrow时存在二次布局过程,因此在对性能有严格要求的场景下建议使用[Column](ts-container-column.md)、[Row](ts-container-row.md)代替。
## 权限列表 ## 权限列表
...@@ -48,13 +49,13 @@ Flex(options?: { direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: F ...@@ -48,13 +49,13 @@ Flex(options?: { direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: F
- FlexAlign枚举说明 - FlexAlign枚举说明
| 名称 | 描述 | | 名称 | 描述 |
| ------------ | ---------------------------------------- | | ------------ | ------------------------------------------------------------ |
| Start | 元素在主轴方向首端对齐,&nbsp;第一个元素与行首对齐,同时后续的元素与前一个对齐。 | | Start | 元素在主轴方向首端对齐第一个元素与行首对齐,同时后续的元素与前一个对齐。 |
| Center | 元素在主轴方向中心对齐,第一个元素与行首的距离与最后一个元素与行尾距离相同。 | | Center | 元素在主轴方向中心对齐,第一个元素与行首的距离与最后一个元素与行尾距离相同。 |
| End | 元素在主轴方向尾部对齐,&nbsp;&nbsp;最后一个元素与行尾对齐,其他元素与后一个对齐。 | | End | 元素在主轴方向尾部对齐最后一个元素与行尾对齐,其他元素与后一个对齐。 |
| SpaceBetween | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。&nbsp;第一个元素与行首对齐,最后一个元素与行尾对齐。 | | SpaceBetween | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。第一个元素与行首对齐,最后一个元素与行尾对齐。 |
| SpaceAround | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。&nbsp;第一个元素到行首的距离和最后一个元素到行尾的距离是相邻元素之间距离的一半。 | | SpaceAround | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。第一个元素到行首的距离和最后一个元素到行尾的距离是相邻元素之间距离的一半。 |
| SpaceEvenly | Flex主轴方向元素等间距布局,&nbsp;相邻元素之间的间距、第一个元素与行首的间距、最后一个元素到行尾的间距都完全一样。 | | SpaceEvenly | Flex主轴方向元素等间距布局,相邻元素之间的间距、第一个元素与行首的间距、最后一个元素到行尾的间距都完全一样。 |
## 示例 ## 示例
......
# Scroll # Scroll
> **说明:** > **说明:**
> 该组件从API version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 > - 该组件从API version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
> - 该组件嵌套List子组件滚动时,若List不设置宽高,则默认全部加载,在对性能有要求的场景下建议指定List的宽高。
可滚动的容器组件,当子组件的布局尺寸超过父组件的视口时,内容可以滚动。 可滚动的容器组件,当子组件的布局尺寸超过父组件的视口时,内容可以滚动。
......
...@@ -41,11 +41,11 @@ Tabs(value: {barPosition?: BarPosition, index?: number, controller?: [TabsContro ...@@ -41,11 +41,11 @@ Tabs(value: {barPosition?: BarPosition, index?: number, controller?: [TabsContro
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| vertical | boolean | 是否为纵向Tab,默认为false。 | 是否为纵向Tab,默认为false。 | | vertical | boolean | false | 是否为纵向Tab,默认为false。 |
| scrollable | boolean | 是否可以通过左右滑动进行页面切换,默认为true。 | 是否可以通过左右滑动进行页面切换,默认为true。 | | scrollable | boolean | true | 是否可以通过左右滑动进行页面切换,默认为true。 |
| barMode | BarMode | TabBar布局模式。 | TabBar布局模式。 | | barMode | BarMode | BarMode.Fixed | TabBar布局模式。 |
| barWidth | number | TabBar的宽度值,不设置时使用系统主题中的默认值。 | TabBar的宽度值,不设置时使用系统主题中的默认值。 | | barWidth | number | - | TabBar的宽度值,不设置时使用系统主题中的默认值。 |
| barHeight | number | TabBar的高度值,不设置时使用系统主题中的默认值。 | TabBar的高度值,不设置时使用系统主题中的默认值。 | | barHeight | number | - | TabBar的高度值,不设置时使用系统主题中的默认值。 |
| animationDuration | number | 200 | TabContent滑动动画时长。 | | animationDuration | number | 200 | TabContent滑动动画时长。 |
- BarMode枚举说明 - BarMode枚举说明
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
| 名称 | 参数类型 | 默认值 | 描述 | | 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| visibility | Visibility | Visibility.Visible | 控制当前组件显示或隐藏。 | | visibility | Visibility | Visibility.Visible | 控制当前组件显示或隐藏。注意,即使组件处于隐藏状态,在页面刷新时仍存在重新创建过程,因此当对性能有严格要求时建议使用[条件渲染](../../ui/ts-rending-control-syntax-if-else.md)代替。|
- Visibility枚举说明 - Visibility枚举说明
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
组件可见区域变化事件指组件在屏幕中显示的面积变化,提供了判断组件是否完全或部分显示在屏幕中的能力,通常适用于像广告曝光埋点之类的场景。 组件可见区域变化事件指组件在屏幕中显示的面积变化,提供了判断组件是否完全或部分显示在屏幕中的能力,通常适用于像广告曝光埋点之类的场景。
> **说明:**从API Version 9开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 > **说明:** 从API Version 9开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 权限列表 ## 权限列表
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
| -------------- | -------------------------- | ------------------- | | -------------- | -------------------------- | ------------------- |
| width | number | 目标元素的宽度,单位为vp。 | | width | number | 目标元素的宽度,单位为vp。 |
| height | number | 目标元素的高度,单位为vp。 | | height | number | 目标元素的高度,单位为vp。 |
| position | [Position](#position8对象说明) | 目标元素左上角相对父元素左上角的位置。 | | position | Position | 目标元素左上角相对父元素左上角的位置。 |
| globalPosition | [Position](#position8对象说明) | 目标元素左上角相对页面左上角的位置。 | | globalPosition | Position | 目标元素左上角相对页面左上角的位置。 |
## Position<sup>8+</sup>对象说明 ## Position<sup>8+</sup>对象说明
| 属性名称 | 参数类型 | 描述 | | 属性名称 | 参数类型 | 描述 |
......
...@@ -26,6 +26,6 @@ FA应用的eTS模块(entry/src/main)的典型开发目录结构如下: ...@@ -26,6 +26,6 @@ FA应用的eTS模块(entry/src/main)的典型开发目录结构如下:
> **说明:** > **说明:**
> >
> - 资源目录resources文件夹位于src/main下,此目录下资源文件的详细规范以及子目录结构规范参看[资源文件的分类](basic-resource-file-categories.md)。 > - 资源目录resources文件夹位于src/main下,此目录下资源文件的详细规范以及子目录结构规范参看[资源文件的分类](ui-ts-basic-resource-file-categories.md)。
> >
> - 页面支持导入TypeScript和JavaScript文件。 > - 页面支持导入TypeScript和JavaScript文件。
# 循环渲染 # 循环渲染
开发框架提供循环渲染(ForEach组件)来迭代数组,并为每个数组项创建相应的组件。ForEach定义如下: 开发框架提供循环渲染(ForEach组件)来迭代数组,并为每个数组项创建相应的组件。当循环渲染的元素较多时,会出现页面加载变慢的情况,出于性能考虑,建议使用[LazyForEach](ts-rending-control-syntax-lazyforeach.md)代替。ForEach定义如下:
```ts ```ts
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
资源引用类型,用于设置组件属性的值。 资源引用类型,用于设置组件属性的值。
可以通过`$r`或者`$rawfile`创建Resource类型对象,详见[资源访问](ts-application-resource-access.md) 可以通过`$r`或者`$rawfile`创建Resource类型对象,详见[资源访问](ts-resource-access.md)
- `$r('belonging.type.name')` - `$r('belonging.type.name')`
......
...@@ -638,7 +638,7 @@ export default { ...@@ -638,7 +638,7 @@ export default {
img.src = 'common/images/2.png'; img.src = 'common/images/2.png';
// 设置图片宽度 // 设置图片宽度
img.width= 150; img.width= 150;
// 设置图高度 // 设置图高度
img.height=150; img.height=150;
// 图片平铺容器 // 图片平铺容器
var pat = ctx.createPattern(img, 'repeat');ctx.fillStyle = pat; var pat = ctx.createPattern(img, 'repeat');ctx.fillStyle = pat;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册