From de0a2a7efe1d340cc205bf5c055ebf34d0dd015c Mon Sep 17 00:00:00 2001 From: Annie_wang Date: Mon, 6 Jun 2022 11:30:59 +0800 Subject: [PATCH] update docs Signed-off-by: Annie_wang --- .../reference/apis/js-apis-filemanager.md | 32 ++++++++++--------- .../reference/apis/js-apis-statfs.md | 18 ++++++----- .../apis/js-apis-storage-statistics.md | 27 +++++++++------- .../reference/apis/js-apis-volumemanager.md | 19 ++++++----- 4 files changed, 53 insertions(+), 43 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-filemanager.md b/en/application-dev/reference/apis/js-apis-filemanager.md index b7e33e70ef..88f58da288 100644 --- a/en/application-dev/reference/apis/js-apis-filemanager.md +++ b/en/application-dev/reference/apis/js-apis-filemanager.md @@ -1,9 +1,11 @@ # User File Access and Management ->![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+>**NOTE**
> ->- The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. +>- The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. >- The APIs of this module are system APIs and cannot be called by third-party applications. Currently, these APIs can be called only by **filepicker**. +This module provides service APIs for accessing and managing user files. It interworks with the underlying file management services to implement media library and external card management, and provides capabilities for applications to query and create user files. + ## Modules to Import ```js @@ -81,8 +83,8 @@ Obtains information about the second-level album or files in asynchronous mode. - Parameters | Name| Type| Mandatory| Description| | --- | --- | --- | -- | - | path | string | Yes| URI of the directory to query.| - | type | string | Yes| Type of the files to query. The file type can be **file**, **image**, **audio**, or **video**.| + | path | promise| Yes| URI of the directory to query.| + | type | promise| Yes| Type of the files to query. The file type can be **file**, **image**, **audio**, or **video**.| | options | Object | No| The options are as follows:
-  **dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported.
-  **offset**: position to start the query. The value is a number.
-  **count**: number of files to query.| - Return value @@ -128,8 +130,8 @@ Obtains information about the second-level album or files in asynchronous mode. | Name | Type | Mandatory| Description | | -------- | ------------------------- | ---- | ------------------------------------------------------------ | - | path | string | Yes | URI of the directory to query. | - | type | string | Yes | Type of the files to query. The file type can be **file**, **image**, **audio**, or **video**.| + | path | promise | Yes | URI of the directory to query. | + | type | promise | Yes | Type of the files to query. The file type can be **file**, **image**, **audio**, or **video**.| | options | Object | No| The options are as follows:
-  **dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported.
-  **offset**: position to start the query. The value is a number.
-  **count**: number of files to query.| | callback | AsyncCallback<[FileInfo](#fileinfo)[]> | Yes | Callback invoked to return the file information obtained. | - Error @@ -156,7 +158,7 @@ Obtains information about the second-level album or files in asynchronous mode. ## filemanager.createFile -filemanager.createFile(path : string, filename : string, options? : {dev? : DevInfo}) : Promise<string> +createFile(path : string, filename : string, options? : {dev? : DevInfo}) : Promise<string> Creates a file in the specified path in asynchronous mode. This API uses a promise to return the result. @@ -165,8 +167,8 @@ Creates a file in the specified path in asynchronous mode. This API uses a promi - Parameters | Name| Type| Mandatory| Description| | --- | --- | --- | -- | - | filename | string | Yes| Name of the file to create.| - | path | string | Yes| URI of the file to create.| + | filename | promise| Yes| Name of the file to create.| + | path | promise| Yes| URI of the file to create.| | options | Object | No| The options are as follows:
-  **dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported.| - Return value @@ -209,8 +211,8 @@ Creates a file in the specified path in asynchronous mode. This API uses a callb | Name | Type | Mandatory| Description | | -------- | ------------------------- | ---- | ----------------------------- | - | filename | string | Yes | Name of the file to create. | - | path | string | Yes | URI of the file to create. | + | filename | promise | Yes | Name of the file to create. | + | path | promise | Yes | URI of the file to create. | | options | Object | No| The options are as follows:
-  **dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported.| | callback | AsyncCallback<[FileInfo](#fileinfo)[]> | Yes | Callback invoked to return the file information obtained. | @@ -246,9 +248,9 @@ Defines the file information returned by **getRoot()** or **listFile()**. | Name| Type| Readable| Writable| Description| | --- | -- | -- | -- | -- | -| name | string | Yes| No| File name.| -| path | string | Yes| No| URI of the file.| -| type | string | Yes| No| File type.| +| name | promise| Yes| No| File name.| +| path | promise| Yes| No| URI of the file.| +| type | promise| Yes| No| File type.| | size | number | Yes| No| File size.| | addedTime | number | Yes| No| Time when the file was scanned to the database.| | modifiedTime | number | Yes| No| Time when the file was modified.| @@ -263,4 +265,4 @@ Defines the device type. | Name| Type | Readable| Writable| Description | | ------ | ------ | ---- | ---- | -------- | -| name | string | Yes | Yes | Device name.| +| name | promise| Yes | Yes | Device name.| diff --git a/en/application-dev/reference/apis/js-apis-statfs.md b/en/application-dev/reference/apis/js-apis-statfs.md index 5a4cbbe84d..b1029f29eb 100644 --- a/en/application-dev/reference/apis/js-apis-statfs.md +++ b/en/application-dev/reference/apis/js-apis-statfs.md @@ -1,8 +1,10 @@ # statfs -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. +This module provides information related to the file system. It provides JS APIs to obtain the total number of bytes and the number of idle bytes of the file system. + ## Modules to Import ```js @@ -11,11 +13,11 @@ import statfs from '@ohos.statfs'; ## Guidelines -Before using this module to perform operations on a file or directory, obtain the absolute path of the file or directory. For details, see [getOrCreateLocalDir of the Context module](js-apis-Context.md). +Before using the APIs provided by this module to perform operations on a file or directory, obtain the path of the application sandbox. For details, see [getOrCreateLocalDir of the Context module](js-apis-Context.md). -Absolute file or directory path = Application directory + File name or directory name +Application sandbox path of a file or directory = Application directory + File name or directory name -For example, if the application directory obtained by using **getOrCreateLocalDir** is **dir** and the file name is **xxx.txt**, the absolute path of the file is as follows: +For example, if the application directory obtained by using **getOrCreateLocalDir** is **dir** and the file name is **xxx.txt**, the application sandbox path of the file is as follows: ```js let path = dir + "xxx.txt"; @@ -25,7 +27,7 @@ let path = dir + "xxx.txt"; getFreeBytes(path:string):Promise<number> -Obtains the number of free bytes of the specified file system in asynchronous mode. This method uses a promise to return the result. +Obtains the number of free bytes of the specified file system in asynchronous mode. This API uses a promise to return the result. **System capability**: SystemCapability.FileManagement.File.FileIO @@ -56,7 +58,7 @@ Obtains the number of free bytes of the specified file system in asynchronous mo getFreeBytes(path:string, callback:AsyncCallback<number>): void -Obtains the number of free bytes of the specified file system in asynchronous mode. This method uses a callback to return the result. +Obtains the number of free bytes of the specified file system in asynchronous mode. This API uses a callback to return the result. **System capability**: SystemCapability.FileManagement.File.FileIO @@ -79,7 +81,7 @@ Obtains the number of free bytes of the specified file system in asynchronous mo getTotalBytes(path: string): Promise<number> -Obtains the total number of bytes of the specified file system in asynchronous mode. This method uses a promise to return the result. +Obtains the total number of bytes of the specified file system in asynchronous mode. This API uses a promise to return the result. **System capability**: SystemCapability.FileManagement.File.FileIO @@ -110,7 +112,7 @@ Obtains the total number of bytes of the specified file system in asynchronous m getTotalBytes(path: string, callback: AsyncCallback<number>): void -Obtains the total number of bytes of the specified file system in asynchronous mode. This method uses a callback to return the result. +Obtains the total number of bytes of the specified file system in asynchronous mode. This API uses a callback to return the result. **System capability**: SystemCapability.FileManagement.File.FileIO diff --git a/en/application-dev/reference/apis/js-apis-storage-statistics.md b/en/application-dev/reference/apis/js-apis-storage-statistics.md index 6a5ee3a36a..d1b3546f0b 100644 --- a/en/application-dev/reference/apis/js-apis-storage-statistics.md +++ b/en/application-dev/reference/apis/js-apis-storage-statistics.md @@ -1,9 +1,12 @@ # App Storage Statistics -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> > - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. -> - API version 9 is a canary release for trial use. The APIs of this version may be unstable. +> - API version 9 is a canary version for trial use. The APIs of this version may be unstable. +> - The APIs of this module are system APIs and cannot be called by third-party applications. + +This module provides functions to obtain storage statistics, including the space of built-in and plug-in memory cards, statistics of application data by type, and application data. ## Modules to Import @@ -130,7 +133,7 @@ Asynchronously obtains the available space of the specified volume. This API use getBundleStats(packageName: string): Promise<BundleStats> -Asynchronously obtains app information. This API uses a promise to return the result. +Asynchronously obtains application information. This API uses a promise to return the result. **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics @@ -138,13 +141,13 @@ Asynchronously obtains app information. This API uses a promise to return the re | Name | Type | Mandatory| Description | | ----------- | ------ | ---- | -------- | - | packageName | string | Yes | Bundle name of the app.| + | packageName | string | Yes | Bundle name of the application.| - Return value | Type | Description | | ------------------------------------------ | -------------------------- | - | Promise<[Bundlestats](#bundlestats)> | Promise used to return the app information.| + | Promise<[Bundlestats](#bundlestats)> | Promise used to return the application data obtained.| - Example @@ -161,7 +164,7 @@ Asynchronously obtains app information. This API uses a promise to return the re getBundleStats(packageName: string, callback: AsyncCallback<BundleStats>): void -Asynchronously obtains app information. This API uses a callback to return the result. +Asynchronously obtains application information. This API uses a callback to return the result. **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics @@ -169,8 +172,8 @@ Asynchronously obtains app information. This API uses a callback to return the r | Name | Type | Mandatory| Description | | -------- | --------------------------------------------------------- | ---- | ------------------------------------ | - | packageName | string | Yes | Bundle name of the app.| - | callback | callback:AsyncCallback<[Bundlestats](#bundlestats)> | Yes | Callback invoked to return the app information.| + | packageName | string | Yes | Bundle name of the application.| + | callback | callback:AsyncCallback<[Bundlestats](#bundlestats)> | Yes | Callback used to return the application information obtained.| - Example @@ -186,10 +189,10 @@ Asynchronously obtains app information. This API uses a callback to return the r **System capability**: SystemCapability.FileManagement.StorageService.SpatialStatistics -### Attributes +### Attribute | Name | Type | Description | | --------- | ------ | -------------- | -| appSize9+ | number | Size of the app. | -| cacheSize9+ | number | Cache size of the app. | -| dataSize9+ | number | Total data size of the app.| +| appSize9+ | number | Size of the application. | +| cacheSize9+ | number | Cache size of the application. | +| dataSize9+ | number | Total data size of the application.| diff --git a/en/application-dev/reference/apis/js-apis-volumemanager.md b/en/application-dev/reference/apis/js-apis-volumemanager.md index 16ca7a6a06..bac1ca14ac 100644 --- a/en/application-dev/reference/apis/js-apis-volumemanager.md +++ b/en/application-dev/reference/apis/js-apis-volumemanager.md @@ -1,9 +1,12 @@ # Volume Management -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> > - The initial APIs of this module are supported since API version 9. -> - API version 9 is a canary release for trial use. The APIs of this version may be unstable. +> - API version 9 is a canary version for trial use. The APIs of this version may be unstable. +> - The APIs of this module are system APIs and cannot be called by third-party applications. + +This module provides APIs to implement volume and disk management, including obtaining volume information, mounting and unmounting volumes, partitioning disks, and formatting volumes. ## Modules to Import @@ -15,7 +18,7 @@ import volumemanager from "@ohos.volumeManager"; getAllVolumes(): Promise<Array<Volume>> -Asynchronously obtains information about all available volumes. This method uses a promise to return the result. +Asynchronously obtains information about all available volumes. This API uses a promise to return the result. **System capability**: SystemCapability.FileManagement.StorageService.Volume @@ -37,7 +40,7 @@ Asynchronously obtains information about all available volumes. This method uses getAllVolumes(callback: AsyncCallback<Array<Volume>>): void -Asynchronously obtains information about all available volumes. This method uses a callback to return the result. +Asynchronously obtains information about all available volumes. This API uses a callback to return the result. **System capability**: SystemCapability.FileManagement.StorageService.Volume @@ -61,7 +64,7 @@ Asynchronously obtains information about all available volumes. This method uses mount(volumeId: string): Promise<boolean> -Asynchronously mounts a volume. This method uses a promise to return the result. +Asynchronously mounts a volume. This API uses a promise to return the result. **System capability**: SystemCapability.FileManagement.StorageService.Volume @@ -90,7 +93,7 @@ Asynchronously mounts a volume. This method uses a promise to return the result. mount(volumeId: string, callback:AsyncCallback<boolean>):void -Asynchronously obtains the available space of the specified volume. This method uses a callback to return the result. +Asynchronously obtains the available space of the specified volume. This API uses a callback to return the result. **System capability**: SystemCapability.FileManagement.StorageService.Volume @@ -114,7 +117,7 @@ Asynchronously obtains the available space of the specified volume. This method unmount(volumeId: string): Promise<boolean> -Asynchronously unmounts a volume. This method uses a promise to return the result. +Asynchronously unmounts a volume. This API uses a promise to return the result. **System capability**: SystemCapability.FileManagement.StorageService.Volume @@ -143,7 +146,7 @@ Asynchronously unmounts a volume. This method uses a promise to return the resul unmount(volumeId: string, callback:AsyncCallback<boolean>):void -Asynchronously unmounts a volume. This method uses a callback to return the result. +Asynchronously unmounts a volume. This API uses a callback to return the result. **System capability**: SystemCapability.FileManagement.StorageService.Volume -- GitLab