From 67978f7ab5b37ca3cc61c90bc3eec69c11c88209 Mon Sep 17 00:00:00 2001 From: Annie_wang Date: Mon, 30 Jan 2023 10:44:52 +0800 Subject: [PATCH] update docs Signed-off-by: Annie_wang --- ...-apis-userfilemanager.md => js-apis-userFileManager.md} | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename en/application-dev/reference/apis/{js-apis-userfilemanager.md => js-apis-userFileManager.md} (99%) diff --git a/en/application-dev/reference/apis/js-apis-userfilemanager.md b/en/application-dev/reference/apis/js-apis-userFileManager.md similarity index 99% rename from en/application-dev/reference/apis/js-apis-userfilemanager.md rename to en/application-dev/reference/apis/js-apis-userFileManager.md index 5249fa7cc0..4de8727e24 100644 --- a/en/application-dev/reference/apis/js-apis-userfilemanager.md +++ b/en/application-dev/reference/apis/js-apis-userFileManager.md @@ -1,4 +1,4 @@ -# @ohos.filemanagement.userFileManager +# @ohos.filemanagement.userFileManager (User Data Management) The **userFileManager** module provides user data management capabilities, including accessing and modifying user media data (audio and video clips, images, and files). @@ -38,6 +38,7 @@ Obtains a **UserFileManager** instance. This instance can be used to access and **Example** ```ts +// The userFileManager instance obtained is a global object. It is used by default in subsequent operations. If the code snippet is not added, an error will be reported indicating that mgr is not defined. const context = getContext(this); let mgr = userFileManager.getUserFileMgr(context); ``` @@ -127,7 +128,7 @@ async function example() { predicates: predicates }; try { - var fetchResult = await mgr.getPhotoAssets(fetchOptions); + let fetchResult = await mgr.getPhotoAssets(fetchOptions); if (fetchResult != undefined) { console.info('fetchResult success'); let fileAsset = await fetchResult.getFirstObject(); @@ -410,7 +411,7 @@ Obtains the system album. This API uses a promise to return the result. async function example() { console.info('getPrivateAlbumDemo'); try { - var fetchResult = await mgr.getPrivateAlbum(userFileManager.PrivateAlbumType.TYPE_TRASH); + let fetchResult = await mgr.getPrivateAlbum(userFileManager.PrivateAlbumType.TYPE_TRASH); let trashAlbum = await fetchResult.getFirstObject(); console.info('first album.albumName = ' + trashAlbum.albumName); } catch (err) { -- GitLab