未验证 提交 3c7688f5 编写于 作者: O openharmony_ci 提交者: Gitee

!9328 翻译完成 9096:js-apis-environment.md

Merge pull request !9328 from ester.zhou/TR-9096
# Environment
This module provides JS APIs for obtaining the root directories of the storage and public files.
The **Environment** module provides APIs for obtaining the root directories of the storage and public files.
> **NOTE**
>
......@@ -21,13 +21,13 @@ Obtains the root directory of the storage. This API uses a promise to return the
**System capability**: SystemCapability.FileManagement.File.Environment
- Return value
**Return value**
| Type | Description |
| --------------------- | ---------------- |
| Promise<string> | Promise returned with the root directory of the storage.|
| Type | Description |
| --------------------- | ---------------- |
| Promise<string> | Promise returned with the root directory of the storage.|
- Example
**Example**
```js
environment.getStorageDataDir().then(function(path){
......@@ -45,13 +45,13 @@ Obtains the root directory of the storage. This API uses an asynchronous callbac
**System capability**: SystemCapability.FileManagement.File.Environment
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback<string> | Yes | Asynchronous callback used to return the root directory of the storage.|
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback<string> | Yes | Asynchronous callback used to return the root directory of the storage.|
- Example
**Example**
```js
environment.getStorageDataDir(function(error, path){
......@@ -67,13 +67,13 @@ Obtains the root directory of public files. This API uses a promise to return th
**System capability**: SystemCapability.FileManagement.File.Environment
- Return value
**Return value**
| Type | Description |
| --------------------- | ------------------ |
| Promise<string> | Promise returned with the root directory of public files.|
| Type | Description |
| --------------------- | ------------------ |
| Promise<string> | Promise returned with the root directory of public files.|
- Example
**Example**
```js
environment.getUserDataDir().then(function(path){
......@@ -91,13 +91,13 @@ Obtains the root directory of public files. This API uses an asynchronous callba
**System capability**: SystemCapability.FileManagement.File.Environment
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback<string> | Yes | Asynchronous callback used to return the root directory of public files.|
- Example
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback<string> | Yes | Asynchronous callback used to return the root directory of public files.|
**Example**
```js
environment.getUserDataDir(function(error, path){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册