diff --git a/CODEOWNERS b/CODEOWNERS
index 9b36e3beb739abd5f7bd294dfb149297e93c0651..9ffdaf23ba7351b7dd5e18b54559e424f4a2b80a 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -317,6 +317,7 @@ zh-cn/application-dev/reference/apis/js-apis-system-parameter.md @qinxiaowang
zh-cn/application-dev/reference/apis/js-apis-thermal.md @qinxiaowang
zh-cn/application-dev/reference/apis/js-apis-update.md @HelloCrease
zh-cn/application-dev/reference/apis/js-apis-usb.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-colorSpaceManager.mdd @ge-yafang
zh-cn/application-dev/reference/apis/js-apis-vibrator.md @HelloCrease
zh-cn/application-dev/reference/apis/js-apis-appAccount.md @zengyawen
zh-cn/application-dev/reference/apis/js-apis-distributed-account.md @zengyawen
diff --git a/OAT.xml b/OAT.xml
index 8cc884632d4a963fa921c5905cfbf96e7e22edb7..4edf72f5a3b3e03801bdab83dad547cd7c0c18ef 100644
--- a/OAT.xml
+++ b/OAT.xml
@@ -66,7 +66,7 @@
-
+
diff --git a/en/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md b/en/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md
index 01fe1ed68b3eb05341438da3d81270afdc4a92e3..f18f59468d0650400adfb50b87645c763a740b9c 100644
--- a/en/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md
+++ b/en/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md
@@ -22,15 +22,16 @@ import stats from '@ohos.bundleState';
| function queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void | Queries the priority group of this application. This API uses an asynchronous callback to return the result.|
| function queryAppUsagePriorityGroup(): Promise<number>; | Queries the priority group of this application. This API uses a promise to return the result.|
| function isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void | Checks whether the application specified by **bundleName** is in the idle state. |
-| function getRecentlyUsedModules(maxNum? : number, callback: AsyncCallback<BundleActiveModuleInfo>): void | Obtains the number of FA usage records specified by **maxNum**. If **maxNum** is not specified, the default value **1000** is used.|
+| function getRecentlyUsedModules(callback: AsyncCallback<BundleActiveModuleInfo>): void | Obtains the number of FA usage records specified by **1000**.|
+| function getRecentlyUsedModules(maxNum: number, callback: AsyncCallback<BundleActiveModuleInfo>): void | Obtains the number of FA usage records specified by **maxNum**.|
| function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void | Queries the number of notifications from all applications based on the specified start time and end time.|
| function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void | Queries statistics about system events (hibernation, wakeup, unlocking, and screen locking) that occur between the specified start time and end time.|
-| function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<number>): void | Queries the priority group of the application specified by **bundleName**. If **bundleName** is not specified, the priority group of the current application is queried. This API uses an asynchronous callback to return the result.|
+| function queryAppUsagePriorityGroup(bundleName : string, callback: AsyncCallback<number>): void | Queries the priority group of the application specified by **bundleName**. This API uses an asynchronous callback to return the result.|
| function queryAppUsagePriorityGroup(bundleName? : string): Promise<number>; | Queries the priority group of the application specified by **bundleName**. If **bundleName** is not specified, the priority group of the current application is queried. This API uses a promise to return the result.|
| function setBundleGroup(bundleName : string, newGroup: GroupType, callback: AsyncCallback>boolean>): void | Sets the group for the application specified by **bundleName**. This API uses an asynchronous callback to return the result.|
| function setBundleGroup(bundleName : string, newGroup : GroupType): Promise>boolean>; | Sets the group for the application specified by **bundleName**. This API uses a promise to return the result.|
-| function registerGroupCallBack(callback: Callback>BundleActiveGroupCallbackInfo>, callback: AsyncCallback>boolean>): void | Registers a callback for application group changes. When an application group of the user changes, the change is returned to all applications that have registered the callback. This API uses an asynchronous callback to return the result.|
-| function registerGroupCallBack(callback: Callback>BundleActiveGroupCallbackInfo>): Promise>boolean>; | Registers a callback for application group changes. When an application group of the user changes, the change is returned to all applications that have registered the callback. This API uses a promise to return the result.|
+| function registerGroupCallBack(groupCallback: Callback>BundleActiveGroupCallbackInfo>, callback: AsyncCallback>boolean>): void | Registers a callback for application group changes. When an application group of the user changes, the change is returned to all applications that have registered the callback. This API uses an asynchronous callback to return the result.|
+| function registerGroupCallBack(groupCallback: Callback>BundleActiveGroupCallbackInfo>): Promise>boolean>; | Registers a callback for application group changes. When an application group of the user changes, the change is returned to all applications that have registered the callback. This API uses a promise to return the result.|
| function unRegisterGroupCallBack(callback: AsyncCallback>boolean>): void | Deregisters the callback for application group changes. This API uses an asynchronous callback to return the result.|
| function unRegisterGroupCallBack(): Promise>boolean>; | Deregisters the callback for application group changes. This API uses a promise to return the result.|
diff --git a/en/application-dev/device/usb-guidelines.md b/en/application-dev/device/usb-guidelines.md
index ae40bcddfd756caf88d1bc506bfba4b9a8d01a6d..d51625ccb9605fe2fb35b95f71eebc4e1607b753 100644
--- a/en/application-dev/device/usb-guidelines.md
+++ b/en/application-dev/device/usb-guidelines.md
@@ -1,13 +1,13 @@
# USB Service Development
-The USB service provides the following functions: query of USB device list, bulk data transfer, control transfer, and access permission management.
-
## When to Use
In Host mode, you can obtain the list of connected devices, enable or disable the devices, manage device access permissions, and perform data transfer or control transfer.
## APIs
+The USB service provides the following functions: query of USB device list, bulk data transfer, control transfer, and access permission management.
+
The following table lists the USB APIs currently available. For details, see the [API Reference](../reference/apis/js-apis-usb.md).
**Table 1** Open USB APIs
@@ -16,12 +16,12 @@ The following table lists the USB APIs currently available. For details, see the
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| hasRight(deviceName: string): boolean | Checks whether the user, for example, the application or system, has the device access permissions. The value **true** is returned if the user has the device access permissions; the value **false** is returned otherwise. |
| requestRight(deviceName: string): Promise\ | Requests the temporary permission for a given application to access the USB device. |
-| connectDevice(device: USBDevice): Readonly\ | Connects to the USB device based on the device information returned by **getDevices()**. |
+| connectDevice(device: USBDevice): Readonly\ | Connects to the USB device based on the device information returned by `getDevices()`. |
| getDevices(): Array> | Obtains the USB device list. |
| setConfiguration(pipe: USBDevicePipe, config: USBConfig): number | Sets the USB device configuration. |
| setInterface(pipe: USBDevicePipe, iface: USBInterface): number | Sets a USB interface. |
-| claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number | Claims a USB interface |
-| bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise\ | Performs bulk transfer. |
+| claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number | Claims a USB interface. |
+| bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise\ | Performs bulk transfer. |
| closePipe(pipe: USBDevicePipe): number | Closes a USB device pipe. |
| releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number | Releases a USB interface. |
| getFileDescriptor(pipe: USBDevicePipe): number | Obtains the file descriptor. |
@@ -30,7 +30,7 @@ The following table lists the USB APIs currently available. For details, see the
## How to Develop
-You can set a USB device as a host to connect to a device for data transfer. The development procedure is as follows:
+You can set a USB device as the USB host to connect to other USB devices for data transfer. The development procedure is as follows:
1. Obtain the USB device list.
@@ -113,7 +113,7 @@ You can set a USB device as a host to connect to a device for data transfer. The
Claim the corresponding interface from deviceList.
interface1 must be one present in the device configuration.
*/
- usb.claimInterface(pipe , interface1, true);
+ usb.claimInterface(pipe, interface1, true);
```
4. Perform data transfer.
diff --git a/en/application-dev/faqs/Readme-EN.md b/en/application-dev/faqs/Readme-EN.md
index b87a565b6da485ea85add166accd20f25cbb686c..dc45ed9db0eec504b1ff6f535babf11265f2df91 100644
--- a/en/application-dev/faqs/Readme-EN.md
+++ b/en/application-dev/faqs/Readme-EN.md
@@ -1,6 +1,11 @@
# FAQs
- [Ability Framework Development](faqs-ability.md)
+- [Data Management Development](faqs-data-management.md)
+- [File Management Development](faqs-file-management.md)
+- [Graphics and Image Development](faqs-graphics.md)
+- [hdc_std Command Usage](faqs-ide.md)
+- [IDE Usage](faqs-hdc-std.md)
- [ArkUI (JavaScript) Development](faqs-ui-js.md)
- [ArkUI (eTS) Development](faqs-ui-ets.md)
- [Graphics and Image Development](faqs-graphics.md)
@@ -8,6 +13,7 @@
- [Data Management Development](faqs-data-management.md)
- [Device Management Development](faqs-device-management.md)
- [Native API Usage](faqs-native.md)
+- [Network and Connection Development](faqs-connectivity.md)
- [Usage of Third- and Fourth-Party Libraries](faqs-third-party-library.md)
- [Development Board](faqs-development-board.md)
diff --git a/en/application-dev/faqs/faqs-connectivity.md b/en/application-dev/faqs/faqs-connectivity.md
new file mode 100644
index 0000000000000000000000000000000000000000..3b8dea82129c03f0dc12c12296a28b9a0c46c99b
--- /dev/null
+++ b/en/application-dev/faqs/faqs-connectivity.md
@@ -0,0 +1,33 @@
+# Network and Connection Development
+
+
+
+## What are the data formats supported by extraData in an HTTP request?
+
+Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9
+
+**extraData** indicates additional data in an HTTP request. It varies depending on the HTTP request method.
+
+- If the HTTP request uses a POST or PUT method, **extraData** serves as the content of the HTTP request.
+
+- If the HTTP request uses a GET, OPTIONS, DELETE, TRACE, or CONNECT method, **extraData** serves as a supplement to the HTTP request parameters and will be added to the URL when the request is sent.
+
+- If you pass in a string object, **extraData** contains the string encoded on your own.
+
+
+## What does error code 28 mean for an HTTP request?
+
+Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9
+
+Error code 28 refers to **CURLE_OPERATION_TIMEDOUT**, which means a libcurl library operation timeout. For details, see any HTTP status code description available.
+
+Reference: [Development Guide](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-http.md#httpresponse) and [Curl Error Codes](https://curl.se/libcurl/c/libcurl-errors.html)
+
+
+## What does error code 6 mean for the response of \@ohos.net.http.d.ts?
+
+Applicable to: OpenHarmony SDK 3.2.3.5
+
+Error code 6 indicates a failure to resolve the host in the address. You can ping the URL carried in the request to check whether the host is accessible.
+
+Reference: [Development Guide](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-http.md#httpresponse) and [Curl Error Codes](https://curl.se/libcurl/c/libcurl-errors.html)
diff --git a/en/application-dev/faqs/faqs-hdc-std.md b/en/application-dev/faqs/faqs-hdc-std.md
new file mode 100644
index 0000000000000000000000000000000000000000..04c0a202a57b702164b8bcb7a32299d3abd5d75c
--- /dev/null
+++ b/en/application-dev/faqs/faqs-hdc-std.md
@@ -0,0 +1,69 @@
+# hdc_std Command Usage
+
+
+
+## What are the commands commonly used for log management?
+
+Applicable to: OpenHarmony SDK 3.2.2.5
+
+- Clearing logs: hdc_std shell hilog -r
+
+- Increasing the buffer size to 20 MB: hdc_std shell hilog -G 20M
+
+- Capturing logs: hdc_std shell hilog > log.txt
+
+
+## What should I do to avoid log flow control?
+
+Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
+
+- Disabling log flow control: hdc_std shell hilog -Q pidoff
+
+- Disabling the privacy flag: hdc_std shell hilog -p off
+
+- Increasing the log buffer to 200 MB: hdc_std shell hilog -G 200M
+
+- Enabling the log function of the specific domain (that is, disabling the global log function): hdc_std shell hilog –b D –D 0xd0xxxxx
+
+After performing the preceding operations, restart the DevEco Studio.
+
+
+## Is HiLog or Console recommended for log printing? How do I set the domain if HiLog is used?
+
+Applicable to: OpenHarmony SDK 3.2.2.5
+
+[HiLog](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-hilog.md) is recommended for an application to print logs. For details about domain setting, see [Development Guide](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-hilog.md#hilogisloggable).
+
+
+## What is the maximum length of a log record when HiLog is used? Is it configurable?
+
+Applicable to: OpenHarmony SDK 3.2.2.5
+
+The maximum length of a log record is 1,024 characters, and it is not changeable.
+
+
+## What should I do if a HAP package cannot be opened after being installed on the development board using the IDE?
+
+Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
+
+Check whether the SDK version is consistent with the system version on the development board. You are advised to use the SDK version and system version that are released on the same day.
+
+
+## How do I upload files using an hdc command?
+
+Applicable to: OpenHarmony SDK 3.2.2.5
+
+Run the **hdc_std file send** command.
+
+## How do I prevent the screen of the RK3568 development board from turning off?
+
+Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
+
+Run the **hdc_std shell "power-shell setmode 602"** command.
+
+
+## How do I start an ability using an hdc command?
+
+Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
+
+Run the **hdc_std shell aa start -a AbilityName -b bundleName -m moduleName** command.
diff --git a/en/application-dev/faqs/faqs-ide.md b/en/application-dev/faqs/faqs-ide.md
new file mode 100644
index 0000000000000000000000000000000000000000..b4a089c873e1eac856c287e639556dc7facbea50
--- /dev/null
+++ b/en/application-dev/faqs/faqs-ide.md
@@ -0,0 +1,20 @@
+# IDE Usage
+
+
+## What should do if the error message "npm ERR! code SELF_SIGNED_CERT_IN_CHAIN" is displayed?
+
+Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
+
+1. Run **npm config set strict-ssl=false** on the DevEco Studio terminal.
+
+2. Run the **npm install** on the DevEco Studio terminal.
+
+## After manual updating of the DevEco Studio SDK, the error message "Cannot find module 'xxx\ets\x.x.x.x\build-tools\ets-loader\node_modules\webpack\bin\webpack.js'" is displayed during HAP building. What should I do?
+
+Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9
+
+1. Run **npm install** in the **ets\x.x.x.x\build-tools\ets-loader** directory of the SDK.
+
+2. Run **npm install** in the **js\x.x.x.x\build-tools\ace-loader** directory of the SDK.
+
+3. Perform HAP building again.
diff --git a/en/application-dev/faqs/faqs-ui-ets.md b/en/application-dev/faqs/faqs-ui-ets.md
index 61fe069fcf25e8e5ae2a5ff4078a3952ad468447..fd21421cd95edc2bc838b8401724fae10448d9fd 100644
--- a/en/application-dev/faqs/faqs-ui-ets.md
+++ b/en/application-dev/faqs/faqs-ui-ets.md
@@ -14,7 +14,7 @@ Below are the restrictions on using generator functions in TypeScript:
- The generator function cannot contain local variables.
-None of the above restrictions apply to anonymous function implementations of event handlers (such as **onClick**)
+None of the above restrictions apply to anonymous function implementations of event handlers (such as **onClick**).
Negative example:
diff --git a/en/application-dev/media/audio-stream-manager.md b/en/application-dev/media/audio-stream-manager.md
index 9a8176b4bdab20b681ad9b3e96343a2ccfc10829..eb89957e9b8793b149c368445f1232bf0ff3b563 100644
--- a/en/application-dev/media/audio-stream-manager.md
+++ b/en/application-dev/media/audio-stream-manager.md
@@ -117,7 +117,7 @@ This API can be used to obtain the unique ID of the audio stream, UID of the aud
console.info('Address:' + i + ':' + AudioRendererChangeInfo.deviceDescriptors[j].address);
console.info('SampleRates:' + i + ':' + AudioRendererChangeInfo.deviceDescriptors[j].sampleRates[0]);
console.info('ChannelCounts' + i + ':' + AudioRendererChangeInfo.deviceDescriptors[j].channelCounts[0]);
- console.info('ChannnelMask:' + i + ':' + AudioRendererChangeInfo.deviceDescriptors[j].channelMasks);
+ console.info('ChannelMask:' + i + ':' + AudioRendererChangeInfo.deviceDescriptors[j].channelMasks);
}
}
}
diff --git a/en/application-dev/media/remote-camera.md b/en/application-dev/media/remote-camera.md
index 8d9bd0eb7b7568e9cb46dd6c2a37b4380933b0bf..e35950e73b1993b8a446f75e3007a80e4bbaff19 100644
--- a/en/application-dev/media/remote-camera.md
+++ b/en/application-dev/media/remote-camera.md
@@ -5,7 +5,7 @@
You can call the APIs provided by the **Camera** module to develop a distributed camera that provides the basic camera functions such as shooting and video recording.
## How to Develop
-Connect your calculator to a distributed device. Your calculator will call **getCameras()** to obtain the camera list and traverse the returned camera list to check **ConnctionType** of the **Camera** objects. If **ConnctionType** of a **Camera** object is **CAMERA_CONNECTION_REMOTE**, your calculator will use this object to create a **CameraInput** object. The subsequent call process is the same as that of the local camera development. For details about the local camera development, see [Camera Development](./camera.md).
+Connect your calculator to a distributed device. Your calculator will call **getCameras()** to obtain the camera list and traverse the returned camera list to check **ConnectionType** of the **Camera** objects. If **ConnectionType** of a **Camera** object is **CAMERA_CONNECTION_REMOTE**, your calculator will use this object to create a **CameraInput** object. The subsequent call process is the same as that of the local camera development. For details about the local camera development, see [Camera Development](./camera.md).
For details about the APIs, see [Camera Management](../reference/apis/js-apis-camera.md).
diff --git a/en/application-dev/quick-start/package-structure.md b/en/application-dev/quick-start/package-structure.md
index cae1337dea083ff731be54f0536fa33f6fd64812..076bc9474ba724746938c1a4da837a3679c73d5a 100644
--- a/en/application-dev/quick-start/package-structure.md
+++ b/en/application-dev/quick-start/package-structure.md
@@ -232,7 +232,6 @@ Table 11 Internal structure of the module tag
| distroFilter | Application distribution rules. AppGallery uses these rules to distribute HAP files to the matching devices. Distribution rules cover three factors: API version, screen shape, and screen resolution. AppGallery distributes a HAP file to the device whose on the mapping between **deviceType** and these three factors. For details, see Table 29. | Object | Yes (initial value: left empty) Set this attribute when an application has multiple entry modules. |
| reqCapabilities | Device capabilities required for running the application. | String array| Yes (initial value: left empty) |
| commonEvents | Static broadcast. For details, see Table 35. | Object array | Yes (initial value: left empty) |
-| allowClassMap | Metadata of the HAP file. The value can be **true** or **false**. If the value is **true**, the HAP file uses the Java object proxy mechanism provided by the OpenHarmony framework. | Boolean | No (initial value: **false**) |
| entryTheme | Keyword of an OpenHarmony internal theme. Set it to the resource index of the name.| String | Yes (initial value: left empty) |
Example of the **module** tag structure:
@@ -348,7 +347,7 @@ Table 17 Internal structure of the abilities attribute
| Attribute | Description | Data Type | Initial Value Allowed |
| ---------------- | ------------------------------------------------------------ | ---------- | -------------------------------------------------------- |
| process | Name of the process running the application or ability. If the **process** attribute is configured in the **deviceConfig** tag, all abilities of the application run in this process. You can set the **process** attribute for a specific ability in the **abilities** attribute, so that the ability can run in the particular process. If this attribute is set to the name of the process running other applications, all these applications can run in the same process, provided they have the same unified user ID and the same signature. Devices running OpenHarmony do not support this attribute.| String | Yes (initial value: left empty) |
-| name | Name of the ability. The value is a reverse domain name, in the format of "*Bundle name*.*Class name*", for example, **"com.example.myapplication.MainAbility"**. Alternatively, the value can start with a period (.) followed by the class name, for example, **".MainAbility"**. The ability name must be unique in an application. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types. Note: When you use DevEco Studio to create a project, the configuration of the first ability is generated by default, including the **MainAbility.java** file and the class name **MainAbility** defaulted in the **name** string for the **abilities** attribute in **config.json**. The value of this attribute can be customized if you use other IDE tools. The value can contain a maximum of 127 characters.| String | No |
+| name | Name of the ability. The value is a reverse domain name, in the format of "*Bundle name*.*Class name*", for example, **"com.example.myapplication.MainAbility"**. Alternatively, the value can start with a period (.) followed by the class name, for example, **".MainAbility"**. The ability name must be unique in an application. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types. Note: If you use DevEco Studio to create the project, an ability named **MainAbility** will be created together with the default configuration in the **config.json** file. The value of this attribute can be customized if you use other IDE tools. The value can contain a maximum of 127 characters.| String | No |
| description | Description of the ability. The value can be a string or a resource index to descriptions in multiple languages. The value can contain a maximum of 255 characters.| String | Yes (initial value: left empty) |
| icon | Index to the ability icon file. Example value: **$media:ability_icon**. In the **skills** attribute of the ability, if the **actions** value contains **action.system.home** and the **entities** value contains **entity.system.home**, the icon of the ability is also used as the icon of the application. If multiple abilities address this condition, the icon of the first candidate ability is used as the application icon. Note: The **icon** and **label** values of an application are visible to users. Ensure that at least one of them is different from any existing icons or labels.| String | Yes (initial value: left empty) |
| label | Ability name visible to users. The value can be a name string or a resource index to names in multiple languages. In the **skills** attribute of the ability, if the **actions** value contains **action.system.home** and the **entities** value contains **entity.system.home**, the label of the ability is also used as the label of the application. If multiple abilities address this condition, the label of the first candidate ability is used as the application label. Note: The **icon** and **label** values of an application are visible to users. Ensure that at least one of them is different from any existing icons or labels. The value can be a reference to a string defined in a resource file or a string enclosed in brackets ({}). The value can contain a maximum of 255 characters.| String | Yes (initial value: left empty) |
@@ -372,7 +371,7 @@ Table 17 Internal structure of the abilities attribute
| supportPipMode | Whether the ability allows the user to enter the Picture in Picture (PiP) mode. The PiP mode enables the user to watch a video in a small window that hovers on top of a full screen window (main window). This attribute applies only to the ability using the Page template. This attribute applies only to the default, tablet, smart TV, head unit, and wearable device types.| Boolean | Yes (initial value: **false**) |
| formsEnabled | Whether the ability can provide forms. This attribute applies only to the ability using the Page template. **true**: This ability can provide forms. **false**: This ability cannot provide forms.| Boolean | Yes (initial value: **false**) |
| forms | Details about the forms used by the ability. This attribute is valid only when **formsEnabled** is set to **true**. For details, see Table 27.| Object array | Yes (initial value: left empty) |
-| srcLanguage | Programming language used to develop the ability. | String | The value can be **java**, **js**, or **ets**. |
+| srcLanguage | Programming language used to develop the ability. | String | The value can be **js**, or **ets**. |
| srcPath | Path of the JS code and components corresponding to the ability. | String | Yes (initial value: left empty) |
| uriPermission | Application data that the ability can access. This attribute consists of the **mode** and **path** sub-attributes. This attribute is valid only for the capability of the type provider. Devices running OpenHarmony do not support this attribute. For details, see Table 18.| Object | Yes (initial value: left empty) |
| startWindowIcon | Index to the icon file of the ability startup page. Example value: **$media:icon**. | String | Yes (initial value: left empty) |
@@ -587,12 +586,10 @@ Table 27 Internal structure of the forms attribute
| name | Class name of the widget. The value is a string with a maximum of 127 bytes. | String | No |
| description | Description of the widget. The value can be a string or a resource index to descriptions in multiple languages. The value is a string with a maximum of 255 bytes.| String | Yes (initial value: left empty) |
| isDefault | Whether the widget is a default one. Each ability has only one default widget. **true**: The widget is the default one. **false**: The widget is not the default one.| Boolean | No |
-| type | Type of the widget. Available values are as follows: **Java**: indicates a Java-programmed widget. **JS**: indicates a JavaScript-programmed widget.| String | No |
+| type | Type of the widget. Available values are as follows: **JS**: indicates a JavaScript-programmed widget.| String | No |
| colorMode | Color mode of the widget. Available values are as follows: **auto**: The widget adopts the auto-adaptive color mode. **dark**: The widget adopts the dark color mode. **light**: The widget adopts the light color mode.| String | Yes (initial value: **auto**)|
| supportDimensions | Grid styles supported by the widget. Available values are as follows: 1 * 2: indicates a grid with one row and two columns. 2 * 2: indicates a grid with two rows and two columns. 2 * 4: indicates a grid with two rows and four columns. 4 * 4: indicates a grid with four rows and four columns.| String array| No |
| defaultDimension | Default grid style of the widget. The value must be available in the **supportDimensions** array of the widget.| String | No |
-| landscapeLayouts | Landscape layouts for the grid styles. Values in this array must correspond to the values in the **supportDimensions** array. This field is required only by Java-programmed widgets.| String array| No |
-| portraitLayouts | Portrait layouts for the grid styles. Values in this array must correspond to the values in the **supportDimensions** array. This field is required only by Java-programmed widgets.| String array| No |
| updateEnabled | Whether the widget can be updated periodically. Available values are as follows: **true**: The widget can be updated periodically, depending on the update way you select, either at a specified interval (**updateDuration**) or at the scheduled time (**scheduledUpdateTime**). **updateDuration** is preferentially recommended. **false**: The widget cannot be updated periodically.| Boolean | No |
| scheduledUpdateTime | Scheduled time to update the widget. The value is in 24-hour format and accurate to minute. | String | Yes (initial value: **0:0**) |
| updateDuration | Interval to update the widget. The value is a natural number, in the unit of 30 minutes. If the value is **0**, this field does not take effect. If the value is a positive integer ***N***, the interval is calculated by multiplying ***N*** and 30 minutes.| Number | Yes (initial value: **0**) |
@@ -632,9 +629,9 @@ Example of the **forms** attribute structure:
]
},
{
- "name": "Form_Java",
- "description": "It's Java Form",
- "type": "Java",
+ "name": "Form_JS",
+ "description": "It's JS Form",
+ "type": "JS",
"colorMode": "auto",
"isDefault": false,
"updateEnabled": true,
diff --git a/en/application-dev/quick-start/start-with-ets-fa.md b/en/application-dev/quick-start/start-with-ets-fa.md
index 325f4983f16f0cd48899fb657d3c9e41d2f9c3d8..03ed574bb99bcd65cecf0c6ca4710ab2271db9d3 100644
--- a/en/application-dev/quick-start/start-with-ets-fa.md
+++ b/en/application-dev/quick-start/start-with-ets-fa.md
@@ -187,7 +187,7 @@
## Implementing Page Redirection
-You can implement page redirection through the page router, which finds the target page based on the page URL. Import the **router** module and then perform the steps below:
+You can implement page redirection through the [page router](../reference/apis/js-apis-router.md#routerpush), which finds the target page based on the page URL. Import the **router** module and then perform the steps below:
1. Implement redirection from the first page to the second page.
diff --git a/en/application-dev/quick-start/start-with-ets-stage.md b/en/application-dev/quick-start/start-with-ets-stage.md
index 7c623151a90c6f7fe278ee9354ff3232456b6026..b6b8cd11b8ba18b59931c1bf0244d4af3d7ec888 100644
--- a/en/application-dev/quick-start/start-with-ets-stage.md
+++ b/en/application-dev/quick-start/start-with-ets-stage.md
@@ -185,7 +185,7 @@
## Implementing Page Redirection
-You can implement page redirection through the page router, which finds the target page based on the page URL. Import the **router** module and then perform the steps below:
+You can implement page redirection through the [page router](../reference/apis/js-apis-router.md#routerpush), which finds the target page based on the page URL. Import the **router** module and then perform the steps below:
1. Implement redirection from the first page to the second page.
diff --git a/en/application-dev/quick-start/start-with-js-fa.md b/en/application-dev/quick-start/start-with-js-fa.md
index dbd2931eba6f6de6c6d23777a5c761dc505dc7c4..03b037aeb529dcf7d481caf56db32625943c055b 100644
--- a/en/application-dev/quick-start/start-with-js-fa.md
+++ b/en/application-dev/quick-start/start-with-js-fa.md
@@ -181,7 +181,7 @@
## Implementing Page Redirection
-You can implement page redirection through the [page router](../ui/ui-js-building-ui-routes.md), which finds the target page based on the page URL. Import the **router** module and then perform the steps below:
+You can implement page redirection through the [page router](../reference/apis/js-apis-router.md#routerpush), which finds the target page based on the page URL. Import the **router** module and then perform the steps below:
1. Implement redirection from the first page to the second page.
diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md
index fe77dc5347f70c5cbcef596dbd8c3b57df83d9cc..e580b6bbef7bd71869de1da19a3a3d5c4757370d 100644
--- a/en/application-dev/reference/apis/Readme-EN.md
+++ b/en/application-dev/reference/apis/Readme-EN.md
@@ -146,6 +146,7 @@
- [@ohos.privacyManager](js-apis-privacyManager.md)
- [@ohos.security.huks ](js-apis-huks.md)
- [@ohos.userIAM.userAuth ](js-apis-useriam-userauth.md)
+ - [@ohos.userIAM.faceAuth](js-apis-useriam-faceauth.md)
- [@system.cipher](js-apis-system-cipher.md)
- Data Management
diff --git a/en/application-dev/reference/apis/js-apis-bluetooth.md b/en/application-dev/reference/apis/js-apis-bluetooth.md
index e7bcef69308231e54d2786e4324969a3b0444923..eb54d689022397f603f9d93d2cc8591d9d1cdc82 100644
--- a/en/application-dev/reference/apis/js-apis-bluetooth.md
+++ b/en/application-dev/reference/apis/js-apis-bluetooth.md
@@ -1,6 +1,6 @@
# Bluetooth
-The Bluetooth module provides classic Bluetooth capabilities and Bluetooth Low Energy (BLE) scan and advertising.
+The **Bluetooth** module provides classic Bluetooth capabilities and Bluetooth Low Energy (BLE) scan and advertising.
> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -281,7 +281,7 @@ let remoteDeviceName = bluetooth.getRemoteDeviceName("XX:XX:XX:XX:XX:XX");
getRemoteDeviceClass(deviceId: string): DeviceClass
-Obtains the type of the remote Bluetooth device.
+Obtains the class of the remote Bluetooth device.
**Required permissions**: ohos.permission.USE_BLUETOOTH
@@ -297,7 +297,7 @@ Obtains the type of the remote Bluetooth device.
| Type | Description |
| --------------------------- | -------- |
-| [DeviceClass](#deviceclass) | Type of a remote device obtained.|
+| [DeviceClass](#deviceclass) | Class of the remote device obtained.|
**Example**
@@ -389,7 +389,7 @@ startBluetoothDiscovery(): boolean
Starts Bluetooth scan to discover remote devices.
-**Required permissions**: ohos.permission.DISCOVER_BLUETOOTH and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.DISCOVER_BLUETOOTH and ohos.permission.LOCATION
**System capability**: SystemCapability.Communication.Bluetooth.Core
@@ -515,7 +515,7 @@ Unsubscribes from the Bluetooth device discovery events.
| Name | Type | Mandatory | Description |
| -------- | ----------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **bluetoothDeviceFind** indicates an event reported when a Bluetooth device is discovered. |
-| callback | Callback<Array<string>> | No | Callback used to report the discovered devices. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<Array<string>> | No | Callback for the **bluetoothDeviceFind** event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -578,7 +578,7 @@ Unsubscribes from the pairing request events of the remote Bluetooth device.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **pinRequired** indicates a pairing request event. |
-| callback | Callback<[PinRequiredParam](#pinrequiredparam)> | No | Callback used to report the Bluetooth pairing request. The input parameter is the pairing request parameter. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<[PinRequiredParam](#pinrequiredparam)> | No | Callback for the Bluetooth pairing request event. The input parameter is the pairing request parameter. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -599,7 +599,7 @@ bluetooth.off('pinRequired', onReceiveEvent);
on(type: "bondStateChange", callback: Callback<BondStateParam>): void
-Subscribes to the Bluetooth bond state change events.
+Subscribes to the Bluetooth pairing state change events.
**Required permissions**: ohos.permission.USE_BLUETOOTH
@@ -609,8 +609,8 @@ Subscribes to the Bluetooth bond state change events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ------------------------------------ |
-| type | string | Yes | Event type. The value **bondStateChange** indicates a Bluetooth bond state change event.|
-| callback | Callback<[BondStateParam](#BondStateParam)> | Yes | Callback invoked to return the bond state. You need to implement this callback. |
+| type | string | Yes | Event type. The value **bondStateChange** indicates a Bluetooth pairing state change event.|
+| callback | Callback<[BondStateParam](#BondStateParam)> | Yes | Callback invoked to return the pairing state. You need to implement this callback. |
**Return value**
@@ -619,7 +619,7 @@ No value is returned.
**Example**
```js
-function onReceiveEvent(data) { // data, as the input parameter of the callback, indicates the bond state.
+function onReceiveEvent(data) { // data, as the input parameter of the callback, indicates the pairing state.
console.info('pair state = '+ JSON.stringify(data));
}
bluetooth.on('bondStateChange', onReceiveEvent);
@@ -630,7 +630,7 @@ bluetooth.on('bondStateChange', onReceiveEvent);
off(type: "bondStateChange", callback?: Callback<BondStateParam>): void
-Unsubscribes from the Bluetooth bond state change events.
+Unsubscribes from the Bluetooth pairing state change events.
**Required permissions**: ohos.permission.USE_BLUETOOTH
@@ -640,8 +640,8 @@ Unsubscribes from the Bluetooth bond state change events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
-| type | string | Yes | Event type. The value **bondStateChange** indicates a Bluetooth bond state change event. |
-| callback | Callback<[BondStateParam](#BondStateParam)> | No | Callback used to report the change of the Bluetooth bond state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| type | string | Yes | Event type. The value **bondStateChange** indicates a Bluetooth pairing state change event. |
+| callback | Callback<[BondStateParam](#BondStateParam)> | No | Callback for the change of the Bluetooth pairing state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -704,7 +704,7 @@ Unsubscribes from the Bluetooth connection state change events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **stateChange** indicates a Bluetooth connection state change event. |
-| callback | Callback<[BluetoothState](#bluetoothstate)> | No | Callback used to report the Bluetooth connection state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<[BluetoothState](#bluetoothstate)> | No | Callback for the Bluetooth connection state change event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -990,7 +990,7 @@ Unsubscribes from the SPP read request events.
| ------------ | --------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **sppRead** indicates an SPP read request event. |
| clientSocket | number | Yes | Client socket ID, which is obtained by **sppAccept** or **sppConnect**. |
-| callback | Callback<ArrayBuffer> | No | Callback used to report an SPP read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<ArrayBuffer> | No | Callback for the SPP read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -1248,7 +1248,7 @@ Unsubscribes from the BLE device discovery events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **BLEDeviceFind** indicates an event reported when a BLE device is discovered. |
-| callback | Callback<Array<[ScanResult](#scanresult)>> | No | Callback used to report the discovered devices. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<Array<[ScanResult](#scanresult)>> | No | Callback for the **BLEDeviceFind** event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -1558,7 +1558,7 @@ Subscribes to the HFP connection state change events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **connectionStateChange** indicates an HFP connection state change event.|
-| callback | Callback<[StateChangeParam](#StateChangeParam)> | Yes | Callback used to return the HFP connection state change event. |
+| callback | Callback<[StateChangeParam](#StateChangeParam)> | Yes | Callback invoked to return the HFP connection state change event. |
**Return value**
@@ -1588,7 +1588,7 @@ Unsubscribes from the HFP connection state change events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **connectionStateChange** indicates an HFP connection state change event.|
-| callback | Callback<[StateChangeParam](#StateChangeParam)> | No | Callback used to return the HFP connection state change event. |
+| callback | Callback<[StateChangeParam](#StateChangeParam)> | No | Callback for the HFP connection state change event. |
**Return value**
@@ -1718,7 +1718,7 @@ Unsubscribes from the HidHost connection state change events.
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------- | ---- | --------------------------------------------------------- |
| type | string | Yes | Event type. The value **connectionStateChange** indicates a HidHost connection state change event.|
-| callback | Callback<[StateChangeParam](#StateChangeParam)> | No | Callback used to return the HidHost connection state change event. |
+| callback | Callback<[StateChangeParam](#StateChangeParam)> | No | Callback for the HidHost connection state change event. |
**Return value**
@@ -1786,7 +1786,7 @@ Subscribes to the PAN connection state change events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **connectionStateChange** indicates a PAN connection state change event.|
-| callback | Callback<[StateChangeParam](#StateChangeParam)> | Yes | Callback used to return the PAN connection state change event. |
+| callback | Callback<[StateChangeParam](#StateChangeParam)> | Yes | Callback invoked to return the PAN connection state change event. |
**Return value**
@@ -1816,7 +1816,7 @@ Unsubscribes from the PAN connection state change events.
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------- | ---- | --------------------------------------------------------- |
| type | string | Yes | Event type. The value **connectionStateChange** indicates a PAN connection state change event.|
-| callback | Callback<[StateChangeParam](#StateChangeParam)> | No | Callback used to return the PAN connection state change event. |
+| callback | Callback<[StateChangeParam](#StateChangeParam)> | No | Callback for the PAN connection state change event. |
**Return value**
@@ -2061,10 +2061,9 @@ Removes a service from this GATT server.
**Return value**
-| | |
+| Type | Description |
| ------- | -------------------------- |
-| Type | Description |
-| boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example**
@@ -2111,10 +2110,9 @@ Notifies the connected client device when a characteristic value changes.
**Return value**
-| | |
+| Type | Description |
| ------- | ------------------------ |
-| Type | Description |
-| boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example**
@@ -2156,10 +2154,9 @@ Sends a response to a read or write request from the GATT client.
**Return value**
-| | |
+| Type | Description |
| ------- | -------------------------- |
-| Type | Description |
-| boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example**
@@ -2249,7 +2246,7 @@ Unsubscribes from the characteristic read request events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **characteristicRead** indicates a characteristic read request event. |
-| callback | Callback<[CharacteristicReadReq](#characteristicreadreq)> | No | Callback used to report a characteristic read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<[CharacteristicReadReq](#characteristicreadreq)> | No | Callback for the characteristic read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -2329,7 +2326,7 @@ Unsubscribes from the characteristic write request events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **characteristicWrite** indicates a characteristic write request event. |
-| callback | Callback<[CharacteristicWriteReq](#characteristicwritereq)> | No | Callback used to report a characteristic write request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<[CharacteristicWriteReq](#characteristicwritereq)> | No | Callback for the characteristic write request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -2406,7 +2403,7 @@ Unsubscribes from the descriptor read request events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **descriptorRead** indicates a descriptor read request event. |
-| callback | Callback<[DescriptorReadReq](#descriptorreadreq)> | No | Callback used to report a descriptor read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<[DescriptorReadReq](#descriptorreadreq)> | No | Callback for the descriptor read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -2486,7 +2483,7 @@ Unsubscribes from the descriptor write request events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **descriptorWrite** indicates a descriptor write request event. |
-| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | No | Callback used to report a descriptor write request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | No | Callback for the descriptor write request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -2499,6 +2496,7 @@ let gattServer = bluetooth.BLE.createGattServer();
gattServer.off("descriptorWrite");
```
+
### on('connectStateChange')
on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void
@@ -2548,7 +2546,7 @@ Unsubscribes from the BLE connection state change events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **connectStateChange** indicates a BLE connection state change event.|
-| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | No | Callback used to report the BLE connection state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | No | Callback for the BLE connection state change event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -2785,10 +2783,9 @@ Reads the characteristic value of the specific service of the remote BLE device.
**Return value**
-| | |
+| Type | Description |
| ---------------------------------------- | -------------------------- |
-| Type | Description |
-| Promise<[BLECharacteristic](#blecharacteristic)> | Promise used to return the characteristic value read. |
+| Promise<[BLECharacteristic](#blecharacteristic)> | Promise used to return the characteristic value read.|
**Example**
@@ -2876,10 +2873,9 @@ Reads the descriptor contained in the specific characteristic of the remote BLE
**Return value**
-| | |
+| Type | Description |
| ---------------------------------------- | -------------------------- |
-| Type | Description |
-| Promise<[BLEDescriptor](#bledescriptor)> | Promise used to return the descriptor read. |
+| Promise<[BLEDescriptor](#bledescriptor)> | Promise used to return the descriptor read.|
**Example**
@@ -2990,7 +2986,7 @@ if (retWriteDesc) {
setBLEMtuSize(mtu: number): boolean
-Sets the maximum transmission unit (MTU) that can be transmitted between the GATT client and its remote BLE device. This method can be used only after a connection is set up by calling [connect](#connect).
+Sets the maximum transmission unit (MTU) that can be transmitted between the GATT client and its remote BLE device. This API can be used only after a connection is set up by calling [connect](#connect).
**Required permissions**: ohos.permission.USE_BLUETOOTH
@@ -3108,7 +3104,7 @@ Unsubscribes from the BLE characteristic change events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **BLECharacteristicChange** indicates a characteristic value change event.|
-| callback | Callback<[BLECharacteristic](#blecharacteristic)> | No | Callback used to report the characteristic value. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<[BLECharacteristic](#blecharacteristic)> | No | Callback for the characteristic value change event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -3170,7 +3166,7 @@ Unsubscribes from the BLE connection state change events.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **BLEConnectionStateChange** indicates a BLE connection state change event.|
-| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | No | Callback used to report the BLE connection state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
+| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | No | Callback for the BLE connection state change event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value**
@@ -3671,13 +3667,13 @@ Defines the pairing request parameters.
## BondStateParam8+
-Defines the bond state parameters.
+Defines the pairing state parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core
| Name | Type | Readable | Writable | Description |
| -------- | ------ | ---- | ---- | ----------- |
-| deviceId | string | Yes | No | ID of the device.|
+| deviceId | string | Yes | No | ID of the device to pair.|
| state | BondState | Yes | No | State of the device.|
diff --git a/en/application-dev/reference/apis/js-apis-call.md b/en/application-dev/reference/apis/js-apis-call.md
index ac82d0b2e610751bd000849ec35337363b0dcb3a..9b20ccb9f359ed6f8109d3fc57fdebd9d4d728ed 100644
--- a/en/application-dev/reference/apis/js-apis-call.md
+++ b/en/application-dev/reference/apis/js-apis-call.md
@@ -824,11 +824,8 @@ This is a system API.
**Example**
```js
-let promise = call.reject(1);
-promise.then(data => {
- console.log(`reject success, promise: data->${JSON.stringify(data)}`);
-}).catch(err => {
- console.error(`reject fail, promise: err->${JSON.stringify(err)}`);
+call.reject(1, (error, data) => {
+ console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
diff --git a/en/application-dev/reference/apis/js-apis-commonEvent.md b/en/application-dev/reference/apis/js-apis-commonEvent.md
index 710d6ccb8820e88ed98e3519c36824efdd5e5b17..50fad38058530104fda01f09d5745c0f8051000a 100644
--- a/en/application-dev/reference/apis/js-apis-commonEvent.md
+++ b/en/application-dev/reference/apis/js-apis-commonEvent.md
@@ -66,15 +66,11 @@ Provides the event types supported by the **CommonEvent** module. The name and v
| COMMON_EVENT_USER_STARTED | usual.event.USER_STARTED | - | Indicates the common event that the user has been started. |
| COMMON_EVENT_USER_BACKGROUND | usual.event.USER_BACKGROUND | - | Indicates the common event that the user has been brought to the background. |
| COMMON_EVENT_USER_FOREGROUND | usual.event.USER_FOREGROUND | - | Indicates the common event that the user has been brought to the foreground. |
-| COMMON_EVENT_USER_SWITCHED | usual.event.USER_SWITCHED | ohos.permission.MANAGE_USERS | Indicates the common event that user switching is happening. |
-| COMMON_EVENT_USER_STARTING | usual.event.USER_STARTING | ohos.permission.INTERACT_ACROSS_USERS | Indicates the common event that the user is going to be started. |
+| COMMON_EVENT_USER_SWITCHED | usual.event.USER_SWITCHED | ohos.permission.MANAGE_LOCAL_ACCOUNTS | Indicates the common event that user switching is happening. |
+| COMMON_EVENT_USER_STARTING | usual.event.USER_STARTING | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | Indicates the common event that the user is going to be started. |
| COMMON_EVENT_USER_UNLOCKED | usual.event.USER_UNLOCKED | - | Indicates the common event that the credential-encrypted storage has been unlocked for the current user when the device is unlocked after being restarted. |
-| COMMON_EVENT_USER_STOPPING | usual.event.USER_STOPPING | ohos.permission.INTERACT_ACROSS_USERS | Indicates the common event that the user is going to be stopped. |
+| COMMON_EVENT_USER_STOPPING | usual.event.USER_STOPPING | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | Indicates the common event that the user is going to be stopped. |
| COMMON_EVENT_USER_STOPPED | usual.event.USER_STOPPED | - | Indicates the common event that the user has been stopped. |
-| COMMON_EVENT_HWID_LOGIN | common.event.HWID_LOGIN | - | Indicates the common event about a HUAWEI ID login. |
-| COMMON_EVENT_HWID_LOGOUT | common.event.HWID_LOGOUT | - | Indicates the common event about a HUAWEI ID logout. |
-| COMMON_EVENT_HWID_TOKEN_INVALID | common.event.HWID_TOKEN_INVALID | - | Indicates the common event that the HUAWEI ID is invalid. |
-| COMMON_EVENT_HWID_LOGOFF | common.event.HWID_LOGOFF | - | Indicates the common event about a HUAWEI ID logoff. |
| COMMON_EVENT_WIFI_POWER_STATE | usual.event.wifi.POWER_STATE | - | Indicates the common event about the Wi-Fi network state, such as enabled and disabled. |
| COMMON_EVENT_WIFI_SCAN_FINISHED | usual.event.wifi.SCAN_FINISHED | ohos.permission.LOCATION | Indicates the common event that the Wi-Fi access point has been scanned and proven to be available. |
| COMMON_EVENT_WIFI_RSSI_VALUE | usual.event.wifi.RSSI_VALUE | ohos.permission.GET_WIFI_INFO | Indicates the common event that the Wi-Fi signal strength (RSSI) has changed. |
@@ -133,8 +129,8 @@ Provides the event types supported by the **CommonEvent** module. The name and v
| COMMON_EVENT_CHARGING | usual.event.CHARGING | - | Indicates the common event that the system starts charging the battery. |
| COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED | usual.event.DEVICE_IDLE_MODE_CHANGED | - | Indicates the common event that the system idle mode has changed. |
| COMMON_EVENT_POWER_SAVE_MODE_CHANGED | usual.event.POWER_SAVE_MODE_CHANGED | - | Indicates the common event that the power saving mode of the system has changed. |
-| COMMON_EVENT_USER_ADDED | usual.event.USER_ADDED | ohos.permission.MANAGE_USERS | Indicates the common event that a user has been added to the system. |
-| COMMON_EVENT_USER_REMOVED | usual.event.USER_REMOVED | ohos.permission.MANAGE_USERS | Indicates the common event that a user has been removed from the system. |
+| COMMON_EVENT_USER_ADDED | usual.event.USER_ADDED | ohos.permission.MANAGE_LOCAL_ACCOUNTS | Indicates the common event that a user has been added to the system. |
+| COMMON_EVENT_USER_REMOVED | usual.event.USER_REMOVED | ohos.permission.MANAGE_LOCAL_ACCOUNTS | Indicates the common event that a user has been removed from the system. |
| COMMON_EVENT_ABILITY_ADDED | usual.event.ABILITY_ADDED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been added. |
| COMMON_EVENT_ABILITY_REMOVED | usual.event.ABILITY_REMOVED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been removed. |
| COMMON_EVENT_ABILITY_UPDATED | usual.event.ABILITY_UPDATED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been updated. |
diff --git a/en/application-dev/reference/apis/js-apis-deque.md b/en/application-dev/reference/apis/js-apis-deque.md
index 8d9a9c1b42bef6ce74fdfb21a8033b80e68c1868..ea8803f444dca95990cb00a015bfbad12f590639 100644
--- a/en/application-dev/reference/apis/js-apis-deque.md
+++ b/en/application-dev/reference/apis/js-apis-deque.md
@@ -8,7 +8,7 @@ Double-ended queue (deque) is a sequence container implemented based on the queu
**Queue** follows the principle of FIFO only and allows element removal at the front and insertion at the rear.
-**Vector** supports insertion and deletion of elements in between, as well asat both the ends. When compared with **Vector**, **Deque** is more efficient in inserting and removing header elements, but less efficient in accessing elements.
+**Vector** supports insertion and deletion of elements in between, as well as at both the ends. When compared with **Vector**, **Deque** is more efficient in inserting and removing header elements, but less efficient in accessing elements.
**Recommended use case**: Use **Deque** when you need to frequently insert or remove elements at both the ends of a container.
diff --git a/en/application-dev/reference/apis/js-apis-deviceUsageStatistics.md b/en/application-dev/reference/apis/js-apis-deviceUsageStatistics.md
index 8d18622ce2eb432210858545308e2a607891b1f0..81ee6f74b796de60b190f06b3f2a8a719f8569c3 100644
--- a/en/application-dev/reference/apis/js-apis-deviceUsageStatistics.md
+++ b/en/application-dev/reference/apis/js-apis-deviceUsageStatistics.md
@@ -484,9 +484,9 @@ Obtains the number of FA usage records specified by **maxNum**. This API uses a
## bundleState.getRecentlyUsedModules9+
-getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback<Array<BundleActiveModuleInfo>>): void
+getRecentlyUsedModules(callback: AsyncCallback<Array<BundleActiveModuleInfo>>): void
-Obtains the number of FA usage records specified by **maxNum**. This API uses an asynchronous callback to return the records sorted by time (most recent first).
+This API uses an asynchronous callback to return at most 1000 records sorted by time (most recent first).
**Required permissions**: ohos.permission.BUNDLE_ACTIVE_INFO
@@ -498,13 +498,12 @@ Obtains the number of FA usage records specified by **maxNum**. This API uses an
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------------------------------- |
-| maxNum | number | No | Maximum number of returned records. The maximum and default value is **1000**. If this parameter is not specified, **1000** is used. |
| callback | AsyncCallback<Array<[BundleActiveModuleInfo](#bundleactivemoduleinfo9)>> | Yes | Callback used to return the result.|
**Example**
```js
- bundleState.getRecentlyUsedModules(1000,(err, res) => {
+ bundleState.getRecentlyUsedModules((err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE getRecentlyUsedModules callback failed, because: ' + err.code);
} else {
@@ -513,11 +512,33 @@ Obtains the number of FA usage records specified by **maxNum**. This API uses an
console.log('BUNDLE_ACTIVE getRecentlyUsedModules callback number : ' + (i + 1));
console.log('BUNDLE_ACTIVE getRecentlyUsedModules callback result ' + JSON.stringify(res[i]));
}
- }
+ }
});
+ ```
- // Invocation when maxNum is not passed
- bundleState.getRecentlyUsedModules((err, res) => {
+## bundleState.getRecentlyUsedModules9+
+
+getRecentlyUsedModules(maxNum: number, callback: AsyncCallback<Array<BundleActiveModuleInfo>>): void
+
+Obtains the number of FA usage records specified by **maxNum**. This API uses an asynchronous callback to return the records sorted by time (most recent first).
+
+**Required permissions**: ohos.permission.BUNDLE_ACTIVE_INFO
+
+**System capability**: SystemCapability.ResourceSchedule.UsageStatistics.App
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------------------- | ---- | ----------------------------------- |
+| maxNum | number | Yes | Maximum number of returned records. The maximum and default value is **1000**.|
+| callback | AsyncCallback<Array<[BundleActiveModuleInfo](#bundleactivemoduleinfo9)>> | Yes | Callback used to return the result.|
+
+**Example**
+
+ ```js
+ bundleState.getRecentlyUsedModules(1000,(err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE getRecentlyUsedModules callback failed, because: ' + err.code);
} else {
@@ -526,7 +547,7 @@ Obtains the number of FA usage records specified by **maxNum**. This API uses an
console.log('BUNDLE_ACTIVE getRecentlyUsedModules callback number : ' + (i + 1));
console.log('BUNDLE_ACTIVE getRecentlyUsedModules callback result ' + JSON.stringify(res[i]));
}
- }
+ }
});
```
@@ -574,9 +595,9 @@ bundleState.queryAppUsagePriorityGroup().then( res => {
## bundleState.queryAppUsagePriorityGroup9+
-queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<number>): void
+queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void
-Queries the priority group of the application specified by **bundleName**. If **bundleName** is not specified, the priority group of the current application is queried. This API uses an asynchronous callback to return the result.
+Queries the priority group of the current application . This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.BUNDLE_ACTIVE_INFO
@@ -588,23 +609,44 @@ Queries the priority group of the application specified by **bundleName**. If **
| Name | Type | Mandatory | Description |
| ---------- | --------------------- | ---- | ---------------------------------------- |
-| bundleName | string | No | Bundle name of the target application. If this parameter is not specified, the priority group of the current application is queried.|
| callback | AsyncCallback<number> | Yes | Callback used to return the result. |
**Example**
```javascript
-// Callback with bundleName
-let bundleName = "com.ohos.camera";
-bundleState.queryAppUsagePriorityGroup(bundleName, (err, res) => {
+bundleState.queryAppUsagePriorityGroup((err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE QueryPackageGroup callback failed. because: ' + err.code);
} else {
console.log('BUNDLE_ACTIVE QueryPackageGroup callback succeeded. result: ' + JSON.stringify(res));
}
});
-// Callback without bundleName
-bundleState.queryAppUsagePriorityGroup((err, res) => {
+```
+
+## bundleState.queryAppUsagePriorityGroup9+
+
+queryAppUsagePriorityGroup(bundleName : string, callback: AsyncCallback<number>): void
+
+Queries the priority group of the application specified by **bundleName**. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.BUNDLE_ACTIVE_INFO
+
+**System capability**: SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
+
+**System API**: This is a system API and cannot be called by third-party applications.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---------- | --------------------- | ---- | ---------------------------------------- |
+| bundleName | string | Yes | Bundle name of the target application.|
+| callback | AsyncCallback<number> | Yes | Callback used to return the result. |
+
+**Example**
+
+```javascript
+let bundleName = "com.ohos.camera";
+bundleState.queryAppUsagePriorityGroup(bundleName, (err, res) => {
if(err) {
console.log('BUNDLE_ACTIVE QueryPackageGroup callback failed. because: ' + err.code);
} else {
@@ -688,7 +730,7 @@ bundleState.setBundleGroup(bundleName, newGroup, (err) => {
## bundleState.registerGroupCallBack9+
-registerGroupCallBack(callback: Callback<BundleActiveGroupCallbackInfo>): Promise<void>
+registerGroupCallBack(groupCallback: Callback<BundleActiveGroupCallbackInfo>): Promise<void>
Registers a callback for application group changes. When an application group of the user changes, a **[BundleActiveGroupCallbackInfo](#bundleactivegroupcallbackinfo9)** instance is returned to all applications that have registered the callback. This API uses a promise to return the result.
@@ -730,7 +772,7 @@ bundleState.registerGroupCallBack(onBundleGroupChanged).then( () => {
## bundleState.registerGroupCallBack9+
-registerGroupCallBack(callback: Callback<BundleActiveGroupCallbackInfo>, callback: AsyncCallback<void>): void
+registerGroupCallBack(groupCallback: Callback<BundleActiveGroupCallbackInfo>, callback: AsyncCallback<void>): void
Registers a callback for application group changes. When an application group of the user changes, a **[BundleActiveGroupCallbackInfo](#bundleactivegroupcallbackinfo9)** instance is returned to all applications that have registered the callback. This API uses an asynchronous callback to return the result.
@@ -1034,20 +1076,6 @@ Provides the usage duration information of applications.
| infosBeginTime | number | No | Time logged in the first application usage record in the **BundleActiveInfo** object. This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.|
| infosEndTime | number | No | Time logged in the last application usage record in the **BundleActiveInfo** object. This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.|
-### merge
-
-merge(toMerge: BundleStateInfo): void
-
-Merges the application usage information that has the same bundle name.
-
-**System capability**: SystemCapability.ResourceSchedule.UsageStatistics.App
-
-**Parameters**
-
-| Name | Type | Mandatory | Description |
-| ------- | ----------------------------------- | ---- | -------------- |
-| toMerge | [BundleStateInfo](#bundlestateinfo) | Yes | Application usage information to merge.|
-
## BundleActiveState
Provides information about an application event.
diff --git a/en/application-dev/reference/apis/js-apis-i18n.md b/en/application-dev/reference/apis/js-apis-i18n.md
index dc6d5ed6e1c8589733ee79c22cf3b413d7f80141..255c867d802b2f600c4792cd713a891b0e46e67e 100644
--- a/en/application-dev/reference/apis/js-apis-i18n.md
+++ b/en/application-dev/reference/apis/js-apis-i18n.md
@@ -26,6 +26,7 @@ Obtains the localized script for the specified language.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------------ | ------- | ---- | ---------------- |
| language | string | Yes | Specified language. |
@@ -33,6 +34,7 @@ Obtains the localized script for the specified language.
| sentenceCase | boolean | No | Whether to use sentence case for the localized script.|
**Return value**
+
| Type | Description |
| ------ | ------------- |
| string | Localized script for the specified language.|
@@ -53,6 +55,7 @@ Obtains the localized script for the specified country.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------------ | ------- | ---- | ---------------- |
| country | string | Yes | Specified country. |
@@ -60,6 +63,7 @@ Obtains the localized script for the specified country.
| sentenceCase | boolean | No | Whether to use sentence case for the localized script.|
**Return value**
+
| Type | Description |
| ------ | ------------- |
| string | Localized script for the specified country.|
@@ -80,11 +84,13 @@ Checks whether the localized script for the specified language is displayed from
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Description |
| ------ | ------ | ------- |
| locale | string | Locale ID.|
**Return value**
+
| Type | Description |
| ------- | ---------------------------------------- |
| boolean | Returns **true** if the localized script is displayed from right to left; returns **false** otherwise.|
@@ -105,6 +111,7 @@ Obtains the system language.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ------- |
| string | System language ID.|
@@ -128,11 +135,13 @@ This is a system API.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Description |
| -------- | ------ | ----- |
| language | string | Language ID.|
**Return value**
+
| Type | Description |
| ------- | ------------------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
@@ -143,7 +152,7 @@ This is a system API.
```
-## i18n.getSystemLanguages
+## i18n.getSystemLanguages9+
getSystemLanguages(): Array<string>
@@ -154,6 +163,7 @@ Obtains the list of system languages.
**System API**: This is a system API and cannot be called by third-party applications.
**Return value**
+
| Type | Description |
| ------------------- | ------------ |
| Array<string> | List of the IDs of system languages.|
@@ -164,7 +174,7 @@ Obtains the list of system languages.
```
-## i18n.getSystemCountries
+## i18n.getSystemCountries9+
getSystemCountries(language: string): Array<string>
@@ -175,11 +185,13 @@ Obtains the list of countries and regions supported for the specified language.
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
+
| Name | Type | Description |
| -------- | ------ | ----- |
| language | string | Language ID.|
**Return value**
+
| Type | Description |
| ------------------- | ------------ |
| Array<string> | List of the IDs of the countries and regions supported for the specified language.|
@@ -199,6 +211,7 @@ Obtains the system region.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ------- |
| string | System region ID.|
@@ -222,11 +235,13 @@ This is a system API.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Description |
| ------ | ------ | ----- |
| region | string | Region ID.|
**Return value**
+
| Type | Description |
| ------- | ------------------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
@@ -246,6 +261,7 @@ Obtains the system locale.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ------- |
| string | System locale ID.|
@@ -269,11 +285,13 @@ This is a system API.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Description |
| ------ | ------ | --------------- |
| locale | string | System locale ID, for example, **zh-CN**.|
**Return value**
+
| Type | Description |
| ------- | ---------------------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
@@ -284,7 +302,7 @@ This is a system API.
```
-## i18n.isSuggested
+## i18n.isSuggested9+
isSuggested(language: string, region?: string): boolean
@@ -295,12 +313,14 @@ Checks whether the system language matches the specified region.
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
+
| Name | Type | Mandatory | Description |
| -------- | ------ | ---- | ------------- |
| language | string | Yes | Valid language ID, for example, **zh**.|
| region | string | No | Valid region ID, for example, **CN**. |
**Return value**
+
| Type | Description |
| ------- | ---------------------------------------- |
| boolean | Returns **true** if the system language matches the specified region; returns **false** otherwise.|
@@ -320,12 +340,14 @@ Obtains a **Calendar** object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------------------------- |
| locale | string | Yes | Valid locale value, for example, **zh-Hans-CN**. |
| type | string | No | Valid calendar type. Currently, the valid types are as follows: **buddhist**, **chinese**, **coptic**, **ethiopic**, **hebrew**, **gregory**, **indian**, **islamic\_civil**, **islamic\_tbla**, **islamic\_umalqura**, **japanese**, and **persian**. If this parameter is left unspecified, the default calendar type of the specified locale is used.|
**Return value**
+
| Type | Description |
| ---------------------- | ----- |
| [Calendar](#calendar8) | **Calendar** object.|
@@ -348,6 +370,7 @@ Sets the date for this **Calendar** object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ---- | ---- | ----------------- |
| date | Date | Yes | Date to be set for the **Calendar** object.|
@@ -369,6 +392,7 @@ Sets the date and time for this **Calendar** object. The value is represented by
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ---------------------------------------- |
| time | number | Yes | Number of milliseconds that have elapsed since the Unix epoch.|
@@ -389,6 +413,7 @@ Sets the year, month, day, hour, minute, and second for this **Calendar** object
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ------ |
| year | number | Yes | Year to set. |
@@ -414,6 +439,7 @@ Sets the time zone of this **Calendar** object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| -------- | ------ | ---- | ------------------------- |
| timezone | string | Yes | Time zone, for example, **Asia/Shanghai**.|
@@ -434,6 +460,7 @@ Obtains the time zone of this **Calendar** object.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ---------- |
| string | Time zone of the **Calendar** object.|
@@ -455,6 +482,7 @@ Obtains the start day of a week for this **Calendar** object.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | --------------------- |
| number | Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.|
@@ -475,6 +503,7 @@ Sets the start day of a week for this **Calendar** object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | --------------------- |
| value | number | No | Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.|
@@ -495,6 +524,7 @@ Obtains the minimum number of days in the first week of a year.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ------------ |
| number | Minimum number of days in the first week of a year.|
@@ -515,6 +545,7 @@ Sets the minimum number of days in the first week of a year.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ------------ |
| value | number | No | Minimum number of days in the first week of a year.|
@@ -535,11 +566,13 @@ Obtains the value of the specified field in the **Calendar** object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ---------------------------------------- |
| field | string | Yes | Value of the specified field in the **Calendar** object. Currently, a valid field can be any of the following: **era**, **year**, **month**, **week\_of\_year**, **week\_of\_month**, **date**, **day\_of\_year**, **day\_of\_week**, **day\_of\_week\_in\_month**, **hour**, **hour\_of\_day**, **minute**, **second**, **millisecond**, **zone\_offset**, **dst\_offset**, **year\_woy**, **dow\_local**, **extended\_year**, **julian\_day**, **milliseconds\_in\_day**, **is\_leap\_month**.|
**Return value**
+
| Type | Description |
| ------ | ---------------------------------------- |
| number | Value of the specified field. For example, if the year in the internal date of this **Calendar** object is **1990**, the **get("year")** function will return **1990**.|
@@ -561,11 +594,13 @@ Obtains the name of the **Calendar** object displayed for the specified locale.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------------------------- |
| locale | string | Yes | Locale for which the name of the **Calendar** object is displayed. For example, if **locale** is **en-US**, the name of the Buddhist calendar will be **Buddhist Calendar**.|
**Return value**
+
| Type | Description |
| ------ | ------------------- |
| string | Name of the **Calendar** object displayed for the specified locale.|
@@ -586,11 +621,13 @@ Checks whether the specified date in this **Calendar** object is a weekend.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ---- | ---- | ---------------------------------------- |
| date | Date | No | Specified date in this **Calendar** object. If this parameter is left unspecified, the system checks whether the current date in the **Calendar** object is a weekend.|
**Return value**
+
| Type | Description |
| ------- | ----------------------------------- |
| boolean | Returns **true** if the date is a weekend; returns **false** if the date is a weekday.|
@@ -620,7 +657,7 @@ Parameters
| Name | Type | Mandatory | Description |
| ------- | ---------------------------------------- | ---- | ---------------- |
| country | string | Yes | Country or region to which the phone number to be formatted belongs.|
-| options | [PhoneNumberFormatOptions](#phonenumberformatoptions8) | No | Options of the **PhoneNumberFormat** object. |
+| options | [PhoneNumberFormatOptions](#phonenumberformatoptions9) | No | Options of the **PhoneNumberFormat** object. |
**Example**
```js
@@ -637,11 +674,13 @@ Checks whether the format of the specified phone number is valid.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | --------- |
| number | string | Yes | Phone number to be checked.|
**Return value**
+
| Type | Description |
| ------- | ------------------------------------- |
| boolean | Returns **true** if the phone number format is valid; returns **false** otherwise.|
@@ -662,11 +701,13 @@ Formats a phone number.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------- |
| number | string | Yes | Phone number to be formatted.|
**Return value**
+
| Type | Description |
| ------ | ---------- |
| string | Formatted phone number.|
@@ -686,12 +727,14 @@ Obtains the home location of a phone number.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------- |
| number | string | Yes | Phone number.|
| locale | string | Yes | Locale ID.|
**Return value**
+
| Type | Description |
| ------ | ---------- |
| string | Home location of the phone number.|
@@ -703,7 +746,7 @@ Obtains the home location of a phone number.
```
-## PhoneNumberFormatOptions8+
+## PhoneNumberFormatOptions9+
Defines the options for this PhoneNumberFormat object.
@@ -726,18 +769,24 @@ Defines the measurement unit information.
| measureSystem | string | Yes | Yes | Measurement system. The value can be **SI**, **US**, or **UK**.|
-## Util8+
+## Util(deprecated)
-### unitConvert8+
+### unitConvert(deprecated)
static unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string
Converts one measurement unit into another and formats the unit based on the specified locale and style.
+> **NOTE**
+> This API is deprecated since API version 9. You are advised to use [unitConvert](#unitconvert9) instead.
+>
+> This API is supported since API version 8.
+
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ---------------------------------------- |
| fromUnit | [UnitInfo](#unitinfo8) | Yes | Measurement unit to be converted. |
@@ -747,37 +796,10 @@ Converts one measurement unit into another and formats the unit based on the spe
| style | string | No | Style used for formatting. The value can be **long**, **short**, or **narrow**.|
**Return value**
-| Type | Description |
-| ------ | ----------------------- |
-| string | Character string obtained after formatting based on the measurement unit specified by **toUnit**.|
-
-**Example**
- ```js
- i18n.Util.unitConvert({unit: "cup", measureSystem: "US"}, {unit: "liter", measureSystem: "SI"}, 1000, "en-US", "long");
- ```
-
-### getDateOrder9+
-
-static getDateOrder(locale: string): string
-Obtains the sequence of the year, month, and day in the specified locale.
-
-**System capability**: SystemCapability.Global.I18n
-
-**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ---------------------- | ---- | ---------------------------------------- |
-| locale | string | Yes | Locale used for formatting, for example, **zh-Hans-CN**. |
-
-**Return value**
| Type | Description |
| ------ | ----------------------- |
-| string | Sequence of the year, month, and day.|
-
-**Example**
- ```
- i18n.Util.getDateOrder("zh-CN");
- ```
+| string | Character string obtained after formatting based on the measurement unit specified by **toUnit**.|
## getInstance8+
@@ -789,11 +811,13 @@ Creates an **IndexUtil** object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------------- |
| locale | string | No | A string containing locale information, including the language, optional script, and region.|
**Return value**
+
| Type | Description |
| ------------------------ | --------------------- |
| [IndexUtil](#indexutil8) | **IndexUtil** object mapping to the specified locale.|
@@ -816,6 +840,7 @@ Obtains the index list for this **locale** object.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------------------- | ------------------ |
| Array<string> | Index list for this **locale** object.|
@@ -836,6 +861,7 @@ Adds the index of the new **locale** object to the index list.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------------- |
| locale | string | Yes | A string containing locale information, including the language, optional script, and region.|
@@ -856,11 +882,13 @@ Obtains the index of a text object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ------------ |
| text | string | Yes | **text** object whose index is to be obtained.|
**Return value**
+
| Type | Description |
| ------ | ----------- |
| string | Index of the **text** object.|
@@ -872,223 +900,250 @@ Obtains the index of a text object.
```
-## Character8+
+## Character(deprecated)
-### isDigit8+
+### isDigit(deprecated)
static isDigit(char: string): boolean
Checks whether the input character string is composed of digits.
+> **NOTE**
+> This API is deprecated since API version 9. You are advised to use [isDigit](#isdigit9) instead.
+>
+> This API is supported since API version 8.
+
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----- |
| char | string | Yes | Input character.|
**Return value**
+
| Type | Description |
| ------- | ------------------------------------ |
| boolean | Returns **true** if the input character is a digit; returns **false** otherwise.|
-**Example**
- ```js
- var isdigit = i18n.Character.isDigit("1"); // Return true.
- ```
-### isSpaceChar8+
+### isSpaceChar(deprecated)
static isSpaceChar(char: string): boolean
Checks whether the input character is a space.
+> **NOTE**
+> This API is deprecated since API version 9. You are advised to use [isSpaceChar](#isspacechar9) instead.
+>
+> This API is supported since API version 8.
+
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----- |
| char | string | Yes | Input character.|
**Return value**
+
| Type | Description |
| ------- | -------------------------------------- |
| boolean | Returns **true** if the input character is a space; returns **false** otherwise.|
-**Example**
- ```js
- var isspacechar = i18n.Character.isSpaceChar("a"); // Return false.
- ```
-### isWhitespace8+
+### isWhitespace(deprecated)
static isWhitespace(char: string): boolean
Checks whether the input character is a white space.
+> **NOTE**
+> This API is deprecated since API version 9. You are advised to use [isWhitespace](#iswhitespace9) instead.
+>
+> This API is supported since API version 8.
+
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----- |
| char | string | Yes | Input character.|
**Return value**
+
| Type | Description |
| ------- | -------------------------------------- |
| boolean | Returns **true** if the input character is a white space; returns **false** otherwise.|
-**Example**
- ```js
- var isspacechar = i18n.Character.isSpaceChar("a"); // Return false.
- ```
-### isRTL8+
+### isRTL(deprecated)
static isRTL(char: string): boolean
Checks whether the input character is of the right to left (RTL) language.
+> **NOTE**
+> This API is deprecated since API version 9. You are advised to use [isRTL](#isrtl9) instead.
+>
+> This API is supported since API version 8.
+
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----- |
| char | string | Yes | Input character.|
**Return value**
+
| Type | Description |
| ------- | ---------------------------------------- |
| boolean | Returns **true** if the input character is of the RTL language; returns **false** otherwise.|
-**Example**
- ```js
- var isrtl = i18n.Character.isRTL("a"); // Return false.
- ```
-### isIdeograph8+
+### isIdeograph(deprecated)
static isIdeograph(char: string): boolean
Checks whether the input character is an ideographic character.
+> **NOTE**
+> This API is deprecated since API version 9. You are advised to use [isIdeograph](#isideograph9) instead.
+>
+> This API is supported since API version 8.
+
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----- |
| char | string | Yes | Input character.|
**Return value**
+
| Type | Description |
| ------- | ---------------------------------------- |
| boolean | Returns **true** if the input character is an ideographic character; returns **false** otherwise.|
-**Example**
- ```js
- var isideograph = i18n.Character.isIdeograph("a"); // Return false.
- ```
-### isLetter8+
+### isLetter(deprecated)
static isLetter(char: string): boolean
Checks whether the input character is a letter.
+> **NOTE**
+> This API is deprecated since API version 9. You are advised to use [isLetter](#isletter9) instead.
+>
+> This API is supported since API version 8.
+
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----- |
| char | string | Yes | Input character.|
**Return value**
+
| Type | Description |
| ------- | ------------------------------------ |
| boolean | Returns **true** if the input character is a letter; returns **false** otherwise.|
-**Example**
- ```js
- var isletter = i18n.Character.isLetter("a"); // Return true.
- ```
-### isLowerCase8+
+### isLowerCase(deprecated)
static isLowerCase(char: string): boolean
Checks whether the input character is a lowercase letter.
+> **NOTE**
+> This API is deprecated since API version 9. You are advised to use [isLowerCase](#islowercase9) instead.
+>
+> This API is supported since API version 8.
+
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----- |
| char | string | Yes | Input character.|
**Return value**
+
| Type | Description |
| ------- | ---------------------------------------- |
| boolean | Returns **true** if the input character is a lowercase letter; returns **false** otherwise.|
-**Example**
- ```js
- var islowercase = i18n.Character.isLowerCase("a"); // Return true.
- ```
-### isUpperCase8+
+### isUpperCase(deprecated)
static isUpperCase(char: string): boolean
Checks whether the input character is an uppercase letter.
+> **NOTE**
+> This API is deprecated since API version 9. You are advised to use [isUpperCase](#isuppercase9) instead.
+>
+> This API is supported since API version 8.
+
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----- |
| char | string | Yes | Input character.|
**Return value**
+
| Type | Description |
| ------- | ---------------------------------------- |
| boolean | Returns **true** if the input character is an uppercase letter; returns **false** otherwise.|
-**Example**
- ```js
- var isuppercase = i18n.Character.isUpperCase("a"); // Return false.
- ```
-### getType8+
+### getType(deprecated)
static getType(char: string): string
Obtains the type of the input character string.
+> **NOTE**
+> This API is deprecated since API version 9. You are advised to use [getType](#gettype9) instead.
+>
+> This API is supported since API version 8.
+
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----- |
| char | string | Yes | Input character.|
**Return value**
+
| Type | Description |
| ------ | ----------- |
| string | Type of the input character.|
-**Example**
- ```js
- var type = i18n.Character.getType("a");
- ```
## i18n.getLineInstance8+
@@ -1100,11 +1155,13 @@ Obtains a [BreakIterator](#breakiterator8) object for text segmentation.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------------------------- |
| locale | string | Yes | Valid locale value, for example, **zh-Hans-CN**. The [BreakIterator](#breakiterator8) object segments text according to the rules of the specified locale.|
**Return value**
+
| Type | Description |
| -------------------------------- | ----------- |
| [BreakIterator](#breakiterator8) | [BreakIterator](#breakiterator8) object used for text segmentation.|
@@ -1127,6 +1184,7 @@ Sets the text to be processed by the [BreakIterator](#breakiterator8) object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----------------------- |
| text | string | Yes | Text to be processed by the **BreakIterator** object.|
@@ -1147,6 +1205,7 @@ Obtains the text being processed by the [BreakIterator](#breakiterator8) object.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ---------------------- |
| string | Text being processed by the **BreakIterator** object.|
@@ -1168,6 +1227,7 @@ Obtains the position of the [BreakIterator](#breakiterator8) object in the text
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | --------------------------- |
| number | Position of the **BreakIterator** object in the text being processed.|
@@ -1189,6 +1249,7 @@ Puts the [BreakIterator](#breakiterator8) object to the first text boundary, whi
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ----------------- |
| number | Offset to the first text boundary of the processed text.|
@@ -1210,6 +1271,7 @@ Puts the [BreakIterator](#breakiterator8) object to the last text boundary, whic
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ------------------ |
| number | Offset of the last text boundary of the processed text.|
@@ -1231,11 +1293,13 @@ Moves the [BreakIterator](#breakiterator8) object backward by the specified numb
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ---------------------------------------- |
| index | number | No | Number of text boundaries by which the [BreakIterator](#breakiterator8) object is moved. A positive value indicates that the text boundary is moved backward, and a negative value indicates the opposite. If no index is specified, the index will be treated as **1**.|
**Return value**
+
| Type | Description |
| ------ | ---------------------------------------- |
| number | Position of the [BreakIterator](#breakiterator8) object in the text after it is moved by the specified number of text boundaries. The value **-1** is returned if the position of the [BreakIterator](#breakiterator8) object is outside of the processed text after it is moved by the specified number of text boundaries.|
@@ -1259,6 +1323,7 @@ Moves the [BreakIterator](#breakiterator8) object to the previous text boundary.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ---------------------------------------- |
| number | Position of the [BreakIterator](#breakiterator8) object in the text after it is moved to the previous text boundary. The value **-1** is returned if the position of the [BreakIterator](#breakiterator8) object is outside of the processed text after it is moved by the specified number of text boundaries.|
@@ -1282,11 +1347,13 @@ Moves the [BreakIterator](#breakiterator8) object to the text boundary after the
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------------------------- |
| offset | number | Yes | Offset to the position before the text boundary to which the [BreakIterator](#breakiterator8) object is moved.|
**Return value**
+
| Type | Description |
| ------ | ---------------------------------------- |
| number | The value **-1** is returned if the text boundary to which the [BreakIterator](#breakiterator8) object is moved is outside of the processed text.|
@@ -1310,11 +1377,13 @@ Checks whether the position specified by the offset is a text boundary. If **tru
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ----------- |
| offset | number | Yes | Position to check.|
**Return value**
+
| Type | Description |
| ------- | ------------------------------- |
| boolean | Returns **true** if the position specified by the offset is a text boundary; returns **false** otherwise.|
@@ -1337,6 +1406,7 @@ Checks whether the 24-hour clock is used.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------- | ---------------------------------------- |
| boolean | Returns **true** if the 24-hour clock is used; returns **false** otherwise.|
@@ -1358,11 +1428,13 @@ Sets the 24-hour clock.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------- | ---- | ---------------------------------------- |
| option | boolean | Yes | Whether to enable the 24-hour clock. The value **true** means to enable the 24-hour clock, and the value **false** means the opposite.|
**Return value**
+
| Type | Description |
| ------- | ----------------------------- |
| boolean | Returns **true** if the 24-hour clock is enabled; returns **false** otherwise.|
@@ -1385,12 +1457,14 @@ Adds a preferred language to the specified position on the preferred language li
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| -------- | ------ | ---- | ---------- |
| language | string | Yes | Preferred language to add. |
| index | number | No | Position to which the preferred language is added.|
**Return value**
+
| Type | Description |
| ------- | ----------------------------- |
| boolean | Returns **true** if the preferred language is successfully added; returns **false** otherwise.|
@@ -1415,11 +1489,13 @@ Deletes a preferred language from the specified position on the preferred langua
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | --------------------- |
| index | number | Yes | Position of the preferred language to delete.|
**Return value**
+
| Type | Description |
| ------- | ----------------------------- |
| boolean | Returns **true** if the preferred language is deleted; returns **false** otherwise.|
@@ -1441,6 +1517,7 @@ Obtains the list of preferred languages.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------------------- | --------- |
| Array<string> | List of preferred languages.|
@@ -1460,6 +1537,7 @@ Obtains the first language in the preferred language list.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | -------------- |
| string | First language in the preferred language list.|
@@ -1479,6 +1557,7 @@ Obtains the preferred language of an application.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | -------------- |
| string | Preferred language of the application.|
@@ -1498,11 +1577,13 @@ Obtains the **TimeZone** object corresponding to the specified time zone ID.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ----- |
| zondID | string | No | Time zone ID.|
**Return value**
+
| Type | Description |
| -------- | ------------ |
| TimeZone | **TimeZone** object corresponding to the time zone ID.|
@@ -1525,6 +1606,7 @@ Obtains the ID of the specified **TimeZone** object.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ------------ |
| string | Time zone ID corresponding to the **TimeZone** object.|
@@ -1545,12 +1627,14 @@ Obtains the representation of a **TimeZone** object in the specified locale.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------- | ---- | -------------------- |
| locale | string | No | System locale ID. |
| isDST | boolean | No | Whether to consider DST when obtaining the representation of the **TimeZone** object.|
**Return value**
+
| Type | Description |
| ------ | ------------- |
| string | Representation of the **TimeZone** object in the specified locale.|
@@ -1571,6 +1655,7 @@ Obtains the offset between the time zone represented by a **TimeZone** object an
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ------------------- |
| number | Offset between the time zone represented by the **TimeZone** object and the UTC time zone.|
@@ -1591,6 +1676,7 @@ Obtains the offset between the time zone represented by a **TimeZone** object an
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ----------------------- |
| number | Offset between the time zone represented by the **TimeZone** object and the UTC time zone at a certain time point.|
@@ -1610,6 +1696,7 @@ Obtains the list of time zone IDs supported by the system.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ----------------------- |
| Array<string> | List of time zone IDs supported by the system.|
@@ -1629,6 +1716,7 @@ Obtains the list of time zone city IDs supported by the system.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ----------------------- |
| Array<string> | List of time zone city IDs supported by the system.|
@@ -1648,12 +1736,14 @@ Obtains the localized display of a time zone city in the specified locale.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ----- |
| cityID | string | Yes | Time zone city ID.|
| locale | string | Yes | Locale ID.|
**Return value**
+
| Type | Description |
| ------ | ----------------------- |
| string | Localized display of the time zone city in the specified locale.|
@@ -1673,11 +1763,13 @@ Obtains the **TimeZone** object corresponding to the specified time zone city ID
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ----- |
| cityID | string | Yes | Time zone city ID.|
**Return value**
+
| Type | Description |
| ------ | ----------------------- |
| TimeZone | **TimeZone** object corresponding to the specified time zone city ID.|
@@ -1700,11 +1792,13 @@ This is a system API.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ----- |
| flag | boolean | Yes | Whether to turn on the local digit switch. The value **true** means to turn on the local digit switch, and the value **false** indicates the opposite.|
**Return value**
+
| Type | Description |
| -------- | ------------ |
| boolean | Result indicating whether the local digit switch is successfully set. The value **true** indicates that the local digit switch is successfully set, and the value **false** indicates the opposite.|
@@ -1724,6 +1818,7 @@ Checks whether the local digit switch is turned on.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| -------- | ------------ |
| boolean | Result indicating whether the local digit switch is turned on. The value **true** indicates that the local digit switch is turned on, and the value **false** indicates the opposite.|
@@ -1745,6 +1840,7 @@ Obtains a list of IDs supported by the **Transliterator** object.
**System capability**: SystemCapability.Global.I18n
**Return value**
+
| Type | Description |
| ------ | ------------ |
| string[] | List of IDs supported by the **Transliterator** object.|
@@ -1764,11 +1860,13 @@ Creates a **Transliterator** object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------- | ---- | -------------------- |
| id | string | Yes | ID supported by the **Transliterator** object. |
**Return value**
+
| Type | Description |
| ------ | ------------- |
| [Transliterator](#transliterator9) | **Transliterator** object.|
@@ -1788,11 +1886,13 @@ Converts the input string from the source format to the target format.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------- | ---- | -------------------- |
| text | string | Yes | Input string. |
**Return value**
+
| Type | Description |
| ------ | ------------- |
| string | Target string.|
@@ -1802,3 +1902,298 @@ Converts the input string from the source format to the target format.
var transliterator = i18n.Transliterator.getInstance("Any-Latn");
transliterator.transform ("China");
```
+
+## Unicode9+
+
+
+### isDigit9+
+
+static isDigit(char: string): boolean
+
+Checks whether the input character string is composed of digits.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---- | ------ | ---- | ----- |
+| char | string | Yes | Input character.|
+
+**Return value**
+
+| Type | Description |
+| ------- | ------------------------------------ |
+| boolean | Returns **true** if the input character is a digit; returns **false** otherwise.|
+
+**Example**
+ ```js
+ var isdigit = i18n.Unicode.isDigit("1"); // Return true.
+ ```
+
+
+### isSpaceChar9+
+
+static isSpaceChar(char: string): boolean
+
+Checks whether the input character is a space.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---- | ------ | ---- | ----- |
+| char | string | Yes | Input character.|
+
+**Return value**
+
+| Type | Description |
+| ------- | -------------------------------------- |
+| boolean | Returns **true** if the input character is a space; returns **false** otherwise.|
+
+**Example**
+ ```js
+ var isspacechar = i18n.Unicode.isSpaceChar("a"); // Return false.
+ ```
+
+
+### isWhitespace9+
+
+static isWhitespace(char: string): boolean
+
+Checks whether the input character is a white space.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---- | ------ | ---- | ----- |
+| char | string | Yes | Input character.|
+
+**Return value**
+
+| Type | Description |
+| ------- | -------------------------------------- |
+| boolean | Returns **true** if the input character is a white space; returns **false** otherwise.|
+
+**Example**
+ ```js
+ var iswhitespace = i18n.Unicode.isWhitespace("a"); // Return false.
+ ```
+
+
+### isRTL9+
+
+static isRTL(char: string): boolean
+
+Checks whether the input character is of the right to left (RTL) language.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---- | ------ | ---- | ----- |
+| char | string | Yes | Input character.|
+
+**Return value**
+
+| Type | Description |
+| ------- | ---------------------------------------- |
+| boolean | Returns **true** if the input character is of the RTL language; returns **false** otherwise.|
+
+**Example**
+ ```js
+ var isrtl = i18n.Unicode.isRTL("a"); // Return false.
+ ```
+
+
+### isIdeograph9+
+
+static isIdeograph(char: string): boolean
+
+Checks whether the input character is an ideographic character.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---- | ------ | ---- | ----- |
+| char | string | Yes | Input character.|
+
+**Return value**
+
+| Type | Description |
+| ------- | ---------------------------------------- |
+| boolean | Returns **true** if the input character is an ideographic character; returns **false** otherwise.|
+
+**Example**
+ ```js
+ var isideograph = i18n.Unicode.isIdeograph("a"); // Return false.
+ ```
+
+
+### isLetter9+
+
+static isLetter(char: string): boolean
+
+Checks whether the input character is a letter.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---- | ------ | ---- | ----- |
+| char | string | Yes | Input character.|
+
+**Return value**
+
+| Type | Description |
+| ------- | ------------------------------------ |
+| boolean | Returns **true** if the input character is a letter; returns **false** otherwise.|
+
+**Example**
+ ```js
+ var isletter = i18n.Unicode.isLetter("a"); // Return true.
+ ```
+
+
+### isLowerCase9+
+
+static isLowerCase(char: string): boolean
+
+Checks whether the input character is a lowercase letter.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---- | ------ | ---- | ----- |
+| char | string | Yes | Input character.|
+
+**Return value**
+
+| Type | Description |
+| ------- | ---------------------------------------- |
+| boolean | Returns **true** if the input character is a lowercase letter; returns **false** otherwise.|
+
+**Example**
+ ```js
+ var islowercase = i18n.Unicode.isLowerCase("a"); // Return true.
+ ```
+
+
+### isUpperCase9+
+
+static isUpperCase(char: string): boolean
+
+Checks whether the input character is an uppercase letter.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---- | ------ | ---- | ----- |
+| char | string | Yes | Input character.|
+
+**Return value**
+
+| Type | Description |
+| ------- | ---------------------------------------- |
+| boolean | Returns **true** if the input character is an uppercase letter; returns **false** otherwise.|
+
+**Example**
+ ```js
+ var isuppercase = i18n.Unicode.isUpperCase("a"); // Return false.
+ ```
+
+
+### getType9+
+
+static getType(char: string): string
+
+Obtains the type of the input character string.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ---- | ------ | ---- | ----- |
+| char | string | Yes | Input character.|
+
+**Return value**
+
+| Type | Description |
+| ------ | ----------- |
+| string | Type of the input character.|
+
+**Example**
+ ```js
+ var type = i18n.Unicode.getType("a");
+ ```
+
+
+## I18NUtil9+
+
+
+### unitConvert9+
+
+static unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string
+
+Converts one measurement unit into another and formats the unit based on the specified locale and style.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------- | ---- | ---------------------------------------- |
+| fromUnit | [UnitInfo](#unitinfo8) | Yes | Measurement unit to be converted. |
+| toUnit | [UnitInfo](#unitinfo8) | Yes | Measurement unit to be converted to. |
+| value | number | Yes | Value of the measurement unit to be converted. |
+| locale | string | Yes | Locale used for formatting, for example, **zh-Hans-CN**. |
+| style | string | No | Style used for formatting. The value can be **long**, **short**, or **narrow**.|
+
+**Return value**
+
+| Type | Description |
+| ------ | ----------------------- |
+| string | Character string obtained after formatting based on the measurement unit specified by **toUnit**.|
+
+**Example**
+ ```js
+ i18n.I18NUtil.unitConvert({unit: "cup", measureSystem: "US"}, {unit: "liter", measureSystem: "SI"}, 1000, "en-US", "long");
+ ```
+
+
+### getDateOrder9+
+
+static getDateOrder(locale: string): string
+
+Obtains the sequence of the year, month, and day in the specified locale.
+
+**System capability**: SystemCapability.Global.I18n
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| ------ | ------ | ---- | ------------------------- |
+| locale | string | Yes | Locale used for formatting, for example, **zh-Hans-CN**.|
+
+**Return value**
+
+| Type | Description |
+| ------ | ------------------- |
+| string | Sequence of the year, month, and day.|
+
+**Example**
+ ```js
+ i18n.I18NUtil.getDateOrder("zh-CN");
+ ```
diff --git a/en/application-dev/reference/apis/js-apis-intl.md b/en/application-dev/reference/apis/js-apis-intl.md
index cae08502ee91872765050fbb53fe6701bc2cbb9b..fcf2858aa7b4a1adda999a0e1bf0850495c0d00f 100644
--- a/en/application-dev/reference/apis/js-apis-intl.md
+++ b/en/application-dev/reference/apis/js-apis-intl.md
@@ -60,6 +60,7 @@ Creates a Locale object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------- | ------------- | ---- | ---------------------------- |
| locale | string | Yes | A string containing locale information, including the language, optional script, and region.|
@@ -80,6 +81,7 @@ Converts locale information to a string.
**System capability**: SystemCapability.Global.I18n
**Return Value**
+
| Type | Description |
| ------ | ----------- |
| string | String containing locale information.|
@@ -100,6 +102,7 @@ Maximizes information of the **Locale** object. If the script and locale informa
**System capability**: SystemCapability.Global.I18n
**Return Value**
+
| Type | Description |
| ----------------- | ---------- |
| [Locale](#locale) | **Locale** object with the maximized information.|
@@ -120,6 +123,7 @@ Minimizes information of the **Locale** object. If the script and locale informa
**System capability**: SystemCapability.Global.I18n
**Return Value**
+
| Type | Description |
| ----------------- | ---------- |
| [Locale](#locale) | **Locale** object with the minimized information.|
@@ -131,7 +135,7 @@ Minimizes information of the **Locale** object. If the script and locale informa
```
-## LocaleOptions
+## LocaleOptions9+
Represents the locale options.
@@ -173,6 +177,7 @@ Creates a **DateTimeOptions** object for the specified locale.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------- | ----------------------------------- | ---- | ---------------------------- |
| locale | string \| Array<string> | Yes | A string containing locale information, including the language, optional script, and region.|
@@ -199,11 +204,13 @@ Formats the specified date and time.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ---- | ---- | ------- |
| date | Date | Yes | Date and time to be formatted.|
**Return Value**
+
| Type | Description |
| ------ | ------------ |
| string | A string containing the formatted date and time.|
@@ -225,12 +232,14 @@ Formats the specified date range.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| --------- | ---- | ---- | -------- |
| startDate | Date | Yes | Start date and time to be formatted.|
| endDate | Date | Yes | End date and time to be formatted.|
**Return Value**
+
| Type | Description |
| ------ | -------------- |
| string | A string containing the formatted date and time range.|
@@ -253,6 +262,7 @@ Obtains the formatting options for **DateTimeFormat** object.
**System capability**: SystemCapability.Global.I18n
**Return Value**
+
| Type | Description |
| ----------------------------------- | ----------------------------- |
| [DateTimeOptions](#datetimeoptions) | Formatting options for **DateTimeFormat** objects.|
@@ -264,7 +274,7 @@ Obtains the formatting options for **DateTimeFormat** object.
```
-## DateTimeOptions
+## DateTimeOptions9+
Provides the options for the **DateTimeFormat** object.
@@ -339,11 +349,13 @@ Formats a number.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---- |
| number | number | Yes | Number to be formatted.|
**Return Value**
+
| Type | Description |
| ------ | ---------- |
| string | Formatted number.|
@@ -365,6 +377,7 @@ Obtains the options of the **NumberFormat** object.
**System capability**: SystemCapability.Global.I18n
**Return Value**
+
| Type | Description |
| ------------------------------- | --------------------------- |
| [NumberOptions](#numberoptions) | Formatting options for **NumberFormat** objects.|
@@ -377,7 +390,7 @@ Obtains the options of the **NumberFormat** object.
```
-## NumberOptions
+## NumberOptions9+
Provides the device capability.
@@ -453,12 +466,14 @@ Compares two strings based on the sorting policy of the **Collator** object.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ------------ |
| first | string | Yes | First string to compare. |
| second | string | Yes | Second string to compare.|
**Return Value**
+
| Type | Description |
| ------ | ---------------------------------------- |
| number | Comparison result. If the value is a negative number, the first string is before the second string. If the value of number is **0**, the first string is equal to the second string. If the value of number is a positive number, the first string is after the second string.|
@@ -479,6 +494,7 @@ Returns properties reflecting the locale and collation options of a **Collator**
**System capability**: SystemCapability.Global.I18n
**Return Value**
+
| Type | Description |
| ----------------------------------- | ----------------- |
| [CollatorOptions](#collatoroptions) | Properties of the **Collator** object.|
@@ -490,7 +506,7 @@ Returns properties reflecting the locale and collation options of a **Collator**
```
-## CollatorOptions8+
+## CollatorOptions9+
Represents the properties of a **Collator** object.
@@ -553,11 +569,13 @@ Obtains a string that represents the singular-plural type of the specified numbe
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ------------ |
| n | number | Yes | Number for which the singular-plural type is to be obtained.|
**Return Value**
+
| Type | Description |
| ------ | ---------------------------------------- |
| string | Singular-plural type. The value can be any of the following: **one**, **two**, **few**, **many**, **others**.|
@@ -569,7 +587,7 @@ Obtains a string that represents the singular-plural type of the specified numbe
```
-## PluralRulesOptions8+
+## PluralRulesOptions9+
Represents the properties of a **PluralRules** object.
@@ -611,7 +629,8 @@ Creates a **RelativeTimeFormat** object.
**System capability**: SystemCapability.Global.I18n
-Parameters
+**Parameters**
+
| Name | Type | Mandatory | Description |
| ------- | ---------------------------------------- | ---- | ---------------------------- |
| locale | string \| Array<string> | Yes | A string containing locale information, including the language, optional script, and region.|
@@ -632,12 +651,14 @@ Formats the value and unit based on the specified locale and formatting options.
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ---------------------------------------- |
| value | number | Yes | Value to format. |
| unit | string | Yes | Unit to format. The value can be any of the following: **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, **second**.|
**Return Value**
+
| Type | Description |
| ------ | ---------- |
| string | Relative time after formatting.|
@@ -658,12 +679,14 @@ Returns an array of RelativeTimeFormat objects in parts for locale-aware formatt
**System capability**: SystemCapability.Global.I18n
**Parameters**
+
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ---------------------------------------- |
| value | number | Yes | Value to format. |
| unit | string | Yes | Unit to format. The value can be any of the following: **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, **second**.|
**Return Value**
+
| Type | Description |
| ------------------- | --------------------------- |
| Array<object> | An array of **RelativeTimeFormat** objects in parts.|
@@ -684,6 +707,7 @@ Obtains the formatting options for **RelativeTimeFormat** objects.
**System capability**: SystemCapability.Global.I18n
**Return Value**
+
| Type | Description |
| ---------------------------------------- | --------------------------------- |
| [RelativeTimeFormatResolvedOptions](#relativetimeformatresolvedoptions) | Formatting options for **RelativeTimeFormat** objects.|
@@ -695,7 +719,7 @@ Obtains the formatting options for **RelativeTimeFormat** objects.
```
-## RelativeTimeFormatInputOptions8+
+## RelativeTimeFormatInputOptions9+
Represents the properties of a **RelativeTimeFormat** object.
diff --git a/en/application-dev/reference/apis/js-apis-medialibrary.md b/en/application-dev/reference/apis/js-apis-medialibrary.md
index b66eeec85c124ac083b27859849a86e1a5f1d4c2..e805a8d3172b2ec12f05a4fe39034be08d249905 100644
--- a/en/application-dev/reference/apis/js-apis-medialibrary.md
+++ b/en/application-dev/reference/apis/js-apis-medialibrary.md
@@ -1130,7 +1130,7 @@ async function example() {
const fetchFileResult = await media.getFileAssets(getImageOp);
const asset = await fetchFileResult.getFirstObject();
asset.getThumbnail((err, pixelmap) => {
- console.info('mediaLibraryTest : getThumbnail Successfull '+ pixelmap);
+ console.info('mediaLibraryTest : getThumbnail successful '+ pixelmap);
});
}
```
@@ -1168,7 +1168,7 @@ async function example() {
const fetchFileResult = await media.getFileAssets(getImageOp);
const asset = await fetchFileResult.getFirstObject();
asset.getThumbnail(size, (err, pixelmap) => {
- console.info('mediaLibraryTest : getThumbnail Successfull '+ pixelmap);
+ console.info('mediaLibraryTest : getThumbnail successful '+ pixelmap);
});
}
```
@@ -1212,7 +1212,7 @@ async function example() {
const asset = await fetchFileResult.getFirstObject();
asset.getThumbnail(size)
.then((pixelmap) => {
- console.info('mediaLibraryTest : getThumbnail Successfull '+ pixelmap);
+ console.info('mediaLibraryTest : getThumbnail successful '+ pixelmap);
})
.catch((err) => {
console.info('mediaLibraryTest : getThumbnail fail'+ err);
@@ -1502,7 +1502,7 @@ async function example() {
asset.trash(true, istrashCallBack);
} else {
- console.info('mediaLibraryTest : ASSET_CALLBACK isTrash Unsuccessfull = ' + err);
+ console.info('mediaLibraryTest : ASSET_CALLBACK isTrash Unsuccessful = ' + err);
console.info('mediaLibraryTest : ASSET_CALLBACK isTrash : FAIL');
}
@@ -1736,7 +1736,7 @@ Obtains the next file asset in the result set. This API uses an asynchronous cal
| Name | Type | Mandatory| Description |
| --------- | --------------------------------------------- | ---- | ----------------------------------------- |
-| callbacke | AsyncCallback<[FileAsset](#fileasset7)> | Yes | Callback used to return the next file asset.|
+| callback | AsyncCallback<[FileAsset](#fileasset7)> | Yes | Callback used to return the next file asset.|
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-osAccount.md b/en/application-dev/reference/apis/js-apis-osAccount.md
index 97a293e22137964215cbbfae1e86b768f7e5acaf..a4692039779fa40b82edb8de1dab204423ac957d 100644
--- a/en/application-dev/reference/apis/js-apis-osAccount.md
+++ b/en/application-dev/reference/apis/js-apis-osAccount.md
@@ -1,4 +1,4 @@
-# OS Account Management
+# OS Account Management
The **osAccount** module provides basic capabilities for managing operating system (OS) accounts, including adding, deleting, querying, setting, subscribing to, and enabling an OS account, and storing OS account data to disks.
@@ -3163,7 +3163,7 @@ This is a system API and cannot be called by third-party applications.
| FACE_AUTH_TIP_POOR_GAZE | 10 | The face is not facing the device. |
| FACE_AUTH_TIP_NOT_DETECTED | 11 | No face is detected. |
-## ingerprintTips8+
+## FingerprintTips8+
Enumerates the tip codes for fingerprint authentication.
diff --git a/en/application-dev/reference/apis/js-apis-socket.md b/en/application-dev/reference/apis/js-apis-socket.md
index b590efb7ca3455c95c3d217b86e741848c5ac547..77dd0bc0560d11837a5cfbb68f38fd3f39075310 100644
--- a/en/application-dev/reference/apis/js-apis-socket.md
+++ b/en/application-dev/reference/apis/js-apis-socket.md
@@ -1041,7 +1041,7 @@ promise1.then(() => {
console.log('connect success');
let promise2 = tcp.getRemoteAddress();
promise2.then(() => {
- console.log('getRemoteAddress success:' + JSON.stringify(data));
+ console.log('getRemoteAddress success');
}).catch(err => {
console.log('getRemoteAddressfail');
});
@@ -1120,7 +1120,7 @@ promise.then(() => {
console.log('connect success');
let promise1 = tcp.getState();
promise1.then(() => {
- console.log('getState success:' + JSON.stringify(data));
+ console.log('getState success');
}).catch(err => {
console.log('getState fail');
});
diff --git a/en/application-dev/reference/apis/js-apis-system-sensor.md b/en/application-dev/reference/apis/js-apis-system-sensor.md
index a551dea9a8f79c5d153649ce69dc912f93ddd4b6..7df5f6675bb53168935ada36ca1d0675e49da978 100644
--- a/en/application-dev/reference/apis/js-apis-system-sensor.md
+++ b/en/application-dev/reference/apis/js-apis-system-sensor.md
@@ -21,9 +21,9 @@ import sensor from '@system.sensor';
## Error Codes
-| Error Code | Description |
-| ---- | -------------- |
-| 900 | The current device does not support the corresponding sensor.|
+| Error Code | Description |
+| ---------- | ---------------------------------------- |
+| 900 | The current device does not support the corresponding sensor. |
## sensor.subscribeAccelerometer
@@ -37,19 +37,19 @@ Subscribes to data changes of the acceleration sensor. If this API is called mul
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | -------- | ---- | ---------------------------------------- |
-| interval | string | Yes | Execution frequency of the callback for returning the acceleration sensor data. The default value is **normal**. The options are as follows: - **game**: called at an interval of 20 ms, which is applicable to gaming scenarios. - **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios. - **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
-| success | Function | Yes | Called when the acceleration sensor data changes. |
-| fail | Function | No | Callback upon failure. |
+| Name | Type | Mandatory | Description |
+| -------- | -------- | --------- | ---------------------------------------- |
+| interval | string | Yes | Execution frequency of the callback for returning the acceleration sensor data. The default value is **normal**. The options are as follows: - **game**: called at an interval of 20 ms, which is applicable to gaming scenarios. - **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios. - **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. |
+| success | Function | Yes | Called when the acceleration sensor data changes. |
+| fail | Function | No | Callback upon failure. |
Return values of the success callback
-| Name | Type | Description |
-| ---- | ------ | ------- |
-| x | number | Acceleration on the x-axis.|
-| y | number | Acceleration on the y-axis.|
-| z | number | Acceleration on the z-axis.|
+| Name | Type | Description |
+| ---- | ------ | --------------------------- |
+| x | number | Acceleration on the x-axis. |
+| y | number | Acceleration on the y-axis. |
+| z | number | Acceleration on the z-axis. |
**Example**
@@ -97,16 +97,16 @@ Subscribes to data changes of the compass sensor. If this API is called multiple
**Parameters**
-| Name | Type | Mandatory | Description |
-| ------- | -------- | ---- | --------------- |
-| success | Function | Yes | Called when the compass sensor data changes.|
-| fail | Function | No | Callback upon failure. |
+| Name | Type | Mandatory | Description |
+| ------- | -------- | --------- | ---------------------------------------- |
+| success | Function | Yes | Called when the compass sensor data changes. |
+| fail | Function | No | Callback upon failure. |
Return values of the success callback
-| Name | Type | Description |
-| --------- | ------ | ---------- |
-| direction | number | Direction of the device, in degrees.|
+| Name | Type | Description |
+| --------- | ------ | ------------------------------------ |
+| direction | number | Direction of the device, in degrees. |
**Example**
@@ -149,16 +149,16 @@ Subscribes to data changes of the proximity sensor. If this API is called multip
**Parameters**
-| Name | Type | Mandatory | Description |
-| ------- | -------- | ---- | ----------------- |
-| success | Function | Yes | Called when the proximity sensor data changes.|
-| fail | Function | No | Callback upon failure. |
+| Name | Type | Mandatory | Description |
+| ------- | -------- | --------- | ---------------------------------------- |
+| success | Function | Yes | Called when the proximity sensor data changes. |
+| fail | Function | No | Callback upon failure. |
Return values of the success callback
-| Name | Type | Description |
-| -------- | ------ | --------------------- |
-| distance | number | Distance between a visible object and the device screen.|
+| Name | Type | Description |
+| -------- | ------ | ---------------------------------------- |
+| distance | number | Distance between a visible object and the device screen. |
**Example**
@@ -201,16 +201,16 @@ Subscribes to data changes of the ambient light sensor. If this API is called mu
**Parameters**
-| Name | Type | Mandatory | Description |
-| ------- | -------- | ---- | --------------- |
-| success | Function | Yes | Called when the ambient light sensor data changes|
-| fail | Function | No | Callback upon failure. |
+| Name | Type | Mandatory | Description |
+| ------- | -------- | --------- | ---------------------------------------- |
+| success | Function | Yes | Called when the ambient light sensor data changes |
+| fail | Function | No | Callback upon failure. |
Return values of the success callback
-| Name | Type | Description |
-| --------- | ------ | ------------ |
-| intensity | number | Light intensity, in lux.|
+| Name | Type | Description |
+| --------- | ------ | ------------------------ |
+| intensity | number | Light intensity, in lux. |
**Example**
@@ -255,16 +255,16 @@ Subscribes to data changes of the step counter sensor. If this API is called mul
**Parameters**
-| Name | Type | Mandatory | Description |
-| ------- | -------- | ---- | ---------------- |
-| success | Function | Yes | Called when the step counter sensor data changes.|
-| fail | Function | No | Callback upon failure. |
+| Name | Type | Mandatory | Description |
+| ------- | -------- | --------- | ---------------------------------------- |
+| success | Function | Yes | Called when the step counter sensor data changes. |
+| fail | Function | No | Callback upon failure. |
Return values of the success callback
-| Name | Type | Description |
-| ----- | ------ | --------------------- |
-| steps | number | Number of counted steps after the sensor is restarted. |
+| Name | Type | Description |
+| ----- | ------ | ---------------------------------------- |
+| steps | number | Number of counted steps after the sensor is restarted. |
**Example**
@@ -302,7 +302,7 @@ sensor.unsubscribeStepCounter();
## sensor.subscribeBarometer
-subcribeBarometer(Object): void
+subscribeBarometer(Object): void
Subscribes to data changes of the barometer sensor. If this API is called multiple times for the same application, the last call takes effect.
@@ -310,16 +310,16 @@ Subscribes to data changes of the barometer sensor. If this API is called multip
**Parameters**
-| Name | Type | Mandatory | Description |
-| ------- | -------- | ---- | ---------------- |
-| success | Function | Yes | Called when the barometer sensor data changes.|
-| fail | Function | No | Callback upon failure. |
+| Name | Type | Mandatory | Description |
+| ------- | -------- | --------- | ---------------------------------------- |
+| success | Function | Yes | Called when the barometer sensor data changes. |
+| fail | Function | No | Callback upon failure. |
Return values of the success callback
-| Name | Type | Description |
-| -------- | ------ | ----------- |
-| pressure | number | Pressure, in pascal.|
+| Name | Type | Description |
+| -------- | ------ | -------------------- |
+| pressure | number | Pressure, in pascal. |
**Example**
@@ -366,16 +366,16 @@ Subscribes to data changes of the heart rate sensor. If this API is called multi
**Parameters**
-| Name | Type | Mandatory | Description |
-| ------- | -------- | ---- | ------------------------- |
-| success | Function | Yes | Called when the heart rate sensor data changes. This callback is invoked every five seconds.|
-| fail | Function | No | Callback upon failure. |
+| Name | Type | Mandatory | Description |
+| ------- | -------- | --------- | ---------------------------------------- |
+| success | Function | Yes | Called when the heart rate sensor data changes. This callback is invoked every five seconds. |
+| fail | Function | No | Callback upon failure. |
Return values of the success callback
-| Name | Type | Description |
-| --------- | ------ | ---- |
-| heartRate | number | Heart rate.|
+| Name | Type | Description |
+| --------- | ------ | ----------- |
+| heartRate | number | Heart rate. |
**Example**
@@ -421,16 +421,16 @@ Subscribes to changes of the wearing state of a wearable device. If this API is
**Parameters**
-| Name | Type | Mandatory | Description |
-| ------- | -------- | ---- | ------------- |
-| success | Function | Yes | Called when the wearing state changes.|
-| fail | Function | No | Callback upon failure. |
+| Name | Type | Mandatory | Description |
+| ------- | -------- | --------- | -------------------------------------- |
+| success | Function | Yes | Called when the wearing state changes. |
+| fail | Function | No | Callback upon failure. |
Return values of the success callback
-| Name | Type | Description |
-| ----- | ------- | ------ |
-| value | boolean | Whether the wearable device is worn.|
+| Name | Type | Description |
+| ----- | ------- | ------------------------------------ |
+| value | boolean | Whether the wearable device is worn. |
**Example**
@@ -473,17 +473,17 @@ Obtains the wearing state of a wearable device.
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | -------- | ---- | ------------ |
-| success | Function | No | Callback upon success.|
-| fail | Function | No | Callback upon failure.|
-| complete | Function | No | Called when the execution is complete.|
+| Name | Type | Mandatory | Description |
+| -------- | -------- | --------- | -------------------------------------- |
+| success | Function | No | Callback upon success. |
+| fail | Function | No | Callback upon failure. |
+| complete | Function | No | Called when the execution is complete. |
Return values of the success callback
-| Name | Type | Description |
-| ----- | ------- | ------ |
-| value | boolean | Whether the wearable device is worn.|
+| Name | Type | Description |
+| ----- | ------- | ------------------------------------ |
+| value | boolean | Whether the wearable device is worn. |
**Example**
@@ -510,18 +510,18 @@ If this API is called multiple times for the same application, the last call tak
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | -------- | ---- | ---------------------------------------- |
-| interval | string | Yes | Interval at which the callback is invoked to return the device orientation sensor data. The default value is **normal**. The options are as follows: - **game**: called at an interval of 20 ms, which is applicable to gaming scenarios. - **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios. - **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
-| success | Function | Yes | Called when the device orientation sensor data changes. |
-| fail | Function | No | Callback upon failure. |
+| Name | Type | Mandatory | Description |
+| -------- | -------- | --------- | ---------------------------------------- |
+| interval | string | Yes | Interval at which the callback is invoked to return the device orientation sensor data. The default value is **normal**. The options are as follows: - **game**: called at an interval of 20 ms, which is applicable to gaming scenarios. - **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios. - **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. |
+| success | Function | Yes | Called when the device orientation sensor data changes. |
+| fail | Function | No | Callback upon failure. |
Return values of the success callback
-| Name | Type | Description |
+| Name | Type | Description |
| ----- | ------ | ---------------------------------------- |
-| alpha | number | Rotation angle around the Z axis when the X/Y axis of the device coincides with the X/Y axis of the earth.|
-| beta | number | Rotation angle around the X axis when the Y/Z axis of the device coincides with the Y/Z axis of the earth.|
-| gamma | number | Rotation angle around the Y axis when the X/Z axis of the device coincides with the X/Z axis of the earth.|
+| alpha | number | Rotation angle around the Z axis when the X/Y axis of the device coincides with the X/Y axis of the earth. |
+| beta | number | Rotation angle around the X axis when the Y/Z axis of the device coincides with the Y/Z axis of the earth. |
+| gamma | number | Rotation angle around the Y axis when the X/Z axis of the device coincides with the X/Z axis of the earth. |
**Example**
@@ -571,19 +571,19 @@ If this API is called multiple times for the same application, the last call tak
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | -------- | ---- | ---------------------------------------- |
-| interval | string | Yes | Interval at which the callback is invoked to return the gyroscope sensor data. The default value is **normal**. The options are as follows: - **game**: called at an interval of 20 ms, which is applicable to gaming scenarios. - **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios. - **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios.|
-| success | Function | Yes | Called when the gyroscope sensor data changes. |
-| fail | Function | No | Callback upon failure. |
+| Name | Type | Mandatory | Description |
+| -------- | -------- | --------- | ---------------------------------------- |
+| interval | string | Yes | Interval at which the callback is invoked to return the gyroscope sensor data. The default value is **normal**. The options are as follows: - **game**: called at an interval of 20 ms, which is applicable to gaming scenarios. - **ui**: called at an interval of 60 ms, which is applicable to UI updating scenarios. - **normal**: called at an interval of 200 ms, which is applicable to power-saving scenarios. |
+| success | Function | Yes | Called when the gyroscope sensor data changes. |
+| fail | Function | No | Callback upon failure. |
Return values of the success callback
-| Name | Type | Description |
-| ---- | ------ | --------- |
-| x | number | Rotation angular velocity of the X axis.|
-| y | number | Rotation angular velocity of the Y axis.|
-| z | number | Rotation angular velocity of the Z axis.|
+| Name | Type | Description |
+| ---- | ------ | ---------------------------------------- |
+| x | number | Rotation angular velocity of the X axis. |
+| y | number | Rotation angular velocity of the Y axis. |
+| z | number | Rotation angular velocity of the Z axis. |
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-update.md b/en/application-dev/reference/apis/js-apis-update.md
index ab8fc8e866ae68175f6ddabc0be83ac1f2803b5f..91013f97245cf0b63073b88c51af91705324038a 100644
--- a/en/application-dev/reference/apis/js-apis-update.md
+++ b/en/application-dev/reference/apis/js-apis-update.md
@@ -7,7 +7,7 @@ There are two types of updates: SD card update and over the air (OTA) update.
- The SD card update depends on the update packages and SD cards.
- The OTA update depends on the server deployed by the device manufacturer for managing update packages. The OTA server IP address is passed by the caller. The request interface is fixed and developed by the device manufacturer.
-> **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.
>
@@ -239,7 +239,7 @@ var versionDigestInfo = {
// Options of the description file
var descriptionOptions = {
- format: DescriptionFormat.STANDARD, // Standard format
+ format: update.DescriptionFormat.STANDARD, // Standard format
language: "zh-cn" // Chinese
}
@@ -282,7 +282,7 @@ var versionDigestInfo = {
// Options of the description file
var descriptionOptions = {
- format: DescriptionFormat.STANDARD, // Standard format
+ format: update.DescriptionFormat.STANDARD, // Standard format
language: "zh-cn" // Chinese
}
@@ -369,7 +369,7 @@ Obtains the description file of the current version. This API uses an asynchrono
```ts
// Options of the description file
var descriptionOptions = {
- format: DescriptionFormat.STANDARD, // Standard format
+ format: update.DescriptionFormat.STANDARD, // Standard format
language: "zh-cn" // Chinese
}
@@ -406,7 +406,7 @@ Obtains the description file of the current version. This API uses a promise to
```ts
// Options of the description file
var descriptionOptions = {
- format: DescriptionFormat.STANDARD, // Standard format
+ format: update.DescriptionFormat.STANDARD, // Standard format
language: "zh-cn" // Chinese
}
@@ -1580,7 +1580,7 @@ Represents an update file.
## UpgradeTaskCallback
-### (eventInfo: [EventInfo](#eventinfo)): void
+(eventInfo: EventInfo): void
Represents an event callback.
diff --git a/en/application-dev/reference/apis/js-apis-url.md b/en/application-dev/reference/apis/js-apis-url.md
index 679dc182e6c06d96248a084e313cc3d1baaea7f9..c060118f7e466da51f2ee5b7fdd6ad20f7e256ca 100755
--- a/en/application-dev/reference/apis/js-apis-url.md
+++ b/en/application-dev/reference/apis/js-apis-url.md
@@ -197,9 +197,9 @@ Obtains the value of the first key-value pair based on the specified key.
**Example**
```js
-let paramsOject = new Url.URLSearchParams('name=Jonathan&age=18');
-let name = paramsOject.get("name"); // is the string "Jonathan"
-let age = parseInt(paramsOject.get("age"), 10); // is the number 18
+let paramsObject = new Url.URLSearchParams('name=Jonathan&age=18');
+let name = paramsObject.get("name"); // is the string "Jonathan"
+let age = parseInt(paramsObject.get("age"), 10); // is the number 18
```
diff --git a/en/application-dev/reference/apis/js-apis-usb.md b/en/application-dev/reference/apis/js-apis-usb.md
index 8979bdeefaaebbd77e0e17bd094313025155527b..d21f6372b5fe26f6e8aeded00e3245b2def23428 100644
--- a/en/application-dev/reference/apis/js-apis-usb.md
+++ b/en/application-dev/reference/apis/js-apis-usb.md
@@ -94,14 +94,16 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | device | [USBDevice](#usbdevice) | Yes| USB device information.|
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| device | [USBDevice](#usbdevice) | Yes| USB device information.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Readonly<[USBDevicePipe](#usbdevicepipe)> | USB device pipe for data transfer.|
+
+| Type| Description|
+| -------- | -------- |
+| Readonly<[USBDevicePipe](#usbdevicepipe)> | USB device pipe for data transfer.|
**Example**
@@ -119,14 +121,16 @@ Checks whether the application has the permission to access the device.
**System capability**: SystemCapability.USB.USBManager
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | deviceName | string | Yes| Device name to set.|
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| deviceName | string | Yes| Device name.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | boolean | Returns **true** if the application has the permission to access the device; returns **false** otherwise.|
+
+| Type| Description|
+| -------- | -------- |
+| boolean | The value **true** indicates that the application has the permission to access the device, and the value **false** indicates the opposite.|
**Example**
@@ -140,19 +144,21 @@ console.log(bool);
requestRight(deviceName: string): Promise<boolean>
-Requests the temporary permission for the application to access the USB device.
+Requests the temporary permission for the application to access the USB device. This API uses a promise to return the result.
**System capability**: SystemCapability.USB.USBManager
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | deviceName | string | Yes| Device name to set.|
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| deviceName | string | Yes| Device name.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<boolean> | Returns **true** if the temporary device access permissions are granted; returns **false** otherwise.|
+
+| Type| Description|
+| -------- | -------- |
+| Promise<boolean> | Promise used to return the result. The value **true** indicates that the temporary device access permissions are granted, and the value **false** indicates the opposite.|
**Example**
@@ -174,16 +180,18 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
- | iface | [USBInterface](#usbinterface) | Yes| USB interface, which is used to determine the index of the interface to claim.|
- | force | boolean | No| Whether to forcibly claim the USB interface. The default value is **false**, indicating not to forcibly claim the USB interface.|
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
+| iface | [USBInterface](#usbinterface) | Yes| USB interface, which is used to determine the index of the interface to claim.|
+| force | boolean | No| Whether to forcibly claim the USB interface. The default value is **false**, indicating not to forcibly claim the USB interface.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | number | Returns **0** if the USB interface is successfully claimed; returns an error code otherwise.|
+
+| Type| Description|
+| -------- | -------- |
+| number | The value **0** indicates that the USB interface is successfully claimed, and an error code indicates the opposite.|
**Example**
@@ -203,15 +211,17 @@ Before you do this, ensure that you have claimed the interface by calling [usb.c
**System capability**: SystemCapability.USB.USBManager
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
- | iface | [USBInterface](#usbinterface) | Yes| USB interface, which is used to determine the index of the interface to release.|
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
+| iface | [USBInterface](#usbinterface) | Yes| USB interface, which is used to determine the index of the interface to release.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | number | Returns **0** if the USB interface is successfully released; returns an error code otherwise.|
+
+| Type| Description|
+| -------- | -------- |
+| number | The value **0** indicates that the USB interface is successfully released, and an error code indicates the opposite.|
**Example**
@@ -231,15 +241,17 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
- | config | [USBConfig](#usbconfig) | Yes| USB configuration to set.|
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
+| config | [USBConfig](#usbconfig) | Yes| USB configuration to set.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | number | Returns **0** if the USB configuration is successfully set; returns an error code otherwise.|
+
+| Type| Description|
+| -------- | -------- |
+| number | The value **0** indicates that the USB configuration is successfully set, and an error code indicates the opposite.|
**Example**
@@ -266,9 +278,10 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| iface | [USBInterface](#usbinterface) | Yes | USB interface to set. |
**Return value**
- | Type| Description|
- | -------- | -------- |
- | number | Returns **0** if the USB interface is successfully set; returns an error code otherwise.|
+
+| Type| Description|
+| -------- | -------- |
+| number | The value **0** indicates that the USB interface is successfully set, and an error code indicates the opposite.|
**Example**
@@ -289,14 +302,15 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
**Return value**
+
| Type| Description|
| -------- | -------- |
-| Uint8Array | Returns the raw USB descriptor if the operation is successful; returns **undefined** otherwise.|
+| Uint8Array | The return value is the raw USB descriptor if the operation is successful, or **undefined** if the operation has failed.|
**Example**
@@ -315,15 +329,16 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address.|
**Return value**
| Type | Description |
| ------ | -------------------- |
-| number | Returns the file descriptor of the USB device if the operation is successful; returns **-1** otherwise.|
+| number | The return value is the file descriptor of the USB device if the operation is successful, or **-1** if the operation has failed.|
**Example**
@@ -342,16 +357,18 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device.|
- | contrlparam | [USBControlParams](#usbcontrolparams) | Yes| Control transfer parameters.|
- | timeout | number | No| Timeout duration. The default value is **0**, indicating no timeout.|
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device.|
+| contrlparam | [USBControlParams](#usbcontrolparams) | Yes| Control transfer parameters.|
+| timeout | number | No| Timeout duration in ms. This parameter is optional. The default value is **0**, indicating no timeout.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<number> | Returns the size of the transmitted or received data block if the control transfer is successful; returns **-1** if an exception occurs.|
+
+| Type| Description|
+| -------- | -------- |
+| Promise<number> | Promise used to return the result, which is the size of the transmitted or received data block if the transfer is successful, or **-1** if an exception has occurred.|
**Example**
@@ -372,17 +389,19 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device.|
- | endpoint | [USBEndpoint](#usbendpoint) | Yes| USB endpoint, which is used to determine the USB port for data transfer.|
- | buffer | Uint8Array | Yes| Buffer for writing or reading data.|
- | timeout | number | No| Timeout duration. The default value is **0**, indicating no timeout.|
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device.|
+| endpoint | [USBEndpoint](#usbendpoint) | Yes| USB endpoint, which is used to determine the USB port for data transfer.|
+| buffer | Uint8Array | Yes| Buffer for writing or reading data.|
+| timeout | number | No| Timeout duration in ms. This parameter is optional. The default value is **0**, indicating no timeout.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<number> | Returns the size of the transmitted or received data block if the control transfer is successful; returns **-1** if an exception occurs.|
+
+| Type| Description|
+| -------- | -------- |
+| Promise<number> | Promise used to return the result, which is the size of the transmitted or received data block if the transfer is successful, or **-1** if an exception has occurred.|
**Example**
@@ -406,14 +425,16 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**System capability**: SystemCapability.USB.USBManager
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe.|
+
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | number | Returns **0** if the USB device pipe is closed successfully; returns an error code otherwise.|
+
+| Type| Description|
+| -------- | -------- |
+| number | The value **0** indicates that the USB device pipe is closed successfully, and an error code indicates the opposite.|
**Example**
@@ -498,8 +519,8 @@ Sets the current USB function list in Device mode.
**Return value**
-| Type | Description |
-| ------------------ | ------------------------------------------------------ |
+| Type | Description |
+| ------------------ | ------------------------------------------------------------ |
| Promise\ | Promise used to return the result. The value **true** indicates that the operation is successful, and the value **false** indicates the opposite.|
**Example**
@@ -601,8 +622,8 @@ Sets the role types supported by a specified port, which can be **powerRole** (f
**Return value**
-| Type | Description |
-| ------------------ | -------------- |
+| Type | Description |
+| ------------------ | ------------------------------------------------------------ |
| Promise\ | Promise used to return the result. The value **true** indicates that the operation is successful, and the value **false** indicates the opposite.|
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-useriam-faceauth.md b/en/application-dev/reference/apis/js-apis-useriam-faceauth.md
new file mode 100644
index 0000000000000000000000000000000000000000..60690327946699362eb5b86deaaae3b438897e3e
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-useriam-faceauth.md
@@ -0,0 +1,81 @@
+# Facial Authentication
+
+The **userIAM.faceAuth** module provides APIs for face enrollment.
+
+> **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 APIs provided by this module are system APIs.
+
+## Modules to Import
+
+```js
+import userIAM_faceAuth from '@ohos.userIAM.faceAuth';
+```
+
+## FaceAuthManager
+
+Provides APIs for facial authentication management.
+
+### constructor
+
+constructor()
+
+A constructor used to create a **FaceAuthManager** object.
+
+**System capability**: SystemCapability.UserIAM.UserAuth.FaceAuth
+
+**Return value**
+
+| Type | Description |
+| ---------------------- | -------------------- |
+| [FaceAuthManager](#faceauthmanager) | **FaceAuthManager** object.|
+
+**Example**
+
+ ```js
+ import userIAM_faceAuth from '@ohos.userIAM.faceAuth';
+
+ let faceAuthManager = new userIAM_faceAuth.FaceAuthManager()
+ ```
+
+### setSurfaceId
+
+setSurfaceId(surfaceId: string): ResultCode;
+
+Sets an [XComponent surface ID](../arkui-ts/ts-basic-components-xcomponent.md#getxcomponentsurfaceid) for the face preview page in the face enrollment process.
+
+**System capability**: SystemCapability.UserIAM.UserAuth.FaceAuth
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------------- | ---------------------------------- | ---- | -------------------------- |
+| surfaceId | string | Yes | ID of the surface held by the [XComponent](../arkui-ts/ts-basic-components-xcomponent.md#getxcomponentsurfaceid).|
+
+**Return value**
+
+| Type | Description |
+| ---------- | ------------------------------------------------------------ |
+| [ResultCode](#resultcode) | Operation result code.|
+
+**Example**
+
+ ```js
+ import userIAM_faceAuth from '@ohos.userIAM.faceAuth';
+
+ let faceAuthManager = new userIAM_faceAuth.FaceAuthManager()
+ faceAuthManager.setSurfaceId("0");
+ ```
+
+## ResultCode
+
+ Enumerates the operation result codes.
+
+ **System capability**: SystemCapability.UserIAM.UserAuth.FaceAuth
+
+| Name | Default Value| Description |
+| ----------------------- | ------ | -------------------- |
+| SUCCESS | 0 | The operation is successful. |
+| FAIL | 1 | The operation fails. |
diff --git a/en/application-dev/reference/apis/js-apis-useriam-userauth.md b/en/application-dev/reference/apis/js-apis-useriam-userauth.md
index d98f43faaf7bc2a575cfa80907a776d9436bfbff..a43b77bcf631b9ad1c2882a841af545fbe9669fd 100644
--- a/en/application-dev/reference/apis/js-apis-useriam-userauth.md
+++ b/en/application-dev/reference/apis/js-apis-useriam-userauth.md
@@ -119,8 +119,6 @@ constructor()
A constructor used to create an **authenticator** object.
-**Required permissions**: ohos.permission.ACCESS_BIOMETRIC
-
**System capability**: SystemCapability.UserIAM.UserAuth.Core
**Return value**
@@ -279,7 +277,8 @@ Cancels an authentication.
// contextId can be obtained using auth(). In this example, it is defined here.
let contextId = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7]);
- let cancelCode = auth.cancel(contextId);
+ let auth = new userIAM_userAuth.UserAuth();
+ let cancelCode = auth.cancelAuth(contextId);
if (cancelCode == userIAM_userAuth.ResultCode.SUCCESS) {
console.info("cancel auth success");
} else {
@@ -492,11 +491,10 @@ getAuthenticator(): Authenticator
Obtains an **Authenticator** object for user authentication.
-**Required permissions**: ohos.permission.ACCESS_BIOMETRIC
-
**System capability**: SystemCapability.UserIAM.UserAuth.Core
**Return value**
+
| Type | Description |
| ----------------------------------------- | ------------ |
| [Authenticator](#authenticatordeprecated) | **Authenticator** object obtained.|
@@ -516,7 +514,7 @@ Provides methods to manage an **Authenticator** object.
### execute(deprecated)
-execute(type: string, level: string, callback: AsyncCallback<number>): void
+execute(type: AuthType, level: SecureLevel, callback: AsyncCallback<number>): void
> **NOTE**
> This API is not longer maintained since API version 8. You are advised to use [auth](#auth8).
@@ -531,8 +529,8 @@ Performs user authentication. This API uses asynchronous callback to return the
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | ------------------------------------------------------------ |
-| type | string | Yes | Authentication type. Only **FACE_ONLY** is supported. **ALL** is reserved and not supported by the current version.|
-| level | string | Yes | Security level of the authentication. It can be S1 (lowest), S2, S3, or S4 (highest). Devices capable of 3D facial recognition support S3 and lower-level authentication. Devices capable of 2D facial recognition support S2 and lower-level authentication.|
+| type | AuthType | Yes | Authentication type. Only **FACE_ONLY** is supported. **ALL** is reserved and not supported by the current version.|
+| level | SecureLevel | Yes | Security level of the authentication. It can be **S1** (lowest), **S2**, **S3**, or **S4** (highest). Devices capable of 3D facial recognition support S3 and lower-level authentication. Devices capable of 2D facial recognition support S2 and lower-level authentication.|
| callback | AsyncCallback<number> | No | Callback used to return the result. |
Parameters returned in callback
@@ -543,19 +541,20 @@ Performs user authentication. This API uses asynchronous callback to return the
**Example**
```js
- authenticator.execute("FACE_ONLY", "S2", (code)=>{
- if (code == userIAM_userAuth.AuthenticationResult.SUCCESS) {
+ let authenticator = userIAM_userAuth.getAuthenticator();
+ authenticator.execute("FACE_ONLY", "S2", (error, code)=>{
+ if (code === userIAM_userAuth.ResultCode.SUCCESS) {
console.info("auth success");
return;
}
console.error("auth fail, code = " + code);
- })
+ });
```
### execute(deprecated)
-execute(type:string, level:string): Promise<number>
+execute(type:AuthType, level:SecureLevel): Promise<number>
> **NOTE**
> This API is not longer maintained since API version 8. You are advised to use [auth](#auth8).
@@ -567,26 +566,28 @@ Performs user authentication. This API uses a promise to return the result.
**System capability**: SystemCapability.UserIAM.UserAuth.Core
**Parameters**
+
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------------------------------ |
-| type | string | Yes | Authentication type. Only **FACE_ONLY** is supported. **ALL** is reserved and not supported by the current version.|
-| level | string | Yes | Security level of the authentication. It can be S1 (lowest), S2, S3, or S4 (highest). Devices capable of 3D facial recognition support S3 and lower-level authentication. Devices capable of 2D facial recognition support S2 and lower-level authentication.|
+| type | AuthType | Yes | Authentication type. Only **FACE_ONLY** is supported. **ALL** is reserved and not supported by the current version.|
+| level | SecureLevel | Yes | Security level of the authentication. It can be **S1** (lowest), **S2**, **S3**, or **S4** (highest). Devices capable of 3D facial recognition support S3 and lower-level authentication. Devices capable of 2D facial recognition support S2 and lower-level authentication.|
**Return value**
+
| Type | Description |
| --------------------- | ------------------------------------------------------------ |
| Promise<number> | Promise used to return the authentication result, which is a number. For details, see [AuthenticationResult](#authenticationresultdeprecated).|
**Example**
-```js
-let authenticator = userIAM_userAuth.getAuthenticator();
-authenticator.execute("FACE_ONLY", "S2").then((code)=>{
- console.info("auth success");
-}).catch((code)=>{
- console.error("auth fail, code = " + code);
-});
-```
+ ```js
+ let authenticator = userIAM_userAuth.getAuthenticator();
+ authenticator.execute("FACE_ONLY", "S2").then((code)=>{
+ console.info("auth success");
+ }).catch((error)=>{
+ console.error("auth fail, code = " + error);
+ });
+ ```
## AuthenticationResult(deprecated)
diff --git a/en/application-dev/reference/apis/js-apis-util.md b/en/application-dev/reference/apis/js-apis-util.md
index f9820758decfac7eaef530c4ff3c65aa81544150..eb52d85a2c418842f2cb2d581fb0583917b68622 100755
--- a/en/application-dev/reference/apis/js-apis-util.md
+++ b/en/application-dev/reference/apis/js-apis-util.md
@@ -1015,7 +1015,7 @@ Obtains the value of the specified key.
| Type| Description|
| -------- | -------- |
-| V \| undefind | Returns the value of the key if a match is found in the buffer; returns **undefined** otherwise.|
+| V \| undefined | Returns the value of the key if a match is found in the buffer; returns **undefined** otherwise.|
**Example**
```js
@@ -1116,7 +1116,7 @@ Removes the specified key and its value from this buffer.
| Type| Description|
| -------- | -------- |
-| V \| undefind | Returns an **Optional** object containing the removed key-value pair if the key exists in the buffer; returns an empty **Optional** object otherwise. If the key is null, an exception will be thrown.|
+| V \| undefined | Returns an **Optional** object containing the removed key-value pair if the key exists in the buffer; returns an empty **Optional** object otherwise. If the key is null, an exception will be thrown.|
**Example**
```js
@@ -1291,7 +1291,7 @@ class Temperature{
// private readonly _temp: Temperature;
this._temp = value;
}
- comapreTo(value){
+ compareTo(value){
return this._temp >= value.getTemp();
}
getTemp(){
diff --git a/en/application-dev/reference/apis/js-apis-wifi.md b/en/application-dev/reference/apis/js-apis-wifi.md
index ae5ab4c9b924e6b72457a9bbadec1cfd26ef5e6b..7f5b41145c5831f3ecd0014687a52366b598f9d4 100644
--- a/en/application-dev/reference/apis/js-apis-wifi.md
+++ b/en/application-dev/reference/apis/js-apis-wifi.md
@@ -25,9 +25,9 @@ Enables WLAN.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.disableWifi
@@ -44,9 +44,9 @@ Disables WLAN.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.isWifiActive
@@ -61,9 +61,9 @@ Checks whether WLAN is enabled.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if WLAN is enabled; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if WLAN is enabled; returns **false** otherwise.|
## wifi.scan
@@ -78,9 +78,9 @@ Starts a scan for WLAN.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.getScanInfos
@@ -95,9 +95,9 @@ Obtains the scan result. This API uses a promise to return the result.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Promise< Array<[WifiScanInfo](#wifiscaninfo)> > | Promise used to return the detected hotspots.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise< Array<[WifiScanInfo](#wifiscaninfo)> > | Promise used to return the detected hotspots.|
## wifi.getScanInfos
@@ -112,9 +112,9 @@ Obtains the scan result. This API uses an asynchronous callback to return the re
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback< Array<[WifiScanInfo](#wifiscaninfo)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the detected hotspots. Otherwise, **err** is a non-zero value and **data** is empty.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback< Array<[WifiScanInfo](#wifiscaninfo)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the detected hotspots. Otherwise, **err** is a non-zero value and **data** is empty.|
**Example**
```js
@@ -247,9 +247,9 @@ Obtains the scan result. This API returns the result synchronously.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Array<[WifiScanInfo](#wifiscaninfo)> | Scan result obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[WifiScanInfo](#wifiscaninfo)> | Scan result obtained.|
## wifi.addDeviceConfig
@@ -266,15 +266,15 @@ Adds network configuration. This API uses a promise to return the result.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Promise<number> | Promise used to return the WLAN configuration ID. If **-1** is returned, the operation has failed.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<number> | Promise used to return the WLAN configuration ID. If **-1** is returned, the operation has failed.|
## WifiDeviceConfig
@@ -412,10 +412,10 @@ Adds network configuration. This API uses an asynchronous callback to return the
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
- | callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
## wifi.addUntrustedConfig7+
@@ -430,15 +430,15 @@ Adds the configuration of an untrusted network. This API uses a promise to retur
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Promise<boolean> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<boolean> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.|
## wifi.addUntrustedConfig7+
@@ -453,10 +453,10 @@ Adds the configuration of an untrusted network. This API uses an asynchronous ca
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
- | callback | AsyncCallback<boolean> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is **true**. If the operation fails, **data** is **false**. If **err** is not **0**, an error has occurred.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| callback | AsyncCallback<boolean> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is **true**. If the operation fails, **data** is **false**. If **err** is not **0**, an error has occurred.|
## wifi.removeUntrustedConfig7+
@@ -471,15 +471,15 @@ Removes the configuration of an untrusted network. This API uses a promise to re
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Promise<boolean> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<boolean> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.|
## wifi.removeUntrustedConfig7+
@@ -494,10 +494,10 @@ Removes the configuration of an untrusted network. This API uses an asynchronous
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.|
- | callback | AsyncCallback<boolean> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is **true**. If the operation fails, **data** is **false**. If **err** is not **0**, an error has occurred.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.|
+| callback | AsyncCallback<boolean> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is **true**. If the operation fails, **data** is **false**. If **err** is not **0**, an error has occurred.|
## wifi.addCandidateConfig9+
@@ -512,15 +512,15 @@ Adds the configuration of a candidate network. This API uses a promise to return
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Promise<number> | Promise used to return the network configuration ID.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<number> | Promise used to return the network configuration ID.|
## wifi.addCandidateConfig9+
@@ -535,10 +535,10 @@ Adds the configuration of a candidate network. This API uses an asynchronous cal
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
- | callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
## wifi.removeCandidateConfig9+
@@ -553,15 +553,15 @@ Removes the configuration of a candidate network. This API uses a promise to ret
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | networkId | number | Yes| ID of the network configuration to remove.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| ID of the network configuration to remove.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Promise<void> | Promise used to return the result.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<void> | Promise used to return the result.|
## wifi.removeCandidateConfig9+
@@ -576,10 +576,10 @@ Removes the configuration of a candidate network. This API uses an asynchronous
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | networkId | number | Yes| ID of the network configuration to remove.|
- | callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the operation is successful, the value of **err** is **0**. If **err** is not **0**, an error has occurred.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| ID of the network configuration to remove.|
+| callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the operation is successful, the value of **err** is **0**. If **err** is not **0**, an error has occurred.|
## wifi.getCandidateConfigs9+
@@ -594,9 +594,9 @@ Obtains candidate network configuration.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Array<[WifiDeviceConfig](#wifideviceconfig)> | Candidate network configuration obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[WifiDeviceConfig](#wifideviceconfig)> | Candidate network configuration obtained.|
## wifi.connectToCandidateConfig9+
@@ -611,9 +611,9 @@ Connects to a candidate network.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | networkId | number | Yes| ID of the candidate network configuration.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| ID of the candidate network configuration.|
## wifi.connectToNetwork
@@ -630,15 +630,15 @@ Connects to the specified network.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | networkId | number | Yes| Network configuration ID.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| Network configuration ID.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.connectToDevice
@@ -656,15 +656,15 @@ Connects to the specified network.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.disconnect
@@ -682,9 +682,9 @@ Disconnects the network.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.getSignalLevel
@@ -699,16 +699,16 @@ Obtains the WLAN signal level.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | rssi | number | Yes| RSSI of the hotspot, in dBm.|
- | band | number | Yes| Frequency band of the WLAN AP.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| rssi | number | Yes| RSSI of the hotspot, in dBm.|
+| band | number | Yes| Frequency band of the WLAN AP.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | number | Signal level obtained. The value range is [0, 4].|
+| **Type**| **Description**|
+| -------- | -------- |
+| number | Signal level obtained. The value range is [0, 4].|
## wifi.getLinkedInfo
@@ -723,9 +723,9 @@ Obtains WLAN connection information. This API uses a promise to return the resul
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<[WifiLinkedInfo](#wifilinkedinfo)> | Promise used to return the WLAN connection information obtained.|
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiLinkedInfo](#wifilinkedinfo)> | Promise used to return the WLAN connection information obtained.|
## wifi.getLinkedInfo
@@ -740,9 +740,9 @@ Obtains WLAN connection information. This API uses an asynchronous callback to r
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[WifiLinkedInfo](#wifilinkedinfo)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the WLAN connection information obtained. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiLinkedInfo](#wifilinkedinfo)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the WLAN connection information obtained. If **err** is not **0**, an error has occurred.|
**Example**
```js
@@ -844,9 +844,9 @@ Checks whether the WLAN is connected.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the WLAN is connected; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the WLAN is connected; returns **false** otherwise.|
## wifi.getSupportedFeatures7+
@@ -863,24 +863,24 @@ Obtains the features supported by this device.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | number | Feature value. |
+| **Type**| **Description**|
+| -------- | -------- |
+| number | Feature value. |
**Feature IDs**
| Value| Description|
| -------- | -------- |
-| 0x0001 | WLAN infrastructure mode|
-| 0x0002 | 5 GHz feature|
-| 0x0004 | Generic Advertisement Service (GAS)/Access Network Query Protocol (ANQP) feature|
-| 0x0008 | Wi-Fi Direct|
-| 0x0010 | SoftAP|
-| 0x0040 | Wi-Fi AWare|
-| 0x8000 | WLAN AP/STA concurrency|
-| 0x8000000 | WPA3 Personal (WPA-3 SAE)|
-| 0x10000000 | WPA3-Enterprise Suite B |
-| 0x20000000 | Enhanced open feature|
+| 0x0001 | WLAN infrastructure mode. |
+| 0x0002 | 5 GHz feature. |
+| 0x0004 | Generic Advertisement Service (GAS)/Access Network Query Protocol (ANQP) feature. |
+| 0x0008 | Wi-Fi Direct. |
+| 0x0010 | SoftAP. |
+| 0x0040 | Wi-Fi AWare. |
+| 0x8000 | WLAN AP/STA concurrency. |
+| 0x8000000 | WPA3 Personal (WPA-3 SAE). |
+| 0x10000000 | WPA3-Enterprise Suite B. |
+| 0x20000000 | Enhanced open feature. |
## wifi.isFeatureSupported7+
@@ -896,15 +896,15 @@ Checks whether the device supports the specified WLAN feature.
**Parameters**
- | **Name**| **Type**| Mandatory| **Description**|
- | -------- | -------- | -------- | -------- |
- | featureId | number | Yes| Feature ID.|
+| **Name**| **Type**| Mandatory| **Description**|
+| -------- | -------- | -------- | -------- |
+| featureId | number | Yes| Feature ID.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
## wifi.getDeviceMacAddress7+
@@ -921,9 +921,9 @@ Obtains the device MAC address.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | string[] | MAC address obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| string[] | MAC address obtained.|
## wifi.getIpInfo7+
@@ -938,9 +938,9 @@ Obtains IP information.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | [IpInfo](#ipinfo7) | IP information obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| [IpInfo](#ipinfo7) | IP information obtained.|
## IpInfo7+
@@ -972,9 +972,9 @@ Obtains the country code.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | string | Country code obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| string | Country code obtained.|
## wifi.reassociate7+
@@ -991,9 +991,9 @@ Re-associates with the network.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.reconnect7+
@@ -1010,9 +1010,9 @@ Reconnects to the network.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.getDeviceConfigs7+
@@ -1029,9 +1029,9 @@ Obtains network configuration.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Array<[WifiDeviceConfig](#wifideviceconfig)> | Array of network configuration obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[WifiDeviceConfig](#wifideviceconfig)> | Array of network configuration obtained.|
## wifi.updateNetwork7+
@@ -1048,15 +1048,15 @@ Updates network configuration.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| New WLAN configuration.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| New WLAN configuration.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | number | ID of the updated network configuration. The value **-1** indicates that the operation has failed.|
+| **Type**| **Description**|
+| -------- | -------- |
+| number | ID of the updated network configuration. The value **-1** indicates that the operation has failed.|
## wifi.disableNetwork7+
@@ -1073,15 +1073,15 @@ Disables network configuration.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | netId | number | Yes| ID of the network configuration to disable.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| netId | number | Yes| ID of the network configuration to disable.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.removeAllNetwork7+
@@ -1098,9 +1098,9 @@ Removes the configuration of all networks.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.removeDevice7+
@@ -1117,15 +1117,15 @@ Removes the specified network configuration.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | id | number | Yes| ID of the network configuration to remove.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| id | number | Yes| ID of the network configuration to remove.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.enableHotspot7+
@@ -1142,9 +1142,9 @@ Enables this hotspot.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.disableHotspot7+
@@ -1161,9 +1161,9 @@ Disables this hotspot.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.isHotspotDualBandSupported7+
@@ -1180,9 +1180,9 @@ Checks whether the hotspot supports dual band.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
## wifi.isHotspotActive7+
@@ -1199,9 +1199,9 @@ Checks whether this hotspot is active.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the hotspot is active; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the hotspot is active; returns **false** otherwise.|
## wifi.setHotspotConfig7+
@@ -1218,15 +1218,15 @@ Sets hotspot configuration.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [HotspotConfig](#hotspotconfig7) | Yes| Hotspot configuration to set.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [HotspotConfig](#hotspotconfig7) | Yes| Hotspot configuration to set.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## HotspotConfig7+
@@ -1260,9 +1260,9 @@ obtains hotspot configuration.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | [HotspotConfig](#hotspotconfig7) | Hotspot configuration obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| [HotspotConfig](#hotspotconfig7) | Hotspot configuration obtained.|
## wifi.getStations7+
@@ -1279,9 +1279,9 @@ Obtains information about the connected stations.
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | Array<[StationInfo](#stationinfo7)> | Connected stations obtained.|
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[StationInfo](#stationinfo7)> | Connected stations obtained.|
## StationInfo7+
@@ -1311,9 +1311,9 @@ Obtains P2P link information. This API uses a promise to return the result.
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Promise used to return the P2P link information obtained.|
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Promise used to return the P2P link information obtained.|
@@ -1354,9 +1354,9 @@ Obtains P2P link information. This API uses an asynchronous callback to return t
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the P2P link information. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the P2P link information. If **err** is not **0**, an error has occurred.|
## wifi.getCurrentGroup8+
@@ -1371,9 +1371,9 @@ Obtains the current P2P group information. This API uses a promise to return the
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Promise used to return the group information obtained.|
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Promise used to return the group information obtained.|
## wifi.getCurrentGroup8+
@@ -1388,9 +1388,9 @@ Obtains the current P2P group information. This API uses an asynchronous callbac
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
## wifi.getP2pPeerDevices8+
@@ -1405,9 +1405,9 @@ Obtains the peer device list in the P2P connection. This API uses a promise to r
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<[WifiP2pDevice[]](#wifip2pdevice8)> | Promise used to return the peer device list.|
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiP2pDevice[]](#wifip2pdevice8)> | Promise used to return the peer device list.|
## wifi.getP2pPeerDevices8+
@@ -1422,9 +1422,9 @@ Obtains the peer device list in the P2P connection. This API uses an asynchronou
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[WifiP2pDevice[]](#wifip2pdevice8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the peer device list obtained. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiP2pDevice[]](#wifip2pdevice8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the peer device list obtained. If **err** is not **0**, an error has occurred.|
## WifiP2pDevice8+
@@ -1469,9 +1469,9 @@ Obtains the local device information in the P2P connection. This API uses a prom
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise<[WifiP2pDevice](#wifip2pdevice8)> | Promise used to return the local device information obtained.|
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiP2pDevice](#wifip2pdevice8)> | Promise used to return the local device information obtained.|
## wifi.getP2pLocalDevice9+
@@ -1486,9 +1486,9 @@ Obtains the local device information in the P2P connection. This API uses an asy
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[WifiP2pDevice](#wifip2pdevice8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the local device information obtained. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiP2pDevice](#wifip2pdevice8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the local device information obtained. If **err** is not **0**, an error has occurred.|
## wifi.createGroup8+
@@ -1503,15 +1503,15 @@ Creates a P2P group.
**Parameters**
- | **Name**| **Type**| Mandatory| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiP2PConfig](#wifip2pconfig8) | Yes| Group configuration.|
+| **Name**| **Type**| Mandatory| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiP2PConfig](#wifip2pconfig8) | Yes| Group configuration.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| Type| Description|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## WifiP2PConfig8+
@@ -1554,9 +1554,9 @@ Removes this P2P group.
**Return value**
- | Type| Description|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| Type| Description|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.p2pConnect8+
@@ -1572,15 +1572,15 @@ Sets up a P2P connection.
**Parameters**
- | **Name**| **Type**| Mandatory| **Description**|
- | -------- | -------- | -------- | -------- |
- | config | [WifiP2PConfig](#wifip2pconfig8) | Yes| P2P group configuration.|
+| **Name**| **Type**| Mandatory| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiP2PConfig](#wifip2pconfig8) | Yes| P2P group configuration.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| Type| Description|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example**
@@ -1662,9 +1662,9 @@ Cancels this P2P connection.
**Return value**
- | Type| Description|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| Type| Description|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.startDiscoverDevices8+
@@ -1679,9 +1679,9 @@ Starts to discover devices.
**Return value**
- | Type| Description|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| Type| Description|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.stopDiscoverDevices8+
@@ -1696,9 +1696,9 @@ Stops discovering devices.
**Return value**
- | Type| Description|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| Type| Description|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.deletePersistentGroup8+
@@ -1716,15 +1716,15 @@ Deletes a persistent group.
**Parameters**
- | **Name**| **Type**| Mandatory| **Description**|
- | -------- | -------- | -------- | -------- |
- | netId | number | Yes| ID of the group to delete.|
+| **Name**| **Type**| Mandatory| **Description**|
+| -------- | -------- | -------- | -------- |
+| netId | number | Yes| ID of the group to delete.|
**Return value**
- | Type| Description|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| Type| Description|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.getP2pGroups9+
@@ -1741,9 +1741,9 @@ Obtains information about all P2P groups. This API uses a promise to return the
**Return value**
- | Type| Description|
- | -------- | -------- |
- | Promise< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> > | Promise used to return the group information obtained.|
+| Type| Description|
+| -------- | -------- |
+| Promise< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> > | Promise used to return the group information obtained.|
## WifiP2pGroupInfo8+
@@ -1779,9 +1779,9 @@ Obtains information about all P2P groups. This API uses an asynchronous callback
**Parameters**
- | Name| Type| Mandatory| Description|
- | -------- | -------- | -------- | -------- |
- | callback | AsyncCallback< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo8)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo8)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
## wifi.setDeviceName8+
@@ -1798,15 +1798,15 @@ Sets the device name.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | devName | string | Yes| Device name to set.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| devName | string | Yes| Device name to set.|
**Return value**
- | **Type**| **Description**|
- | -------- | -------- |
- | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.on('wifiStateChange')7+
@@ -1821,19 +1821,19 @@ Registers the WLAN state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiStateChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the WLAN state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiStateChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the WLAN state.|
**WLAN states**
| **Value**| **Description**|
| -------- | -------- |
-| 0 | Deactivated|
-| 1 | Activated|
-| 2 | Activating|
-| 3 | Deactivating|
+| 0 | Deactivated. |
+| 1 | Activated. |
+| 2 | Activating. |
+| 3 | Deactivating. |
## wifi.off('wifiStateChange')7+
@@ -1848,25 +1848,24 @@ Unregisters the WLAN state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiStateChange**.|
- | callback | Callback<number> | No| Callback used to return the WLAN state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiStateChange**.|
+| callback | Callback<number> | No| Callback used to return the WLAN state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Example**
```js
import wifi from '@ohos.wifi';
- var WIFI_POWER_STATE = "wifiStateChange";
var recvPowerNotifyFunc = result => {
console.info("Receive power state change event: " + result);
}
// Register an event.
- wifi.on(WIFI_POWER_STATE, recvPowerNotifyFunc);
+ wifi.on("wifiStateChange", recvPowerNotifyFunc);
// Unregister an event.
- wifi.off(WIFI_POWER_STATE, recvPowerNotifyFunc);
+ wifi.off("wifiStateChange", recvPowerNotifyFunc);
```
@@ -1882,17 +1881,17 @@ Registers the WLAN connection state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiConnectionChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the WLAN connection state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiConnectionChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the WLAN connection state.|
**WLAN connection states**
| **Value**| **Description**|
| -------- | -------- |
-| 0 | Disconnected|
-| 1 | Connected|
+| 0 | Disconnected.|
+| 1 | Connected.|
## wifi.off('wifiConnectionChange')7+
@@ -1907,10 +1906,10 @@ Unregisters the WLAN connection state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiConnectionChange**.|
- | callback | Callback<number> | No| Callback used to return the WLAN connection state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiConnectionChange**.|
+| callback | Callback<number> | No| Callback used to return the WLAN connection state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('wifiScanStateChange')7+
@@ -1925,17 +1924,17 @@ Registers the WLAN scan state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiScanStateChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the WLAN scan state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiScanStateChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the WLAN scan state.|
**WLAN scan states**
| **Value**| **Description**|
| -------- | -------- |
-| 0 | Scan failed|
-| 1 | Scan successful|
+| 0 | Scan failed.|
+| 1 | Scan successful.|
## wifi.off('wifiScanStateChange')7+
@@ -1968,10 +1967,10 @@ Registers the RSSI change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiRssiChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the RSSI, in dBm.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiRssiChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the RSSI, in dBm.|
## wifi.off('wifiRssiChange')7+
@@ -1986,10 +1985,10 @@ Unregisters the RSSI change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **wifiRssiChange**.|
- | callback | Callback<number> | No| Callback used to return the RSSI. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **wifiRssiChange**.|
+| callback | Callback<number> | No| Callback used to return the RSSI. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('hotspotStateChange')7+
@@ -2004,19 +2003,19 @@ Registers the hotspot state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **hotspotStateChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the hotspot state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **hotspotStateChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the hotspot state.|
**Hotspot states**
| **Value**| **Description**|
| -------- | -------- |
-| 0 | Deactivated|
-| 1 | Activated|
-| 2 | Activating|
-| 3 | Deactivating|
+| 0 | Deactivated. |
+| 1 | Activated. |
+| 2 | Activating. |
+| 3 | Deactivating. |
## wifi.off('hotspotStateChange')7+
@@ -2031,10 +2030,10 @@ Unregisters the hotspot state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **hotspotStateChange**.|
- | callback | Callback<number> | No| Callback used to return the hotspot state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **hotspotStateChange**.|
+| callback | Callback<number> | No| Callback used to return the hotspot state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('p2pStateChange')8+
@@ -2049,20 +2048,20 @@ Registers the P2P state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pStateChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the P2P state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pStateChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the P2P state.|
**P2P states**
| **Value**| **Description**|
| -------- | -------- |
-| 1 | Available|
-| 2 | Opening|
-| 3 | Opened|
-| 4 | Closing|
-| 5 | Closed|
+| 1 | Available. |
+| 2 | Opening. |
+| 3 | Opened. |
+| 4 | Closing. |
+| 5 | Closed. |
## wifi.off('p2pStateChange')8+
@@ -2076,10 +2075,10 @@ Unregisters the P2P state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pStateChange**.|
- | callback | Callback<number> | No| Callback used to return the P2P state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pStateChange**.|
+| callback | Callback<number> | No| Callback used to return the P2P state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('p2pConnectionChange')8+
@@ -2094,10 +2093,10 @@ Registers the P2P connection state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pConnectionChange**.|
- | callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Yes| Callback invoked to return the P2P connection state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pConnectionChange**.|
+| callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Yes| Callback invoked to return the P2P connection state.|
## wifi.off('p2pConnectionChange')8+
@@ -2112,10 +2111,10 @@ Unregisters the P2P connection state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pConnectionChange**.|
- | callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | No| Callback used to return the P2P connection state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pConnectionChange**.|
+| callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | No| Callback used to return the P2P connection state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('p2pDeviceChange')8+
@@ -2130,10 +2129,10 @@ Registers the P2P device state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pDeviceChange**.|
- | callback | Callback<[WifiP2pDevice](#wifip2pdevice8)> | Yes| Callback invoked to return the P2P device state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pDeviceChange**.|
+| callback | Callback<[WifiP2pDevice](#wifip2pdevice8)> | Yes| Callback invoked to return the P2P device state.|
## wifi.off('p2pDeviceChange')8+
@@ -2148,10 +2147,10 @@ Unregisters the P2P device state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pDeviceChange**.|
- | callback | Callback<[WifiP2pDevice](#wifip2pdevice8)> | No| Callback used to return the P2P device state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pDeviceChange**.|
+| callback | Callback<[WifiP2pDevice](#wifip2pdevice8)> | No| Callback used to return the P2P device state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('p2pPeerDeviceChange')8+
@@ -2166,10 +2165,10 @@ Registers the P2P peer device state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
- | callback | Callback<[WifiP2pDevice[]](#wifip2pdevice8)> | Yes| Callback invoked to return the P2P peer device state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
+| callback | Callback<[WifiP2pDevice[]](#wifip2pdevice8)> | Yes| Callback invoked to return the P2P peer device state.|
## wifi.off('p2pPeerDeviceChange')8+
@@ -2184,10 +2183,10 @@ Unregisters the P2P peer device state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
- | callback | Callback<[WifiP2pDevice[]](#wifip2pdevice8)> | No| Callback used to return the peer device state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
+| callback | Callback<[WifiP2pDevice[]](#wifip2pdevice8)> | No| Callback used to return the peer device state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('p2pPersistentGroupChange')8+
@@ -2202,10 +2201,10 @@ Registers the P2P persistent group state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
- | callback | Callback<void> | Yes| Callback invoked to return the P2P persistent group state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
+| callback | Callback<void> | Yes| Callback invoked to return the P2P persistent group state.|
## wifi.off('p2pPersistentGroupChange')8+
@@ -2220,10 +2219,10 @@ Unregisters the P2P persistent group state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
- | callback | Callback<void> | No| Callback used to return the P2P persistent group state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
+| callback | Callback<void> | No| Callback used to return the P2P persistent group state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('p2pDiscoveryChange')8+
@@ -2238,17 +2237,17 @@ Registers the P2P device discovery state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
- | callback | Callback<number> | Yes| Callback invoked to return the P2P device discovery state.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
+| callback | Callback<number> | Yes| Callback invoked to return the P2P device discovery state.|
**P2P discovered device states**
| **Value**| **Description**|
| -------- | -------- |
-| 0 | Initial state|
-| 1 | Discovered|
+| 0 | Initial state.|
+| 1 | Discovered.|
## wifi.off('p2pDiscoveryChange')8+
@@ -2263,7 +2262,7 @@ Unregisters the P2P device discovery state change events.
**Parameters**
- | **Name**| **Type**| **Mandatory**| **Description**|
- | -------- | -------- | -------- | -------- |
- | type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
- | callback | Callback<number> | No| Callback used to return the P2P device discovery state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
+| callback | Callback<number> | No| Callback used to return the P2P device discovery state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
diff --git a/en/application-dev/reference/apis/js-apis-wifiext.md b/en/application-dev/reference/apis/js-apis-wifiext.md
index e421081e97a52ec917050bbfee15dda5e0c6c74a..9ce53d76e2517eb199067f779168fb9fe9d8b032 100644
--- a/en/application-dev/reference/apis/js-apis-wifiext.md
+++ b/en/application-dev/reference/apis/js-apis-wifiext.md
@@ -23,6 +23,7 @@ Enables the WLAN hotspot.
**System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Return value**
+
| **Type**| **Description**|
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
@@ -39,6 +40,7 @@ Disables the WLAN hotspot.
**System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Return value**
+
| **Type**| **Description**|
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
@@ -55,6 +57,7 @@ Obtains the supported power models. This API uses a promise to return the result
**System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Return value**
+
| Type| Description|
| -------- | -------- |
| Promise<Array<[PowerModel](#powermodel)>> | Promise used to return the power models obtained.|
@@ -84,6 +87,7 @@ Obtains the supported power models. This API uses an asynchronous callback to re
**System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Parameters**
+
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<[PowerModel](#powermodel)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is 0 and **data** is the power models obtained. If **err** is not **0**, an error has occurred.|
@@ -100,6 +104,7 @@ Obtains the power model. This API uses a promise to return the result.
**System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Return value**
+
| Type| Description|
| -------- | -------- |
| Promise<[PowerModel](#powermodel)> | Promise used to return the power model obtained.|
@@ -116,6 +121,7 @@ Obtains the power model. This API uses an asynchronous callback to return the re
**System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Parameters**
+
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<[PowerModel](#powermodel)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power model obtained. If **err** is not **0**, an error has occurred.|
@@ -132,11 +138,13 @@ setPowerModel(model: PowerModel) : boolean;
**System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Parameters**
+
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| model | AsyncCallback<[PowerModel](#powermodel)> | Yes| Power model to set.|
**Return value**
+
| **Type**| **Description**|
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
diff --git a/en/application-dev/reference/arkui-js/js-components-basic-input.md b/en/application-dev/reference/arkui-js/js-components-basic-input.md
index 066da49683ce647db66b9c8cdecd551550b23844..2ce4c7d3b07a6e8dbdcd47c4d3143ec8e4b285df 100644
--- a/en/application-dev/reference/arkui-js/js-components-basic-input.md
+++ b/en/application-dev/reference/arkui-js/js-components-basic-input.md
@@ -20,44 +20,44 @@ Not supported
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
-| Name | Type | Default Value | Mandatory | Description |
-| -------------------------------- | ----------------------- | --------- | ---- | ---------------------------------------- |
-| type | string | text | No | Type of the input component. Available values include **text**, **email**, **date**, **time**, **number**, **password**, **button**, **checkbox**, and **radio**. The **text**, **email**, **date**, **time**, **number**, and **password** types can be dynamically switched and modified. The **button**, **checkbox**, and **radio** types cannot be dynamically modified. - **button**: a button that can be clicked. - **checkbox**: a check box. - **radio**: a radio button that allows users to select one from multiple others with the same name. - **text**: a single-line text field. - **email**: a field used for an email address. - **date**: date component, including the year, month, and day, but excluding time. - **time**: time component, without the time zone. - **number**: field for entering digits. - **password**: password field, in which characters will be shielded.|
-| checked | boolean | false | No | Whether the **\** component is selected. This attribute is valid only when **type** is set to **checkbox** or **radio**. |
-| name | string | - | No | Name of the **\** component. This attribute is mandatory when **type** is set to **radio**. |
-| value | string | - | No | Value of the **\** component. When **type** is **radio**, this attribute is mandatory and the value must be unique for radio buttons with the same name.|
-| placeholder | string | - | No | Content of the hint text. This attribute is available only when the component type is set to **text** \|email\|date\|time\|number\|**password**.|
-| maxlength | number | - | No | Maximum number of characters that can be entered in the input box. The empty value indicates no limit. |
-| enterkeytype | string | default | No | Type of the **Enter** key on the soft keyboard. The value cannot be dynamically updated. Available values include: - default - next - go - done - send - search Except for the **next** type, clicking the Enter key hides the soft keyboard.|
-| headericon | string | - | No | Icon resource path before text input. This icon does not support click events and is unavailable for **button**, **checkbox**, and **radio** types. The supported icon image formats are JPG, PNG, and SVG.|
-| showcounter5+ | boolean | false | No | Whether to display the character counter for an input box. This attribute takes effect only when **maxlength** is set. |
-| menuoptions5+ | Array<MeunOption> | - | No | Menu options displayed after users click the **More** button. |
-| autofocus6+ | boolean | false | No | Whether to automatically obtain focus. This attribute setting does not take effect on the application home page. You can enable a text box on the home page to automatically obtain focus, by delaying the **focus** method call (for about 100–500 ms) in **onActive**.|
-| selectedstart6+ | number | -1 | No | Start position for text selection. |
-| selectedend6+ | number | -1 | No | End position for text selection. |
-| softkeyboardenabled6+ | boolean | true | No | Whether to display the soft keyboard during editing. |
-| showpasswordicon6+ | boolean | true | No | Whether to display the icon at the end of the password text box. This attribute is available only when **type** is set to **password**. |
+| Name | Type | Default Value | Mandatory | Description |
+| -------------------------------- | ----------------------- | ------------- | --------- | ---------------------------------------- |
+| type | string | text | No | Type of the input component. Available values include **text**, **email**, **date**, **time**, **number**, **password**, **button**, **checkbox**, and **radio**. The **text**, **email**, **date**, **time**, **number**, and **password** types can be dynamically switched and modified. The **button**, **checkbox**, and **radio** types cannot be dynamically modified. - **button**: a button that can be clicked. - **checkbox**: a check box. - **radio**: a radio button that allows users to select one from multiple others with the same name. - **text**: a single-line text field. - **email**: a field used for an email address. - **date**: date component, including the year, month, and day, but excluding time. - **time**: time component, without the time zone. - **number**: field for entering digits. - **password**: password field, in which characters will be shielded. |
+| checked | boolean | false | No | Whether the **\** component is selected. This attribute is valid only when **type** is set to **checkbox** or **radio**. |
+| name | string | - | No | Name of the **\** component. This attribute is mandatory when **type** is set to **radio**. |
+| value | string | - | No | Value of the **\** component. When **type** is **radio**, this attribute is mandatory and the value must be unique for radio buttons with the same name. |
+| placeholder | string | - | No | Content of the hint text. This attribute is available only when the component type is set to **text** \|email\|date\|time\|number\|**password**. |
+| maxlength | number | - | No | Maximum number of characters that can be entered in the input box. The empty value indicates no limit. |
+| enterkeytype | string | default | No | Type of the **Enter** key on the soft keyboard. The value cannot be dynamically updated. Available values include: - default - next - go - done - send - search Except for the **next** type, clicking the Enter key hides the soft keyboard. |
+| headericon | string | - | No | Icon resource path before text input. This icon does not support click events and is unavailable for **button**, **checkbox**, and **radio** types. The supported icon image formats are JPG, PNG, and SVG. |
+| showcounter5+ | boolean | false | No | Whether to display the character counter for an input box. This attribute takes effect only when **maxlength** is set. |
+| menuoptions5+ | Array<MenuOption> | - | No | Menu options displayed after users click the **More** button. |
+| autofocus6+ | boolean | false | No | Whether to automatically obtain focus. This attribute setting does not take effect on the application home page. You can enable a text box on the home page to automatically obtain focus, by delaying the **focus** method call (for about 100–500 ms) in **onActive**. |
+| selectedstart6+ | number | -1 | No | Start position for text selection. |
+| selectedend6+ | number | -1 | No | End position for text selection. |
+| softkeyboardenabled6+ | boolean | true | No | Whether to display the soft keyboard during editing. |
+| showpasswordicon6+ | boolean | true | No | Whether to display the icon at the end of the password text box. This attribute is available only when **type** is set to **password**. |
**Table 1** MenuOption5+
-| Name | Type | Description |
-| ------- | ------ | ----------- |
-| icon | string | Path of the icon for a menu option.|
-| content | string | Text content of a menu option.|
+| Name | Type | Description |
+| ------- | ------ | ----------------------------------- |
+| icon | string | Path of the icon for a menu option. |
+| content | string | Text content of a menu option. |
## Styles
In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
-| Name | Type | Default Value | Mandatory | Description |
-| ------------------------ | -------------------------- | ---------- | ---- | ---------------------------------------- |
-| color | <color> | \#e6000000 | No | Font color of the single-line text box or button. |
-| font-size | <length> | 16px | No | Font size of the single-line text box or button. |
-| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings. If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
-| placeholder-color | <color> | \#99000000 | No | Color of the hint text in the single-line text box. This attribute is available only when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
-| font-weight | number \| string | normal | No | Font weight of the single-line text box or button. For details, see **font-weight** of the [**\**](../arkui-js/js-components-basic-text.md) component. |
-| caret-color6+ | <color> | - | No | Color of the caret. |
+| Name | Type | Default Value | Mandatory | Description |
+| ------------------------ | ---------------- | ------------- | --------- | ---------------------------------------- |
+| color | <color> | \#e6000000 | No | Font color of the single-line text box or button. |
+| font-size | <length> | 16px | No | Font size of the single-line text box or button. |
+| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings. If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart. |
+| placeholder-color | <color> | \#99000000 | No | Color of the hint text in the single-line text box. This attribute is available only when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
+| font-weight | number \| string | normal | No | Font weight of the single-line text box or button. For details, see **font-weight** of the [**\**](../arkui-js/js-components-basic-text.md) component. |
+| caret-color6+ | <color> | - | No | Color of the caret. |
## Events
@@ -65,31 +65,31 @@ In addition to the [universal styles](../arkui-js/js-components-common-styles.md
In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
- When **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**, the following events are supported.
-
- | Name | Parameter | Description |
+
+ | Name | Parameter | Description |
| ------------------------- | ---------------------------------------- | ---------------------------------------- |
- | change | { value: inputValue } | Triggered when the content entered in the input box changes. The most recent content entered by the user is returned. If you change the **value** attribute directly, this event will not be triggered.|
- | enterkeyclick | { value: enterKey } | Triggered when the **Enter** key on the soft keyboard is clicked. The type of the **Enter** key is returned, which is of the number type. Available values are as follows: - **2**: returned if **enterkeytype** is **go**. - **3**: returned if **enterkeytype** is **search**. - **4**: returned if **enterkeytype** is **send**. - **5**: returned if **enterkeytype** is **next**. - **6**: returned if **enterkeytype** is **default**, **done**, or is not set.|
- | translate5+ | { value: selectedText } | Triggered when users click the translate button in the menu displayed after they select a text segment. The selected text content is returned.|
- | share5+ | { value: selectedText } | Triggered when users click the share button in the menu displayed after they select a text segment. The selected text content is returned.|
- | search5+ | { value: selectedText } | Triggered when users click the search button in the menu displayed after they select a text segment. The selected text content is returned.|
- | optionselect5+ | { index: optionIndex, value: selectedText } | Triggered when users click a menu option in the menu displayed after they select a text segment. This event is valid only when the **menuoptions** attribute is set. The option index and selected text content are returned.|
- | selectchange6+ | { start: number, end: number } | Triggered when the text selection changes. |
+ | change | { value: inputValue } | Triggered when the content entered in the input box changes. The most recent content entered by the user is returned. If you change the **value** attribute directly, this event will not be triggered. |
+ | enterkeyclick | { value: enterKey } | Triggered when the **Enter** key on the soft keyboard is clicked. The type of the **Enter** key is returned, which is of the number type. Available values are as follows: - **2**: returned if **enterkeytype** is **go**. - **3**: returned if **enterkeytype** is **search**. - **4**: returned if **enterkeytype** is **send**. - **5**: returned if **enterkeytype** is **next**. - **6**: returned if **enterkeytype** is **default**, **done**, or is not set. |
+ | translate5+ | { value: selectedText } | Triggered when users click the translate button in the menu displayed after they select a text segment. The selected text content is returned. |
+ | share5+ | { value: selectedText } | Triggered when users click the share button in the menu displayed after they select a text segment. The selected text content is returned. |
+ | search5+ | { value: selectedText } | Triggered when users click the search button in the menu displayed after they select a text segment. The selected text content is returned. |
+ | optionselect5+ | { index: optionIndex, value: selectedText } | Triggered when users click a menu option in the menu displayed after they select a text segment. This event is valid only when the **menuoptions** attribute is set. The option index and selected text content are returned. |
+ | selectchange6+ | { start: number, end: number } | Triggered when the text selection changes. |
- When **type** is set to **checkbox** or **radio**, the following events are supported.
-
- | Name | Parameter | Description |
- | ------ | ---------------------------------------- | ---------------------------------------- |
- | change | { checked:true \| false } | Triggered when the checked status of the **checkbox** or **radio** button changes.|
+
+ | Name | Parameter | Description |
+ | ------ | --------------------------------- | ---------------------------------------- |
+ | change | { checked:true \| false } | Triggered when the checked status of the **checkbox** or **radio** button changes. |
## Methods
In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
-| Name | Parameter | Description |
+| Name | Parameter | Description |
| ------------------- | ---------------------------------------- | ---------------------------------------- |
-| focus | { focus: true\|false }: If **focus** is not passed, the default value **true** is used.| Obtains or loses focus. When **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**, the input method can be displayed or collapsed. |
-| showError | { error: string } | Displays the error message. This method is available when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
+| focus | { focus: true\|false }: If **focus** is not passed, the default value **true** is used. | Obtains or loses focus. When **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**, the input method can be displayed or collapsed. |
+| showError | { error: string } | Displays the error message. This method is available when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**. |
| delete6+ | - | Deletes text based on the current caret position when **type** is set to **text**, **email**, **date**, **time**, **number**, or **password**; deletes the last character and displays the caret if the current input component does not have a caret. |
## Example
diff --git a/en/application-dev/reference/arkui-js/js-components-media-video.md b/en/application-dev/reference/arkui-js/js-components-media-video.md
index 18c3fbef3bff790dfea6359d7a5d7c5516d0ecd5..c024cbe0058093b754c98f04f579b1cd7dac620f 100644
--- a/en/application-dev/reference/arkui-js/js-components-media-video.md
+++ b/en/application-dev/reference/arkui-js/js-components-media-video.md
@@ -3,17 +3,17 @@
> **NOTE**
>
-> - This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
+> - This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
>
-> - Set **configChanges** under **abilities** in the **config.json** file to **orientation**.
-> ```
-> "abilities": [
-> {
-> "configChanges": ["orientation"],
-> ...
-> }
-> ]
-> ```
+> - Set **configChanges** under **abilities** in the **config.json** file to **orientation**.
+> ```
+> "abilities": [
+> {
+> "configChanges": ["orientation"],
+> ...
+> }
+> ]
+> ```
The **\