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

!3998 Sample引用修改:无需翻译; API样板化:需同步翻译

Merge pull request !3998 from 葛亚芳/master
......@@ -35,6 +35,10 @@ Ability框架在API 8及更早版本使用FA模型。FA模型中Ability分为Pag
![fa-threading-nodel](figures/fa-threading-model.png)
## 相关实例
针对Ability开发,有以下相关实例可供参考:
- [`DistributeCalc`:分布式计算器(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/Preset/DistributeCalc)
- [`DistributeGraffti`:分布式涂鸦(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/DistributedGraffiti)
- [分布式调度启动远程FA](https://gitee.com/openharmony/codelabs/tree/master/Distributed/RemoteStartFA)
- [分布式新闻客户端](https://gitee.com/openharmony/codelabs/tree/master/Distributed/NewsDemo)
- [分布式手写板(eTS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/DistributeDatabaseDrawEts)
......
......@@ -235,4 +235,4 @@ export default {
## 相关实例
针对PageAbility开发,有以下相关实例可供参考:
- [`DMS`:分布式Demo(eTS)(API7)](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
\ No newline at end of file
- [`DMS`:分布式Demo(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
\ No newline at end of file
......@@ -399,4 +399,4 @@ export default {
针对ServiceAbility开发,有以下相关实例可供参考:
- [`ServiceAbility`:ServiceAbility的创建与使用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceAbility)
- [`DMS`:分布式Demo(eTS)(API7](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
- [`DMS`:分布式Demo(eTS)(API8](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
......@@ -89,29 +89,29 @@ Ability类拥有context属性,context属性为AbilityContext类,AbilityConte
onCreate(want, launchParam) {
console.log("MainAbility onCreate")
}
onDestroy() {
console.log("MainAbility onDestroy")
}
onWindowStageCreate(windowStage) {
console.log("MainAbility onWindowStageCreate")
windowStage.loadContent("pages/index").then((data) => {
console.log("MainAbility load content succeed with data: " + JSON.stringify(data))
}).catch((error) => {
console.error("MainAbility load content failed with error: " + JSON.stringify(error))
})
}
onWindowStageDestroy() {
console.log("MainAbility onWindowStageDestroy")
}
onForeground() {
console.log("MainAbility onForeground")
}
onBackground() {
console.log("MainAbility onBackground")
}
......@@ -323,4 +323,4 @@ struct Index {
## 相关实例
针对Stage模型Ability开发,有以下相关示例可供参考:
- [`StageCallAbility`:StageAbility的创建与使用(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility)
- [`StageCallAbility`:StageCallAbility的创建与使用(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility)
......@@ -248,4 +248,4 @@ try {
## 相关实例
针对Stage模型本地Call功能开发,有以下相关实例可供参考:
- [`StageCallAbility`:StageAbility的创建与使用(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility)
- [`StageCallAbility`:StageCallAbility的创建与使用(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility)
......@@ -79,4 +79,4 @@ ExtensionAbility,是Stage模型中新增的扩展组件的基类,一般用
## 相关实例
针对ServiceExtensionAbility开发,有以下相关实例可供参考:
- [`ServiceExtAbility`:StageAbility的创建与使用(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceExtAbility)
- [`ServiceExtAbility`:StageExtAbility的创建与使用(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceExtAbility)
......@@ -309,4 +309,5 @@
## 相关实例
针对关系型数据库开发,有以下相关实例可供参考:
- [`Rdb`:关系型数据库(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/data/Rdb)
- [`DistributedRdb`:分布式关系型数据库(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/data/DistributedRdb)
- [关系型数据库](https://gitee.com/openharmony/codelabs/tree/master/Data/JSRelationshipData)
......@@ -215,4 +215,4 @@
恭喜您已经使用JS语言开发(传统代码方式)完成了第一个OpenHarmony应用,快来[探索更多的OpenHarmony功能](../application-dev-guide.md)吧。
## 相关实例
针对使用JS语言(传统代码方式)开发快速入门,有以下相关实例可供参考:
- [`JsHelloWorld`:你好世界(JS)(API7](https://gitee.com/openharmony/app_samples/tree/master/common/JsHelloWorld)
- [`JsHelloWorld`:你好世界(JS)(API8](https://gitee.com/openharmony/app_samples/tree/master/common/JsHelloWorld)
# DataAbility 谓词
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......@@ -19,9 +19,10 @@ createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates):
从DataAabilityPredicates对象创建RdbPredicates对象。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| name | string | 是 | 数据库表中的表名。 |
......@@ -53,7 +54,7 @@ equalTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且值等于指定值的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -81,7 +82,7 @@ notEqualTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且值不等于指定值的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -109,7 +110,7 @@ beginWrap(): DataAbilityPredicates
向谓词添加左括号。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:**
| 类型 | 说明 |
......@@ -136,7 +137,7 @@ endWrap(): DataAbilityPredicates
向谓词添加右括号。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:**
| 类型 | 说明 |
......@@ -163,7 +164,7 @@ or(): DataAbilityPredicates
将或条件添加到谓词中。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:**
| 类型 | 说明 |
......@@ -187,7 +188,7 @@ and(): DataAbilityPredicates
将和条件添加到谓词中。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:**
| 类型 | 说明 |
......@@ -211,7 +212,7 @@ contains(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且value包含指定值的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -239,7 +240,7 @@ beginsWith(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且值以指定字符串开头的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -267,7 +268,7 @@ endsWith(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且值以指定字符串结尾的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -295,7 +296,7 @@ isNull(field: string): DataAbilityPredicates
配置谓词以匹配值为null的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -322,7 +323,7 @@ isNotNull(field: string): DataAbilityPredicates
配置谓词以匹配值不为null的指定字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -349,7 +350,7 @@ like(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且值类似于指定字符串的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -377,7 +378,7 @@ glob(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string的指定字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -405,7 +406,7 @@ between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且value在指定范围内的指定字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -434,7 +435,7 @@ notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicate
配置谓词以匹配数据类型为ValueType且value超出给定范围的指定字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -463,7 +464,7 @@ greaterThan(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且值大于指定值的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -491,7 +492,7 @@ lessThan(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为valueType且value小于指定值的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -519,7 +520,7 @@ greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且value大于或等于指定值的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -547,7 +548,7 @@ lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且value小于或等于指定值的字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -575,7 +576,7 @@ orderByAsc(field: string): DataAbilityPredicates
配置谓词以匹配其值按升序排序的列。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -602,7 +603,7 @@ orderByDesc(field: string): DataAbilityPredicates
配置谓词以匹配其值按降序排序的列。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -629,7 +630,7 @@ distinct(): DataAbilityPredicates
配置谓词以过滤重复记录并仅保留其中一个。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:**
| 类型 | 说明 |
......@@ -657,7 +658,7 @@ limitAs(value: number): DataAbilityPredicates
设置最大数据记录数的谓词。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -684,7 +685,7 @@ offsetAs(rowOffset: number): DataAbilityPredicates
配置谓词以指定返回结果的起始位置。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -711,7 +712,7 @@ groupBy(fields: Array<string>): DataAbilityPredicates
配置谓词按指定列分组查询结果。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -763,7 +764,7 @@ in(field: string, value: Array<ValueType>): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType数组且值在给定范围内的指定字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -792,7 +793,7 @@ notIn(field: string, value: Array<ValueType>): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType数组且值不在给定范围内的指定字段。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -816,7 +817,7 @@ notIn(field: string, value: Array<ValueType>): DataAbilityPredicates
用于表示允许的数据字段类型。
**系统能力**SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。
| 名称 | 说明 |
| ------- | -------------------- |
......
# 分布式数据对象
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......@@ -10,8 +10,6 @@
import distributedObject from '@ohos.data.distributedDataObject';
```
## distributedDataObject.createDistributedObject
createDistributedObject(source: object): DistributedObject
......@@ -19,7 +17,7 @@ createDistributedObject(source: object): DistributedObject
创建一个分布式对象。
**系统能力**SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**系统能力:** SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -46,7 +44,7 @@ genSessionId(): string
随机创建一个sessionId。
**系统能力**SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**系统能力:** SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**返回值:**
| 类型 | 说明 |
......@@ -70,7 +68,7 @@ setSessionId(sessionId?: string): boolean
设置同步的sessionId,当可信组网中有多个设备时,多个设备间的对象如果设置为同一个sessionId,就能自动同步。
**系统能力**SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**系统能力:** SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**参数:**
......@@ -103,7 +101,7 @@ on(type: 'change', callback: Callback<{ sessionId: string, fields: Array&lt;stri
监听分布式对象的变更。
**系统能力**SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**系统能力:** SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -132,7 +130,7 @@ off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array&lt;st
当不再进行数据变更监听时,使用此接口删除对象的变更监听。
**系统能力**SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**系统能力:** SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -163,7 +161,7 @@ on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, st
监听分布式对象的上下线。
**系统能力**SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**系统能力:** SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -188,7 +186,7 @@ off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, s
当不再进行对象上下线监听时,使用此接口删除对象的上下线监听。
**系统能力**SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**系统能力:** SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......
# 结果集
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......@@ -25,7 +25,7 @@ promise.then((resultSet) => {
### 属性
**系统能力**以下各项对应的系统能力均为SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.DistributedDataManager.RelationalStore.Core。
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -46,7 +46,7 @@ getColumnIndex(columnName: string): number
根据指定的列名获取列索引。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -74,7 +74,7 @@ getColumnName(columnIndex: number): string
根据指定的列索引获取列名。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -100,7 +100,7 @@ goTo(offset:number): boolean
向前或向后转至结果集的指定行,相对于其当前位置偏移。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -131,7 +131,7 @@ goToRow(position: number): boolean
转到结果集的指定行。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -163,7 +163,7 @@ goToFirstRow(): boolean
转到结果集的第一行。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**返回值:**
| 类型 | 说明 |
......@@ -189,7 +189,7 @@ goToLastRow(): boolean
转到结果集的最后一行。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**返回值:**
| 类型 | 说明 |
......@@ -215,7 +215,7 @@ goToNextRow(): boolean
转到结果集的下一行。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**返回值:**
| 类型 | 说明 |
......@@ -241,7 +241,7 @@ goToPreviousRow(): boolean
转到结果集的上一行。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**返回值:**
| 类型 | 说明 |
......@@ -267,7 +267,7 @@ getBlob(columnIndex: number): Uint8Array
以字节数组的形式获取当前行中指定列的值。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -291,7 +291,7 @@ getString(columnIndex: number): string
以字符串形式获取当前行中指定列的值。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -315,7 +315,7 @@ getLong(columnIndex: number): number
以Long形式获取当前行中指定列的值。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -339,7 +339,7 @@ getDouble(columnIndex: number): number
以double形式获取当前行中指定列的值。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -363,7 +363,7 @@ isColumnNull(columnIndex: number): boolean
检查当前行中指定列的值是否为null。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -387,7 +387,7 @@ close(): void
关闭结果集。
**系统能力**SystemCapability.DistributedDataManager.RelationalStore.Core。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core。
**示例:**
```js
......
......@@ -3,7 +3,7 @@
轻量级存储为应用提供key-value键值型的文件数据处理能力,支持应用对数据进行轻量级存储及查询。数据存储形式为键值对,键的类型为字符串型,值的存储数据类型包括数字型、字符型、布尔型。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
>
> - 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
......@@ -18,7 +18,7 @@ import dataStorage from '@ohos.data.storage';
## 常量
**系统能力**以下各项对应的系统能力均为SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** 以下各项对应的系统能力均为SystemCapability.DistributedDataManager.Preferences.Core
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
......@@ -30,9 +30,9 @@ import dataStorage from '@ohos.data.storage';
getStorageSync(path: string): Storage
读取指定文件,将数据加载到Storage实例,用于数据操作,此方法为同步方法
读取指定文件,将数据加载到Storage实例,用于数据操作。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -67,9 +67,9 @@ getStorageSync(path: string): Storage
getStorage(path: string, callback: AsyncCallback&lt;Storage&gt;): void
读取指定文件,将数据加载到Storage实例,用于数据操作,使用callback形式返回结果
读取指定文件,将数据加载到Storage实例,用于数据操作,使用callback方式返回结果,此方法为异步方法
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -105,9 +105,9 @@ getStorage(path: string, callback: AsyncCallback&lt;Storage&gt;): void
getStorage(path: string): Promise&lt;Storage&gt;
读取指定文件,将数据加载到Storage实例,用于数据操作,使用Promise方式为异步方法。
读取指定文件,将数据加载到Storage实例,用于数据操作,使用Promise方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -146,9 +146,9 @@ getStorage(path: string): Promise&lt;Storage&gt;
deleteStorageSync(path: string): void
从内存中移除指定文件对应的Storage单实例,并删除指定文件及其备份文件、损坏文件。删除指定文件时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题,此方法为同步方法
从内存中移除指定文件对应的Storage单实例,并删除指定文件及其备份文件、损坏文件。删除指定文件时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -165,9 +165,9 @@ deleteStorageSync(path: string): void
deleteStorage(path: string, callback: AsyncCallback&lt;void&gt;): void
从内存中移除指定文件对应的Storage单实例,并删除指定文件及其备份文件、损坏文件。删除指定文件时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题,使用callback方式为异步方法。
从内存中移除指定文件对应的Storage单实例,并删除指定文件及其备份文件、损坏文件。删除指定文件时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题,使用callback方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -191,9 +191,9 @@ deleteStorage(path: string, callback: AsyncCallback&lt;void&gt;): void
deleteStorage(path: string): Promise&lt;void&gt;
从内存中移除指定文件对应的Storage单实例,并删除指定文件及其备份文件、损坏文件。删除指定文件时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题,使用promise方式为异步方法。
从内存中移除指定文件对应的Storage单实例,并删除指定文件及其备份文件、损坏文件。删除指定文件时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题,使用promise方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -222,9 +222,7 @@ removeStorageFromCacheSync(path: string): void
从内存中移除指定文件对应的Storage单实例。移除Storage单实例时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题。
此方法为同步方法。
**系统能力**:SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -241,11 +239,9 @@ removeStorageFromCacheSync(path: string): void
removeStorageFromCache(path: string, callback: AsyncCallback&lt;void&gt;): void
从内存中移除指定文件对应的Storage单实例。移除Storage单实例时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题。
此方法为异步方法。
从内存中移除指定文件对应的Storage单实例。移除Storage单实例时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题。使用callback方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -269,11 +265,9 @@ removeStorageFromCache(path: string, callback: AsyncCallback&lt;void&gt;): void
removeStorageFromCache(path: string): Promise&lt;void&gt;
从内存中移除指定文件对应的Storage单实例。移除Storage单实例时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题。
此方法为异步方法。
从内存中移除指定文件对应的Storage单实例。移除Storage单实例时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题。使用Promise方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -307,9 +301,7 @@ getSync(key: string, defValue: ValueType): ValueType
获取键对应的值,如果值为null或者非默认值类型,返回默认数据。
此方法为同步方法。
**系统能力**:SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -333,11 +325,9 @@ getSync(key: string, defValue: ValueType): ValueType
get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;): void
获取键对应的值,如果值为null或者非默认值类型,返回默认数据。
此方法为异步方法。
获取键对应的值,如果值为null或者非默认值类型,返回默认数据。使用callback方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -362,11 +352,9 @@ get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;):
get(key: string, defValue: ValueType): Promise&lt;ValueType&gt;
获取键对应的值,如果值为null或者非默认值类型,返默认数据。
获取键对应的值,如果值为null或者非默认值类型,返默认数据。使用Promise方式返回结果,此方法为异步方法。
此方法为异步方法。
**系统能力**:SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
......@@ -397,9 +385,7 @@ putSync(key: string, value: ValueType): void
首先获取指定文件对应的Storage实例,然后借助Storage API将数据写入Storage实例,通过flush或者flushSync将Storage实例持久化。
此方法为同步方法。
**系统能力**:SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -417,11 +403,9 @@ putSync(key: string, value: ValueType): void
put(key: string, value: ValueType, callback: AsyncCallback&lt;void&gt;): void
首先获取指定文件对应的Storage实例,然后借助Storage API将数据写入Storage实例,通过flush或者flushSync将Storage实例持久化。
此方法为异步方法。
首先获取指定文件对应的Storage实例,然后借助Storage API将数据写入Storage实例,通过flush或者flushSync将Storage实例持久化。使用callback方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -446,11 +430,9 @@ put(key: string, value: ValueType, callback: AsyncCallback&lt;void&gt;): void
put(key: string, value: ValueType): Promise&lt;void&gt;
首先获取指定文件对应的Storage实例,然后借助Storage API将数据写入Storage实例,通过flush或者flushSync将Storage实例持久化。
此方法为异步方法。
首先获取指定文件对应的Storage实例,然后借助Storage API将数据写入Storage实例,通过flush或者flushSync将Storage实例持久化。使用Promise方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -480,9 +462,7 @@ hasSync(key: string): boolean
检查存储对象是否包含名为给定key的存储。
此方法为同步方法。
**系统能力**:SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -507,11 +487,9 @@ hasSync(key: string): boolean
has(key: string, callback: AsyncCallback&lt;boolean&gt;): boolean
检查存储对象是否包含名为给定key的存储。
此方法为异步方法。
检查存储对象是否包含名为给定key的存储。使用callback方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -542,11 +520,9 @@ has(key: string, callback: AsyncCallback&lt;boolean&gt;): boolean
has(key: string): Promise&lt;boolean&gt;
检查存储对象是否包含名为给定key的存储。
此方法为异步方法。
检查存储对象是否包含名为给定key的存储。使用Promise方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -577,9 +553,7 @@ deleteSync(key: string): void
从存储对象中删除名为给定key的存储。
此方法为同步方法。
**系统能力**:SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -592,15 +566,13 @@ deleteSync(key: string): void
```
### deletej
### delete
delete(key: string, callback: AsyncCallback&lt;void&gt;): void
从存储对象中删除名为给定key的存储。
此方法为异步方法。
从存储对象中删除名为给定key的存储。使用callback方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -624,11 +596,9 @@ delete(key: string, callback: AsyncCallback&lt;void&gt;): void
delete(key: string): Promise&lt;void&gt;
从存储对象删除名为给定key的存储。
此方法为异步方法。
从存储对象删除名为给定key的存储。使用Promise方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -657,9 +627,7 @@ flushSync(): void
将当前storage对象中的修改保存到当前的storage,并同步存储到文件中。
此方法为同步方法。
**系统能力**:SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**示例:**
```js
......@@ -671,11 +639,9 @@ flushSync(): void
flush(callback: AsyncCallback&lt;void&gt;): void
将当前storage对象中的修改保存到当前的storage,并异步存储到文件中。
此方法为异步方法。
将当前storage对象中的修改保存到当前的storage,并异步存储到文件中。使用callback方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -698,11 +664,9 @@ flush(callback: AsyncCallback&lt;void&gt;): void
flush(): Promise&lt;void&gt;
将当前storage对象中的修改保存到当前的storage,并异步存储到文件中。
将当前storage对象中的修改保存到当前的storage,并异步存储到文件中。使用Promise方式返回结果,此方法为异步方法。
此方法为异步方法。
**系统能力**:SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**返回值:**
| 类型 | 说明 |
......@@ -726,9 +690,7 @@ clearSync(): void
清除此存储对象中的所有存储。
此方法为同步方法。
**系统能力**:SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**示例:**
```js
......@@ -740,11 +702,9 @@ clearSync(): void
clear(callback: AsyncCallback&lt;void&gt;): void
清除此存储对象中的所有存储。
此方法为异步方法。
清除此存储对象中的所有存储。使用callback方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -767,11 +727,9 @@ clear(callback: AsyncCallback&lt;void&gt;): void
clear(): Promise&lt;void&gt;
清除此存储对象中的所有存储。
此方法为异步方法。
清除此存储对象中的所有存储。使用Promise方式返回结果,此方法为异步方法。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**返回值:**
| 类型 | 说明 |
......@@ -795,7 +753,7 @@ on(type: 'change', callback: Callback&lt;StorageObserver&gt;): void
订阅数据变更者类需要实现StorageObserver接口,订阅的key的值发生变更后,在执行flush/flushSync方法后,callback方法会被回调。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 说明 |
......@@ -820,7 +778,7 @@ off(type: 'change', callback: Callback&lt;StorageObserver&gt;): void
当不再进行订阅数据变更时,使用此接口取消订阅。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 说明 |
......@@ -839,7 +797,7 @@ off(type: 'change', callback: Callback&lt;StorageObserver&gt;): void
## StorageObserver
**系统能力**以下各项对应的系统能力均为SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** 以下各项对应的系统能力均为SystemCapability.DistributedDataManager.Preferences.Core
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -849,7 +807,7 @@ off(type: 'change', callback: Callback&lt;StorageObserver&gt;): void
用于表示允许的数据字段类型。
**系统能力**SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
| 名称 | 说明 |
| ------- | -------------------- |
......
# 屏幕属性
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
......@@ -14,7 +14,7 @@ import display from '@ohos.display';
用于表示显示设备的状态。
**系统能力**以下各项对应的系统能力均为 SystemCapability.WindowManager.WindowManager.Core。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.WindowManager.WindowManager.Core。
| 名称 | 默认值 | 说明 |
| -------- | -------- | -------- |
......@@ -31,7 +31,7 @@ import display from '@ohos.display';
描述display对象的属性。
**系统能力**以下各项对应的系统能力均为 SystemCapability.WindowManager.WindowManager.Core。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.WindowManager.WindowManager.Core。
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
......@@ -56,7 +56,7 @@ getDefaultDisplay(callback: AsyncCallback&lt;Display&gt;): void
获取当前默认的display对象。
**系统能力**SystemCapability.WindowManager.WindowManager.Core
**系统能力:** SystemCapability.WindowManager.WindowManager.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -82,7 +82,7 @@ getDefaultDisplay(): Promise&lt;Display&gt;
获取当前默认的display对象。
**系统能力**SystemCapability.WindowManager.WindowManager.Core
**系统能力:** SystemCapability.WindowManager.WindowManager.Core
**返回值:**
......@@ -107,7 +107,7 @@ getAllDisplay(callback: AsyncCallback&lt;Array&lt;Display&gt;&gt;): void
获取当前所有的display对象。
**系统能力**SystemCapability.WindowManager.WindowManager.Core
**系统能力:** SystemCapability.WindowManager.WindowManager.Core
**参数:**
......@@ -133,7 +133,7 @@ getAllDisplay(): Promise&lt;Array&lt;Display&gt;&gt;
获取当前所有的display对象。
**系统能力**SystemCapability.WindowManager.WindowManager.Core
**系统能力:** SystemCapability.WindowManager.WindowManager.Core
**返回值:**
......@@ -158,7 +158,7 @@ on(type: 'add'|'remove'|'change', callback: Callback&lt;number&gt;): void
开启监听。
**系统能力**SystemCapability.WindowManager.WindowManager.Core
**系统能力:** SystemCapability.WindowManager.WindowManager.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -182,7 +182,7 @@ off(type: 'add'|'remove'|'change', callback?: Callback&lt;number&gt;): void
关闭监听。
**系统能力**SystemCapability.WindowManager.WindowManager.Core
**系统能力:** SystemCapability.WindowManager.WindowManager.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......
# 屏幕截图
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
......@@ -13,7 +13,7 @@ import screenshot from '@ohos.screenshot';
设置截取图像的信息。
**系统能力**以下各项对应的系统能力均为 SystemCapability.WindowManager.WindowManager.Core。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.WindowManager.WindowManager.Core。
| 参数名 | 类型 | 必填 | 说明 |
......@@ -27,7 +27,7 @@ import screenshot from '@ohos.screenshot';
表示截取图像的区域。
**系统能力**以下各项对应的系统能力均为 SystemCapability.WindowManager.WindowManager.Core。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.WindowManager.WindowManager.Core。
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------------------------------------------------------------ |
......@@ -41,7 +41,7 @@ import screenshot from '@ohos.screenshot';
表示截取图像的大小。
**系统能力**以下各项对应的系统能力均为 SystemCapability.WindowManager.WindowManager.Core。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.WindowManager.WindowManager.Core。
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------------------------------------------------------------ |
......@@ -54,7 +54,7 @@ save(options?: ScreenshotOptions, callback: AsyncCallback&lt;image.PixelMap&gt;)
获取屏幕截图。
**系统能力**SystemCapability.WindowManager.WindowManager.Core
**系统能力:** SystemCapability.WindowManager.WindowManager.Core
**需要权限**:ohos.permission.CAPTURE_SCREEN
......@@ -94,15 +94,15 @@ save(options?: ScreenshotOptions): Promise&lt;image.PixelMap&gt;
获取屏幕截图。
**系统能力**SystemCapability.WindowManager.WindowManager.Core
**系统能力:** SystemCapability.WindowManager.WindowManager.Core
**需要权限**:ohos.permission.CAPTURE_SCREEN
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| options | [ScreenshotOptions](#screenshotoptions) | 否 | 该类型的参数包含screenRect,imageSize,rotation三个参数,需要分别设置这三个参数。 |
| 参数名 | 类型 | 必填 | 说明 |
| ------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| options | [ScreenshotOptions](#screenshotoptions) | 否 | 该类型的参数包含screenRect、imageSize、rotation三个参数,需要分别设置这三个参数。 |
**返回值:**
......
# 数据存储
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
>
> - 从API Version 6开始,该模块不再维护,可以使用模块[`@ohos.data.storage`](js-apis-data-storage.md)。在API Version 9后,推荐使用新模块[`@ohos.data.preferences`](js-apis-data-preferences.md)。
>
......@@ -21,7 +21,7 @@ get(Object): void
通过索引读取缓存中存储的值。
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
......@@ -61,7 +61,7 @@ set(Object): void
修改缓存中索引对应的值。
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
......@@ -99,7 +99,7 @@ clear(Object): void
清空缓存中存储的键值对。
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
......@@ -133,7 +133,7 @@ delete(Object): void
删除缓存中索引对应的键值对。
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
......
# USB管理
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
......@@ -15,9 +15,10 @@ getDevices(): Array&lt;Readonly&lt;USBDevice&gt;&gt;
获取USB设备列表。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Array&lt;Readonly&lt;[USBDevice](#usbdevice)&gt;&gt; | 设备信息列表。 |
......@@ -87,7 +88,7 @@ connectDevice(device: USBDevice): Readonly&lt;USBDevicePipe&gt;
需要调用[usb.getDevices](#usbgetdevices)获取设备信息以及device;再调用[usb.requestRight](#usbrequestright)获取设备请求权限。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -112,7 +113,7 @@ hasRight(deviceName: string): boolean
判断是否有权访问该设备。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -138,7 +139,7 @@ requestRight(deviceName: string): Promise&lt;boolean&gt;
请求软件包的临时权限以访问设备。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -167,7 +168,7 @@ claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): numbe
需要调用[usb.getDevices](#usbgetdevices)获取设备信息以及interfaces;调用[usb.requestRight](#usbrequestright)获取设备请求权限;调用[usb.connectDevice](#usbconnectdevice)接口得到devicepipe作为参数。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -196,7 +197,7 @@ releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number
需要调用[usb.claimInterface](#usbclaiminterface)先获取接口,才能使用此方法释放接口。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -224,7 +225,7 @@ setConfiguration(pipe: USBDevicePipe, config: USBConfig): number
需要调用[usb.getDevices](#usbgetdevices)获取设备信息以及config;调用[usb.requestRight](#usbrequestright)获取设备请求权限;调用[usb.connectDevice](#usbconnectdevice)得到devicepipe作为参数。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -252,7 +253,7 @@ setInterface(pipe: USBDevicePipe, iface: USBInterface): number
需要调用[usb.getDevices](#usbgetdevices)获取设备列表以及interfaces;调用[usb.requestRight](#usbrequestright)获取设备请求权限;调用[usb.connectDevice](#usbconnectdevice)得到devicepipe作为参数。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -280,7 +281,7 @@ getRawDescriptor(pipe: USBDevicePipe): Uint8Array
需要调用[usb.getDevices](#usbgetdevices)获取设备列表;调用[usb.requestRight](#usbrequestright)获取设备请求权限;调用[usb.connectDevice](#usbconnectdevice)接口得到devicepipe作为参数。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -306,17 +307,18 @@ getFileDescriptor(pipe: USBDevicePipe): number
需要调用[usb.getDevices](#usbgetdevices)获取设备列表;调用[usb.requestRight](#usbrequestright)获取设备请求权限;调用[usb.connectDevice](#usbconnectdevice)接口得到devicepipe作为参数。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| pipe | [USBDevicePipe](#usbdevicepipe) | 是 | 用于确定总线号和设备地址。 |
- 返回值:
| 类型 | 说明 |
| -------- | -------- |
| number | 返回设备对应的文件描述符。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回设备对应的文件描述符。 |
**示例:**
```js
......@@ -332,7 +334,7 @@ controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: nu
需要调用[usb.getDevices](#usbgetdevices)获取设备列表;调用[usb.requestRight](#usbrequestright)获取设备请求权限;调用[usb.connectDevice](#usbconnectdevice)接口得到devicepipe作为参数。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -362,7 +364,7 @@ bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, tim
需要调用[usb.getDevices](#usbgetdevices)获取设备信息列表以及endpoint;再调用[usb.requestRight](#usbrequestright)获取设备请求权限;然后调用[usb.connectDevice](#usbconnectdevice)接口得到返回数据devicepipe之后,再次获取接口[usb.claimInterface](#usbclaiminterface);再调用usb.bulkTransfer接口。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -396,7 +398,7 @@ closePipe(pipe: USBDevicePipe): number
需要调用[usb.getDevices](#usbgetdevices)获取设备列表;调用[usb.requestRight](#usbrequestright)获取设备请求权限;调用[usb.connectDevice](#usbconnectdevice)得到devicepipe作为参数。
**系统能力**: SystemCapability.USB.USBManager
**系统能力:** SystemCapability.USB.USBManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......
# webgl
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......@@ -34,7 +34,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0);
## Type
**系统能力**以下各项对应的系统能力均为 SystemCapability.Graphic.Graphic2D.WebGL。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.Graphic.Graphic2D.WebGL。
**表1** Type
......@@ -62,7 +62,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0);
## Interface
**系统能力**以下各项对应的系统能力均为 SystemCapability.Graphic.Graphic2D.WebGL。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.Graphic.Graphic2D.WebGL。
**表2** Interface
......
# webgl2
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......@@ -34,7 +34,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0);
## Type
**系统能力**以下各项对应的系统能力均为 SystemCapability.Graphic.Graphic2D.WebGL2。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.Graphic.Graphic2D.WebGL2。
**表1** Type
......@@ -48,7 +48,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0);
## Interface
**系统能力**以下各项对应的系统能力均为 SystemCapability.Graphic.Graphic2D.WebGL2。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.Graphic.Graphic2D.WebGL2。
**表2** Interface
......
......@@ -699,3 +699,9 @@ WebGL主要帮助开发者在前端开发中完成图形图像的相关处理,
**图2** 点击按钮绘制彩色三角形的效果图
![zh-cn_image_0000001192429306](figures/zh-cn_image_0000001192429306.gif)
## 相关实例
针对WebGL开发,有以下相关实例可供参考:
- [`JsWbgGL`:WebGL(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/Graphics/JsWebGL)
......@@ -37,5 +37,5 @@ screenshot.save(ScreenshotOptions).then((image) => {
```
## 相关实例
针对屏幕截图开发,有以下相关实例可供参考:
- [`Screenshot`:基础功能-屏幕截图(eTS)(API8](https://gitee.com/openharmony/app_samples/tree/master/Basic/Screenshot)
- [`Screenshot`:屏幕截图(eTS)(API9](https://gitee.com/openharmony/app_samples/tree/master/Basic/Screenshot)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册