Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
bcbb0783
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看板
提交
bcbb0783
编写于
3月 07, 2022
作者:
P
panqiangbiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix code issue
Signed-off-by:
N
panqiangbiao
<
panqiangbiao@huawei.com
>
上级
2bd6e6ce
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
37 deletion
+37
-37
zh-cn/application-dev/reference/apis/js-apis-medialibrary.md
zh-cn/application-dev/reference/apis/js-apis-medialibrary.md
+37
-37
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-medialibrary.md
浏览文件 @
bcbb0783
...
...
@@ -296,7 +296,7 @@ getPublicDirectory(type: DirectoryType): Promise<string>;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
DIR_CAMERA
=
mediaLibrary
.
DirectoryType
.
DIR_CAMERA
;
const
dicResult
=
await
media
.
getPublicDirectory
(
DIR_CAMERA
);
if
(
dicResult
==
'camera/'
)
{
...
...
@@ -445,7 +445,7 @@ isDirectory(callback: AsyncCallback<boolean>): void;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -480,7 +480,7 @@ isDirectory():Promise<boolean>;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -517,7 +517,7 @@ commitModify(callback: AsyncCallback<void>): void;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -553,7 +553,7 @@ commitModify(): Promise<void>;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -588,7 +588,7 @@ open(mode: string, callback: AsyncCallback<number>): void;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
mediaType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
path
=
"Pictures/"
;
asset
=
await
media
.
createAsset
(
mediaType
,
"image00003.jpg"
,
path
);
...
...
@@ -627,7 +627,7 @@ open(mode: string): Promise<number>;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
mediaType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
path
=
"Pictures/"
;
asset
=
await
media
.
createAsset
(
mediaType
,
"image00003.jpg"
,
path
);
...
...
@@ -661,7 +661,7 @@ close(fd: number, callback: AsyncCallback<void>): void;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -707,7 +707,7 @@ close(fd: number): Promise<void>;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -748,7 +748,7 @@ getThumbnail(callback: AsyncCallback<image.PixelMap>): void;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -784,7 +784,7 @@ getThumbnail(size: Size, callback: AsyncCallback<image.PixelMap>): void;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -825,7 +825,7 @@ getThumbnail(size?: Size): Promise<image.PixelMap>;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -861,7 +861,7 @@ favorite(isFavorite: boolean, callback: AsyncCallback<void>): void;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -902,7 +902,7 @@ favorite(isFavorite: boolean): Promise<void>;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -939,7 +939,7 @@ isFavorite(callback: AsyncCallback<boolean>): void;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -978,7 +978,7 @@ isFavorite():Promise<boolean>;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1018,7 +1018,7 @@ trash(isTrash: boolean, callback: AsyncCallback<void&g;): void;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1062,7 +1062,7 @@ trash(isTrash: boolean,): Promise<void>;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1099,7 +1099,7 @@ isTrash(callback: AsyncCallback<boolean>): void;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1143,7 +1143,7 @@ isTrash():Promise<boolean>;
**示例:**
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1184,7 +1184,7 @@ getCount(): number;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
getFileCountOneOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
selectionArgs
:
[
fileType
.
toString
()],
...
...
@@ -1215,7 +1215,7 @@ isAfterLast(): boolean;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1254,7 +1254,7 @@ close(): void;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1286,7 +1286,7 @@ getFirstObject(callback: AsyncCallback<FileAsset>): void;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1325,7 +1325,7 @@ getFirstObject(): Promise<FileAsset>;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1361,7 +1361,7 @@ async function (done) {
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1399,7 +1399,7 @@ async function (done) {
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1433,7 +1433,7 @@ getLastObject(callback: AsyncCallback<FileAsset>): void;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1471,7 +1471,7 @@ getLastObject(): Promise<FileAsset>;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1504,7 +1504,7 @@ getPositionObject(index: number, callback: AsyncCallback<FileAsset>): void
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1548,7 +1548,7 @@ getPositionObject(index: number): Promise<FileAsset>;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1586,7 +1586,7 @@ getAllObject(callback: AsyncCallback<Array<FileAsset>>): void;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1624,7 +1624,7 @@ getAllObject(): Promise<Array<FileAsset>>;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
imageType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
getImageOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'= ?'
,
...
...
@@ -1656,7 +1656,7 @@ commitModify(callback: AsyncCallback<void>): void;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
AlbumNoArgsfetchOp
=
{
selections
:
''
,
selectionArgs
:
[],
...
...
@@ -1693,7 +1693,7 @@ commitModify(): Promise<void>;
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
AlbumNoArgsfetchOp
=
{
selections
:
''
,
selectionArgs
:
[],
...
...
@@ -1729,7 +1729,7 @@ getFileAssets(options: MediaFetchOptions, callback: AsyncCallback<FetchFileRe
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
AlbumNoArgsfetchOp
=
{
selections
:
''
,
selectionArgs
:
[],
...
...
@@ -1768,7 +1768,7 @@ async function (done) {
**示例**
:
```
async function
(done
) {
async
function
example
(
)
{
let
AlbumNoArgsfetchOp
=
{
selections
:
''
,
selectionArgs
:
[],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录