Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
be9b2bdb
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看板
未验证
提交
be9b2bdb
编写于
11月 18, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
!11550 modify userFileManager import
Merge pull request !11550 from 胡伟奇/modify_userFileManager
上级
edb3401a
527fb077
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
86 addition
and
3 deletion
+86
-3
zh-cn/application-dev/reference/apis/js-apis-userFileManager.md
...application-dev/reference/apis/js-apis-userFileManager.md
+86
-3
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-userFileManager.md
浏览文件 @
be9b2bdb
...
...
@@ -10,7 +10,6 @@
```
ts
import
userFileManager
from
'
@ohos.filemanagement.userFileManager
'
;
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
```
## userFileManager.getUserFileMgr
...
...
@@ -91,6 +90,8 @@ getPhotoAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getPhotoAssets
'
);
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -139,6 +140,8 @@ getPhotoAssets(options: FetchOptions): Promise<FetchResult<FileAsset>&g
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getPhotoAssets
'
);
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -181,6 +184,8 @@ createPhotoAsset(displayName: string, albumUri: string, callback: AsyncCallback&
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
createPhotoAssetDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -292,6 +297,8 @@ getPhotoAlbums(options: AlbumFetchOptions, callback: AsyncCallback<FetchResul
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getPhotoAlbumsDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -341,6 +348,8 @@ getPhotoAlbums(options: AlbumFetchOptions): Promise<FetchResult<Album>&
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getPhotoAlbumsDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -451,6 +460,8 @@ getAudioAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getAudioAssets
'
);
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -499,6 +510,8 @@ getAudioAssets(options: FetchOptions): Promise<FetchResult<FileAsset>&g
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getAudioAssets
'
);
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -541,6 +554,8 @@ delete(uri: string, callback: AsyncCallback<void>): void;
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
deleteAssetDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -593,6 +608,8 @@ delete(uri: string): Promise<void>;
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
deleteDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -935,7 +952,10 @@ get(member: string): MemberType;
| member | string | 是 | 成员参数名称例如:ImageVideoKey.URI |
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
fileAssetGetDemo
'
)
try
{
...
...
@@ -971,7 +991,10 @@ set(member: string, value: string): void;
| value | string | 是 | 设置成员参数名称,只能修改ImageVideoKey.TITLE的值 |
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
fileAssetSetDemo
'
)
try
{
...
...
@@ -1009,6 +1032,8 @@ commitModify(callback: AsyncCallback<void>): void
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
commitModifyDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1052,6 +1077,8 @@ commitModify(): Promise<void>
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
commitModifyDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1174,6 +1201,8 @@ close(fd: number, callback: AsyncCallback<void>): void
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
closeDemo
'
)
try
{
...
...
@@ -1222,6 +1251,8 @@ close(fd: number): Promise<void>
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
closeDemo
'
)
try
{
...
...
@@ -1261,6 +1292,8 @@ getThumbnail(callback: AsyncCallback<image.PixelMap>): void
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getThumbnailDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1301,6 +1334,8 @@ getThumbnail(size: Size, callback: AsyncCallback<image.PixelMap>): void
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getThumbnailDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1347,6 +1382,8 @@ getThumbnail(size?: Size): Promise<image.PixelMap>
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getThumbnailDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1386,6 +1423,8 @@ favorite(isFavorite: boolean, callback: AsyncCallback<void>): void
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
favoriteDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1430,6 +1469,8 @@ favorite(isFavorite: boolean): Promise<void>
**示例:**
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
favoriteDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1468,6 +1509,8 @@ getCount(): number
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getCountDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1498,6 +1541,8 @@ isAfterLast(): boolean
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
let
fetchOption
=
{
...
...
@@ -1527,6 +1572,8 @@ close(): void
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
fetchResultCloseDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1557,6 +1604,8 @@ getFirstObject(callback: AsyncCallback<T>): void
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getFirstObjectDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1592,6 +1641,8 @@ getFirstObject(): Promise<T>
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getFirstObjectDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1622,6 +1673,8 @@ async function example() {
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getNextObjectDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1660,6 +1713,8 @@ async function example() {
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getNextObjectDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1693,6 +1748,8 @@ getLastObject(callback: AsyncCallback<T>): void
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getLastObjectDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1728,6 +1785,8 @@ getLastObject(): Promise<T>
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getLastObjectDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1759,6 +1818,8 @@ getPositionObject(index: number, callback: AsyncCallback<T>): void
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getPositionObjectDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1800,6 +1861,8 @@ getPositionObject(index: number): Promise<T>
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
getPositionObjectDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1849,6 +1912,8 @@ getPhotoAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
albumGetFileAssetsDemoCallback
'
)
...
...
@@ -1891,6 +1956,8 @@ getPhotoAssets(options: FetchOptions): Promise<FetchResult<FileAsset>&g
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
albumGetFileAssetsDemoPromise
'
)
...
...
@@ -1931,6 +1998,8 @@ commitModify(callback: AsyncCallback<void>): void;
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
albumCommitModifyDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -1969,6 +2038,8 @@ commitModify(): Promise<void>;
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
albumCommitModifyDemo
'
)
let
predicates
=
new
dataSharePredicates
.
DataSharePredicates
();
...
...
@@ -2025,6 +2096,8 @@ getPhotoAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
privateAlbumGetFileAssetsDemoCallback
'
)
let
albumList
=
await
mgr
.
getPrivateAlbum
(
userFileManager
.
PrivateAlbumType
.
TYPE_TRASH
);
...
...
@@ -2070,6 +2143,8 @@ getPhotoAssets(options: FetchOptions): Promise<FetchResult<FileAsset>&g
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
privateAlbumGetFileAssetsDemoPromise
'
)
let
albumList
=
await
mgr
.
getPrivateAlbum
(
userFileManager
.
PrivateAlbumType
.
TYPE_TRASH
);
...
...
@@ -2104,6 +2179,8 @@ delete(uri: string, callback: AsyncCallback<void>): void;
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
privateAlbumDeleteCallback
'
);
let
albumList
=
await
mgr
.
getPrivateAlbum
(
userFileManager
.
PrivateAlbumType
.
TYPE_TRASH
);
...
...
@@ -2150,6 +2227,8 @@ delete(uri: string): Promise<void>;
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
privateAlbumDeleteDemoPromise
'
)
let
albumList
=
await
mgr
.
getPrivateAlbum
(
userFileManager
.
PrivateAlbumType
.
TYPE_TRASH
);
...
...
@@ -2190,6 +2269,8 @@ recover(uri: string, callback: AsyncCallback<void>): void;
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
privateAlbumRecoverDemoCallback
'
);
let
albumList
=
await
mgr
.
getPrivateAlbum
(
userFileManager
.
PrivateAlbumType
.
TYPE_TRASH
);
...
...
@@ -2236,6 +2317,8 @@ recover(uri: string): Promise<void>;
**示例**
:
```
ts
import
dataSharePredicates
from
'
@ohos.data.dataSharePredicates
'
;
async
function
example
()
{
console
.
info
(
'
privateAlbumRecoverDemoPromise
'
)
let
albumList
=
await
mgr
.
getPrivateAlbum
(
userFileManager
.
PrivateAlbumType
.
TYPE_TRASH
);
...
...
@@ -2384,7 +2467,7 @@ async function example() {
| 名称 | 类型 | 必填 | 说明 |
| ---------------------- | ------------------- | ---- |------------------------------------------------ |
| fetchColumns | Array
<
string
>
| 是 | 检索条件,指定列名查询,如果该参数为空时默认查询uri、name、fileType。示例:
<br
/>
fetchColumns: "uri"|
| predicates |
[
dataSharePredicates.DataSharePredicates
](
#..
/js-apis-data-dataSharePredicates.md
)
| 是 | 谓词查询,显示过滤条件 |
| predicates |
[
dataSharePredicates.DataSharePredicates
](
../apis
/js-apis-data-dataSharePredicates.md
)
| 是 | 谓词查询,显示过滤条件 |
## AlbumFetchOptions
...
...
@@ -2394,5 +2477,5 @@ async function example() {
| 名称 | 类型 | 必填 | 说明 |
| ---------------------- | ------------------- | ---- |------------------------------------------------ |
| predicates |
[
dataSharePredicates.DataSharePredicates
](
#..
/js-apis-data-dataSharePredicates.md
)
| 是 | 谓词查询,显示过滤条件 |
| predicates |
[
dataSharePredicates.DataSharePredicates
](
../apis
/js-apis-data-dataSharePredicates.md
)
| 是 | 谓词查询,显示过滤条件 |
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录