Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
58b41f4f
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
58b41f4f
编写于
5月 13, 2022
作者:
G
ge-yafang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
ge-yafang
<
geyafang@huawei.com
>
上级
a91d2adf
变更
23
展开全部
显示空白变更内容
内联
并排
Showing
23 changed file
with
593 addition
and
623 deletion
+593
-623
zh-cn/application-dev/ability/fa-brief.md
zh-cn/application-dev/ability/fa-brief.md
+4
-0
zh-cn/application-dev/ability/fa-pageability.md
zh-cn/application-dev/ability/fa-pageability.md
+1
-1
zh-cn/application-dev/ability/fa-serviceability.md
zh-cn/application-dev/ability/fa-serviceability.md
+1
-1
zh-cn/application-dev/ability/stage-ability.md
zh-cn/application-dev/ability/stage-ability.md
+7
-7
zh-cn/application-dev/ability/stage-call.md
zh-cn/application-dev/ability/stage-call.md
+1
-1
zh-cn/application-dev/ability/stage-serviceextension.md
zh-cn/application-dev/ability/stage-serviceextension.md
+1
-1
zh-cn/application-dev/database/database-relational-guidelines.md
...pplication-dev/database/database-relational-guidelines.md
+1
-0
zh-cn/application-dev/quick-start/start-with-js.md
zh-cn/application-dev/quick-start/start-with-js.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-data-ability.md
zh-cn/application-dev/reference/apis/js-apis-data-ability.md
+30
-30
zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md
...tion-dev/reference/apis/js-apis-data-distributedobject.md
+8
-10
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
+68
-70
zh-cn/application-dev/reference/apis/js-apis-data-resultset.md
.../application-dev/reference/apis/js-apis-data-resultset.md
+16
-16
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
+53
-95
zh-cn/application-dev/reference/apis/js-apis-display.md
zh-cn/application-dev/reference/apis/js-apis-display.md
+9
-9
zh-cn/application-dev/reference/apis/js-apis-distributed-data.md
...pplication-dev/reference/apis/js-apis-distributed-data.md
+253
-253
zh-cn/application-dev/reference/apis/js-apis-screenshot.md
zh-cn/application-dev/reference/apis/js-apis-screenshot.md
+9
-9
zh-cn/application-dev/reference/apis/js-apis-system-storage.md
.../application-dev/reference/apis/js-apis-system-storage.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-usb.md
zh-cn/application-dev/reference/apis/js-apis-usb.md
+20
-18
zh-cn/application-dev/reference/apis/js-apis-webgl.md
zh-cn/application-dev/reference/apis/js-apis-webgl.md
+3
-3
zh-cn/application-dev/reference/apis/js-apis-webgl2.md
zh-cn/application-dev/reference/apis/js-apis-webgl2.md
+3
-3
zh-cn/application-dev/reference/apis/js-apis-window.md
zh-cn/application-dev/reference/apis/js-apis-window.md
+96
-93
zh-cn/application-dev/webgl/webgl-guidelines.md
zh-cn/application-dev/webgl/webgl-guidelines.md
+6
-0
zh-cn/application-dev/windowmanager/screenshot-guidelines.md
zh-cn/application-dev/windowmanager/screenshot-guidelines.md
+1
-1
未找到文件。
zh-cn/application-dev/ability/fa-brief.md
浏览文件 @
58b41f4f
...
...
@@ -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
)
...
...
zh-cn/application-dev/ability/fa-pageability.md
浏览文件 @
58b41f4f
...
...
@@ -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
zh-cn/application-dev/ability/fa-serviceability.md
浏览文件 @
58b41f4f
...
...
@@ -399,4 +399,4 @@ export default {
针对ServiceAbility开发,有以下相关实例可供参考:
-
[
`ServiceAbility`:ServiceAbility的创建与使用(eTS)(API8)
](
https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceAbility
)
-
[
`DMS`:分布式Demo(eTS)(API
7
)
](
https://gitee.com/openharmony/app_samples/tree/master/ability/DMS
)
-
[
`DMS`:分布式Demo(eTS)(API
8
)
](
https://gitee.com/openharmony/app_samples/tree/master/ability/DMS
)
zh-cn/application-dev/ability/stage-ability.md
浏览文件 @
58b41f4f
...
...
@@ -323,4 +323,4 @@ struct Index {
## 相关实例
针对Stage模型Ability开发,有以下相关示例可供参考:
-
[
`StageCallAbility`:StageAbility的创建与使用(eTS)(API9)
](
https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility
)
-
[
`StageCallAbility`:Stage
Call
Ability的创建与使用(eTS)(API9)
](
https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility
)
zh-cn/application-dev/ability/stage-call.md
浏览文件 @
58b41f4f
...
...
@@ -248,4 +248,4 @@ try {
## 相关实例
针对Stage模型本地Call功能开发,有以下相关实例可供参考:
-
[
`StageCallAbility`:StageAbility的创建与使用(eTS)(API9)
](
https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility
)
-
[
`StageCallAbility`:Stage
Call
Ability的创建与使用(eTS)(API9)
](
https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility
)
zh-cn/application-dev/ability/stage-serviceextension.md
浏览文件 @
58b41f4f
...
...
@@ -79,4 +79,4 @@ ExtensionAbility,是Stage模型中新增的扩展组件的基类,一般用
## 相关实例
针对ServiceExtensionAbility开发,有以下相关实例可供参考:
-
[
`ServiceExtAbility`:StageAbility的创建与使用(eTS)(API9)
](
https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceExtAbility
)
-
[
`ServiceExtAbility`:Stage
Ext
Ability的创建与使用(eTS)(API9)
](
https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceExtAbility
)
zh-cn/application-dev/database/database-relational-guidelines.md
浏览文件 @
58b41f4f
...
...
@@ -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
)
zh-cn/application-dev/quick-start/start-with-js.md
浏览文件 @
58b41f4f
...
...
@@ -215,4 +215,4 @@
恭喜您已经使用JS语言开发(传统代码方式)完成了第一个OpenHarmony应用,快来
[
探索更多的OpenHarmony功能
](
../application-dev-guide.md
)
吧。
## 相关实例
针对使用JS语言(传统代码方式)开发快速入门,有以下相关实例可供参考:
-
[
`JsHelloWorld`:你好世界(JS)(API
7
)
](
https://gitee.com/openharmony/app_samples/tree/master/common/JsHelloWorld
)
-
[
`JsHelloWorld`:你好世界(JS)(API
8
)
](
https://gitee.com/openharmony/app_samples/tree/master/common/JsHelloWorld
)
zh-cn/application-dev/reference/apis/js-apis-data-ability.md
浏览文件 @
58b41f4f
# DataAbility 谓词
>
![icon-note.gif](public_sys-resources/icon-note.gif)
**说明:**
> **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
...
...
@@ -19,7 +19,7 @@ createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates):
从DataAabilityPredicates对象创建RdbPredicates对象。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -53,7 +53,7 @@ equalTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且值等于指定值的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -81,7 +81,7 @@ notEqualTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且值不等于指定值的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -109,7 +109,7 @@ beginWrap(): DataAbilityPredicates
向谓词添加左括号。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:**
| 类型 | 说明 |
...
...
@@ -136,7 +136,7 @@ endWrap(): DataAbilityPredicates
向谓词添加右括号。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:**
| 类型 | 说明 |
...
...
@@ -163,7 +163,7 @@ or(): DataAbilityPredicates
将或条件添加到谓词中。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:**
| 类型 | 说明 |
...
...
@@ -187,7 +187,7 @@ and(): DataAbilityPredicates
将和条件添加到谓词中。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:**
| 类型 | 说明 |
...
...
@@ -211,7 +211,7 @@ contains(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且value包含指定值的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -239,7 +239,7 @@ beginsWith(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且值以指定字符串开头的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -267,7 +267,7 @@ endsWith(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且值以指定字符串结尾的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -295,7 +295,7 @@ isNull(field: string): DataAbilityPredicates
配置谓词以匹配值为null的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -322,7 +322,7 @@ isNotNull(field: string): DataAbilityPredicates
配置谓词以匹配值不为null的指定字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -349,7 +349,7 @@ like(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string且值类似于指定字符串的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -377,7 +377,7 @@ glob(field: string, value: string): DataAbilityPredicates
配置谓词以匹配数据类型为string的指定字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -405,7 +405,7 @@ between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且value在指定范围内的指定字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -434,7 +434,7 @@ notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicate
配置谓词以匹配数据类型为ValueType且value超出给定范围的指定字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -463,7 +463,7 @@ greaterThan(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且值大于指定值的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -491,7 +491,7 @@ lessThan(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为valueType且value小于指定值的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -519,7 +519,7 @@ greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且value大于或等于指定值的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -547,7 +547,7 @@ lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType且value小于或等于指定值的字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -575,7 +575,7 @@ orderByAsc(field: string): DataAbilityPredicates
配置谓词以匹配其值按升序排序的列。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -602,7 +602,7 @@ orderByDesc(field: string): DataAbilityPredicates
配置谓词以匹配其值按降序排序的列。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -629,7 +629,7 @@ distinct(): DataAbilityPredicates
配置谓词以过滤重复记录并仅保留其中一个。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**返回值:**
| 类型 | 说明 |
...
...
@@ -657,7 +657,7 @@ limitAs(value: number): DataAbilityPredicates
设置最大数据记录数的谓词。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -684,7 +684,7 @@ offsetAs(rowOffset: number): DataAbilityPredicates
配置谓词以指定返回结果的起始位置。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -711,7 +711,7 @@ groupBy(fields: Array<string>): DataAbilityPredicates
配置谓词按指定列分组查询结果。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -763,7 +763,7 @@ in(field: string, value: Array<ValueType>): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType数组且值在给定范围内的指定字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -792,7 +792,7 @@ notIn(field: string, value: Array<ValueType>): DataAbilityPredicates
配置谓词以匹配数据类型为ValueType数组且值不在给定范围内的指定字段。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -816,7 +816,7 @@ notIn(field: string, value: Array<ValueType>): DataAbilityPredicates
用于表示允许的数据字段类型。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataShare.Core。
**系统能力
:**
SystemCapability.DistributedDataManager.DataShare.Core。
| 名称 | 说明 |
| ------- | -------------------- |
...
...
zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md
浏览文件 @
58b41f4f
# 分布式数据对象
>
![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<stri
监听分布式对象的变更。
**系统能力
**
:
SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**系统能力
:**
SystemCapability.DistributedDataManager.DataObject.DistributedObject。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -132,7 +130,7 @@ off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array<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。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
zh-cn/application-dev/reference/apis/js-apis-data-rdb.md
浏览文件 @
58b41f4f
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-data-resultset.md
浏览文件 @
58b41f4f
# 结果集
>
![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
...
...
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
浏览文件 @
58b41f4f
...
...
@@ -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
<
Storage
>
): void
读取指定文件,将数据加载到Storage实例,用于数据操作,使用callback
形式返回结果
。
读取指定文件,将数据加载到Storage实例,用于数据操作,使用callback
方式返回结果,此方法为异步方法
。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -105,9 +105,9 @@ getStorage(path: string, callback: AsyncCallback<Storage>): void
getStorage(path: string): Promise
<
Storage
>
读取指定文件,将数据加载到Storage实例,用于数据操作,使用Promise方式
作
为异步方法。
读取指定文件,将数据加载到Storage实例,用于数据操作,使用Promise方式
返回结果,此方法
为异步方法。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -146,9 +146,9 @@ getStorage(path: string): Promise<Storage>
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
<
void
>
): void
从内存中移除指定文件对应的Storage单实例,并删除指定文件及其备份文件、损坏文件。删除指定文件时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题,使用callback方式
作
为异步方法。
从内存中移除指定文件对应的Storage单实例,并删除指定文件及其备份文件、损坏文件。删除指定文件时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题,使用callback方式
返回结果,此方法
为异步方法。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -191,9 +191,9 @@ deleteStorage(path: string, callback: AsyncCallback<void>): void
deleteStorage(path: string): Promise
<
void
>
从内存中移除指定文件对应的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
<
void
>
): void
从内存中移除指定文件对应的Storage单实例。移除Storage单实例时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题。
此方法为异步方法。
从内存中移除指定文件对应的Storage单实例。移除Storage单实例时,应用不允许再使用该实例进行数据操作,否则会出现数据一致性问题。使用callback方式返回结果,此方法为异步方法。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -269,11 +265,9 @@ removeStorageFromCache(path: string, callback: AsyncCallback<void>): void
removeStorageFromCache(path: string): Promise
<
void
>
从内存中移除指定文件对应的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
<
ValueType
>
): void
获取键对应的值,如果值为null或者非默认值类型,返回默认数据。
此方法为异步方法。
获取键对应的值,如果值为null或者非默认值类型,返回默认数据。使用callback方式返回结果,此方法为异步方法。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -362,11 +352,9 @@ get(key: string, defValue: ValueType, callback: AsyncCallback<ValueType>):
get(key: string, defValue: ValueType): Promise
<
ValueType
>
获取键对应的值,如果值为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
<
void
>
): 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<void>): void
put(key: string, value: ValueType): Promise
<
void
>
首先获取指定文件对应的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
<
boolean
>
): boolean
检查存储对象是否包含名为给定key的存储。
此方法为异步方法。
检查存储对象是否包含名为给定key的存储。使用callback方式返回结果,此方法为异步方法。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -542,11 +520,9 @@ has(key: string, callback: AsyncCallback<boolean>): boolean
has(key: string): Promise
<
boolean
>
检查存储对象是否包含名为给定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
```
### delete
j
### delete
delete(key: string, callback: AsyncCallback
<
void
>
): void
从存储对象中删除名为给定key的存储。
此方法为异步方法。
从存储对象中删除名为给定key的存储。使用callback方式返回结果,此方法为异步方法。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -624,11 +596,9 @@ delete(key: string, callback: AsyncCallback<void>): void
delete(key: string): Promise
<
void
>
从存储对象删除名为给定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
<
void
>
): void
将当前storage对象中的修改保存到当前的storage,并异步存储到文件中。
此方法为异步方法。
将当前storage对象中的修改保存到当前的storage,并异步存储到文件中。使用callback方式返回结果,此方法为异步方法。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -698,11 +664,9 @@ flush(callback: AsyncCallback<void>): void
flush(): Promise
<
void
>
将当前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
<
void
>
): void
清除此存储对象中的所有存储。
此方法为异步方法。
清除此存储对象中的所有存储。使用callback方式返回结果,此方法为异步方法。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -767,11 +727,9 @@ clear(callback: AsyncCallback<void>): void
clear(): Promise
<
void
>
清除此存储对象中的所有存储。
此方法为异步方法。
清除此存储对象中的所有存储。使用Promise方式返回结果,此方法为异步方法。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**返回值:**
| 类型 | 说明 |
...
...
@@ -795,7 +753,7 @@ on(type: 'change', callback: Callback<StorageObserver>): void
订阅数据变更者类需要实现StorageObserver接口,订阅的key的值发生变更后,在执行flush/flushSync方法后,callback方法会被回调。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 说明 |
...
...
@@ -820,7 +778,7 @@ off(type: 'change', callback: Callback<StorageObserver>): void
当不再进行订阅数据变更时,使用此接口取消订阅。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 说明 |
...
...
@@ -839,7 +797,7 @@ off(type: 'change', callback: Callback<StorageObserver>): void
## StorageObserver
**系统能力
**
:
以下各项对应的系统能力均为SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
以下各项对应的系统能力均为SystemCapability.DistributedDataManager.Preferences.Core
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
...
...
@@ -849,7 +807,7 @@ off(type: 'change', callback: Callback<StorageObserver>): void
用于表示允许的数据字段类型。
**系统能力
**
:
SystemCapability.DistributedDataManager.Preferences.Core
**系统能力
:**
SystemCapability.DistributedDataManager.Preferences.Core
| 名称 | 说明 |
| ------- | -------------------- |
...
...
zh-cn/application-dev/reference/apis/js-apis-display.md
浏览文件 @
58b41f4f
# 屏幕属性
>
![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<Display>): void
获取当前默认的display对象。
**系统能力
**
:
SystemCapability.WindowManager.WindowManager.Core
**系统能力
:**
SystemCapability.WindowManager.WindowManager.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -82,7 +82,7 @@ getDefaultDisplay(): Promise<Display>
获取当前默认的display对象。
**系统能力
**
:
SystemCapability.WindowManager.WindowManager.Core
**系统能力
:**
SystemCapability.WindowManager.WindowManager.Core
**返回值:**
...
...
@@ -107,7 +107,7 @@ getAllDisplay(callback: AsyncCallback<Array<Display>>): void
获取当前所有的display对象。
**系统能力
**
:
SystemCapability.WindowManager.WindowManager.Core
**系统能力
:**
SystemCapability.WindowManager.WindowManager.Core
**参数:**
...
...
@@ -133,7 +133,7 @@ getAllDisplay(): Promise<Array<Display>>
获取当前所有的display对象。
**系统能力
**
:
SystemCapability.WindowManager.WindowManager.Core
**系统能力
:**
SystemCapability.WindowManager.WindowManager.Core
**返回值:**
...
...
@@ -158,7 +158,7 @@ on(type: 'add'|'remove'|'change', callback: Callback<number>): void
开启监听。
**系统能力
**
:
SystemCapability.WindowManager.WindowManager.Core
**系统能力
:**
SystemCapability.WindowManager.WindowManager.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -182,7 +182,7 @@ off(type: 'add'|'remove'|'change', callback?: Callback<number>): void
关闭监听。
**系统能力
**
:
SystemCapability.WindowManager.WindowManager.Core
**系统能力
:**
SystemCapability.WindowManager.WindowManager.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
zh-cn/application-dev/reference/apis/js-apis-distributed-data.md
浏览文件 @
58b41f4f
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-screenshot.md
浏览文件 @
58b41f4f
# 屏幕截图
>
![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<image.PixelMap>)
获取屏幕截图。
**系统能力
**
:
SystemCapability.WindowManager.WindowManager.Core
**系统能力
:**
SystemCapability.WindowManager.WindowManager.Core
**需要权限**
:ohos.permission.CAPTURE_SCREEN
...
...
@@ -94,15 +94,15 @@ save(options?: ScreenshotOptions): Promise<image.PixelMap>
获取屏幕截图。
**系统能力
**
:
SystemCapability.WindowManager.WindowManager.Core
**系统能力
:**
SystemCapability.WindowManager.WindowManager.Core
**需要权限**
:ohos.permission.CAPTURE_SCREEN
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| options |
[
ScreenshotOptions
](
#screenshotoptions
)
| 否 | 该类型的参数包含screenRect,imageSize,
rotation三个参数,需要分别设置这三个参数。 |
| 参数名 | 类型 | 必填 | 说明 |
| ------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| options |
[
ScreenshotOptions
](
#screenshotoptions
)
| 否 | 该类型的参数包含screenRect、imageSize、
rotation三个参数,需要分别设置这三个参数。 |
**返回值:**
...
...
zh-cn/application-dev/reference/apis/js-apis-system-storage.md
浏览文件 @
58b41f4f
# 数据存储
>
![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)。
>
...
...
zh-cn/application-dev/reference/apis/js-apis-usb.md
浏览文件 @
58b41f4f
# USB管理
>
![icon-note.gif](public_sys-resources/icon-note.gif)
**说明:**
> **说明:**
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
...
...
@@ -15,9 +15,10 @@ getDevices(): Array<Readonly<USBDevice>>
获取USB设备列表。
**系统能力
**
:
SystemCapability.USB.USBManager
**系统能力
:**
SystemCapability.USB.USBManager
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Array
<
Readonly
<
[USBDevice](#usbdevice)
>>
| 设备信息列表。 |
...
...
@@ -87,7 +88,7 @@ connectDevice(device: USBDevice): Readonly<USBDevicePipe>
需要调用
[
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<boolean>
请求软件包的临时权限以访问设备。
**系统能力
**
:
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
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
zh-cn/application-dev/reference/apis/js-apis-webgl.md
浏览文件 @
58b41f4f
# 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
...
...
zh-cn/application-dev/reference/apis/js-apis-webgl2.md
浏览文件 @
58b41f4f
# 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
...
...
zh-cn/application-dev/reference/apis/js-apis-window.md
浏览文件 @
58b41f4f
此差异已折叠。
点击以展开。
zh-cn/application-dev/webgl/webgl-guidelines.md
浏览文件 @
58b41f4f
...
...
@@ -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
)
zh-cn/application-dev/windowmanager/screenshot-guidelines.md
浏览文件 @
58b41f4f
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录