| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application that checks the Wi-Fi status. |
| callback | AsyncCallback<boolean> | Yes | Callback invoked to return whether Wi-Fi is enabled. |
| callback | AsyncCallback<boolean> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null** and **data** is a Boolean value (**true** indicates that Wi-Fi is active; and **false** indicates that Wi-Fi is inactive). If the operation fails, **err** is an error object. |
**Error codes**
**Error codes**
...
@@ -72,13 +72,13 @@ Checks whether Wi-Fi is active. This API uses a promise to return the result.
...
@@ -72,13 +72,13 @@ Checks whether Wi-Fi is active. This API uses a promise to return the result.
| Promise<boolean> | Promise used to return whether Wi-Fi is active. |
| Promise<boolean> | Promise used to return the result. The value **true** indicates that Wi-Fi is active, and the value **false** indicates that Wi-Fi is inactive. |
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. |
**Error codes**
For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md).
The File Picker encapsulates system applications, such as **PhotoViewPicker**, **DocumentViewPicker**, and **AudioViewPicker**, and provides capabilities of selecting and saving photos, documents, and audio clips. The application can select the picker as required.
**Picker** encapsulates the system applications such as **PhotoViewPicker**, **DocumentViewPicker** and **AudioViewPicker** to provide capabilities of selecting and saving files of different types. The application can select the picker as required.
> **NOTE**
> **NOTE**
>
>
> 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 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.
## Modules to Import
## Modules to Import
```js
```js
importpickerfrom'@ohos.file.picker';
importpickerfrom'@ohos.file.picker';
...
@@ -28,7 +27,7 @@ let photoPicker = new picker.PhotoViewPicker();
...
@@ -28,7 +27,7 @@ let photoPicker = new picker.PhotoViewPicker();
Selects one or more images or videos in a **photoPicker** page. This API uses a promise to return the result. You can pass in **PhotoSelectOptions** to specify the media type and the maximum number of files to select.
Selects one or more images or videos in a **photoPicker** page. This API uses a promise to return the result. You can pass in **PhotoSelectOptions** to specify the media file type and the maximum number of files to select.
| option | [PhotoSelectOptions](#photoselectoptions) | No | Options for selecting images or videos.|
| option | [PhotoSelectOptions](#photoselectoptions) | No | Options for selecting files. If this parameter is not specified, images and videos are selected by default. A maximum of 50 files can be selected.|
Selects one or more images or videos in a **photoPicker** page. This API uses an asynchronous callback to return the result. You can pass in **PhotoSelectOptions** to specify the media type and the maximum number of files to select.
Selects one or more images or videos in a **photoPicker** page. This API uses an asynchronous callback to return the result. You can pass in **PhotoSelectOptions** to specify the media file type and the maximum number of files to select.
| option | [PhotoSaveOptions](#photosaveoptions) | No | Options for saving images or videos.|
| option | [PhotoSaveOptions](#photosaveoptions) | No | Options for saving files. If this parameter is not specified, a **photoPicker** page will be displayed for the user to enter the names of the files to save.|
**Return value**
**Return value**
...
@@ -266,7 +265,7 @@ Selects one or more documents in a **documentPicker** page. This API uses a prom
...
@@ -266,7 +265,7 @@ Selects one or more documents in a **documentPicker** page. This API uses a prom
| option | [DocumentSelectOptions](#documentselectoptions) | No | Options for selecting documents.|
| option | [DocumentSelectOptions](#documentselectoptions) | No | Options for select documents. If this parameter is not specified, the **documentPicker** page is displayed by default.|
**Return value**
**Return value**
...
@@ -373,7 +372,7 @@ Saves one or more documents in a **documentPicker** page. This API uses a promis
...
@@ -373,7 +372,7 @@ Saves one or more documents in a **documentPicker** page. This API uses a promis
| option | [DocumentSaveOptions](#documentsaveoptions) | No | Options for saving the documents.|
| option | [DocumentSaveOptions](#documentsaveoptions) | No | Options for saving the documents. If this parameter is not specified, a **documentPicker** page will be displayed for the user to enter the names of the documents to save.|
**Return value**
**Return value**
...
@@ -493,7 +492,7 @@ Selects one or more audio files in an **audioPicker** page (currently, a **docum
...
@@ -493,7 +492,7 @@ Selects one or more audio files in an **audioPicker** page (currently, a **docum
| option | [AudioSelectOptions](#audioselectoptions) | No | Options for selecting audio files.|
| option | [AudioSelectOptions](#audioselectoptions) | No | Options for selecting the audio files. If this parameter is not specified, the **audioPicker** page is displayed by default. |
Saves one or more audio files in an **audioPicker** page (currently, a **documentPicker** page is displayed). This API uses a promise to return the result. You can pass in **AudioSaveOptions** to specify the file names of the audio clips to save.
Saves one or more audio files in an **audioPicker** page (currently, a **documentPicker** page is displayed). This API uses a promise to return the result. You can pass in **AudioSaveOptions** to specify the names of the audio files to save.
| option | [AudioSaveOptions](#audiosaveoptions) | No | Options for saving audio files.|
| option | [AudioSaveOptions](#audiosaveoptions) | No | Options for saving audio files. If this parameter is not specified, an **audioPicker** page will be displayed for the user to enter the names of the files to save.|
Saves one or more audio files in an **audioPicker** page (currently, a **documentPicker** page is displayed). This API uses an asynchronous callback to return the result. You can pass in **AudioSaveOptions** to specify the file names of the audio clips to save.
Saves one or more audio files in an **audioPicker** page (currently, a **documentPicker** page is displayed). This API uses an asynchronous callback to return the result. You can pass in **AudioSaveOptions** to specify the names of the audio files to save.
| newFileNames? | Array<string> | No | File names of the documents to save.|
| newFileNames? | Array<string> | No | Names of the documents to save. If this parameter is not specified, the user needs to enter the document names. |
## AudioSelectOptions
## AudioSelectOptions
Defines the options for selecting audio clips. Currently, this parameter cannot be configured.
Defines the options for selecting audio files. Currently, this parameter cannot be configured.
| newFileNames? | Array<string> | No | File names of the audio clips to save.|
| newFileNames? | Array<string> | No | Name of the audio files to save. If this parameter is not specified, the user needs to enter the file names.|
| token | Uint8Array | Yes | New token of the domain account.|
| callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the token is successfully updated, **err** is **null**. Otherwise, **err** is an error object.|