提交 58b41f4f 编写于 作者: G ge-yafang

update docs

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