diff --git a/en/application-dev/background-agent-scheduled-reminder/Readme-EN.md b/en/application-dev/background-agent-scheduled-reminder/Readme-EN.md
new file mode 100644
index 0000000000000000000000000000000000000000..7f4083e641ecf002e40313deaed5a9616ad32913
--- /dev/null
+++ b/en/application-dev/background-agent-scheduled-reminder/Readme-EN.md
@@ -0,0 +1,4 @@
+# Agent-Powered Scheduled Reminders
+
+- [Overview](background-agent-scheduled-reminder-overview.md)
+- [Development Guidelines](background-agent-scheduled-reminder-guide.md)
diff --git a/en/application-dev/background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md b/en/application-dev/background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md
new file mode 100644
index 0000000000000000000000000000000000000000..dedcdc819a68c2bf70b47106adadcfa3a3e74402
--- /dev/null
+++ b/en/application-dev/background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md
@@ -0,0 +1,683 @@
+# Development Guidelines
+
+## When to Use
+
+You can set your application to call the **ReminderRequest** class to create scheduled reminders for countdown timers, calendar events, and alarm clocks. When the created reminders are published, the timing and pop-up notification functions of your application will be taken over by the reminder agent in the background, even when your application is frozen or exits.
+
+## Available APIs
+
+**reminderAgent** encapsulates the methods for publishing and canceling reminders.
+
+**Table 1** Major APIs in reminderAgent
+
+
+
API
+
+
Description
+
+
+
+
function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void;
+
function publishReminder(reminderReq: ReminderRequest): Promise<number>;
+
+
Publishes a scheduled reminder.
+
The maximum number of valid notifications (excluding expired ones that will not pop up again) is 30 for one application and 2000 for the entire system.
+
+
+
function cancelReminder(reminderId: number, callback: AsyncCallback<void>): void;
+
function cancelReminder(reminderId: number): Promise<void>;
+
+
Cancels a specified reminder. (The value of reminderId is obtained from the return value of publishReminder.)
+
+
+
function getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void;
+
function getValidReminders(): Promise<Array<ReminderRequest>>;
+
+
Obtains all valid reminders set by the current application.
+
+
+
function cancelAllReminders(callback: AsyncCallback<void>): void;
+
function cancelAllReminders(): Promise<void>;
+
+
Cancels all reminders set by the current application.
+
+
+
function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void;
+
function addNotificationSlot(slot: NotificationSlot): Promise<void>;
+
+
Registers a NotificationSlot instance to be used by the reminder.
+
+
+
function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void;
+
function removeNotificationSlot(slotType: notification.SlotType): Promise<void>;
+
+**WantAgent** sets the package and ability that are redirected to when the reminder notification is clicked.
+
+**Table 5** WantAgent instance
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
pkgName
+
+
string
+
+
Yes
+
+
Name of the package redirected to when the reminder notification is clicked.
+
+
+
abilityName
+
+
string
+
+
Yes
+
+
Name of the ability redirected to when the reminder notification is clicked.
+
+
+
+
+
+**MaxScreenWantAgent** sets the name of the target package and ability to start automatically when the reminder arrives and the device is not in use. If the device is in use, a notification will be displayed.
+
+**Table 6** MaxScreenWantAgent instance
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
pkgName
+
+
string
+
+
Yes
+
+
Name of the package that is automatically started when the reminder arrives and the device is not in use.
+
+
+
abilityName
+
+
string
+
+
Yes
+
+
Name of the ability that is automatically started when the reminder arrives and the device is not in use.
+
+
+
+
+
+**ReminderRequest** defines the reminder to publish.
+
+**Table 7** ReminderRequest instance
+
+
+
+
+**ReminderRequestCalendar** extends **ReminderRequest** and defines a reminder for a calendar event.
+
+The earliest reminder time must be later than the current time.
+
+**Table 8** ReminderRequestCalendar instance
+
+
+
+
+**ReminderRequestAlarm** extends **ReminderRequest** and defines a reminder for the alarm clock.
+
+**Table 9** ReminderRequestAlarm instance
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
hour
+
+
number
+
+
Yes
+
+
Hour portion of the reminder time.
+
+
+
minute
+
+
number
+
+
Yes
+
+
Minute portion of the reminder time.
+
+
+
daysOfWeek
+
+
Array<number>
+
+
No
+
+
Days of a week when the reminder repeats.
+
+
+
+
+
+**ReminderRequestTimer** extends **ReminderRequest** and defines a reminder for a scheduled timer.
+
+**Table 10** ReminderRequestTimer instance
+
+
+
Obtains an RDB store. You can set parameters for the RDB store based on service requirements, call APIs to perform data operations, and use a callback to return the result.
+
config: configuration of the RDB store.
version: version of the RDB store.
callback: callback invoked to return the RDB store.
Obtains an RDB store. You can set parameters for the RDB store based on service requirements, call APIs to perform data operations, and use a promise to return the result.
Deletes an RDB store. This method uses a callback to return the result.
+
name: name of the RDB store to delete.
callback: callback invoked to return the result. If the RDB store is deleted, true will be returned. Otherwise, false will be returned.
+
+
+
dataRdb
+
+
deleteRdbStore(name: string): Promise<void>
+
+
Deletes an RDB store. This method uses a promise to return the result.
+
name: name of the RDB store to delete.
+
+
+
+
+
+**Managing Data in an RDB Store**
+
+The RDB provides APIs for inserting, deleting, modifying, and querying data in the local RDB store.
+
+- **Inserting data**
+
+ The RDB provides methods for inserting data through **ValuesBucket** in a data table. If the data is inserted successfully, the row number of the data inserted is returned; otherwise, **-1** is returned.
+
+ **Table 2** APIs for inserting data to a data table
+
+
+
Inserts a row of data into a table. This method uses a promise to return the result.
+
name: name of the target table.
values: data to be inserted into the table.
+
+
+
+
+
+- **Updating data**
+
+ Call the **update\(\)** method to pass the new data and specify the update conditions by using **RdbPredicates**. If the data is successfully updated, the row number of the updated data is returned; otherwise, **0** is returned.
+
+ **Table 3** APIs for updating data
+
+
+
Updates the data that meets the conditions specified by the RdbPredicates object. This method uses a promise to return the result.
+
values: data to update, which is stored in ValuesBucket.
rdbPredicates: conditions for updating data.
+
+
+
+
+
+- **Deleting data**
+
+ Call the **delete\(\)** method to delete data meeting the conditions specified by **RdbPredicates**. If the data is deleted, the row number of the deleted data is returned; otherwise, **0** is returned.
+
+ **Table 4** APIs for deleting data
+
+
+
Deletes data based on the conditions specified by RdbPredicates. This method uses a callback to return the result.
+
rdbPredicates: conditions for deleting data.
callback: callback invoked to return the number of rows deleted.
+
+
+
RdbStore
+
+
delete(rdbPredicates: RdbPredicates): Promise
+
+
Deletes data based on the conditions specified by RdbPredicates. This method uses a promise to return the result.
+
rdbPredicates: conditions for deleting data.
+
+
+
+
+
+- **Querying data**
+
+ You can query data in the RDB in either of the following ways:
+
+ - Call the **query** method to query data based on the predicates, without passing any SQL statement.
+ - Run the native SQL statement.
+
+ **Table 5** APIs for querying data
+
+
+
Sets the RdbPredicates to match the field with data type Array<ValueType> and value out of the specified range.
+
field: column name in the database table.
+
value: array of ValueType to match.
RdbPredicates: RdbPredicates object that matches the specified field.
+
+
+
+
+
+**Using the Result Set**
+
+A result set can be regarded as rows of data in the queried results. It allows you to traverse and access the data you have queried. The following table describes the external APIs of **ResultSet**.
+
+>![](public_sys-resources/icon-notice.gif) **NOTICE:**
+>After a result set is used, you must call the **close\(\)** method to close it explicitly.
+
+**Table 7** APIs for using the result set
+
+
+
Class
+
+
API
+
+
Description
+
+
+
+
ResultSet
+
+
goTo(offset:number): boolean
+
+
Moves the result set forwards or backwards by an offset relative to its current position.
+
+
+
ResultSet
+
+
goToRow(position: number): boolean
+
+
Moves the result set to a specified row.
+
+
+
ResultSet
+
+
goToNextRow(): boolean
+
+
Moves the result set to the next row.
+
+
+
ResultSet
+
+
goToPreviousRow(): boolean
+
+
Moves the result set to the previous row.
+
+
+
ResultSet
+
+
getColumnIndex(columnName: string): number
+
+
Obtains the column index based on the specified column name.
+
+
+
ResultSet
+
+
getColumnName(columnIndex: number): string
+
+
Obtains the column name based on the specified column index.
+
+
+
ResultSet
+
+
goToFirstRow(): boolean
+
+
Checks whether the result set is located in the first row.
+
+
+
ResultSet
+
+
goToLastRow(): boolean
+
+
Checks whether the result set is located in the last row.
+
+
+
ResultSet
+
+
getString(columnIndex: number): string
+
+
Obtains the values in the specified column of the current row, in strings.
+
+
+
ResultSet
+
+
getBlob(columnIndex: number): Uint8Array
+
+
Obtains the values in the specified column of the current row, in a byte array.
+
+
+
ResultSet
+
+
getDouble(columnIndex: number): number
+
+
Obtains the values in the specified column of the current row, in double.
+
+
+
ResultSet
+
+
isColumnNull(columnIndex: number): boolean
+
+
Checks whether the values in the specified column of the current row are null.
+
+
+
ResultSet
+
+
close(): void
+
+
Closes the result set.
+
+
+
+
+
+**Encrypting an RDB Store**
+
+You can encrypt an RDB store.
+
+When creating an RDB store, you can add a key for security purposes. After that, the RDB store can be accessed only with the correct key. You can change the key but cannot delete it.
+
+Once an RDB store is created without a key, you cannot add a key any longer.
+
+**Table 8** APIs for changing the key
+
+
+
Changes the encryption key for an RDB store. This method uses a callback to return the result. If the key is changed, 0 is returned. Otherwise, a non-zero value is returned.
Changes the encryption key for an RDB store. This method uses a promise to return the result. If the key is changed, 0 is returned. Otherwise, a non-zero value is returned.
+
+
+
+
+
+## How to Develop
+
+1. Create an RDB store.
+
+ 1. Configure the RDB attributes, including the name and storage mode of the database and whether it is read-only.
+ 2. Initialize the table structure and related data in the database.
+ 3. Create an RDB store.
+
+ The sample code is as follows:
+
+ ```
+ import dataRdb from '@ohos.data.rdb';
+
+ const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)";
+ const STORE_CONFIG = {name: "rdbstore.db",}
+
+ let rdbStore = await dataRdb.getRdbStore(STORE_CONFIG, 1);
+ await rdbStore.executeSql(CREATE_TABLE_TEST);
+ ```
+
+2. Insert data.
+
+ 1. Create a **ValuesBucket** object to store the data you need to insert.
+ 2. Call the **insert\(\)** method to insert data into the RDB store.
+
+ The sample code is as follows:
+
+ ```
+ var u8 = new Uint8Array([1, 2, 3])
+ const valueBucket = {"name": "Tom", "age": 18, "salary": 100.5, "blobType": u8,}
+ let insertPromise = rdbStore.insert("test", valueBucket)
+ ```
+
+3. Query data.
+
+ 1. Create an **RdbPredicates** object to specify query conditions.
+ 2. Call the **query \(\)** method to query data in the RDB store.
+ 3. Call the **ResultSet\(\)** method to obtain the query result.
+
+ The sample code is as follows:
+
+ ```
+ let predicates = new dataRdb.RdbPredicates("test");
+ predicates.equalTo("name", "Tom")
+ let resultSet = await rdbStore.query(predicates)
+
+ resultSet.goToFirstRow()
+ const id = await resultSet.getLong(resultSet.getColumnIndex("id"))
+ const name = await resultSet.getString(resultSet.getColumnIndex("name"))
+ const age = await resultSet.getLong(resultSet.getColumnIndex("age"))
+ const salary = await resultSet.getDouble(resultSet.getColumnIndex("salary"))
+ const blobType = await resultSet.getBlob(resultSet.getColumnIndex("blobType"))
+
+ resultSet.close()
+ ```
+
+
diff --git a/en/application-dev/database/database-relational-overview.md b/en/application-dev/database/database-relational-overview.md
new file mode 100644
index 0000000000000000000000000000000000000000..cd675b9701e9e22147833d1fb7b471f420af2f12
--- /dev/null
+++ b/en/application-dev/database/database-relational-overview.md
@@ -0,0 +1,42 @@
+# RDB Overview
+
+The relational database \(RDB\) manages data based on relational models. With the underlying SQLite database, the RDB provides a complete mechanism for managing local databases. To satisfy different needs in complicated scenarios, the RDB offers a series of methods for performing operations such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements.
+
+## Basic Concepts
+
+- **RDB**
+
+ A type of database based on the relational model of data. The RDB stores data in rows and columns. An RDB is also called RDB store.
+
+- **Predicate**
+
+ A representation of the property or feature of a data entity, or the relationship between data entities. It is mainly used to define operation conditions.
+
+- **Result set**
+
+ A set of query results used to access the data. You can access the required data in a result set in flexible modes.
+
+- **SQLite database**
+
+ A lightweight open-source relational database management system that complies with Atomicity, Consistency, Isolation, and Durability \(ACID\).
+
+
+## Working Principles
+
+The RDB provides a common operation interface for external systems. It uses the SQLite as the underlying persistent storage engine, which supports all SQLite database features.
+
+**Figure 1** How RDB works
+![](figures/how-rdb-works.png "how-rdb-works")
+
+## Default Settings
+
+- The default database logging mode is write-ahead logging \(WAL\).
+- The default database flush mode is Full mode.
+- The default shared memory used by the OpenHarmony database is 2 MB.
+
+## Constraints
+
+- A maximum of four connection pools can be connected to an RDB to manage read and write operations.
+
+- To ensure data accuracy, the RDB supports only one write operation at a time.
+
diff --git a/en/application-dev/database/figures/en-us_image_0000001199139454.png b/en/application-dev/database/figures/en-us_image_0000001199139454.png
new file mode 100644
index 0000000000000000000000000000000000000000..ca52bd43d384c5b2d06fe19623b50e0c66ba6295
Binary files /dev/null and b/en/application-dev/database/figures/en-us_image_0000001199139454.png differ
diff --git a/en/application-dev/database/figures/how-rdb-works.png b/en/application-dev/database/figures/how-rdb-works.png
new file mode 100644
index 0000000000000000000000000000000000000000..35e10dc3a07aef0e85a8f02332c3c6cd9d605448
Binary files /dev/null and b/en/application-dev/database/figures/how-rdb-works.png differ
diff --git a/en/application-dev/database/lightweight-data-store-development.md b/en/application-dev/database/lightweight-data-store-development.md
new file mode 100644
index 0000000000000000000000000000000000000000..856257581cb3e9fb7e34f7a3aee01d470bfcf794
--- /dev/null
+++ b/en/application-dev/database/lightweight-data-store-development.md
@@ -0,0 +1,272 @@
+# Lightweight Data Store Development
+
+## When to Use
+
+The lightweight data store is ideal for storing lightweight and frequently used data, but not for storing a large amount of data or data with frequent changes. The application data is persistently stored on a device in the form of files. Note that the instance accessed by an application contains all data of the file. The data is always loaded to the memory of the device until the application removes it from the memory. The application can perform data operations using the **Storage** APIs.
+
+## Available APIs
+
+The lightweight data store provides applications with data processing capability and allows applications to perform lightweight data storage and query. Data is stored in key-value pairs. Keys are of the string type, and values can be of the number, string, or Boolean type.
+
+**Creating a Storage Instance**
+
+Create a **Storage** instance for data operations. A **Storage** instance is created after data is read from a specified file and loaded to the instance.
+
+**Table 1** API for creating a **Storage** instance
+
+
+
Package Name
+
+
Method
+
+
Description
+
+
+
+
ohos.data.storage
+
+
getStorage(path: string): Promise<Storage>;
+
+
Obtains the Storage singleton corresponding to a file for data operations.
+
+
+
+
+
+**Writing Data**
+
+Call the **put\(\)** method to add or modify data in a **Storage** instance.
+
+**Table 2** API for writing data
+
+
+
Reads data of the number, string, and Boolean types.
+
+
+
+
+
+**Storing Data Persistently**
+
+Call the **flush\(\)** method to write the cached data back to its text file for persistent storage.
+
+**Table 4** API for data persistence
+
+
+
Class
+
+
Method
+
+
Description
+
+
+
+
Storage
+
+
flush(): Promise<void>;
+
+
Writes data in the Storage instance back to its file through an asynchronous thread.
+
+
+
+
+
+**Observing Data Changes**
+
+Specify **StorageObserver** as the callback to subscribe to data changes. When the value of the subscribed key is changed and the **flush\(\)** method is executed, **StorageObserver** will be invoked.
+
+**Table 5** APIs for subscribing to data changes
+
+
+
Deletes a Storage instance from the cache to release memory.
+
+
+
+
+
+## How to Develop
+
+1. Import **@ohos.data.storage** and related modules to the development environment.
+
+ ```
+ import dataStorage from '@ohos.data.storage'
+ import featureAbility from '@ohos.ability.featureAbility' // Used to obtain the file storage path.
+ ```
+
+2. Create a **Storage** instance.
+
+ Read the specified file and load its data to the **Storage** instance for data operations.
+
+ ```
+ var context = featureAbility.getContext()
+ var path = await context.getFilesDir()
+ let promise = dataStorage.getStorage(path + '/mystore')
+ ```
+
+
+1. Write data.
+
+ Use the **put\(\)** method of the **Storage** class to write data to the cached **Storage** instance.
+
+ ```
+ promise.then((storage) => {
+ let getPromise = storage.put('startup', 'auto') // Save data to the Storage instance.
+ getPromise.then(() => {
+ console.info("Put the value of startup successfully.")
+ }).catch((err) => {
+ console.info("Put the value of startup failed with err: " + err)
+ })
+ }).catch((err) => {
+ console.info("Get the storage failed")
+ })
+ ```
+
+
+1. Read data.
+
+ Use the **get\(\)** method of the **Storage** class to read data.
+
+ ```
+ promise.then((storage) => {
+ let getPromise = storage.get('startup', 'default')
+ getPromise.then((value) => {
+ console.info("The value of startup is " + value)
+ }).catch((err) => {
+ console.info("Get the value of startup failed with err: " + err)
+ })
+ }).catch((err) => {
+ console.info("Get the storage failed")
+ })
+ ```
+
+
+1. Store data persistently.
+
+ Use the **flush** or **flushSync** method to flush data in the **Storage** instance to its file.
+
+ ```
+ storage.flush();
+ ```
+
+2. Observe data changes.
+
+ Specify **StorageObserver** as the callback to subscribe to data changes for an application. When the value of the subscribed key is changed and the **flush\(\)** method is executed, **StorageObserver** will be invoked. Unregister the **StorageObserver** when it is no longer required.
+
+ ```
+ promise.then((storage) => {
+ var observer = function (key) {
+ console.info("The key of " + key + " changed.")
+ }
+ storage.on('change', observer)
+ storage.putSync('startup', 'auto') // Modify data in the Storage instance.
+ storage.flushSync() // Trigger the StorageObserver callback.
+
+ storage.off(...change..., observer) // Unsubscribe from the data changes.
+ }).catch((err) => {
+ console.info("Get the storage failed")
+ })
+ ```
+
+
+1. Delete the specified file.
+
+ Use the **deleteStorage** method to delete the **Storage** singleton of the specified file from the memory, and delete the specified file, its backup file, and damaged files. After the specified files are deleted, the application cannot use that instance to perform any data operation. Otherwise, data inconsistency will occur. The deleted data and files cannot be restored.
+
+ ```
+ let promise = dataStorage.deleteStorage(path + '/mystore')
+ promise.then(() => {
+ console.info("Deleted successfully.")
+ }).catch((err) => {
+ console.info("Deleted failed with err: " + err)
+ })
+ ```
+
+
diff --git a/en/application-dev/database/lightweight-data-store-overview.md b/en/application-dev/database/lightweight-data-store-overview.md
new file mode 100644
index 0000000000000000000000000000000000000000..45639c75e8ad5d1b3f68c79da90fbc598af7e840
--- /dev/null
+++ b/en/application-dev/database/lightweight-data-store-overview.md
@@ -0,0 +1,31 @@
+# Lightweight Data Store Overview
+
+Lightweight data store is applicable to access and persistence operations on the data in key-value pairs. When an application accesses a lightweight **Storage** instance, data in the **Storage** instance will be cached in the memory for faster access. The cached data can also be written back to the text file for persistent storage. Since file read and write consume system resources, you are advised to minimize the frequency of reading and writing persistent files.
+
+## Basic Concepts
+
+- **Key-Value data structure**
+
+ A type of data structure. The key is the unique identifier for a piece of data, and the value is the specific data being identified.
+
+- **Non-relational database**
+
+ A database not in compliance with the atomicity, consistency, isolation, and durability \(ACID\) database management properties of relational data transactions. The data in a non-relational database is independent.
+
+
+## Working Principles
+
+1. When an application loads data from a specified **Storage** file to a **Storage** instance, the system stores the instance in the memory through a static container. Each file of an application or process has only one **Storage** instance in the memory, till the application removes the instance from the memory or deletes the **Storage** file.
+2. When obtaining a **Storage** instance, the application can read data from or write data to the instance. The data in the **Storage** instance can be flushed to its **Storage** file by calling the **flush** or **flushSync** method.
+
+**Figure 1** How lightweight data store works
+
+
+![](figures/en-us_image_0000001199139454.png)
+
+## Constraints
+
+- **Storage** instances are loaded to the memory. To minimize non-memory overhead, the number of data records stored in a **Storage** instance cannot exceed 10,000. Delete the instances that are no longer used in a timely manner.
+- The key in the key-value pairs is of the string type. It cannot be empty or exceed 80 characters.
+- If the value in the key-value pairs is of the string type, it can be empty or contain a maximum of 8192 characters.
+
diff --git a/en/application-dev/media/figures/playback-status.png b/en/application-dev/media/figures/playback-status.png
deleted file mode 100755
index e0777e28838f6d2455233f2068339f8548f50c67..0000000000000000000000000000000000000000
Binary files a/en/application-dev/media/figures/playback-status.png and /dev/null differ
diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md
index 85bf1c75e1ae29a122a70fd5d0ef47f411f9b2ca..47a186f0c126877789c41f0b93923e72a500ed24 100644
--- a/en/application-dev/reference/apis/Readme-EN.md
+++ b/en/application-dev/reference/apis/Readme-EN.md
@@ -9,6 +9,7 @@
- Event Notification
- [CommonEvent Module](js-apis-commonEvent.md)
- [Notification Module](js-apis-notification.md)
+ - [Reminder Agent](js-apis-reminderAgent.md)
- Resource Management
- [Resource Manager](js-apis-resource-manager.md)
- [Internationalization \(intl\) ](js-apis-intl.md)
@@ -63,6 +64,9 @@
- Language Base Class Library
- [Obtaining Process Information](js-apis-process.md)
- [URL String Parsing](js-apis-url.md)
+ - [URI String Parsing](js-apis-uri.md)
- [Util](js-apis-util.md)
+ - [XML Parsing and Generation](js-apis-xml.md)
+ - [XML-to-JavaScript Conversion](js-apis-convertxml.md)
- [Worker Startup](js-apis-worker.md)
diff --git a/en/application-dev/reference/apis/js-apis-Context.md b/en/application-dev/reference/apis/js-apis-Context.md
index e2b51f2e3cdf0468fe08a8913d4630b80c28269a..ad42e566a0c64f94801f982541cdd5382d96c55c 100644
--- a/en/application-dev/reference/apis/js-apis-Context.md
+++ b/en/application-dev/reference/apis/js-apis-Context.md
@@ -1,28 +1,5 @@
# Context Module
-## Applicable Devices
-
-| API | Phone| Tablet| Smart TV| Wearable| Lite Wearable| SmartVision Device|
-| ------------------------------------------------------------ | ---- | ---- | ------ | -------- | -------------- | ------------ |
-| Context.getOrCreateLocalDir(callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No| No|
-| Context.getOrCreateLocalDir() | Yes| Yes| Yes| Yes| No| No|
-| Context.verifyPermission(permission: string, options: PermissionOptions, callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No| No|
-| Context.verifyPermission(permission: string, callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No| No|
-| Context.verifyPermission(permission: string, options?: PermissionOptions) | Yes| Yes| Yes| Yes| No| No|
-| Context.requestPermissionsFromUser(permissions: Array\, requestCode: number, resultCallback: AsyncCallback\) | Yes| Yes| Yes| Yes| No| No|
-| Context.getApplicationInfo(callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No| No|
-| Context.getApplicationInfo() | Yes| Yes| Yes| Yes| No| No|
-| Context.getBundleName(callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No| No|
-| Context.getBundleName() | Yes| Yes| Yes| Yes| No| No|
-| Context.getProcessInfo(callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No| No|
-| Context.getProcessInfo() | Yes| Yes| Yes| Yes| No| No|
-| Context.getElementName(callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No| No|
-| Context.getElementName() | Yes| Yes| Yes| Yes| No| No|
-| Context.getProcessName(callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No| No|
-| Context.getProcessName() | Yes| Yes| Yes| Yes| No| No|
-| Context.getCallingBundle(callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No| No|
-| Context.getCallingBundle() | Yes| Yes| Yes| Yes| No| No|
-
## Modules to Import
```js
diff --git a/en/application-dev/reference/apis/js-apis-commonEvent.md b/en/application-dev/reference/apis/js-apis-commonEvent.md
index e3f7238a1279728877203071f3e2bfd5b391fa2e..9ef873e163d62b5391c97a0941ef1226c09cd6a1 100644
--- a/en/application-dev/reference/apis/js-apis-commonEvent.md
+++ b/en/application-dev/reference/apis/js-apis-commonEvent.md
@@ -3,17 +3,6 @@
**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.
-## Applicable Devices
-
-| API | Phone| Tablet| Smart TV| Wearable| Lite Wearable|
-| ------------------------------------------------------------ | ---- | ---- | ------ | -------- | -------------- |
-| CommonEvent.publish(event: string, callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No|
-| CommonEvent.publish(event: string, options: CommonEventPublishData, callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No|
-| CommonEvent.createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No|
-| CommonEvent.createSubscriber(subscribeInfo: CommonEventSubscribeInfo) | Yes| Yes| Yes| Yes| No|
-| CommonEvent.subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback\) | Yes| Yes| Yes| Yes| No|
-| CommonEvent.unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback\) | Yes| Yes| Yes| Yes| No|
-
## Required Permissions
| Common Event Macro| Common Event Name| Subscriber Permissions|
diff --git a/en/application-dev/reference/apis/js-apis-convertxml.md b/en/application-dev/reference/apis/js-apis-convertxml.md
new file mode 100644
index 0000000000000000000000000000000000000000..7d3d923d94128325d197e6fda5d97c8c08752cd6
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-convertxml.md
@@ -0,0 +1,277 @@
+# XML-to-JavaScript Conversion
+
+>![](public_sys-resources/icon-note.gif) **NOTE:**
+>The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## Modules to Import
+
+```
+import convertxml from '@ohos.convertxml';
+```
+
+## Required Permissions
+
+None
+
+## ConvertXML
+
+### convert
+
+convert\(xml: string, options?: ConvertOptions\) : Object
+
+Converts an XML text into a JavaScript object.
+
+- Parameters
+
+
+
@@ -163,6 +164,58 @@ Obtains the localized script for the specified country.
```
+## i18n.isRTL8+
+
+isRTL\(locale: string\): boolean
+
+Checks whether the localized script for the specified language is displayed from right to left.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Description
+
+
+
+
locale
+
+
string
+
+
Locale ID.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the localized script is displayed from right to left, and value false indicates the opposite.
+
+
+
+
+
+- Example
+
+ ```
+ i18n.isRTL("zh-CN");// Since Chinese is not written from right to left, false is returned.
+ i18n.isRTL("ar-EG");// Since Arabic is written from right to left, true is returned.
+ ```
+
+
## i18n.getSystemLanguage
getSystemLanguage\(\): string
@@ -253,3 +306,2086 @@ Obtains the system locale.
```
+## i18n.getCalendar8+
+
+getCalendar\(locale: string, type? : string\): Calendar
+
+Obtains a **Calendar** object.
+
+- 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.
+
+- Example
+
+ ```
+ i18n.getCalendar("zh-Hans", "gregory");
+ ```
+
+
+## Calendar8+
+
+### setTime8+
+
+setTime\(date: Date\): void
+
+Sets the date for this **Calendar** object.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
date
+
+
Date
+
+
Yes
+
+
Date to be set for the Calendar object.
+
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = I18n.getCalendar("en-US", "gregory");
+ var date = new Date(2021, 10, 7, 8, 0, 0, 0);
+ calendar.setTime(date);
+ ```
+
+
+### setTime8+
+
+setTime\(time: number\): void
+
+Sets the date and time for this **Calendar** object. The value is represented by the number of milliseconds that have elapsed since the Unix epoch \(00:00:00 UTC on January 1, 1970\).
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
time
+
+
number
+
+
Yes
+
+
Number of milliseconds that have elapsed since the Unix epoch.
+
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = I18n.getCalendar("en-US", "gregory");
+ calendar.setTime(10540800000);
+ ```
+
+
+### set8+
+
+set\(year: number, month: number, date:number, hour?: number, minute?: number, second?: number\): void
+
+Sets the year, month, day, hour, minute, and second for this **Calendar** object.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
year
+
+
number
+
+
Yes
+
+
Year to set.
+
+
+
month
+
+
number
+
+
Yes
+
+
Month to set.
+
+
+
date
+
+
number
+
+
Yes
+
+
Day to set.
+
+
+
hour
+
+
number
+
+
No
+
+
Hour to set.
+
+
+
minute
+
+
number
+
+
No
+
+
Minute to set.
+
+
+
second
+
+
number
+
+
No
+
+
Second to set.
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = i18n.getCalendar("zh-Hans");
+ calendar.setTime(2021, 10, 1, 8, 0, 0); // set time to 2021.10.1 08:00:00
+ ```
+
+
+### setTimeZone8+
+
+setTimeZone\(timezone: string\): void
+
+Sets the time zone of this **Calendar** object.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
timezone
+
+
string
+
+
Yes
+
+
Time zone, for example, Asia/Shanghai.
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = i18n.getCalendar("zh-Hans");
+ calendar.setTimeZone("Asia/Shanghai");
+ ```
+
+
+### getTimeZone8+
+
+getTimeZone\(\): string
+
+Obtains the time zone of this **Calendar** object.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Time zone of the Calendar object.
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = i18n.getCalendar("zh-Hans");
+ calendar.setTimeZone("Asia/Shanghai");
+ calendar.getTimeZone(); // Asia/Shanghai"
+ ```
+
+
+### getFirstDayOfWeek8+
+
+getFirstDayOfWeek\(\): number
+
+Obtains the start day of a week for this **Calendar** object.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Start day of a week. The value 1 indicates Sunday, and value 7 indicates Saturday.
+
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = I18n.getCalendar("en-US", "gregory");
+ calendar.getFirstDayOfWeek();
+ ```
+
+
+### setFirstDayOfWeek8+
+
+setFirstDayOfWeek\(value: number\): void
+
+Sets the start day of a week for this **Calendar** object.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
value
+
+
number
+
+
No
+
+
Start day of a week. The value 1 indicates Sunday, and value 7 indicates Saturday.
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = i18n.getCalendar("zh-Hans");
+ calendar.setFirstDayOfWeek(0);
+ ```
+
+
+### getMinimalDaysInFirstWeek8+
+
+getMinimalDaysInFirstWeek\(\): number
+
+Obtains the minimum number of days in the first week of a year.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Minimum number of days in the first week of a year.
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = i18n.getCalendar("zh-Hans");
+ calendar.getMinimalDaysInFirstWeek();
+ ```
+
+
+### setMinimalDaysInFirstWeek8+
+
+setMinimalDaysInFirstWeek\(value: number\): void
+
+Sets the minimum number of days in the first week of a year.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
value
+
+
number
+
+
No
+
+
Minimum number of days in the first week of a year.
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = i18n.getCalendar("zh-Hans");
+ calendar.setMinimalDaysInFirstWeek(3);
+ ```
+
+
+### get8+
+
+get\(field: string\): number
+
+Obtains the value of the specified field in the **Calendar** object.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
field
+
+
string
+
+
Yes
+
+
Value of the specified field in the Calendar object. Currently, the valid fields are as follows: 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, and is_leap_month.
+
+
+
+
+
+- Return values
+
+
+
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.
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = i18n.getCalendar("zh-Hans");
+ calendar.setTime(2021, 10, 1, 8, 0, 0); // set time to 2021.10.1 08:00:00
+ calendar.get("hour_of_day"); // 8
+ ```
+
+
+### getDisplayName8+
+
+getDisplayName\(locale: string\): string
+
+Obtains the name of the **Calendar** object displayed for the specified locale.
+
+- 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 values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Name of the Calendar object displayed for the specified locale.
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = i18n.getCalendar("en-US", "buddhist");
+ calendar.getDisplayName("zh"); // Obtain the name of the Buddhist calendar in zh.
+ ```
+
+
+### isWeekend8+
+
+isWeekend\(date?: Date\): boolean
+
+Checks whether the specified date in this **Calendar** object is a weekend.
+
+- 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 values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the date is a weekend, and value false indicates a weekday.
+
+
+
+
+
+- Example
+
+ ```
+ var calendar = i18n.getCalendar("zh-Hans");
+ calendar.setTime(2021, 11, 11, 8, 0, 0); // Set the time to 2021.11.11 08:00:00.
+ calendar.isWeekend(); // false
+ var date = new Date(2011, 11, 6, 9, 0, 0);
+ calendar.isWeekend(date); // true
+ ```
+
+
+## PhoneNumberFormat8+
+
+### constructor8+
+
+constructor\(country: string, options?: PhoneNumberFormatOptions\)
+
+Creates a **PhoneNumberFormat** object.
+
+Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
country
+
+
string
+
+
Yes
+
+
Country or region to which the phone number to be formatted belongs.
+
+- Example
+
+ ```
+ var phoneNumberFormat= new i18n.PhoneNumberFormat("CN", {"type": "E164"});
+ ```
+
+
+### isValidNumber8+
+
+isValidNumber\(number: string\): boolean
+
+Checks whether the format of the specified phone number is valid.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
number
+
+
string
+
+
Yes
+
+
Phone number to be checked.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates the phone number format is valid, and value false indicates the opposite.
+
+
+
+
+
+
+- Example
+
+ ```
+ var phonenumberfmt = new i18n.PhoneNumberFormat("CN");
+ phonenumberfmt.isValidNumber("15812312312");
+ ```
+
+
+### format8+
+
+format\(number: string\): string
+
+Formats a phone number.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
number
+
+
string
+
+
Yes
+
+
Phone number to be formatted.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Formatted phone number.
+
+
+
+
+
+
+- Example
+
+ ```
+ var phonenumberfmt = new i18n.PhoneNumberFormat("CN");
+ phonenumberfmt.format("15812312312");
+ ```
+
+
+## PhoneNumberFormatOptions8+
+
+Defines the options for this **PhoneNumberFormat** object.
+
+
+
Name
+
+
Type
+
+
Readable
+
+
Writable
+
+
Description
+
+
+
+
type
+
+
string
+
+
Yes
+
+
Yes
+
+
Format type of a phone number. The available options are as follows: E164, INTERNATIONAL, NATIONAL, and RFC3966.
+
+
+
+
+
+## UnitInfo8+
+
+Defines the measurement unit information.
+
+
+
Name
+
+
Type
+
+
Readable
+
+
Writable
+
+
Description
+
+
+
+
unit
+
+
string
+
+
Yes
+
+
Yes
+
+
Name of the measurement unit, for example, meter, inch, or cup.
+
+
+
measureSystem
+
+
string
+
+
Yes
+
+
Yes
+
+
Measurement system. The value can be SI, US, or UK.
+
+
+
+
+
+## Util8+
+
+### unitConvert8+
+
+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.
+
+- Parameters
+
+
+
+
+
+- Example
+
+ ```
+ var indexUtil= i18n.getInstance("zh-CN");
+ ```
+
+
+## IndexUtil8+
+
+### getIndexList8+
+
+getIndexList\(\): Array
+
+Obtains the index list for this **locale** object.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
Array<string>
+
+
Index list for this locale.
+
+
+
+
+
+
+- Example
+
+ ```
+ var indexUtil = i18n.getInstance("zh-CN");
+ var indexList = indexUtil.getIndexList();
+ ```
+
+
+### addLocale8+
+
+addLocale\(locale: string\)
+
+Adds the index of the new **locale** object to the index list.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
locale
+
+
string
+
+
Yes
+
+
A string containing locale information, including the language, optional script, and region.
+
+
+
+
+
+
+- Example
+
+ ```
+ var indexUtil = i18n.getInstance("zh-CN");
+ indexUtil.addLocale("en-US");
+ ```
+
+
+### getIndex8+
+
+getIndex\(text: string\): string
+
+Obtains the index of a **text** object.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
text
+
+
string
+
+
Yes
+
+
text object whose index is to be obtained.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Index of the text object.
+
+
+
+
+
+
+- Example
+
+ ```
+ var indexUtil= i18n.getInstance("zh-CN");
+ indexUtil.getIndex("hi"); // Return h.
+ ```
+
+
+## Character8+
+
+### isDigit8+
+
+isDigit\(char: string\): boolean
+
+Checks whether the input character string is comprised of digits.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
char
+
+
string
+
+
Yes
+
+
Input character.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the input character is a digit, and value false indicates the opposite.
+
+
+
+
+
+
+- Example
+
+ ```
+ var isdigit = Character.isDigit("1"); // Return true.
+ ```
+
+
+### isSpaceChar8+
+
+isSpaceChar\(char: string\): boolean
+
+Checks whether the input character is comprised of space.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
char
+
+
string
+
+
Yes
+
+
Input character.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the input character is a space, and value false indicates the opposite.
+
+
+
+
+
+
+- Example
+
+ ```
+ var isspacechar = Character.isSpaceChar("a"); // Return false.
+ ```
+
+
+### isWhitespace8+
+
+isWhitespace\(char: string\): boolean
+
+Checks whether the input character is comprised of white space.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
char
+
+
string
+
+
Yes
+
+
Input character.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the input character is a white space, and value false indicates the opposite.
+
+
+
+
+
+
+- Example
+
+ ```
+ var iswhitespace = Character.isWhitespace("a"); // Return false.
+ ```
+
+
+### isRTL8+
+
+isRTL\(char: string\): boolean
+
+Checks whether the input character string is of the right to left \(RTL\) language.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
char
+
+
string
+
+
Yes
+
+
Input character.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the input character is of the RTL language, and value false indicates the opposite.
+
+
+
+
+
+
+- Example
+
+ ```
+ var isrtl = Character.isRTL("a"); // Return false.
+ ```
+
+
+### isIdeograph8+
+
+isIdeograph\(char: string\): boolean
+
+Checks whether the input character string is comprised of ideographic characters.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
char
+
+
string
+
+
Yes
+
+
Input character.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the input character is an ideographic character, and value false indicates the opposite.
+
+
+
+
+
+
+- Example
+
+ ```
+ var isideograph = Character.isIdeograph("a"); // Return false.
+ ```
+
+
+### isLetter8+
+
+isLetter\(char: string\): boolean
+
+Checks whether the input character string is comprised of letters.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
char
+
+
string
+
+
Yes
+
+
Input character.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the input character is a letter, and value false indicates the opposite.
+
+
+
+
+
+
+- Example
+
+ ```
+ var isletter = Character.isLetter("a"); // Return true.
+ ```
+
+
+### isLowerCase8+
+
+isLowerCase\(char: string\): boolean
+
+Checks whether the input character is comprised of lowercase letters.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
char
+
+
string
+
+
Yes
+
+
Input character.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the input character is a lowercase letter, and value false indicates the opposite.
+
+
+
+
+
+
+- Example
+
+ ```
+ var islowercase = Character.isLowerCase("a"); // Return true.
+ ```
+
+
+### isUpperCase8+
+
+isUpperCase\(char: string\): boolean
+
+Checks whether the input character is comprised of uppercase letters.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
char
+
+
string
+
+
Yes
+
+
Input character.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the input character is an uppercase letter, and value false indicates the opposite.
+
+
+
+
+
+
+- Example
+
+ ```
+ var isuppercase = Character.isUpperCase("a"); // Return false.
+ ```
+
+
+### getType8+
+
+getType\(char: string\): string
+
+Obtains the type of the input character string.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
char
+
+
string
+
+
Yes
+
+
Input character.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Type of the input character.
+
+
+
+
+
+
+- Example
+
+ ```
+ var type = Character.getType("a");
+ ```
+
+
+## i18n.getLineInstance8+
+
+getLineInstance\(locale: string\): BreakIterator
+
+Obtains a [BreakIterator](#section1312302611613) object for text segmentation.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
locale
+
+
string
+
+
Yes
+
+
Valid locale value, for example, zh-Hans-CN. The BreakIterator object segments text according to the rules of the specified locale.
+
+
+- Example
+
+ ```
+ iterator = I18n.getLineInstance("en");
+ iterator.setLineBreakText("Apple is my favorite fruit.");
+ iterator.getLineBreakText(); // Apple is my favorite fruit.
+ ```
+
+
+### current8+
+
+current\(\): number
+
+Obtains the position of the [BreakIterator](#section1312302611613) object in the text being processed.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Position of the BreakIterator object in the text being processed.
+
+
+
+
+
+
+- Example
+
+ ```
+ iterator = I18n.getLineInstance("en");
+ iterator.setLineBreakText("Apple is my favorite fruit.");
+ breakIter.current(); // 0
+ ```
+
+
+### first8+
+
+first\(\): number
+
+Puts the [BreakIterator](#section1312302611613) object to the first text boundary, which is always at the beginning of the processed text.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Offset to the first text boundary of the processed text.
+
+
+
+
+
+
+- Example
+
+ ```
+ iterator = I18n.getLineInstance("en");
+ iterator.setLineBreakText("Apple is my favorite fruit.");
+ breakIter.first(); // 0
+ ```
+
+
+### last8+
+
+last\(\): number
+
+Puts the [BreakIterator](#section1312302611613) object to the last text boundary, which is always the next position after the end of the processed text.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Offset of the last text boundary of the processed text.
+
+
+
+
+
+
+- Example
+
+ ```
+ iterator = I18n.getLineInstance("en");
+ iterator.setLineBreakText("Apple is my favorite fruit.");
+ iterator.last(); // 27
+ ```
+
+
+### next8+
+
+next\(index?: number\): number
+
+Moves the [BreakIterator](#section1312302611613) object backward by the specified number of text boundaries if the specified index is a positive number. If the index is a negative number, the [BreakIterator](#section1312302611613) object will be moved forward by the corresponding number of text boundaries. If no index is specified, the index will be treated as **1**.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
index
+
+
number
+
+
No
+
+
Number of text boundaries by which the BreakIterator 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 values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Position of the BreakIterator 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 object is outside of the processed text after it is moved by the specified number of text boundaries.
+
+
+
+
+
+
+- Example
+
+ ```
+ iterator = I18n.getLineInstance("en");
+ iterator.setLineBreakText("Apple is my favorite fruit.");
+ iterator.first(); // 0
+ iterator.next(); // 6
+ iterator.next(10); // -1
+ ```
+
+
+### previous8+
+
+previous\(\): number
+
+Moves the [BreakIterator](#section1312302611613) object to the previous text boundary.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Position of the BreakIterator object in the text after it is moved to the previous text boundary. The value -1 is returned if the position of the BreakIterator object is outside of the processed text after it is moved by the specified number of text boundaries.
+
+
+
+
+
+
+- Example
+
+ ```
+ iterator = I18n.getLineInstance("en");
+ iterator.setLineBreakText("Apple is my favorite fruit.");
+ iterator.first(); // 0
+ iterator.next(3); // 12
+ iterator.previous(); // 9
+ ```
+
+
+### following8+
+
+following\(offset: number\): number
+
+Moves the [BreakIterator](#section1312302611613) object to the text boundary after the position specified by the offset.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
offset
+
+
number
+
+
Yes
+
+
Offset to the position before the text boundary to which the BreakIterator object is moved.
+
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
The value -1 is returned if the text boundary to which the BreakIterator object is moved is outside of the processed text.
+
+
+
+
+
+
+- Example
+
+ ```
+ iterator = I18n.getLineInstance("en");
+ iterator.setLineBreakText("Apple is my favorite fruit.");
+ iterator.following(0); // 6
+ iterator.following(100); // -1
+ iterator.current(); // 27
+ ```
+
+
+### isBoundary8+
+
+isBoundary\(offset: number\): boolean
+
+Checks whether the position specified by the offset is a text boundary. If **true** is returned, the [BreakIterator](#section1312302611613) object is moved to the position specified by the offset. If **false** is returned, the [BreakIterator](#section1312302611613) object is moved to the text boundary after the position specified by the offset, which is equivalent to calling [following\(offset\)](#section1743155314301).
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
offset
+
+
number
+
+
Yes
+
+
Position to check.
+
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
The value true indicates that the position specified by the offset is a text boundary, and value false indicates the opposite.
+
+
+
+
+
+
+- Example
+
+ ```
+ iterator = I18n.getLineInstance("en");
+ iterator.setLineBreakText("Apple is my favorite fruit.");
+ iterator.isBoundary(0); // true;
+ iterator.isBoundary(5); // false;
+ ```
+
diff --git a/en/application-dev/reference/apis/js-apis-intl.md b/en/application-dev/reference/apis/js-apis-intl.md
index 7d182fd07eb55b848088f153625278a4e469e405..f18b8b8bf316bb4b680d03cef06dbcd19e14bbfe 100644
--- a/en/application-dev/reference/apis/js-apis-intl.md
+++ b/en/application-dev/reference/apis/js-apis-intl.md
@@ -1,10 +1,9 @@
-# Internationalization \(intl\)
+# Internationalization (intl)
>![](../../public_sys-resources/icon-note.gif) **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.
>- This module contains standard i18n APIs, which are defined in ECMA 402.
-
## Modules to Import
```
@@ -17,7 +16,7 @@ None
## Locale
-### Attributes
+### Attributes
Name
@@ -40,7 +39,7 @@ None
No
-
Language associated with the locale.
+
Language associated with the locale, for example, zh.
script
@@ -51,7 +50,7 @@ None
No
-
Script type of the language.
+
Script type of the language, for example, Hans.
region
@@ -62,7 +61,7 @@ None
No
-
Region associated with the locale.
+
Region associated with the locale, for example, CN.
baseName
@@ -73,7 +72,7 @@ None
No
-
Basic information about the locale.
+
Basic key information about the locale, which consists of the language, script, and region, for example, zh-Hans-CN.
caseFirst
@@ -84,7 +83,7 @@ None
No
-
Whether case is taken into account for the locale's collation rules.
+
Whether case is taken into account for the locale's collation rules. The value can be upper, lower, or false.
calendar
@@ -95,7 +94,7 @@ None
No
-
Calendar for the locale.
+
Calendar for the locale. The value can be buddhist, chinese, coptic, dangi, ethioaa, ethiopic, gregory, hebrew, indian, islamic, islamic-umalqura, islamic-tbla, islamic-civil, islamic-rgsa, iso8601, japanese, persian, roc, or islamicc.
collation
@@ -106,7 +105,7 @@ None
No
-
Collation rules for the locale.
+
Collation rules for the locale. The value can be any of the following: big5han, compat, dict, direct, ducet, eor, gb2312, phonebk, phonetic, pinyin, reformed, searchjl, stroke, trad, unihan, and zhuyin.
hourCycle
@@ -117,7 +116,7 @@ None
No
-
Time system for the locale.
+
Time system for the locale. The value can be h11, h12, h23, or h24.
numberingSystem
@@ -128,7 +127,7 @@ None
No
-
Numbering system for the locale.
+
Numbering system for the locale. The value can be any of the following: adlm, ahom, arab, arabext, bali, beng, bhks, brah, cakm, cham, deva, diak, fullwide, gong, gonm, gujr, guru, hanidec, hmng, hmnp, java, kali, khmr, knda, lana, lanatham, laoo, latn, lepc, limb, mathbold, mathdbl, mathmono, mathsanb, mathsans, mlym, modi, mong, mroo, mtei, mymr, mymrshan, mymrtlng, newa, nkoo, olck, orya, osma, rohg, saur, segment, shrd, sind, sinh, sora, sund, takr, talu, tamldec, telu, thai, tibt, tirh, vaii, wara, and wcho.
A string containing locale information, including the language, optional script, and locale.
-
options
-
-
options
-
-
No
-
-
Options for creating the Locale object.
-
-
@@ -193,7 +183,7 @@ Creates a **Locale** object.
```
-### toString
+### toString
toString\(\): string
@@ -225,7 +215,7 @@ Converts locale information to a string.
```
-### maximize
+### maximize
maximize\(\): Locale
@@ -240,7 +230,7 @@ Maximizes information of the **Locale** object. If the script and locale infor
-
@@ -257,7 +247,7 @@ Maximizes information of the **Locale** object. If the script and locale infor
```
-### minimize
+### minimize
minimize\(\): Locale
@@ -272,7 +262,7 @@ Minimizes information of the **Locale** object. If the script and locale infor
@@ -291,9 +281,9 @@ Minimizes information of the **Locale** object. If the script and locale infor
## DateTimeFormat
-### constructor
+### constructor
-constructor\(locale: string, options?:DateTimeOptions\)
+constructor\(locale: string, options?: DateTimeOptions\)
Creates a **DateTimeOptions** object for the specified locale.
@@ -321,11 +311,11 @@ Creates a **DateTimeOptions** object for the specified locale.
@@ -339,9 +329,9 @@ Creates a **DateTimeOptions** object for the specified locale.
```
-### constructor
+### constructor
-constructor\(locales: Array, options?:DateTimeOptions\)
+constructor\(locales: Array, options?: DateTimeOptions\)
Creates a **DateTimeOptions** object for the specified array of locales.
@@ -369,11 +359,11 @@ Creates a **DateTimeOptions** object for the specified array of locales.
@@ -387,9 +377,9 @@ Creates a **DateTimeOptions** object for the specified array of locales.
```
-### format
+### format
-format\(date: Date\): string;
+format\(date: Date\): string
Formats the specified date and time.
@@ -445,9 +435,9 @@ Formats the specified date and time.
```
-### formatRange
+### formatRange
-formatRange\(fromDate: Date, toDate: Date\): string;
+formatRange\(fromDate: Date, toDate: Date\): string
Formats the specified date range.
@@ -513,11 +503,11 @@ Formats the specified date range.
```
-### resolvedOptions
+### resolvedOptions
resolvedOptions\(\): DateTimeOptions
-Obtains the options of the **DateTimeFormat** object.
+Obtains the formatting options for **DateTimeFormat** object.
- Return values
@@ -528,9 +518,9 @@ Obtains the options of the **DateTimeFormat** object.
-
-
-
-- Example
-
- ```
- var numfmt = new Intl.NumberFormat(["en-GB", "zh"], {style:'decimal', notation:"scientific"});
- numfmt.resolvedOptions();
- ```
-
-
-## DateTimeOptions
+## DateTimeOptions
Provides the options for the **DateTimeFormat** object.
@@ -756,7 +560,7 @@ Provides the options for the **DateTimeFormat** object.
No
-
Locale information.
+
Locale, for example, zh-Hans-CN.
dateStyle
@@ -789,7 +593,7 @@ Provides the options for the **DateTimeFormat** object.
Yes
-
Hour cycle. The value can be h11, h12, h23, or h24.
+
Time system for the locale. The value can be h11, h12, h23, or h24.
timeZone
@@ -811,7 +615,7 @@ Provides the options for the **DateTimeFormat** object.
Yes
-
Numbering system.
+
Numbering system for the locale. The value can be any of the following: adlm, ahom, arab, arabext, bali, beng, bhks, brah, cakm, cham, deva, diak, fullwide, gong, gonm, gujr, guru, hanidec, hmng, hmnp, java, kali, khmr, knda, lana, lanatham, laoo, latn, lepc, limb, mathbold, mathdbl, mathmono, mathsanb, mathsans, mlym, modi, mong, mroo, mtei, mymr, mymrshan, mymrtlng, newa, nkoo, olck, orya, osma, rohg, saur, segment, shrd, sind, sinh, sora, sund, takr, talu, tamldec, telu, thai, tibt, tirh, vaii, wara, and wcho.
hour12
@@ -960,94 +764,291 @@ Provides the options for the **DateTimeFormat** object.
-## NumberOptions
+## NumberFormat
-Provides the device capability.
+### constructor
-
-
Name
-
-
Parameter Type
-
-
Readable
-
-
Writable
-
-
Description
-
-
-
-
locale
-
-
string
-
-
Yes
-
-
No
-
-
Locale information.
-
-
-
currency
-
-
string
-
-
Yes
-
-
Yes
-
-
Currency for the specified locale.
-
-
-
currencySign
-
-
string
-
-
Yes
-
-
Yes
-
-
Currency symbol.
-
-
-
currencyDisplay
-
-
string
-
-
Yes
-
-
Yes
-
-
Currency display mode. The value can be symbol, narrowSymbol, code, or name.
-
-
-
unit
-
-
string
-
-
Yes
-
-
Yes
-
-
Currency unit.
-
-
-
unitDisplay
-
-
string
-
-
Yes
-
-
Yes
-
-
Currency unit display format. The value can be long, short, or medium.
-
-
-
signDisplay
-
-
string
-
-
Yes
+constructor\(locale: string, options?: NumberOptions\)
+
+Creates a **NumberFormat** object for the specified locale.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
locale
+
+
string
+
+
Yes
+
+
A string containing locale information, including the language, optional script, and locale.
+
+
+- Example
+
+ ```
+ var numfmt = new Intl.NumberFormat(["en-GB", "zh"], {style:'decimal', notation:"scientific"});
+ numfmt.resolvedOptions();
+ ```
+
+
+## NumberOptions
+
+Provides the device capability.
+
+
+
Name
+
+
Parameter Type
+
+
Readable
+
+
Writable
+
+
Description
+
+
+
+
locale
+
+
string
+
+
Yes
+
+
No
+
+
Locale, for example, zh-Hans-CN.
+
+
+
currency
+
+
string
+
+
Yes
+
+
Yes
+
+
Currency unit, for example, EUR, CNY, or USD.
+
+
+
currencySign
+
+
string
+
+
Yes
+
+
Yes
+
+
Currency unit symbol. The value can be symbol, narrowSymbol, code, or name.
+
+
+
currencyDisplay
+
+
string
+
+
Yes
+
+
Yes
+
+
Currency display mode. The value can be symbol, narrowSymbol, code, or name.
+
+
+
unit
+
+
string
+
+
Yes
+
+
Yes
+
+
Unit name, for example, meter, inch, or hectare.
+
+
+
unitDisplay
+
+
string
+
+
Yes
+
+
Yes
+
+
Unit display format. The value can be long, short, or medium.
+
+
+
unitUsage
+
+
string
+
+
Yes
+
+
Yes
+
+
Unit use case. The value can be any of the following: default, area-land-agricult, area-land-commercl, area-land-residntl, length-person, length-person-small, length-rainfall, length-road, length-road-small, length-snowfall, length-vehicle, length-visiblty, length-visiblty-small, length-person-informal, length-person-small-informal, length-road-informal, speed-road-travel, speed-wind, temperature-person, temperature-weather, and volume-vehicle-fuel.
+
+
+
signDisplay
+
+
string
+
+
Yes
Yes
@@ -1106,7 +1107,7 @@ Provides the device capability.
Yes
-
Numbering system.
+
Numbering system for the locale. The value can be any of the following: adlm, ahom, arab, arabext, bali, beng, bhks, brah, cakm, cham, deva, diak, fullwide, gong, gonm, gujr, guru, hanidec, hmng, hmnp, java, kali, khmr, knda, lana, lanatham, laoo, latn, lepc, limb, mathbold, mathdbl, mathmono, mathsanb, mathsans, mlym, modi, mong, mroo, mtei, mymr, mymrshan, mymrtlng, newa, nkoo, olck, orya, osma, rohg, saur, segment, shrd, sind, sinh, sora, sund, takr, talu, tamldec, telu, thai, tibt, tirh, vaii, wara, and wcho.
useGrouping
@@ -1117,7 +1118,7 @@ Provides the device capability.
Yes
-
Whether to enable grouping for display.
+
Whether to use grouping for display.
miniumumIntegerDigits
@@ -1128,7 +1129,7 @@ Provides the device capability.
Yes
-
Minimum number of integer digits.
+
Minimum number of digits allowed in the integer part of a number. The value ranges from 1 to 21.
miniumumFractionDigits
@@ -1139,7 +1140,7 @@ Provides the device capability.
Yes
-
Minimum number of fraction digits.
+
Minimum number of digits in the fraction part of a number. The value ranges from 0 to 20.
maxiumumFractionDigits
@@ -1150,7 +1151,7 @@ Provides the device capability.
Yes
-
Maximum number of fraction digits.
+
Maximum number of digits in the fraction part of a number. The value ranges from 1 to 21.
miniumumSignificantDigits
@@ -1161,7 +1162,7 @@ Provides the device capability.
Yes
-
Minimum number of significant digits.
+
Minimum number of the least significant digits. The value ranges from 1 to 21.
maxiumumSignificantDigits
@@ -1172,9 +1173,824 @@ Provides the device capability.
Yes
-
Maximum number of significant digits.
+
Maximum number of the least significant digits. The value ranges from 1 to 21.
+## Collator8+
+
+### constructor8+
+
+constructor\(\)
+
+Creates a **Collator** object.
+
+- Example
+
+ ```
+ var collator = new Intl.Collator();
+ ```
+
+
+### constructor8+
+
+constructor\(locale: string | Array, options?: CollatorOptions\)
+
+Creates a **Collator** object based on the specified locale and options.
+
+Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
locale
+
+
string|Array<string>
+
+
Yes
+
+
A string containing locale information, including the language, optional script, and locale.
+
+- Example
+
+ ```
+ var collator = new Intl.Collator("zh-CN", {"localeMatcher": "lookup", "usage": "sort"});
+ ```
+
+
+### compare8+
+
+compare\(first: string, second: string\): number
+
+Compares two strings based on the sorting policy of the **Collator**.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
first
+
+
string
+
+
Yes
+
+
First string to compare.
+
+
+
second
+
+
string
+
+
Yes
+
+
Second string to compare.
+
+
+
+
+
+- Return values
+
+
+
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.
+
+
+
+
+
+
+- Example
+
+ ```
+ var collator = new intl.Collator("zh-Hans");
+ collator.compare("first", "second");
+ ```
+
+
+### resolvedOptions8+
+
+resolvedOptions\(\): CollatorOptions
+
+Returns properties reflecting the locale and collation options of a **Collator** object.
+
+- Return values
+
+
+
+
+
+- Example
+
+ ```
+ var collator = new intl.Collator("zh-Hans");
+ var options = collator.resolvedOptions();
+ ```
+
+
+## CollatorOptions8+
+
+Represents the properties of a **Collator** object.
+
+
+
Name
+
+
Parameter Type
+
+
Readable
+
+
Writable
+
+
Description
+
+
+
+
localeMatcher
+
+
string
+
+
Yes
+
+
Yes
+
+
Locale matching algorithm. The value can be lookup or best fit.
+
+
+
usage
+
+
string
+
+
Yes
+
+
Yes
+
+
Whether the comparison is for sorting or for searching. The value can be sort or search.
+
+
+
sensitivity
+
+
string
+
+
Yes
+
+
Yes
+
+
Differences in the strings that lead to non-zero return values. The value can be base, accent, case, or variant.
+
+
+
ignorePunctuation
+
+
boolean
+
+
Yes
+
+
Yes
+
+
Whether punctuation is ignored. The value can be true or false.
+
+
+
collation
+
+
string
+
+
Yes
+
+
Yes
+
+
Sorting policy. The value can be any of the following: big5han, compat, dict, direct, ducet, eor, gb2312, phonebk, phonetic, pinyin, reformed, searchjl, stroke, trad, unihan, and zhuyin.
+
+
+
numeric
+
+
boolean
+
+
Yes
+
+
Yes
+
+
Whether numeric collation is used. The value can be true or false.
+
+
+
caseFirst
+
+
string
+
+
Yes
+
+
Yes
+
+
Whether upper case or lower case is sorted first. The value can be upper, lower, or false.
+
+
+
+
+
+## PluralRules8+
+
+### constructor8+
+
+constructor\(\)
+
+Create a **PluralRules** object.
+
+- Example
+
+ ```
+ var pluralRules = new Intl.PluralRules();
+ ```
+
+
+### constructor8+
+
+constructor\(locale: string | Array, options?: PluralRulesOptions\)
+
+Creates a **PluralRules** object based on the specified locale and options.
+
+Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
locale
+
+
string|Array<string>
+
+
Yes
+
+
A string containing locale information, including the language, optional script, and locale.
+
+- Example
+
+ ```
+ var pluralRules= new Intl.PluraRules("zh-CN", {"localeMatcher": "lookup", "type": "cardinal"});
+ ```
+
+
+### select8+
+
+select\(n: number\): string
+
+Obtains a string that represents the singular-plural type of the specified number.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
n
+
+
number
+
+
Yes
+
+
Number for which the singular-plural type is to be obtained.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Singular-plural type. The options are as follows: zero, one, two, few, many, and others.
+
+
+
+
+
+
+- Example
+
+ ```
+ var pluralRules = new intl.PluralRules("zh-Hans");
+ pluralRules.select(1);
+ ```
+
+
+## PluralRulesOptions8+
+
+Represents the properties of a **PluralRules** object.
+
+
+
Name
+
+
Parameter Type
+
+
Readable
+
+
Writable
+
+
Description
+
+
+
+
localeMatcher
+
+
string
+
+
Yes
+
+
Yes
+
+
Locale matching algorithm. The value can be lookup or best fit.
+
+
+
type
+
+
string
+
+
Yes
+
+
Yes
+
+
Sorting type. The value can be cardinal or ordinal.
+
+
+
minimumIntegerDigits
+
+
number
+
+
Yes
+
+
Yes
+
+
Minimum number of digits allowed in the integer part of a number. The value ranges from 1 to 21.
+
+
+
minimumFractionDigits
+
+
number
+
+
Yes
+
+
Yes
+
+
Minimum number of digits in the fraction part of a number. The value ranges from 0 to 20.
+
+
+
maximumFractionDigits
+
+
number
+
+
Yes
+
+
Yes
+
+
Maximum number of digits in the fraction part of a number. The value ranges from 1 to 21.
+
+
+
minimumSignificantDigits
+
+
number
+
+
Yes
+
+
Yes
+
+
Minimum number of the least significant digits. The value ranges from 1 to 21.
+
+
+
maximumSignificantDigits
+
+
number
+
+
Yes
+
+
Yes
+
+
Maximum number of the least significant digits. The value ranges from 1 to 21.
+
+
+
+
+
+## RelativeTimeFormat8+
+
+### constructor8+
+
+constructor\(\)
+
+Creates a **RelativeTimeFormat** object.
+
+- Example
+
+ ```
+ var relativetimefmt = new Intl.RelativeTimeFormat();
+ ```
+
+
+### constructor8+
+
+constructor\(locale: string | Array, options?: RelativeTimeFormatInputOptions\)
+
+Creates a **RelativeTimeFormat** object based on the specified locale and options.
+
+Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
locale
+
+
string|Array<string>
+
+
Yes
+
+
A string containing locale information, including the language, optional script, and locale.
+
+- Example
+
+ ```
+ var relativeTimeFormat = new Intl.RelativeTimeFormat("zh-CN", {"localeMatcher": "lookup", "numeric": "always", "style": "long"});
+ ```
+
+
+### format8+
+
+format\(value: numeric, unit: string\): string
+
+Formats the value and unit based on the specified locale and formatting options.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
value
+
+
numeric
+
+
Yes
+
+
Value to format.
+
+
+
unit
+
+
string
+
+
Yes
+
+
Unit to format. The value can be year, quarter, month, week, day, hour, minute, or second.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Relative time after formatting.
+
+
+
+
+
+
+- Example
+
+ ```
+ var relativetimefmt = new Intl.RelativeTimeFormat("zh-CN");
+ relativetimefmt.format(3, "quarter")
+ ```
+
+
+### formatToParts8+
+
+formatToParts\(value: numeric, unit: string\): Array
No
-
An array with supplementary group IDs.
+
Array with supplementary group IDs.
pid
@@ -105,12 +105,23 @@ None
Parent process ID (PPID) of a process.
+
tid8+
+
+
number
+
+
Yes
+
+
No
+
+
Thread ID (TID) of a process.
+
+
## ChildProcess
-Allows a process to obtain the standard input and output of its child processes, send signals, and close its child processes.
+Provides methods for a process to obtain the standard input and output of its child processes, send signals, and close its child processes.
### Attributes
@@ -200,7 +211,6 @@ Waits until the child process ends. This method uses a promise to return the exi
- Example
```
- import process from '@ohos.process';
var child = process.runCmd('ls');
var result = child.wait();
result.then(val=>{
@@ -235,7 +245,6 @@ Obtains the standard output of the child process.
- Example
```
- import process from '@ohos.process';
var child = process.runCmd('ls');
var result = child.wait();
child.getOutput.then(val=>{
@@ -270,7 +279,6 @@ Obtains the standard error output of the child process.
- Example
```
- import process from '@ohos.process';
var child = process.runCmd('madir test.text');
var result = child.wait();
child.getErrorOutput.then(val=>{
@@ -288,7 +296,6 @@ Closes the child process in running.
- Example
```
- import process from '@ohos.process';
var child = process.runCmd('sleep 5; ls');
child.close();
```
@@ -328,12 +335,443 @@ Sends a signal to the specified child process to terminate it.
- Example
```
- import process from '@ohos.process';
var child = process.runCmd('sleep 5; ls');
child.kill(9);
```
+## process.isIsolatedProcess8+
+
+isIsolatedProcess\(\): boolean
+
+Checks whether the process is isolated.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
Returns true if the process is isolated; returns false otherwise.
+
+
+
+
+
+
+- Example
+
+ ```
+ var result = process.isIsolatedProcess();
+ ```
+
+
+## process.isAppUid8+
+
+isAppUid\(v:number\): boolean
+
+Checks whether a UID belongs to this app.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
v
+
+
number
+
+
Yes
+
+
UID.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
Returns true if the UID is the app's UID; returns false otherwise.
+
+
+
+
+
+
+- Example
+
+ ```
+ var result = process.isAppUid(688);
+ ```
+
+
+## process.is64Bit8+
+
+is64Bit\(\): boolean
+
+Checks whether the operating environment is of 64-bit.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
Returns true if the operating environment is of 64-bit; returns false otherwise.
+
+
+
+
+
+- Example
+
+ ```
+ var ressult = process.is64Bit();
+ ```
+
+
+## process.getUidForName8+
+
+getUidForName\(v:string\): number
+
+Obtains the process UID based on the process name.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
v
+
+
string
+
+
Yes
+
+
Process name.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Process UID.
+
+
+
+
+
+- Example
+
+ ```
+ var pres = process.getUidForName("tool")
+ ```
+
+
+## process.getThreadPriority8+
+
+getThreadPriority\(v:number\): number
+
+Obtains the thread priority based on the specified TID.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
v
+
+
number
+
+
Yes
+
+
TID.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Priority of the thread.
+
+
+
+
+
+- Example
+
+ ```
+ var tid = process.tid;
+ var pres = process.getThreadPriority(tid);
+ ```
+
+
+## process.getStartRealtime8+
+
+getStartRealtime\(\) :number
+
+Obtains the duration, in milliseconds, from the time the system starts to the time the process starts.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Time duration obtained.
+
+
+
+
+
+
+- Example
+
+ ```
+ var realtime = process.getStartRealtime();
+ ```
+
+
+## process.getAvailableCores8+
+
+getAvailableCores\(\) :number\[\]
+
+Obtains the number of CPU cores available for the current process on a multi-core device.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number[]
+
+
Number of cores available for the process.
+
+
+
+
+
+
+- Example
+
+ ```
+ var result = getAvailableCores();
+ ```
+
+
+## process.getPastCputime8+
+
+getPastCputime\(\) :number
+
+Obtains the CPU time \(in milliseconds\) from the time the process starts to the current time.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
CPU time obtained.
+
+
+
+
+
+
+- Example
+
+ ```
+ var result = process.getPastCputime() ;
+ ```
+
+
+## process.getSystemConfig8+
+
+getSystemConfig\(name:number\): number
+
+Obtains the system configuration.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
name
+
+
number
+
+
Yes
+
+
System configuration parameter name.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
System configuration obtained.
+
+
+
+
+
+- Example
+
+ ```
+ var _SC_ARG_MAX = 0
+ var pres = process.getSystemConfig(_SC_ARG_MAX)
+ ```
+
+
+## process.getEnvironmentVar8+
+
+getEnvironmentVar\(name:string\): string
+
+Obtains the value of an environment variable.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
name
+
+
string
+
+
Yes
+
+
Environment variable name.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Value of the environment variable.
+
+
+
+
+
+- Example
+
+ ```
+ var pres = process.getEnvironmentVar("PATH")
+ ```
+
+
## process.runCmd
runCmd\(command: string, options?: \{ timeout : number, killSignal : number | string, maxBuffer : number \}\) : ChildProcess
@@ -437,12 +875,11 @@ Forks a new process to run a shell command and returns the **ChildProcess** ob
- Example
```
- import process from '@ohos.process';
var child = process.runCmd('ls', { maxBuffer : 2 });
var result = child.wait();
child.getOutput.then(val=>{
console.log("child.getOutput = " + val);
- }
+ })
```
@@ -455,7 +892,6 @@ Aborts a process and generates a core file. This method will cause a process to
- Example
```
- import process from '@ohos.process';
process.abort();
```
@@ -520,7 +956,6 @@ Stores the events triggered by the user.
- Example
```
- import process from '@ohos.process';
process.on("data", (e)=>{
console.log("data callback");
})
@@ -569,7 +1004,7 @@ Deletes the event stored by the user.
boolean
-
Whether the event is deleted.
+
Returns true if the event is deleted; returns false otherwise.
@@ -578,7 +1013,6 @@ Deletes the event stored by the user.
- Example
```
- import process from '@ohos.process';
process.on("data", (e)=>{
console.log("data callback");
})
@@ -590,7 +1024,7 @@ Deletes the event stored by the user.
exit\(code: number\): void
-Terminates a process.
+Terminates this process.
- Parameters
@@ -620,7 +1054,6 @@ Terminates a process.
- Example
```
- import process from '@ohos.process';
process.exit(0);
```
@@ -629,12 +1062,11 @@ Terminates a process.
cwd\(\): string
-Obtains the working directory of the process.
+Obtains the working directory of this process.
- Example
```
- import process from '@ohos.process';
var path = process.cwd();
```
@@ -643,7 +1075,7 @@ Obtains the working directory of the process.
chdir\(dir: string\): void
-Changes the working directory of the process.
+Changes the working directory of this process.
- Parameters
@@ -673,7 +1105,6 @@ Changes the working directory of the process.
- Example
```
- import process from '@ohos.process';
process.chdir('/system');
```
@@ -682,7 +1113,7 @@ Changes the working directory of the process.
uptime\(\): number
-Obtains the running time of the process.
+Obtains the running time of this process.
- Return values
@@ -704,7 +1135,6 @@ Obtains the running time of the process.
- Example
```
- import process from '@ohos.process';
var time = process.uptime();
```
@@ -760,7 +1190,7 @@ Sends a signal to the specified process to terminate it.
boolean
-
Whether the signal is sent successfully.
+
Returns true if the signal is sent successfully; returns false otherwise.
@@ -769,7 +1199,6 @@ Sends a signal to the specified process to terminate it.
- Example
```
- import process from '@ohos.process'
var pres = process.pid
var result = that.kill(pres, 28)
```
diff --git a/en/application-dev/reference/apis/js-apis-reminderAgent.md b/en/application-dev/reference/apis/js-apis-reminderAgent.md
new file mode 100644
index 0000000000000000000000000000000000000000..9522366139b7fd8e2e73a4630eefeb279e063315
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-reminderAgent.md
@@ -0,0 +1,1199 @@
+# Reminder Agent
+
+>**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.
+
+## Applicable Devices
+
+
+
Phone
+
+
Tablet
+
+
Smart TV
+
+
Wearable
+
+
+
+
Yes
+
+
Yes
+
+
Yes
+
+
Yes
+
+
+
+
+
+## Modules to Import
+
+```
+import reminderAgent from '@ohos.reminderAgent';
+```
+
+## Required Permissions
+
+ohos.permission.PUBLISH\_AGENT\_REMINDER
+
+## reminderAgent.publishReminder
+
+publishReminder\(reminderReq: ReminderRequest, callback: AsyncCallback\): void
+
+Publishes an agent-powered reminder. This method uses an asynchronous callback to return the published reminder's ID.
+
+- Parameters
+
+
+
+
+- Example
+
+```
+reminderAgent.cancelAllReminders((err, data) =>{
+ console.log("do next")}
+)
+```
+
+## reminderAgent.cancelAllReminders
+
+cancelAllReminders\(\): Promise
+
+Cancels all reminders set by the current application. This method uses a promise to return the cancellation result.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
Promise<void>
+
+
Promise used to return the result.
+
+
+
+
+
+- Example
+
+```
+reminderAgent.cancelAllReminders().then(() => {
+ console.log("do next")}
+)
+```
+
+## reminderAgent.addNotificationSlot
+
+addNotificationSlot\(slot: NotificationSlot, callback: AsyncCallback\): void
+
+Adds a reminder notification slot. This method uses an asynchronous callback to return the result.
+
+- Parameters
+
+
+
+
+## WantAgent
+
+Sets the package and ability that are redirected to when the reminder notification is clicked.
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
pkgName
+
+
string
+
+
Yes
+
+
Name of the package redirected to when the reminder notification is clicked.
+
+
+
abilityName
+
+
string
+
+
Yes
+
+
Name of the ability that is redirected to when the reminder notification is clicked.
+
+
+
+
+
+## MaxScreenWantAgent
+
+Sets the name of the target package and ability to start automatically when the reminder arrives and the device is not in use. If the device is in use, a notification will be displayed.
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
pkgName
+
+
string
+
+
Yes
+
+
Name of the package that is automatically started when the reminder arrives and the device is not in use.
+
+
+
abilityName
+
+
string
+
+
Yes
+
+
Name of the ability that is automatically started when the reminder arrives and the device is not in use.
+
+
+
+
+
+## ReminderRequest
+
+Defines the reminder to publish.
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
reminderType
+
+
ReminderType
+
+
Yes
+
+
Type of the reminder.
+
+
+
actionButton
+
+
[ActionButton?, ActionButton?]
+
+
No
+
+
Action button displayed in the reminder notification. (The parameter is optional. Up to two buttons are supported.)
+
+
+
wantAgent
+
+
WantAgent
+
+
No
+
+
Information about the ability that is redirected to when the notification is clicked.
+
+
+
maxScreenWantAgent
+
+
MaxScreenWantAgent
+
+
No
+
+
Information about the ability that is automatically started when the reminder arrives. If the device is in use, a notification will be displayed.
+
+
+
ringDuration
+
+
number
+
+
No
+
+
Ringing duration.
+
+
+
snoozeTimes
+
+
number
+
+
No
+
+
Number of reminder snooze times.
+
+
+
timeInterval
+
+
number
+
+
No
+
+
Reminder snooze interval.
+
+
+
title
+
+
string
+
+
No
+
+
Reminder title.
+
+
+
content
+
+
string
+
+
No
+
+
Reminder content.
+
+
+
expiredContent
+
+
string
+
+
No
+
+
Content to be displayed after the reminder expires.
+
+
+
snoozeContent
+
+
string
+
+
No
+
+
Content to be displayed when the reminder is snoozing.
+
+
+
notificationId
+
+
number
+
+
No
+
+
Notification ID used by the reminder. If there are reminders with the same notification ID, the later one will overwrite the earlier one.
+
+## ReminderRequestAlarm
+
+ReminderRequestAlarm extends ReminderRequest
+
+Defines a reminder for the alarm clock.
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
hour
+
+
number
+
+
Yes
+
+
Hour portion of the reminder time.
+
+
+
minute
+
+
number
+
+
Yes
+
+
Minute portion of the reminder time.
+
+
+
daysOfWeek
+
+
Array<number>
+
+
No
+
+
Days of a week when the reminder repeats.
+
+
+
+
+
+## ReminderRequestTimer
+
+Defines a **ReminderRequestTimer** instance, which extends **ReminderRequest**.
+
+Defines a reminder for a scheduled timer.
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
triggerTimeInSeconds
+
+
number
+
+
Yes
+
+
Number of seconds in the countdown timer.
+
+
+
+
+
+## LocalDateTime
+
+Sets the time information for a calendar reminder.
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
year
+
+
number
+
+
Yes
+
+
Year.
+
+
+
month
+
+
number
+
+
Yes
+
+
Month.
+
+
+
day
+
+
number
+
+
Yes
+
+
Date.
+
+
+
hour
+
+
number
+
+
Yes
+
+
Hour.
+
+
+
minute
+
+
number
+
+
Yes
+
+
Minute.
+
+
+
second
+
+
number
+
+
No
+
+
Second.
+
+
+
+
+
diff --git a/en/application-dev/reference/apis/js-apis-resource-manager.md b/en/application-dev/reference/apis/js-apis-resource-manager.md
index d90f8aef6a156bfc2eb68a8d639aa001831d4f11..355e1fb4dfe5ef566498788dbd412b3d368ec3ad 100644
--- a/en/application-dev/reference/apis/js-apis-resource-manager.md
+++ b/en/application-dev/reference/apis/js-apis-resource-manager.md
@@ -1,9 +1,9 @@
-# Resource Manager
+# Resource Manager
+
>![](../../public_sys-resources/icon-note.gif) **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.
-
## Modules to Import
```
@@ -362,8 +362,6 @@ Enumerates screen density types.
Provides the device configuration.
-### Attributes
-
Name
@@ -406,8 +404,6 @@ Provides the device configuration.
Provides the device capability.
-### Attributes
-
Name
@@ -450,6 +446,10 @@ Provides the device capability.
Provides the capability of accessing application resources.
+>![](../public_sys-resources/icon-note.gif) **NOTE:**
+>- The methods involved in **ResourceManager** are applicable only to the TypeScript-based declarative development paradigm.
+>- Resource files are defined in the **resources** directory of the project. You can obtain the resource ID from **$r\(resource address\).id**, for example, **$r\(?app.string.test?\).id**.
+
### getString
getString\(resId: number, callback: AsyncCallback\): void
@@ -494,7 +494,7 @@ Obtains the string corresponding to the specified resource ID. This method uses
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.getString(0x1000000, (error, value) => {
+ mgr.getString($r('app.string.test').id, (error, value) => {
if (error != null) {
console.log(value);
} else {
@@ -557,7 +557,7 @@ Obtains the string corresponding to the specified resource ID. This method uses
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.getString(0x1000000).then(value => {
+ mgr.getString($r('app.string.test').id).then(value => {
console.log(value);
}).catch(error => {
console.log("getstring promise " + error);
@@ -610,7 +610,7 @@ Obtains the array of strings corresponding to the specified resource ID. This me
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.getStringArray(0x1000000, (error, value) => {
+ mgr.getStringArray($r('app.strarray.test').id, (error, value) => {
if (error != null) {
console.log(value);
} else {
@@ -663,7 +663,7 @@ Obtains the array of strings corresponding to the specified resource ID. This me
Promise<Array<string>>
-
Array of character strings corresponding to the specified resource ID.
+
Array of strings corresponding to the specified resource ID.
@@ -673,7 +673,7 @@ Obtains the array of strings corresponding to the specified resource ID. This me
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.getStringArray(0x1000000).then(value => {
+ mgr.getStringArray($r('app.strarray.test').id).then(value => {
console.log(value);
}).catch(error => {
console.log("getstring promise " + error);
@@ -712,7 +712,7 @@ Obtains the content of the media file corresponding to the specified resource ID
callback
-
AsyncCallback<Array<Uint8Array>>
+
AsyncCallback<Uint8Array>
Yes
@@ -726,7 +726,7 @@ Obtains the content of the media file corresponding to the specified resource ID
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.getMedia(0x1000000, (error, value) => {
+ mgr.getMedia($r('app.media.test').id, (error, value) => {
if (error != null) {
console.log(value);
} else {
@@ -777,7 +777,7 @@ Obtains the content of the media file corresponding to the specified resource ID
-
Promise<Array<Uint8Array>>
+
Promise<Uint8Array>
Promise used to return the content of the obtained media file.
@@ -789,7 +789,7 @@ Obtains the content of the media file corresponding to the specified resource ID
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.getMedia(0x1000000).then(value => {
+ mgr.getMedia($r('app.media.test').id).then(value => {
console.log(value);
}).catch(error => {
console.log("getstring promise " + error);
@@ -842,7 +842,7 @@ Obtains the Base64 code of the image corresponding to the specified resource ID.
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.getMediaBase64(0x1000000, (error, value) => {
+ mgr.getMediaBase64($r('app.media.test').id, (error, value) => {
if (error != null) {
console.log(value);
} else {
@@ -905,7 +905,7 @@ Obtains the Base64 code of the image corresponding to the specified resource ID.
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.getMediaBase64(0x1000000).then(value => {
+ mgr.getMediaBase64($r('app.media.test').id).then(value => {
console.log(value);
}).catch(error => {
console.log("getstring promise " + error);
@@ -1131,7 +1131,7 @@ Obtains the specified number of singular-plural strings corresponding to the spe
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.getPluralString(0x1000000, 1, (error, value) => {
+ mgr.getPluralString($r("app.plural.test").id, 1, (error, value) => {
if (error != null) {
console.log(value);
} else {
@@ -1203,7 +1203,7 @@ Obtains the specified number of singular-plural strings corresponding to the spe
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.getPluralString(0x1000000, 1).then(value => {
+ mgr.getPluralString($r("app.plural.test").id, 1).then(value => {
console.log(value);
}).catch(error => {
console.log("getstring promise " + error);
@@ -1212,3 +1212,118 @@ Obtains the specified number of singular-plural strings corresponding to the spe
```
+### getRawFile8+
+
+getRawFile\(path: string, callback: AsyncCallback\): void
+
+Obtains the content of rawfile in the specified path. This method uses an asynchronous callback to return the result.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
path
+
+
string
+
+
Yes
+
+
Path of the rawfile.
+
+
+
callback
+
+
AsyncCallback<Uint8Array>
+
+
Yes
+
+
Asynchronous callback used to return the rawfile content, in byte arrays.
+
+
+
+
+
+- Example
+
+ ```
+ resourceManager.getResourceManager((error, mgr) => {
+ mgr.getRawFile("test.xml", (error, value) => {
+ if (error != null) {
+ console.log(value);
+ } else {
+ console.log(value);
+ }
+ });
+ });
+ ```
+
+
+### getRawFile8+
+
+getRawFile\(path: string\): Promise
+
+Obtains the content of the rawfile in the specified path. This method uses a promise to return the result.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
path
+
+
string
+
+
Yes
+
+
Path of the rawfile.
+
+
+
+
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
Promise<Uint8Array>
+
+
Promise used to return the rawfile content, in byte arrays.
+
+
+
+
+
+- Example
+
+ ```
+ resourceManager.getResourceManager((error, mgr) => {
+ mgr.getRawFile("test.xml").then(value => {
+ console.log(value);
+ }).catch(error => {
+ console.log("getrawfile promise " + error);
+ });
+ });
+ ```
+
diff --git a/en/application-dev/reference/apis/js-apis-system-time.md b/en/application-dev/reference/apis/js-apis-system-time.md
index e851eec1055856e6d5a97f45bb45199143ea742d..d7cedf77c5f9d2c403e243952dba0ba3e8974564 100644
--- a/en/application-dev/reference/apis/js-apis-system-time.md
+++ b/en/application-dev/reference/apis/js-apis-system-time.md
@@ -3,30 +3,6 @@
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>The APIs of this module are supported since API version 7.
-## Applicable Devices
-
-
-
Phone
-
-
Tablet
-
-
Smart TV
-
-
Wearable
-
-
-
-
Yes
-
-
Yes
-
-
Yes
-
-
Yes
-
-
-
-
## Modules to Import
diff --git a/en/application-dev/reference/apis/js-apis-uri.md b/en/application-dev/reference/apis/js-apis-uri.md
new file mode 100644
index 0000000000000000000000000000000000000000..c3eb105e1c4a8b56a4de085d61c4d9abd76c9fae
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-uri.md
@@ -0,0 +1,338 @@
+# URI String Parsing
+
+>![](../../public_sys-resources/icon-note.gif) **NOTE:**
+>The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## Modules to Import
+
+```
+import uri from '@ohos.uri'
+```
+
+## Required Permissions
+
+None
+
+## URI
+
+### Attributes
+
+
+
Name
+
+
Type
+
+
Readable
+
+
Writable
+
+
Description
+
+
+
+
scheme
+
+
string
+
+
Yes
+
+
No
+
+
Protocol in the URI.
+
+
+
userinfo
+
+
string
+
+
Yes
+
+
No
+
+
User information in the URI.
+
+
+
host
+
+
string
+
+
Yes
+
+
No
+
+
Host name (without the port number) in the URI.
+
+
+
port
+
+
string
+
+
Yes
+
+
No
+
+
Port number in the URI.
+
+
+
path
+
+
string
+
+
Yes
+
+
No
+
+
Path in the URI.
+
+
+
query
+
+
string
+
+
Yes
+
+
No
+
+
Query part in the URI.
+
+
+
fragment
+
+
string
+
+
Yes
+
+
No
+
+
Fragment part in the URI.
+
+
+
authority
+
+
string
+
+
Yes
+
+
No
+
+
Authority part in the URI.
+
+
+
ssp
+
+
string
+
+
Yes
+
+
No
+
+
Scheme-specific part in the URI.
+
+
+
+
+
+### constructor
+
+constructor\(uri: string\)
+
+A constructor used to create a URI instance.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Readable
+
+
Writable
+
+
Description
+
+
+
+
url
+
+
string
+
+
Yes
+
+
Yes
+
+
Input parameter object.
+
+
+
+
+
+
+- Example
+
+ ```
+ var mm = 'http://username:password@host:8080/directory/file?foo=1&bar=2#fragment';
+ new uri.URI(mm); // Output 'http://username:password@host:8080/directory/file?foo=1&bar=2#fragment';
+ ```
+
+ ```
+ new uri.URI('http://username:password@host:8080'); // Output 'http://username:password@host:8080';
+ ```
+
+
+### toString
+
+toString\(\): string
+
+Obtains the query string applicable to this URL.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Website address in a serialized string.
+
+
+
+
+
+
+- Example
+
+ ```
+ const url = new uri.URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
+ url.toString()
+ ```
+
+
+### equals
+
+equals\(other: URI\): boolean
+
+Checks whether this URI is the same as another URI object.
+
+- Parameters
+
+
+
Returns true if the two URIs are the same; returns false otherwise.
+
+
+
+
+
+
+- Example
+
+ ```
+ const uriInstance = new uri.URI('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
+ const uriInstance1 = new uri.URI('http://username:password@host:8080/directory/file?query=pppppp#qwer=da#fragment');
+ uriInstance.equals(uriInstance1);
+ ```
+
+
+### checkIsAbsolute
+
+checkIsAbsolute\(\): boolean
+
+Checks whether this URI is an absolute URI \(whether the scheme component is defined\).
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
Returns true if the URI is an absolute URI; returns false otherwise.
+
+
+
+
+
+
+- Example
+
+ ```
+ const uriInstance = new uri.URI('http://username:password@www.qwer.com:8080?query=pppppp');
+ uriInstance.checkIsAbsolute();
+ ```
+
+
+### normalize
+
+normalize\(\): URI
+
+Normalizes the path of this URI.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
URI
+
+
URI with the normalized path.
+
+
+
+
+
+
+- Example
+
+ ```
+ const uriInstance = new uri.URI('http://username:password@www.qwer.com:8080/path/path1/../path2/./path3?query=pppppp');
+ let uriInstance1 = uriInstance.normalize();
+ uriInstance1.path;
+ ```
+
+
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 e05a6fdd45fa03a6c9c47e5114b6f728816f3880..267445bbd619c466f4416e2647c6782e19c61465 100644
--- a/en/application-dev/reference/apis/js-apis-useriam-userauth.md
+++ b/en/application-dev/reference/apis/js-apis-useriam-userauth.md
@@ -3,30 +3,6 @@
>**NOTE:**
>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
-## Applicable Devices
-
-
-
Phone
-
-
Tablet
-
-
Smart TV
-
-
Wearable
-
-
-
-
Yes
-
-
Yes
-
-
No
-
-
No
-
-
-
-
## Modules to Import
diff --git a/en/application-dev/reference/apis/js-apis-worker.md b/en/application-dev/reference/apis/js-apis-worker.md
index ff388df2f05e45d5831d4d72102bdfd6a04ae854..53879bb88fdee523a3f5fdbd0ebc61113c3cc367 100644
--- a/en/application-dev/reference/apis/js-apis-worker.md
+++ b/en/application-dev/reference/apis/js-apis-worker.md
@@ -1,6 +1,6 @@
# Worker Startup
->![](../../public_sys-resources/icon-note.gif) **NOTE:**
+>**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.
## Modules to Import
@@ -131,13 +131,13 @@ A constructor used to create a worker instance.
- Return values
-
Name
+
Type
Description
-
worker
+
Worker
Returns the worker instance created; returns undefined if the worker instance fails to be created.
@@ -148,8 +148,7 @@ A constructor used to create a worker instance.
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js", {name:"first worker"});
+ const workerInstance = new worker.Worker("workers/worker.js", {name:"first worker"});
```
@@ -196,13 +195,14 @@ Sends a message to the worker thread. The data is transferred using the structur
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js");
- worker.postMessage("hello world");
-
- const worker = new worker.Worker("workers/worker.js");
+ const workerInstance = new worker.Worker("workers/worker.js");
+ workerInstance.postMessage("hello world");
+ ```
+
+ ```
+ const workerInstance = new worker.Worker("workers/worker.js");
var buffer = new ArrayBuffer(8);
- worker.postMessage(buffer, [buffer]);
+ workerInstance.postMessage(buffer, [buffer]);
```
@@ -249,9 +249,8 @@ Adds an event listener to the worker.
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.on("alert", (e)=>{
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.on("alert", (e)=>{
console.log("alert listener callback");
})
```
@@ -300,9 +299,8 @@ Adds an event listener to the worker and removes the event listener automaticall
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js");
- worker.once("alert", (e)=>{
+ const workerInstance = new worker.Worker("workers/worker.js");
+ workerInstance.once("alert", (e)=>{
console.log("alert listener callback");
})
```
@@ -351,9 +349,8 @@ Removes an event listener for the worker.
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js");
- worker.off("alert");
+ const workerInstance = new worker.Worker("workers/worker.js");
+ workerInstance.off("alert");
```
@@ -366,9 +363,8 @@ Terminates the worker thread to stop the worker from receiving messages.
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.terminate()
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.terminate()
```
@@ -406,9 +402,8 @@ Defines the event handler to be called when the worker exits. The handler is exe
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.onexit = function(e) {
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.onexit = function(e) {
console.log("onexit")
}
```
@@ -448,9 +443,8 @@ Defines the event handler to be called when an exception occurs during worker ex
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.onerror = function(e) {
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.onerror = function(e) {
console.log("onerror")
}
```
@@ -490,9 +484,8 @@ Defines the event handler to be called when the host thread receives a message c
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.onmessage = function(e) {
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.onmessage = function(e) {
console.log("onerror")
}
```
@@ -532,9 +525,8 @@ Defines the event handler to be called when the worker receives a message that c
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.onmessageerror= function(e) {
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.onmessageerror= function(e) {
console.log("onmessageerror")
}
```
@@ -585,9 +577,8 @@ Adds an event listener to the worker.
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.addEventListener("alert", (e)=>{
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.addEventListener("alert", (e)=>{
console.log("alert listener callback");
})
```
@@ -636,9 +627,8 @@ Removes an event listener for the worker.
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.removeEventListener("alert")
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.removeEventListener("alert")
```
@@ -676,7 +666,7 @@ Dispatches the event defined for the worker.
- Return values
-
Name
+
Type
Description
@@ -693,9 +683,8 @@ Dispatches the event defined for the worker.
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.dispatchEvent({type:"alert"})
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.dispatchEvent({type:"alert"})
```
@@ -708,9 +697,8 @@ Removes all event listeners for the worker.
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.removeAllListener({type:"alert"})
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.removeAllListener({type:"alert"})
```
@@ -762,13 +750,15 @@ Sends a message to the host thread from the worker.
```
// main.js
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.postMessage("hello world")
- worker.onmessage = function(e) {
+ import worker from "@ohos.worker";
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.postMessage("hello world")
+ workerInstance.onmessage = function(e) {
console.log("receive data from worker.js")
}
-
+ ```
+
+ ```
// worker.js
import worker from "@ohos.worker";
const parentPort = worker.parentPort;
@@ -789,8 +779,10 @@ Closes the worker thread to stop the worker from receiving messages.
```
// main.js
import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
-
+ const workerInstance = new worker.Worker("workers/worker.js")
+ ```
+
+ ```
// worker.js
import worker from "@ohos.worker";
const parentPort = worker.parentPort;
@@ -836,9 +828,11 @@ Defines the event handler to be called when the worker thread receives a message
```
// main.js
import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
- worker.postMessage("hello world")
-
+ const workerInstance = new worker.Worker("workers/worker.js")
+ workerInstance.postMessage("hello world")
+ ```
+
+ ```
// worker.js
import worker from "@ohos.worker";
const parentPort = worker.parentPort;
@@ -884,8 +878,10 @@ Defines the event handler to be called when the worker receives a message that c
```
// main.js
import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
-
+ const workerInstance = new worker.Worker("workers/worker.js")
+ ```
+
+ ```
// worker.js
import worker from "@ohos.worker";
const parentPort = worker.parentPort;
@@ -1004,7 +1000,7 @@ Specifies the callback to invoke.
- Return values
-
Name
+
Type
Description
@@ -1021,9 +1017,8 @@ Specifies the callback to invoke.
- Example
```
- import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js");
- worker.addEventListener("alert", (e)=>{
+ const workerInstance = new worker.Worker("workers/worker.js");
+ workerInstance.addEventListener("alert", (e)=>{
console.log("alert listener callback");
})
```
@@ -1215,8 +1210,10 @@ Defines the event handler to be called when an exception occurs during worker ex
```
// main.js
import worker from '@ohos.worker';
- const worker = new worker.Worker("workers/worker.js")
-
+ const workerInstance = new worker.Worker("workers/worker.js")
+ ```
+
+ ```
// worker.js
import worker from "@ohos.worker";
const parentPort = worker.parentPort
diff --git a/en/application-dev/reference/apis/js-apis-xml.md b/en/application-dev/reference/apis/js-apis-xml.md
new file mode 100644
index 0000000000000000000000000000000000000000..98ff62e6a3926a15f049b6a18d98d8f9a463c2b4
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-xml.md
@@ -0,0 +1,976 @@
+# XML Parsing and Generation
+
+>![](../../public_sys-resources/icon-note.gif) **NOTE:**
+>The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## Modules to Import
+
+```
+import xml from '@ohos.xml';
+```
+
+## Required Permissions
+
+None
+
+## XmlSerializer
+
+### constructor
+
+constructor\(buffer: ArrayBuffer | DataView, encoding?: string\)
+
+A constructor used to create an **XmlSerializer** instance.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
buffer
+
+
ArrayBuffer | DataView
+
+
Yes
+
+
ArrayBuffer or DataView for storing the XML information to write.
+
+
+
encoding
+
+
string
+
+
No
+
+
Encoding format.
+
+
+
+
+
+
+- Example
+
+ ```
+ var arrayBuffer = new ArrayBuffer(1024);
+ var bufView = new DataView(arrayBuffer);
+ var thatSer = new xml.XmlSerializer(bufView);
+ ```
+
+
+### setAttributes
+
+setAttributes\(name: string, value: string\): void
+
+Sets an attribute.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
name
+
+
string
+
+
Yes
+
+
Key of the attribute.
+
+
+
value
+
+
string
+
+
Yes
+
+
Value of the attribute.
+
+
+
+
+
+- Example
+
+ ```
+ var thatSer = new xml.XmlSerializer(bufView);
+ thatSer.setAttributes("importance", "high");
+ ```
+
+
+### addEmptyElement
+
+addEmptyElement\(name: string\): void
+
+Adds an empty element.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
name
+
+
string
+
+
Yes
+
+
Name of the empty element to add.
+
+
+
+
+
+
+- Example
+
+ ```
+ var thatSer = new xml.XmlSerializer(bufView);
+ thatSer.addEmptyElement("b"); // =>
+ ```
+
+
+### setDeclaration
+
+setDeclaration\(\): void
+
+Sets a declaration.
+
+- Example
+
+ ```
+ var thatSer = new xml.XmlSerializer(bufView);
+ thatSer.setDeclaration() // => ;
+ ```
+
+
+### startElement
+
+startElement\(name: string\): void
+
+Writes the start tag based on the given element name.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
name
+
+
string
+
+
Yes
+
+
Name of the element.
+
+
+
+
+
+
+- Example
+
+ ```
+ var arrayBuffer = new ArrayBuffer(1024);
+ var thatSer = new xml.XmlSerializer(arrayBuffer);
+ thatSer.startElement("notel");
+ thatSer.endElement();// => '';
+ ```
+
+
+### endElement
+
+endElement\(\): void
+
+Writes the end tag of the element.
+
+- Example
+
+ ```
+ var thatSer = new xml.XmlSerializer(bufView);
+ thatSer.setNamespace("h", "http://www.w3.org/TR/html4/");
+ thatSer.startElement("table");
+ thatSer.setAttributes("importance", "high");
+ thatSer.setText("Happy");
+ endElement(); // => Happy
+ ```
+
+
+### setNamespace
+
+setNamespace\(prefix: string, namespace: string\): void
+
+Sets the namespace for an element tag.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
prefix
+
+
string
+
+
Yes
+
+
Prefix of the element and its child elements.
+
+
+
namespace
+
+
string
+
+
Yes
+
+
Namespace to set.
+
+
+
+
+
+
+- Example
+
+ ```
+ var arrayBuffer = new ArrayBuffer(1024);
+ var thatSer = new xml.XmlSerializer(arrayBuffer);
+ thatSer.setDeclaration();
+ thatSer.setNamespace("h", "http://www.w3.org/TR/html4/");
+ thatSer.startElement("note");
+ thatSer.endElement();// = >'\r\n';
+ ```
+
+
+### setComment
+
+setComment\(text: string\): void
+
+Sets the comment.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
text
+
+
string
+
+
Yes
+
+
Comment to set.
+
+
+
+
+
+
+- Example
+
+ ```
+ var arrayBuffer = new ArrayBuffer(1024);
+ var thatSer = new xml.XmlSerializer(arrayBuffer);
+ thatSer.startElement("note");
+ thatSer.setComment("Hi!");
+ thatSer.endElement(); // => '\r\n \r\n';
+ ```
+
+
+### setCDATA
+
+setCDATA\(text: string\): void
+
+Sets CDATA attributes.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
text
+
+
string
+
+
Yes
+
+
CDATA attribute to set.
+
+
+
+
+
+
+- Example
+
+ ```
+ var arrayBuffer = new ArrayBuffer(1028);
+ var thatSer = new xml.XmlSerializer(arrayBuffer);
+ thatSer.setCDATA('root SYSTEM') // => '';
+ ```
+
+
+### setText
+
+setText\(text: string\): void
+
+Sets **Text**.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
text
+
+
string
+
+
Yes
+
+
Content of the Text to set.
+
+
+
+
+
+
+- Example
+
+ ```
+ var arrayBuffer = new ArrayBuffer(1024);
+ var thatSer = new xml.XmlSerializer(arrayBuffer);
+ thatSer.startElement("note");
+ thatSer.setAttributes("importance", "high");
+ thatSer.setText("Happy1");
+ thatSer.endElement(); // => 'Happy1';
+ ```
+
+
+### setDocType
+
+setDocType\(text: string\): void
+
+Sets **DocType**.
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
text
+
+
string
+
+
Yes
+
+
Content of DocType to set.
+
+
+
+
+
+
+- Example
+
+ ```
+ var arrayBuffer = new ArrayBuffer(1024);
+ var thatSer = new xml.XmlSerializer(arrayBuffer);
+ thatSer.setDocType('root SYSTEM'); // => '';
+ ```
+
+
+## XmlPullParser
+
+### XmlPullParser
+
+constructor\(buffer: ArrayBuffer | DataView, encoding?: string\)
+
+Creates and returns an **XmlPullParser** object. The **XmlPullParser** object passes two parameters. The first parameter is the memory of the **ArrayBuffer** or **DataView** type, and the second parameter is the file format \(UTF-8 by default\).
+
+- Parameters
+
+
+
Name
+
+
Type
+
+
Mandatory
+
+
Description
+
+
+
+
buffer
+
+
ArrayBuffer | DataView
+
+
Yes
+
+
ArrayBuffer or DataView that contains XML text information.
+
+
+
encoding
+
+
string
+
+
No
+
+
Encoding format. Only UTF-8 is supported.
+
+
+
+
+
+
+- Example
+
+ ```
+ var strXml =
+ '' +
+ '' +
+ ' Happy' +
+ ' Work' +
+ ' Play' +
+ '';
+ var arrayBuffer = new ArrayBuffer(strXml.length*2);
+ var bufView = new Uint8Array(arrayBuffer);
+ var strLen = strXml.length;
+ for (var i = 0; i < strLen; ++i) {
+ bufView[i] = strXml.charCodeAt(i);// Set the ArrayBuffer mode.
+ }
+ var that = new xml.XmlPullParser(arrayBuffer);
+ ```
+
+
+### parse
+
+parse\(option: ParseOptions\): void
+
+Parses XML information.
+
+- Parameters
+
+
+
+
+## ParseInfo
+
+Provides methods to manage the parsed XML information.
+
+### getColumnNumber
+
+getColumnNumber\(\): number
+
+Obtains the column line number, which starts from 1.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Column number obtained.
+
+
+
+
+
+
+### getDepth
+
+getDepth\(\): number
+
+Obtains the depth of this element.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Depth obtained.
+
+
+
+
+
+
+### getLineNumber
+
+getLineNumber\(\): number
+
+Obtains the current line number, starting from 1.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
number
+
+
Line number obtained.
+
+
+
+
+
+
+### getName
+
+getName\(\): string
+
+Obtains the name of this element.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Element name obtained.
+
+
+
+
+
+
+### getNamespace
+
+getNamespace\(\): string
+
+Obtains the namespace of this element.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Namespace obtained.
+
+
+
+
+
+
+### getPrefix
+
+getPrefix\(\): string
+
+Obtains the prefix of this element.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Element prefix obtained.
+
+
+
+
+
+
+### getText
+
+getText\(\): string
+
+Obtains the text of the current event.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
string
+
+
Text content obtained.
+
+
+
+
+
+
+### isEmptyElementTag
+
+isEmptyElementTag\(\): boolean
+
+Checks whether the current element is empty.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
Returns true if the element is empty; returns false otherwise.
+
+
+
+
+
+
+### isWhitespace
+
+isWhitespace\(\): boolean
+
+Checks whether the current text event contains only whitespace characters.
+
+- Return values
+
+
+
Type
+
+
Description
+
+
+
+
boolean
+
+
Returns true if the text event contains only whitespace characters; returns false otherwise.
+
+
+
+
+
+
+### getAttributeCount
+
+getAttributeCount\(\): number
+
+Obtains the number of attributes for the current start tag.
+
+- Return values
+
+
+