提交 bbad08e5 编写于 作者: 肖文文

Merge branch 'master' of https://gitee.com/bio_abc/docs

......@@ -36,8 +36,8 @@
- [Device Usage Statistics](device-usage-statistics/Readme-EN.md)
- [DFX](dfx/Readme-EN.md)
- [Internationalization](internationalization/Readme-EN.md)
-
- [Using Native APIs in Application Projects](napi/napi-guidelines.md)
- [OpenHarmony IDL Specifications and User Guide](IDL/idl-guidelines.md)
- [Using Native APIs in Application Projects](napi/Readme-EN.md)
- Tools
- [DevEco Studio (OpenHarmony) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md)
- Hands-On Tutorials
......
......@@ -171,7 +171,7 @@ The following example shows how to implement a distributed data object synchroni
```js
local_object.setSessionId("");
```
## Development Example
## Samples
The following example is provided for you to better understand the development of distributed data objects:
......
......@@ -177,5 +177,5 @@ The following uses a single KV store as an example to describe the development p
```
## Samples
The following samples are provided to help you better understand the distributed data development:
- [`KvStore`: distributed database (eTS) (API8)](https://gitee.com/openharmony/app_samples/tree/master/data/Kvstore)
- [Distributed Database](https://gitee.com/openharmony/codelabs/tree/master/Data/JsDistributedData)
- [`KvStore`: Distributed Data Management (eTS) (API8)](https://gitee.com/openharmony/app_samples/tree/master/data/Kvstore)
- [Distributed Data Service](https://gitee.com/openharmony/codelabs/tree/master/Data/JsDistributedData)
......@@ -116,8 +116,8 @@ The RDB provides **RdbPredicates** for you to set database operation conditions.
A result set can be regarded as a row 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**.
> ![icon-notice.gif](../public_sys-resources/icon-notice.gif) **NOTICE**<br/>
> After a result set is used, you must call the **close()** method to close it explicitly.**
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**<br>
> After a result set is used, you must call the **close()** method to close it explicitly.
**Table 7** APIs for using the result set
......@@ -306,3 +306,8 @@ You can obtain the distributed table name for a remote device based on the local
let tableName = rdbStore.obtainDistributedTableName(deviceId, "test");
let resultSet = rdbStore.querySql("SELECT * FROM " + tableName)
```
## Samples
The following samples are provided for you to better understand the RDB development:
- [`Rdb`: eTS RDB (API8)](https://gitee.com/openharmony/app_samples/tree/master/data/Rdb)
- [`DistributedRdb`: eTS Distributed Relational Database (API8)](https://gitee.com/openharmony/app_samples/tree/master/data/DistributedRdb)
- [Relational Database](https://gitee.com/openharmony/codelabs/tree/master/Data/JSRelationshipData)
......@@ -4,12 +4,12 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
## Setting Locale Information
[Locale](../reference/apis/js-apis-intl.md) APIs are used to maximize or minimize locale information.
Use [Locale](../reference/apis/js-apis-intl.md) APIs to maximize or minimize locale information.
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Instantiates a **Locale** object. |
| ohos.intl | constructor(locale?: string, options?: options) | Instantiates a **Locale** object based on the locale parameter and options. |
......@@ -20,8 +20,8 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
### How to Develop
1. Instantiate a **Locale** object.
Create a **Locale** object using the **Locale** constructor. This method receives a string representing the locale and an optional [Attributes](../reference/apis/js-apis-intl.md) list (**intl** is the name of the imported module).
1. Instantiate a **Locale** object.<br>
Create a **Locale** object by using the **Locale** constructor. This method receives a string representing the locale and an optional [Attributes](../reference/apis/js-apis-intl.md) list. In the code below, **intl** is the name of the imported module.
```
......@@ -30,21 +30,21 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
var localeObj = new intl.Locale(locale, options);
```
2. Obtain the string representing a **Locale** object.
Call the **toString** method to obtain the string representing a **Locale** object, including the language, region, and other options.
2. Obtain the string representing a **Locale** object.<br>
Call the **toString** method to obtain the string representing a **Locale** object, which includes the language, region, and other options.
```
var localeStr = localeObj.toString();
```
3. Maximize locale information.
3. Maximize locale information.<br>
Call the **maximize** method to maximize locale information; that is, supplement the missing script and region information.
```
var maximizedLocale = localeObj.maximize();
```
4. Minimize locale information.
4. Minimize locale information.<br>
Call the **minimize** method to minimize locale information; that is, delete the unnecessary script and region information.
```
......@@ -54,12 +54,12 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
## Formatting the Date and Time
[DateTimeFormat](../reference/apis/js-apis-intl.md) APIs are used to format the date and time for a specific locale.
Use [DateTimeFormat](../reference/apis/js-apis-intl.md) APIs to format the date and time for a specific locale.
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **DateTimeFormat** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: DateTimeOptions) | Creates a **DateTimeFormat** object and sets the locale and other formatting-related attributes. |
......@@ -70,8 +70,8 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
### How to Develop
1. Instantiate a **DateTimeFormat** object.
Use the default constructor of **DateTimeFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **DateTimeFormat** object (**intl** is the name of the imported module).
1. Instantiate a **DateTimeFormat** object.<br>
Use the default constructor of **DateTimeFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **DateTimeFormat** object. In the code below, **intl** is the name of the imported module.
```
......@@ -85,16 +85,16 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
var dateTimeFormat = new intl.DateTimeFormat("zh-CN", options);
```
2. Format the date and time.
Use the **format** method of **DateTimeFormat** to format a **Date** object. A string is returned as the formatting result.
2. Format the date and time.<br>
Use the **format** method of **DateTimeFormat** to format a **Date** object. This method returns a string representing the formatting result.
```
Date date = new Date();
var formatResult = dateTimeFormat.format(date);
```
3. Format a period.
Use the **formatRange** method of **DateTimeFormat** to format a period. This method requires the input of two **Date** objects, which respectively indicate the start date and end date of a period. A string is returned as the formatting result.
3. Format a period.<br>
Use the **formatRange** method of **DateTimeFormat** to format a period. This method requires input of two **Date** objects, which respectively indicate the start date and end date of a period. This method returns a string representing the formatting result.
```
Date startDate = new Date();
......@@ -102,7 +102,7 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
var formatResult = dateTimeFormat.formatRange(startDate, endDate);
```
4. Access the attributes of the **DateTimeFormat** object.
4. Obtain attributes of the **DateTimeFormat** object.<br>
The **resolvedOptions** method of **DateTimeFormat** returns an object that contains all related attributes and values of the **DateTimeFormat** object.
```
......@@ -112,12 +112,12 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
## Number Formatting
[NumberFormat](../reference/apis/js-apis-intl.md) APIs are used to format a number for a specific locale.
Use [NumberFormat](../reference/apis/js-apis-intl.md) APIs to format a number for a specific locale.
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **NumberFormat** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: NumberOptions) | Creates a **NumberFormat** object and sets the locale and other formatting-related attributes. |
......@@ -127,8 +127,8 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
### How to Develop
1. Instantiate a **NumberFormat** object.
Use the default constructor of **NumberFormat** to obtain the system default locale by accessing the system language and region settings and set it as the locale in the **NumberFormat** object (**intl** is the name of the imported module).
1. Instantiate a **NumberFormat** object.<br>
Use the default constructor of **NumberFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **NumberFormat** object. In the code below, **intl** is the name of the imported module.
```
......@@ -142,7 +142,7 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
var numberFormat = new intl.NumberFormat("zh-CN", options);
```
2. Format a number.
2. Format a number.<br>
Use the **format** method of **NumberFormat** to format a number. A string is returned as the formatting result.
```
......@@ -150,7 +150,7 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
var formatResult = numberFormat.format(number);
```
3. Access the attributes of the **NumberFormat** object.
3. Obtain attributes of the **NumberFormat** object.<br>
The **resolvedOptions** method of NumberFormat returns an object that contains all related attributes and values of the **NumberFormat** object.
```
......@@ -160,12 +160,12 @@ This development guide describes how to use i18n APIs that are defined in ECMA 4
## String Sorting
Users in different regions have different requirements for string sorting. [Collator](../reference/apis/js-apis-intl.md) APIs are used to sort strings based on a specific locale.
Use [Collator](../reference/apis/js-apis-intl.md) APIs to sort strings based on a specific locale. Users in different regions have different preferences for string sorting.
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **Collator** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: CollatorOptions)<sup>8+</sup> | Creates a **Collator** object and sets the locale and other related attributes. |
......@@ -175,8 +175,8 @@ Users in different regions have different requirements for string sorting. [Coll
### How to Develop
1. Instantiate a **Collator** object.
Use the default constructor of **Collator** to obtain the system default locale by accessing the system language and region settings and set it as the locale in the **Collator** object (**intl** is the name of the imported module).
1. Instantiate a **Collator** object.<br>
Use the default constructor of **Collator** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **Collator** object. In the code below, **intl** is the name of the imported module.
```
......@@ -189,7 +189,7 @@ Users in different regions have different requirements for string sorting. [Coll
var collator= new intl.Collator("zh-CN", {localeMatcher: "best fit", usage: "sort"};
```
2. Compare two strings.
2. Compare two strings.<br>
Use the **compare** method of **Collator** to compare two input strings. This method returns a value as the comparison result. The return value **-1** indicates that the first string is shorter than the second string, the return value **1** indicates that the first string is longer than the second string, and the return value **0** indicates that the two strings are of equal lengths.
```
......@@ -198,7 +198,7 @@ Users in different regions have different requirements for string sorting. [Coll
var compareResult = collator.compare(str1, str2);
```
3. Access the attributes of the **Collator** object.
3. Obtain attributes of the **Collator** object.<br>
The **resolvedOptions** method of **Collator** returns an object that contains all related attributes and values of the **Collator** object.
```
......@@ -208,12 +208,12 @@ Users in different regions have different requirements for string sorting. [Coll
## Determining the Singular-Plural Type
According to grammars in certain languages, the singular or plural form of a noun depends on the number prior to the noun. [PluralRules](../reference/apis/js-apis-intl.md) APIs are used to determine the singular-plural type for a specific locale.
Use [PluralRules](../reference/apis/js-apis-intl.md) APIs to determine the singular-plural type for a specific locale. According to the grammar of certain languages, the singular or plural form of a noun depends on its preceding number.
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **PluralRules** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: PluralRulesOptions)<sup>8+</sup> | Creates a **PluralRules** object and sets the locale and other related attributes. |
......@@ -222,8 +222,8 @@ According to grammars in certain languages, the singular or plural form of a nou
### How to Develop
1. Instantiate a **PluralRules** object.
Use the default constructor of **PluralRules** to obtain the system default locale by accessing the system language and region settings and set it as the locale in the **PluralRules** object (**intl** is the name of the imported module).
1. Instantiate a **PluralRules** object.<br>
Use the default constructor of **PluralRules** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **PluralRules** object. In the code below, **intl** is the name of the imported module.
```
......@@ -236,7 +236,7 @@ According to grammars in certain languages, the singular or plural form of a nou
var plurals = new intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"};
```
2. Determine the singular or plural category.
2. Determine the singular or plural category.<br>
Use the **select** method of **PluralRules** to determine the singular-plural type for an input number. This method returns a string as the category of the input number, which can be any of the following: **zero**, **one**, **two**, **few**, **many**, and **other**.
```
......@@ -247,12 +247,12 @@ According to grammars in certain languages, the singular or plural form of a nou
## Formatting Relative Time
[RelativeTimeFormat](../reference/apis/js-apis-intl.md) APIs are used to format the relative time for a specific locale.
Use [RelativeTimeFormat](../reference/apis/js-apis-intl.md) APIs to format the relative time for a specific locale.
### Available APIs
| Module | API | Description |
| Module | API | Description |
| -------- | -------- | -------- |
| ohos.intl | constructor()<sup>8+</sup> | Creates a **RelativeTimeFormat** object. |
| ohos.intl | constructor(locale: string \| Array&lt;string&gt;, options?: RelativeTimeFormatInputOptions)<sup>8+</sup> | Creates a **RelativeTimeFormat** object and sets the locale and other formatting-related attributes. |
......@@ -263,8 +263,8 @@ According to grammars in certain languages, the singular or plural form of a nou
### How to Develop
1. Instantiate a **RelativeTimeFormat** object.
Use the default constructor of **RelativeTimeFormat** to obtain the system default locale by accessing the system language and region settings and set it as the locale in the **RelativeTimeFormat** object (**intl** is the name of the imported module).
1. Instantiate a **RelativeTimeFormat** object.<br>
Use the default constructor of **RelativeTimeFormat** to obtain the system default locale by accessing the system language and region settings, and set it as the locale in the **RelativeTimeFormat** object. In the code below, **intl** is the name of the imported module.
```
......@@ -277,8 +277,8 @@ According to grammars in certain languages, the singular or plural form of a nou
var relativeTimeFormat = new intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"};
```
2. Format the relative time.
Use the **format** method of **RelativeTimeFormat** to format the relative time. This method receives a numeric value representing the time length and a string-form unit, like **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, and **second**. A string is returned as the formatting result.
2. Format the relative time.<br>
Use the **format** method of **RelativeTimeFormat** to format the relative time. This method receives a numeric value representing the time length and a string-form unit, like **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, and **second**. This method returns a string representing the formatting result.
```
var number = 2;
......@@ -286,8 +286,8 @@ According to grammars in certain languages, the singular or plural form of a nou
var formatResult = relativeTimeFormat.format(number, unit);
```
3. Obtain each part of the relative time format.
On obtaining each part of the relative time format, customize the relative time formatting result.
3. Obtain each part of the relative time format.<br>
Upon obtaining each part of the relative time format, customize the relative time formatting result.
```
var number = 2;
......@@ -295,7 +295,7 @@ According to grammars in certain languages, the singular or plural form of a nou
var formatResult = relativeTimeFormat.formatToParts(number, unit);
```
4. Access the attributes of the **RelativeTimeFormat** object.
4. Obtain attributes of the **RelativeTimeFormat** object.<br>
The **resolvedOptions** method of **RelativeTimeFormat** returns an object that contains all related attributes and values of the **RelativeTimeFormat** object. For a full list of attributes, see [ RelativeTimeFormatResolvedOptions](../reference/apis/js-apis-intl.md).
```
......@@ -306,4 +306,4 @@ According to grammars in certain languages, the singular or plural form of a nou
The following sample is provided to help you better understand how to develop internationalization capabilities:
-[`International`: Internationalization (JS) (API7)](https://gitee.com/openharmony/app_samples/tree/master/UI/International)
-[`International`: Internationalization (JS) (API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/International)
......@@ -401,10 +401,6 @@ export class VideoPlayerDemo {
}
}
sleep(time) {
for(let t = Date.now(); Date.now() - t <= time;);
}
async videoPlayerDemo() {
let videoPlayer = undefined;
let surfaceID = 'test' // The surfaceID parameter is used for screen display. Its value is obtained through the XComponent API. For details about the document link, see the method of creating the XComponent.
......@@ -442,27 +438,15 @@ export class VideoPlayerDemo {
}, this.failureCallback).catch(this.catchCallback);
// Set the loop playback attribute.
videoPlayer.loop = true;
// Call the play API to start playback.
// Call the play API to start loop playback.
await videoPlayer.play().then(() => {
console.info('play success');
}, this.failureCallback).catch(this.catchCallback);
// After the progress bar reaches the end, the playback continues for 3 seconds and then starts from the beginning, since loop playback is configured.
await videoPlayer.seek(videoPlayer.duration, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
console.info('seek duration success');
}, this.failureCallback).catch(this.catchCallback);
this.sleep(3000);
// Release playback resources.
await videoPlayer.release().then(() => {
console.info('release success');
console.info('play success, loop value is ' + videoPlayer.loop);
}, this.failureCallback).catch(this.catchCallback);
// Set the related instances to undefined.
videoPlayer = undefined;
surfaceID = undefined;
}
}
```
## Samples
The following samples are provided to help you better understand how to develop video playback:
- [`VideoPlayer`: Video Playback (eTS, API version 9)](https://gitee.com/openharmony/app_samples/tree/master/media/VideoPlayer)
# Native APIs
- [Using Native APIs in Application Projects](napi-guidelines.md)
......@@ -174,4 +174,4 @@ if (this.subscriber != null) {
The following sample is provided to help you better understand how to use the common event functionality:
- [`CommonEvent`: eTS Common Event (API 7)](https://gitee.com/openharmony/app_samples/tree/master/Notification/CommonEvent)
- [`CommonEvent`: eTS Common Event (API 8)](https://gitee.com/openharmony/app_samples/tree/master/Notification/CommonEvent)
......@@ -262,4 +262,4 @@ Notification.cancel(1, "label", cancelCallback)
The following sample is provided to help you better understand how to develop notification functions:
[`Notification`: EtsNotification (API 7)](https://gitee.com/openharmony/app_samples/tree/master/common/Notification)
\ No newline at end of file
[`Notification`: EtsNotification (API 8)](https://gitee.com/openharmony/app_samples/tree/master/common/Notification)
\ No newline at end of file
......@@ -20,17 +20,18 @@
## eTS Project Files
- **entry** : OpenHarmony project module, which can be built into an ability package ([HAP](../../glossary.md#hap)).
- **src &gt; main &gt; ets** : a collection of eTS source code.
- **src &gt; main &gt; ets &gt; MainAbility** : entry to your application/service.
- **src &gt; main &gt; ets &gt; MainAbility &gt; pages** : pages contained in **MainAbility**.
- **src &gt; main &gt; ets &gt; MainAbility &gt; app.ets** : ability lifecycle file.
- **src &gt; main &gt; resources** : a collection of resource files used by your application/service, such as graphics, multimedia, character strings, and layout files.
- **src &gt; main &gt; config.json** : module configuration file. This file describes the global configuration information of the application/service, the device-specific configuration information, and the configuration information of the HAP file.
- **build-profile.json5** : current module information and build configuration options, including **buildOption target**.
- **hvigorfile.js** : module-level compilation and build task script. You can customize related tasks and code implementation.
- **build-profile.json5** : application-level configuration information, including the signature and product configuration.
- **hvigorfile.js** : application-level compilation and build task script.
- **entry**: OpenHarmony project module, which can be built into an ability package ([HAP](../../glossary.md#hap)).
- **src &gt; main &gt; ets**: a collection of eTS source code.
- **src &gt; main &gt; ets &gt; MainAbility**: entry to your application/service.
- **src &gt; main &gt; ets &gt; MainAbility &gt; pages**: pages contained in **MainAbility**.
- **src &gt; main &gt; ets &gt; MainAbility &gt; pages &gt; index.ets**: the first page in the pages list, that is, the home page of your application.
- **src &gt; main &gt; ets &gt; MainAbility &gt; app.ets**: ability lifecycle file.
- **src &gt; main &gt; resources**: a collection of resource files used by your application/service, such as graphics, multimedia, character strings, and layout files.
- **src &gt; main &gt; config.json**: module configuration file. This file describes the global configuration information of the application/service, the device-specific configuration information, and the configuration information of the HAP file.
- **build-profile.json5**: current module information and build configuration options, including **buildOption target**.
- **hvigorfile.js**: module-level compilation and build task script. You can customize related tasks and code implementation.
- **build-profile.json5**: application-level configuration information, including the signature and product configuration.
- **hvigorfile.js**: application-level compilation and build task script.
## Building the First Page
......@@ -62,7 +63,7 @@
2. Add a **&lt;Button&gt;** component.
On the default page, add a **&lt;Button&gt;** component to accept user clicks and implement redirection to another page. The sample code in the **index.ets** file is shown below:
On the default page, add a **&lt;Button&gt;** component to respond to user clicks and implement redirection to another page. The sample code in the **index.ets** file is shown below:
```
......@@ -77,7 +78,7 @@
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
// Add a button to accept user clicks.
// Add a button to respond to user clicks.
Button() {
Text('Next')
.fontSize(30)
......@@ -174,7 +175,7 @@ You can implement page redirection through the page router, which finds the targ
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
// Add a button to accept user clicks.
// Add a button to respond to user clicks.
Button() {
Text('Next')
.fontSize(30)
......
......@@ -37,10 +37,11 @@ After the project synchronization is complete, a low-code directory structure is
![en-us_image_0000001223558810](figures/en-us_image_0000001223558810.png)
- **entry &gt; src &gt; main &gt; js &gt; MainAbility &gt; pages &gt; index &gt; index.js** : defines logical relationships, such as data and events, used on low-code pages. For details, see [JavaScript](../ui/js-framework-syntax-js.md). If multiple low-code development pages are created, a page folder and the corresponding **.js** file will be created for each of these pages.
- **entry &gt; src &gt; main &gt; js &gt; MainAbility &gt; pages &gt; index &gt; index.js**: defines logical relationships, such as data and events, used on low-code pages. For details, see [JavaScript](../ui/js-framework-syntax-js.md). If multiple low-code development pages are created, a page folder and the corresponding **.js** file will be created for each of these pages.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>To avoid build errors when using the low-code development page, make sure the directory where the corresponding **.js** file is located does not contain **.hml** or **.css** files. For example, in the preceding example, no **.hml** or **.css** file is allowed in **js** &gt; **MainAbility** &gt; **pages** &gt; **index**.
>
- **entry &gt; src &gt; main &gt; supervisual &gt; MainAbility &gt; pages &gt; index &gt; index.visual** : stores the data model of the low-code development page. You can double-click the file to open the low-code development page. If multiple low-code development pages are created, a page folder and the corresponding **.visual** file will be created for each of these pages.
- **entry &gt; src &gt; main &gt; supervisual &gt; MainAbility &gt; pages &gt; index &gt; index.visual**: stores the data model of the low-code development page. You can double-click the file to open the low-code development page. If multiple low-code development pages are created, a page folder and the corresponding **.visual** file will be created for each of these pages.
## Building the First Page
......
......@@ -19,7 +19,7 @@
## JavaScript Project Files
- **entry** : OpenHarmony project module, which can be built into an ability package ([HAP](../../glossary.md#hap)).
- **entry**: OpenHarmony project module, which can be built into an ability package ([HAP](../../glossary.md#hap)).
- **src &gt; main &gt; js**: a collection of JS source code.
- **src &gt; main &gt; js &gt; MainAbility**: entry to your application/service.
- **src &gt; main &gt; js &gt; MainAbility &gt; i18n**: resources in different languages, for example, UI strings and image paths.
......@@ -50,7 +50,7 @@
2. Add a button and bind the **onclick** method to this button.
On the default page, add an **&lt;input&gt;** component of the button type to accept user clicks and implement redirection to another page. The sample code in the **index.hml** file is shown below:
On the default page, add an **&lt;input&gt;** component of the button type to respond to user clicks and implement redirection to another page. The sample code in the **index.hml** file is shown below:
```
......
# DataAbilityPredicates
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> **NOTE**<br/>
> 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.
......@@ -22,6 +22,7 @@ Creates an **RdbPredicates** object based on a **DataAabilityPredicates** object
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| name | string | Yes| Table name in the RDB store.|
......
# Distributed Data Object
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> **NOTE**<br/>
> 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.
......@@ -10,8 +10,6 @@
import distributedObject from '@ohos.data.distributedDataObject';
```
## distributedDataObject.createDistributedObject
createDistributedObject(source: object): DistributedObject
......
# Result Set
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> **NOTE**<br/>
> 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.
......
......@@ -3,7 +3,7 @@
Lightweight storage provides applications with data processing capability and allows applications to perform lightweight data storage and query. Data is stored in key-value (KV) pairs. Keys are of the string type, and values can be of the number, string, or Boolean type.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> **NOTE**<br/>
>
> - 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.
>
......@@ -30,7 +30,7 @@ import dataStorage from '@ohos.data.storage';
getStorageSync(path: string): Storage
Reads a file and loads the data to the **Storage** instance in synchronous mode.
Reads the specified file and load its data to the **Storage** instance for data operations.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -67,7 +67,7 @@ Reads a file and loads the data to the **Storage** instance in synchronous mode.
getStorage(path: string, callback: AsyncCallback&lt;Storage&gt;): void
Reads a file and loads the data to the **Storage** instance. This API uses an asynchronous callback to return the execution result.
Reads the specified file and loads its data to the **Storage** instance for data operations. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -105,7 +105,7 @@ Reads a file and loads the data to the **Storage** instance. This API uses an as
getStorage(path: string): Promise&lt;Storage&gt;
Reads a file and loads the data to the **Storage** instance. This API uses a promise to return the execution result.
Reads the specified file and loads its data to the **Storage** instance for data operations. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -146,7 +146,7 @@ Reads a file and loads the data to the **Storage** instance. This API uses a pro
deleteStorageSync(path: string): void
Deletes the singleton **Storage** instance of a file from the memory, and deletes the specified file, its backup file, and damaged files. After the specified files are deleted, the **Storage** instance cannot be used for data operations. Otherwise, data inconsistency will occur. This API uses a synchronous mode.
Deletes the singleton **Storage** instance of a file from the memory, and deletes the specified file, its backup file, and damaged files. After the specified files are deleted, the **Storage** instance cannot be used for data operations. Otherwise, data inconsistency will occur.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -165,7 +165,7 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete
deleteStorage(path: string, callback: AsyncCallback&lt;void&gt;): void
Deletes the singleton **Storage** instance of a file from the memory, and deletes the specified file, its backup file, and damaged files. After the specified files are deleted, the **Storage** instance cannot be used for data operations. Otherwise, data inconsistency will occur. This API uses an asynchronous callback to return the execution result.
Deletes the singleton **Storage** instance of a file from the memory, and deletes the specified file, its backup file, and damaged files. After the specified files are deleted, the **Storage** instance cannot be used for data operations. Otherwise, data inconsistency will occur. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -191,7 +191,7 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete
deleteStorage(path: string): Promise&lt;void&gt;
Deletes the singleton **Storage** instance of a file from the memory, and deletes the specified file, its backup file, and damaged files. After the specified files are deleted, the **Storage** instance cannot be used for data operations. Otherwise, data inconsistency will occur. This API uses a promise to return the execution result.
Deletes the singleton **Storage** instance of a file from the memory, and deletes the specified file, its backup file, and damaged files. After the specified files are deleted, the **Storage** instance cannot be used for data operations. Otherwise, data inconsistency will occur. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -222,8 +222,6 @@ removeStorageFromCacheSync(path: string): void
Removes the singleton **Storage** instance of a file from the cache. The removed instance cannot be used for data operations. Otherwise, data inconsistency will occur.
This API uses a synchronous mode.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
**Parameters**
......@@ -241,9 +239,7 @@ This API uses a synchronous mode.
removeStorageFromCache(path: string, callback: AsyncCallback&lt;void&gt;): void
Removes the singleton **Storage** instance of a file from the cache. The removed instance cannot be used for data operations. Otherwise, data inconsistency will occur.
This API uses an asynchronous callback to return the result.
Removes the singleton **Storage** instance of a file from the cache. The removed instance cannot be used for data operations. Otherwise, data inconsistency will occur. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -269,9 +265,7 @@ This API uses an asynchronous callback to return the result.
removeStorageFromCache(path: string): Promise&lt;void&gt;
Removes the singleton **Storage** instance of a file from the cache. The removed instance cannot be used for data operations. Otherwise, data inconsistency will occur.
This API uses a promise to return the result.
Removes the singleton **Storage** instance of a file from the cache. The removed instance cannot be used for data operations. Otherwise, data inconsistency will occur. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -307,8 +301,6 @@ getSync(key: string, defValue: ValueType): ValueType
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned.
This API uses a synchronous mode.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
**Parameters**
......@@ -333,9 +325,7 @@ This API uses a synchronous mode.
get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;): void
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned.
This API uses an asynchronous callback to return the result.
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -362,9 +352,7 @@ This API uses an asynchronous callback to return the result.
get(key: string, defValue: ValueType): Promise&lt;ValueType&gt;
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned.
This API uses a promise to return the result.
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -397,8 +385,6 @@ putSync(key: string, value: ValueType): void
Obtains the **Storage** instance corresponding to the specified file, writes data to the **Storage** instance using a **Storage** API, and saves the modification using **flush()** or **flushSync()**.
This API uses a synchronous mode.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
**Parameters**
......@@ -417,9 +403,7 @@ This API uses a synchronous mode.
put(key: string, value: ValueType, callback: AsyncCallback&lt;void&gt;): void
Obtains the **Storage** instance corresponding to the specified file, writes data to the **Storage** instance using a **Storage** API, and saves the modification using **flush()** or **flushSync()**.
This API uses an asynchronous callback to return the result.
Obtains the **Storage** instance corresponding to the specified file, writes data to the **Storage** instance using a **Storage** API, and saves the modification using **flush()** or **flushSync()**. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -446,9 +430,7 @@ This API uses an asynchronous callback to return the result.
put(key: string, value: ValueType): Promise&lt;void&gt;
Obtains the **Storage** instance corresponding to the specified file, writes data to the **Storage** instance using a **Storage** API, and saves the modification using **flush()** or **flushSync()**.
This API uses a promise to return the result.
Obtains the **Storage** instance corresponding to the specified file, writes data to the **Storage** instance using a **Storage** API, and saves the modification using **flush()** or **flushSync()**. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -480,8 +462,6 @@ hasSync(key: string): boolean
Checks whether the storage object contains data with a given key.
This API uses a synchronous mode.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
**Parameters**
......@@ -507,9 +487,7 @@ This API uses a synchronous mode.
has(key: string, callback: AsyncCallback&lt;boolean&gt;): boolean
Checks whether the storage object contains data with a given key.
This API uses an asynchronous callback to return the result.
Checks whether the storage object contains data with a given key. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -542,9 +520,7 @@ This API uses an asynchronous callback to return the result.
has(key: string): Promise&lt;boolean&gt;
Checks whether the storage object contains data with a given key.
This API uses a promise to return the result.
Checks whether the storage object contains data with a given key. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -577,8 +553,6 @@ deleteSync(key: string): void
Deletes data with the specified key from this storage object.
This API uses a synchronous mode.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
**Parameters**
......@@ -592,13 +566,11 @@ This API uses a synchronous mode.
```
### deletej
### delete
delete(key: string, callback: AsyncCallback&lt;void&gt;): void
Deletes data with the specified key from this storage object.
This API uses an asynchronous callback to return the result.
Deletes data with the specified key from this storage object. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -624,9 +596,7 @@ This API uses an asynchronous callback to return the result.
delete(key: string): Promise&lt;void&gt;
Deletes data with the specified key from this storage object.
This API uses a promise to return the result.
Deletes data with the specified key from this storage object. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -657,8 +627,6 @@ flushSync(): void
Saves the modification of this object to the **Storage** instance and synchronizes the modification to the file.
This API uses a synchronous mode.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
**Example**
......@@ -671,9 +639,7 @@ This API uses a synchronous mode.
flush(callback: AsyncCallback&lt;void&gt;): void
Saves the modification of this object to the **Storage** instance and synchronizes the modification to the file.
This API uses an asynchronous callback to return the result.
Saves the modification of this object to the **Storage** instance and synchronizes the modification to the file. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -698,9 +664,7 @@ This API uses an asynchronous callback to return the result.
flush(): Promise&lt;void&gt;
Saves the modification of this object to the **Storage** instance and synchronizes the modification to the file.
This API uses a promise to return the result.
Saves the modification of this object to the **Storage** instance and synchronizes the modification to the file. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -726,8 +690,6 @@ clearSync(): void
Clears this **Storage** object.
This API uses a synchronous mode.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
**Example**
......@@ -740,9 +702,7 @@ This API uses a synchronous mode.
clear(callback: AsyncCallback&lt;void&gt;): void
Clears this **Storage** object.
This API uses an asynchronous callback to return the result.
Clears this **Storage** object. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......@@ -767,9 +727,7 @@ This API uses an asynchronous callback to return the result.
clear(): Promise&lt;void&gt;
Clears this **Storage** object.
This API uses a promise to return the result.
Clears this **Storage** object. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......
......@@ -2,7 +2,7 @@
Distributed data management provides collaboration between databases of different devices for applications. The APIs provided by distributed data management can be used to save data to the distributed database and perform operations such as adding, deleting, modifying, and querying data in the distributed database.
>![](../../public_sys-resources/icon-note.gif) **NOTE**<br/>
>**NOTE**<br/>
>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.
......@@ -2922,6 +2922,7 @@ These value types can be used only by internal applications.
| BOOLEAN |4 |Boolean. |
| DOUBLE |5 |Double (double-precision floating point). |
## SingleKVStore
Provides methods to query and synchronize data in a single KV store. This class inherits from **KVStore**. Before calling any method in **SingleKVStore**, you must use [getKVStore](#getkvstore) to obtain a **SingleKVStore** object.
......@@ -3447,7 +3448,7 @@ Closes the **KvStoreResultSet** object obtained by **getResultSet**. This API us
| Name | Type| Mandatory | Description |
| ----- | ------ | ---- | ----------------------- |
| resultSet |[KvStoreResultSet](#kvstoreresultset8) | Yes |**KvStoreResultSet** object to close. |
| callback |AsyncCallback&lt;void&gt; | Yes |Callback used to return the execution result. |
| callback |AsyncCallback&lt;void&gt; | Yes |Callback used to return the result. |
**Example**
......
# File Interaction
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> **NOTE**<br>
> - 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.
> - The APIs of this module will be deprecated and are not recommended for use. An exception will be thrown if any of the APIs is called.
## Modules to Import
......
# Emitter
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> **NOTE**<br>
> The initial APIs of this module are supported since API version 7.
## Modules to Import
......@@ -17,12 +17,12 @@ None
Enumerates the event emit priority levels.
| Name | Value | Description |
| --------- | ---- | ------------------------------------------------- |
| IMMEDIATE | 0 | The event will be emitted immediately.<br>**System capability**: SystemCapability.Notification.Emitter |
| HIGH | 1 | The event will be emitted before low-priority events.<br>**System capability**: SystemCapability.Notification.Emitter |
| LOW | 2 | The event will be emitted before idle-priority events. By default, an event is in LOW priority.<br>**System capability**: SystemCapability.Notification.Emitter |
| IDLE | 3 | The event will be emitted after all the other events.<br>**System capability**: SystemCapability.Notification.Emitter |
| Name | Value | Description |
| --------- | ---- | ------------------------------------------------- |
| IMMEDIATE | 0 | The event will be emitted immediately.<br>**System capability**: SystemCapability.Notification.Emitter |
| HIGH | 1 | The event will be emitted before low-priority events.<br>**System capability**: SystemCapability.Notification.Emitter |
| LOW | 2 | The event will be emitted before idle-priority events. By default, an event is in LOW priority.<br>**System capability**: SystemCapability.Notification.Emitter |
| IDLE | 3 | The event will be emitted after all the other events.<br>**System capability**: SystemCapability.Notification.Emitter |
## emitter.on
......@@ -34,10 +34,10 @@ Subscribes to an event in persistent manner. This API uses a callback to return
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ----------------------------------- | ---- | ------------------------ |
| event | [InnerEvent](#innerevent) | Yes | Event to subscribe to in persistent manner. |
| callback | Callback\<[EventData](#eventdata)\> | Yes | Callback used to return the event. |
| Name | Type | Mandatory | Description |
| -------- | ----------------------------------- | ---- | ------------------------ |
| event | [InnerEvent](#innerevent) | Yes | Event to subscribe to in persistent manner. |
| callback | Callback\<[EventData](#eventdata)\> | Yes | Callback used to return the event. |
**Example**
......@@ -61,10 +61,10 @@ Subscribes to an event in one-shot manner and unsubscribes from it after the eve
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ----------------------------------- | ---- | ------------------------ |
| event | [InnerEvent](#innerevent) | Yes | Event to subscribe to in one-shot manner. |
| callback | Callback\<[EventData](#eventdata)\> | Yes | Callback used to return the event. |
| Name | Type | Mandatory | Description |
| -------- | ----------------------------------- | ---- | ------------------------ |
| event | [InnerEvent](#innerevent) | Yes | Event to subscribe to in one-shot manner. |
| callback | Callback\<[EventData](#eventdata)\> | Yes | Callback used to return the event. |
**Example**
......@@ -88,9 +88,9 @@ Unsubscribes from an event.
**Parameters**
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | ------ |
| eventId | number | Yes | Event ID. |
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | ------ |
| eventId | number | Yes | Event ID. |
**Example**
......@@ -108,10 +108,10 @@ Emits an event to the event queue.
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------------------------- | ---- | -------------- |
| event | [InnerEvent](#innerevent) | Yes | Event to emit. |
| data | [EventData](#eventdata) | No | Data carried by the event. |
| Name | Type | Mandatory | Description |
| ------ | ------------------------- | ---- | -------------- |
| event | [InnerEvent](#innerevent) | Yes | Event to emit. |
| data | [EventData](#eventdata) | No | Data carried by the event. |
**Example**
......@@ -132,15 +132,15 @@ emitter.emit(innerEvent, eventData);
Describes an intra-process event.
| Name | Type | Readable| Writable| Description |
| -------- | ------------------------------- | ---- | ---- | ---------------------------------- |
| eventId | number | Yes | Yes | Event ID, which is used to identify an event.<br>**System capability**: SystemCapability.Notification.Emitter |
| priority | [EventPriority](#eventpriority) | Yes | Yes | Emit priority of the event.<br>**System capability**: SystemCapability.Notification.Emitter |
| Name | Type | Readable | Writable | Description |
| -------- | ------------------------------- | ---- | ---- | ---------------------------------- |
| eventId | number | Yes | Yes | Event ID, which is used to identify an event.<br>**System capability**: SystemCapability.Notification.Emitter |
| priority | [EventPriority](#eventpriority) | Yes | Yes | Emit priority of the event.<br>**System capability**: SystemCapability.Notification.Emitter |
## EventData
Describes the data passed in the event.
| Name| Type | Readable| Writable| Description |
| ---- | ------------------ | ---- | ---- | -------------- |
| data | [key: string]: any | Yes | Yes | Data carried by the event. The data type can be String, Integer, or Boolean.<br>**System capability**: SystemCapability.Notification.Emitter |
| Name | Type | Readable | Writable | Description |
| ---- | ------------------ | ---- | ---- | -------------- |
| data | [key: string]: any | Yes | Yes | Data carried by the event. The data type can be String, Integer, or Boolean.<br>**System capability**: SystemCapability.Notification.Emitter |
# Enterprise Device Management
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> **NOTE**<br>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......@@ -28,12 +27,12 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | Yes | Enterprise information of the device administrator application.|
| type | [AdminType](#AdminType) | Yes| Type of the device administrator to activate.|
| callback | AsyncCallback\<boolean> | Yes| Callback used to return the result.|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | Yes | Enterprise information of the device administrator application. |
| type | [AdminType](#AdminType) | Yes | Type of the device administrator to activate. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. |
**Example**
......@@ -71,17 +70,17 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ---------------------------------------------- | ---- | ------------------------ |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | Yes | Enterprise information of the device administrator application.|
| type | [AdminType](#AdminType) | Yes | Type of the device administrator to activate. |
| Name | Type | Mandatory | Description |
| -------------- | ---------------------------------------------- | ---- | ------------------------ |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | Yes | Enterprise information of the device administrator application. |
| type | [AdminType](#AdminType) | Yes | Type of the device administrator to activate. |
**Return value**
| Type | Description |
| ----------------- | --------------------------- |
| Promise\<boolean> | Promise used to return the result.|
| Type | Description |
| ----------------- | --------------------------- |
| Promise\<boolean> | Promise used to return the result. |
**Example**
......@@ -118,10 +117,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------- | ---- | ------------------------------ |
| admin | [Want](js-apis-application-Want.md) | Yes | Device common administrator application. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result.|
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------------- | ---- | ------------------------------ |
| admin | [Want](js-apis-application-Want.md) | Yes | Device common administrator application. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. |
**Example**
......@@ -157,15 +156,15 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ---------------------------------------------- | ---- | ------------------ |
| admin | [Want](js-apis-application-Want.md) | Yes | Device common administrator application.|
| Name | Type | Mandatory | Description |
| ------ | ---------------------------------------------- | ---- | ------------------ |
| admin | [Want](js-apis-application-Want.md) | Yes | Device common administrator application. |
**Return value**
| Type | Description |
| ----------------- | --------------------------- |
| Promise\<boolean> | Promise used to return the result.|
| Type | Description |
| ----------------- | --------------------------- |
| Promise\<boolean> | Promise used to return the result. |
**Example**
......@@ -193,10 +192,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ----------------------- | ---- | ------------------------------ |
| bundleName | String | Yes | Bundle name of a device super administrator application. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result.|
| Name | Type | Mandatory | Description |
| ---------- | ----------------------- | ---- | ------------------------------ |
| bundleName | String | Yes | Bundle name of a device super administrator application. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. |
**Example**
......@@ -223,15 +222,15 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ------------------------ |
| bundleName | String | Yes | Bundle name of a device super administrator application.|
| Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ------------------------ |
| bundleName | String | Yes | Bundle name of a device super administrator application. |
**Return value**
| Type | Description |
| ----------------- | --------------------------- |
| Promise\<boolean> | Promise used to return the result.|
| Type | Description |
| ----------------- | --------------------------- |
| Promise\<boolean> | Promise used to return the result. |
**Example**
......@@ -256,10 +255,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------- | ---- | -------------------------------- |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result.|
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------------- | ---- | -------------------------------- |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. |
**Example**
......@@ -291,15 +290,15 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ---------------------------------------------- | ---- | -------------- |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application.|
| Name | Type | Mandatory | Description |
| ------ | ---------------------------------------------- | ---- | -------------- |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
**Return value**
| Type | Description |
| ----------------- | ------------------------------- |
| Promise\<boolean> | Promise used to return the result.|
| Type | Description |
| ----------------- | ------------------------------- |
| Promise\<boolean> | Promise used to return the result. |
**Example**
......@@ -327,10 +326,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ----------------------- | ---- | -------------------------------- |
| bundleName | String | Yes | Bundle name of a device super administrator application. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result.|
| Name | Type | Mandatory | Description |
| ---------- | ----------------------- | ---- | -------------------------------- |
| bundleName | String | Yes | Bundle name of a device super administrator application. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. |
**Example**
......@@ -359,15 +358,15 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ------------------ |
| bundleName | String | Yes | Bundle name of a device super administrator application.|
| Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ------------------ |
| bundleName | String | Yes | Bundle name of a device super administrator application. |
**Return value**
| Type | Description |
| ----------------- | ------------------------------- |
| Promise\<boolean> | Promise used to return the result.|
| Type | Description |
| ----------------- | ------------------------------- |
| Promise\<boolean> | Promise used to return the result. |
**Example**
......@@ -392,9 +391,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<DeviceSettingsManager&gt; | Yes | Callback used to return the **DeviceSettingsManager** object obtained.|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<DeviceSettingsManager&gt; | Yes | Callback used to return the **DeviceSettingsManager** object obtained. |
**Example**
......@@ -431,9 +430,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;DeviceSettingsManager&gt; | Promise used to return the **DeviceSettingsManager** object obtained.|
| Type | Description |
| -------- | -------- |
| Promise&lt;DeviceSettingsManager&gt; | Promise used to return the **DeviceSettingsManager** object obtained. |
**Example**
......@@ -465,11 +464,11 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ---------------------------------------------- | ---- | ------------------------------------ |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | Yes | Enterprise information of the device administrator application. |
| callback | AsyncCallback\<boolean&gt; | Yes | Callback used to return the result.|
| Name | Type | Mandatory | Description |
| -------------- | ---------------------------------------------- | ---- | ------------------------------------ |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | Yes | Enterprise information of the device administrator application. |
| callback | AsyncCallback\<boolean&gt; | Yes | Callback used to return the result. |
**Example**
......@@ -503,16 +502,16 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ---------------------------------------------- | ---- | ------------------------ |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | Yes | Enterprise information of the device administrator application.|
| Name | Type | Mandatory | Description |
| -------------- | ---------------------------------------------- | ---- | ------------------------ |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| enterpriseInfo | [EnterpriseInfo](#EnterpriseInfo) | Yes | Enterprise information of the device administrator application. |
**Return value**
| Type | Description |
| ------------------ | ----------------------------------- |
| Promise\<boolean>; | Callback used to return the result.|
| Type | Description |
| ------------------ | ----------------------------------- |
| Promise\<boolean>; | Callback used to return the result. |
**Example**
......@@ -545,10 +544,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------ | ---- | ---------------------------------------- |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| callback | AsyncCallback&lt;[EnterpriseInfo](#EnterpriseInfo)&gt; | Yes | Callback used to return the enterprise information of the device administrator application.|
| Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------------ | ---- | ---------------------------------------- |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
| callback | AsyncCallback&lt;[EnterpriseInfo](#EnterpriseInfo)&gt; | Yes | Callback used to return the enterprise information of the device administrator application. |
**Example**
......@@ -570,7 +569,7 @@ enterpriseDeviceManager.getEnterpriseInfo(wantTemp, (error, result) => {
## enterpriseDeviceManager.getEnterpriseInfo
getDeviceSettingsManager(admin: Want): Promise&lt;EnterpriseInfo&gt;
getEnterpriseInfo(admin: Want): Promise&lt;EnterpriseInfo&gt;
Obtains the enterprise information of a device administrator application. This API uses a promise to return the result.
......@@ -580,15 +579,15 @@ SystemCapability.Customation.EnterpriseDeviceManager
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ---------------------------------------------- | ---- | -------------- |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application.|
| Name | Type | Mandatory | Description |
| ------ | ---------------------------------------------- | ---- | -------------- |
| admin | [Want](js-apis-application-Want.md) | Yes | Device administrator application. |
**Return value**
| Type | Description |
| ------------------------------------------------ | ------------------------------------------- |
| Promise&lt;[EnterpriseInfo](#EnterpriseInfo)&gt; | Promise used to return the enterprise information of the device administrator application.|
| Type | Description |
| ------------------------------------------------ | ------------------------------------------- |
| Promise&lt;[EnterpriseInfo](#EnterpriseInfo)&gt; | Promise used to return the enterprise information of the device administrator application. |
**Example**
......@@ -613,10 +612,10 @@ Describes the enterprise information of a device administrator application.
SystemCapability.Customation.EnterpriseDeviceManager
| Name | Readable/Writable| Type | Mandatory| Description |
| ----------- | -------- | ------ | ---- | ---------------------------------- |
| name | Read only | string | Yes | Name of the enterprise to which the device administrator application belongs.|
| description | Read only | string | Yes | Description of the enterprise to which the device administrator application belongs.|
| Name | Readable/Writable | Type | Mandatory | Description |
| ----------- | -------- | ------ | ---- | ---------------------------------- |
| name | Read only | string | Yes | Name of the enterprise to which the device administrator application belongs. |
| description | Read only | string | Yes | Description of the enterprise to which the device administrator application belongs. |
## AdminType
......@@ -627,7 +626,7 @@ Enumerates the administrator types of the device administrator application.
SystemCapability.Customation.EnterpriseDeviceManager
| Name| Default Value| Description|
| -------- | -------- | -------- |
| ADMIN_TYPE_NORMAL | 0x00 | Common administrator.|
| ADMIN_TYPE_SUPER | 0x01 | Super administrator.|
| Name | Default Value | Description |
| -------- | -------- | -------- |
| ADMIN_TYPE_NORMAL | 0x00 | Common administrator. |
| ADMIN_TYPE_SUPER | 0x01 | Super administrator. |
# EventHub
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> **NOTE**<br>
> The initial APIs of this module are supported since API 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......@@ -34,10 +34,10 @@ Subscribes to an event.
**Parameters**
| Name| Type| Mandatory| Description |
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| event | string | Yes| Event name. |
| callback | Function | Yes| Callback invoked when the event is triggered. |
| event | string | Yes | Event name. |
| callback | Function | Yes | Callback invoked when the event is triggered. |
**Example**
......@@ -72,9 +72,9 @@ Unsubscribes from an event. If **callback** is specified, this API unsubscribes
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| event | string | Yes| Event name. |
| event | string | Yes | Event name. |
| callback | Function | No | Callback for the event. If **callback** is unspecified, all callbacks of the event are unsubscribed. |
**Example**
......@@ -110,10 +110,10 @@ Triggers an event.
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| event | string | Yes| Event name. |
| ...args | Object[] | Yes| Variable parameters, which are passed to the callback when the event is triggered. |
| event | string | Yes | Event name. |
| ...args | Object[] | Yes | Variable parameters, which are passed to the callback when the event is triggered. |
**Example**
......
# Data Storage
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> **NOTE**<br/>
>
> - The APIs of this module are no longer maintained since API Version 6, and you are advised to use [`@ohos.data.storage`](js-apis-data-storage.md). From API Version 9, you are advised to use [`@ohos.data.preferences`](js-apis-data-preferences.md).
>
......@@ -67,7 +67,7 @@ Sets the value in the cache based on the specified key.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| key | string | Yes| Key of the value to set.|
| key | string | Yes| Key of the data to set.|
| value | string | Yes| New value to set. The maximum length is 128 bytes.|
| success | Function | No| Called when **storage.set()** is successful.|
| fail | Function | No| Called when **storage.set()** fails. In the callback, **data** indicates the error information, and **code** indicates the error code.|
......
# User Authentication
> ![icon-note.gif](public_sys-resources/icon-note.gif)**NOTE**<br/>
> **NOTE**<br>
> 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.
......@@ -122,7 +122,7 @@ Obtains an **Authenticator** object for user authentication.
**Return value**
| Type | Description |
| ----------------------------------------- | ------------ |
| [Authenticator](#authenticatordeprecated) | **Authenticator** object obtained.|
| [Authenticator](#authenticatordeprecated) | **Authenticator** object obtained. |
**Example**
```js
......@@ -144,7 +144,7 @@ execute(type: string, level: string, callback: AsyncCallback&lt;number&gt;): voi
> **NOTE**<br/>
> This API is not longer maintained since API version 8. You are advised to use [auth](#auth8).
Performs user authentication. This method uses asynchronous callback to return the result.
Performs user authentication. This API uses asynchronous callback to return the result.
**Required permissions**: ohos.permission.ACCESS_BIOMETRIC
......@@ -154,15 +154,15 @@ Performs user authentication. This method uses asynchronous callback to return t
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Authentication type. Only **FACE_ONLY** is supported.<br>**ALL** is reserved and not supported by the current version.|
| level | string | Yes | Security level of the authentication. It can be S1 (lowest), S2, S3, or S4 (highest).<br>Devices capable of 3D facial recognition support S3 and lower-level authentication.<br>Devices capable of 2D facial recognition support S2 and lower-level authentication.|
| type | string | Yes | Authentication type. Only **FACE_ONLY** is supported.<br>**ALL** is reserved and not supported by the current version. |
| level | string | Yes | Security level of the authentication. It can be S1 (lowest), S2, S3, or S4 (highest).<br>Devices capable of 3D facial recognition support S3 and lower-level authentication.<br>Devices capable of 2D facial recognition support S2 and lower-level authentication. |
| callback | AsyncCallback&lt;number&gt; | No | Callback used to return the result. |
Parameters returned in callback
| Type | Description |
| ------ | ------------------------------------------------------------ |
| number | Authentication result. For details, see [AuthenticationResult](#authenticationresultdeprecated).|
| number | Authentication result. For details, see [AuthenticationResult](#authenticationresultdeprecated). |
**Example**
```js
......@@ -183,7 +183,7 @@ execute(type:string, level:string): Promise&lt;number&gt;
> **NOTE**<br/>
> This API is not longer maintained since API version 8. You are advised to use [auth](#auth8).
Performs user authentication. This method uses a promise to return the result.
Performs user authentication. This API uses a promise to return the result.
**Required permissions**: ohos.permission.ACCESS_BIOMETRIC
......@@ -192,13 +192,13 @@ Performs user authentication. This method uses a promise to return the result.
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Authentication type. Only **FACE_ONLY** is supported.<br>**ALL** is reserved and not supported by the current version.|
| level | string | Yes | Security level of the authentication. It can be S1 (lowest), S2, S3, or S4 (highest).<br>Devices capable of 3D facial recognition support S3 and lower-level authentication.<br>Devices capable of 2D facial recognition support S2 and lower-level authentication.|
| type | string | Yes | Authentication type. Only **FACE_ONLY** is supported.<br>**ALL** is reserved and not supported by the current version. |
| level | string | Yes | Security level of the authentication. It can be S1 (lowest), S2, S3, or S4 (highest).<br>Devices capable of 3D facial recognition support S3 and lower-level authentication.<br>Devices capable of 2D facial recognition support S2 and lower-level authentication. |
**Return value**
| Type | Description |
| --------------------- | ------------------------------------------------------------ |
| Promise&lt;number&gt; | Promise used to return the authentication result, which is a number. For details, see [AuthenticationResult](#authenticationresultdeprecated).|
| Promise&lt;number&gt; | Promise used to return the authentication result, which is a number. For details, see [AuthenticationResult](#authenticationresultdeprecated). |
**Example**
......@@ -222,7 +222,7 @@ Enumerates the authentication results.
| Name | Default Value| Description |
| ------------------ | ------ | -------------------------- |
| NO_SUPPORT | -1 | The device does not support the current authentication mode.|
| NO_SUPPORT | -1 | The device does not support the current authentication mode. |
| SUCCESS | 0 | The authentication is successful. |
| COMPARE_FAILURE | 1 | The feature comparison failed. |
| CANCELED | 2 | The authentication was canceled by the user. |
......@@ -230,7 +230,7 @@ Enumerates the authentication results.
| CAMERA_FAIL | 4 | The camera failed to start. |
| BUSY | 5 | The authentication service is not available. Try again later. |
| INVALID_PARAMETERS | 6 | The authentication parameters are invalid. |
| LOCKED | 7 | The user account is locked because the number of authentication failures has reached the threshold.|
| LOCKED | 7 | The user account is locked because the number of authentication failures has reached the threshold. |
| NOT_ENROLLED | 8 | No authentication credential is registered. |
| GENERAL_ERROR | 100 | Other errors. |
......@@ -252,7 +252,7 @@ A constructor used to create an **authenticator** object.
| Type | Description |
| ---------------------- | -------------------- |
| [UserAuth](#userauth8) | **Authenticator** object obtained.|
| [UserAuth](#userauth8) | **Authenticator** object obtained. |
**Example**
......@@ -276,7 +276,7 @@ Obtains the authentication executor version.
| Type | Description |
| ------ | ---------------------- |
| number | Authentication executor version obtained.|
| number | Authentication executor version obtained. |
**Example**
......@@ -302,14 +302,14 @@ Checks whether the authentication capability of the specified trust level is ava
| Name | Type | Mandatory| Description |
| -------------- | ---------------------------------- | ---- | -------------------------- |
| authType | [UserAuthType](#userauthtype8) | Yes | Authentication type. Only **FACE** is supported.|
| authType | [UserAuthType](#userauthtype8) | Yes | Authentication type. Only **FACE** is supported. |
| authTrustLevel | [AuthTrustLevel](#authtrustlevel8) | Yes | Trust level of the authentication result. |
**Return value**
| Type | Description |
| ------ | ------------------------------------------------------------ |
| number | Whether the authentication capability of the specified trust level is available. For details, see [ResultCode](#resultcode8).|
| number | Whether the authentication capability of the specified trust level is available. For details, see [ResultCode](#resultcode8). |
**Example**
......@@ -331,7 +331,7 @@ Checks whether the authentication capability of the specified trust level is ava
auth(challenge: Uint8Array, authType: UserAuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array
Performs user authentication. This method uses a callback to return the result.
Performs user authentication. This API uses a callback to return the result.
**Required permissions**: ohos.permission.ACCESS_BIOMETRIC
......@@ -342,7 +342,7 @@ Performs user authentication. This method uses a callback to return the result.
| Name | Type | Mandatory| Description |
| -------------- | ---------------------------------------- | ---- | ------------------------ |
| challenge | Uint8Array | Yes | Challenge value, which can be null. |
| authType | [UserAuthType](#userauthtype8) | Yes | Authentication type. Only **FACE** is supported.|
| authType | [UserAuthType](#userauthtype8) | Yes | Authentication type. Only **FACE** is supported. |
| authTrustLevel | [AuthTrustLevel](#authtrustlevel8) | Yes | Trust level. |
| callback | [IUserAuthCallback](#iuserauthcallback8) | Yes | Callback used to return the result. |
......@@ -350,7 +350,7 @@ Performs user authentication. This method uses a callback to return the result.
| Type | Description |
| ---------- | ------------------------------------------------------------ |
| Uint8Array | ContextId, which is used as the input parameter of [cancelAuth](#cancelauth8).|
| Uint8Array | ContextId, which is used as the input parameter of [cancelAuth](#cancelauth8). |
**Example**
......@@ -389,13 +389,13 @@ Cancels an authentication.
| Name | Type | Mandatory| Description |
| --------- | ---------- | ---- | ------------------------------------------ |
| contextID | Uint8Array | Yes | Context ID, which is obtained using [auth](#auth8).|
| contextID | Uint8Array | Yes | Context ID, which is obtained using [auth](#auth8). |
**Return value**
| Type | Description |
| ------ | ------------------------ |
| number | Whether the authentication is canceled.|
| number | Whether the authentication is canceled. |
**Example**
......@@ -429,7 +429,7 @@ Obtains the authentication result.
| Name | Type | Mandatory| Description |
| --------- | -------------------------- | ---- | ------------------------------------------------------------ |
| result | number | Yes | Authentication result obtained. For details, see [ResultCode](#resultcode8). |
| extraInfo | [AuthResult](#authresult8) | Yes | Extended information, which varies depending on the authentication result.<br>If the authentication is successful, the user authentication token will be returned in **extraInfo**.<br>If the authentication fails, the remaining number of authentication times will be returned in **extraInfo**.<br>If the authentication executor is locked, the freeze time will be returned in **extraInfo**.|
| extraInfo | [AuthResult](#authresult8) | Yes | Extended information, which varies depending on the authentication result.<br>If the authentication is successful, the user authentication token will be returned in **extraInfo**.<br>If the authentication fails, the remaining number of authentication times will be returned in **extraInfo**.<br>If the authentication executor is locked, the freeze time will be returned in **extraInfo**. |
**Example**
......@@ -478,7 +478,7 @@ Obtains the tip code information during authentication. This function is optiona
| Name | Type | Mandatory| Description |
| --------- | ------ | ---- | ------------------------------ |
| module | number | Yes | Type of the authentication executor. |
| acquire | number | Yes | Interaction information of the authentication executor during the authentication process.|
| acquire | number | Yes | Interaction information of the authentication executor during the authentication process. |
| extraInfo | any | Yes | Reserved field. |
**Example**
......@@ -523,8 +523,8 @@ Represents the authentication result object.
| Name | Type | Mandatory| Description |
| ------------ | ---------- | ---- | -------------------- |
| token | Uint8Array | No | Identity authentication token. |
| remainTimes | number | No | Number of remaining authentication operations.|
| freezingTime | number | No | Time for which the authentication operation is frozen.|
| remainTimes | number | No | Number of remaining authentication operations. |
| freezingTime | number | No | Time for which the authentication operation is frozen. |
## ResultCode<sup>8+</sup>
......@@ -544,7 +544,7 @@ Enumerates the operation results.
| BUSY | 7 | Indicates the busy state. |
| INVALID_PARAMETERS | 8 | Invalid parameters are detected. |
| LOCKED | 9 | The authentication executor is locked. |
| NOT_ENROLLED | 10 | The user has not entered the authentication information.|
| NOT_ENROLLED | 10 | The user has not entered the authentication information. |
## FaceTips<sup>8+</sup>
......@@ -563,7 +563,7 @@ Enumerates the tip codes used during the facial authentication process.
| FACE_AUTH_TIP_TOO_LOW | 6 | Only the lower part of the face is captured because the device is angled too low. |
| FACE_AUTH_TIP_TOO_RIGHT | 7 | Only the right part of the face is captured because the device is deviated to the right. |
| FACE_AUTH_TIP_TOO_LEFT | 8 | Only the left part of the face is captured because the device is deviated to the left. |
| FACE_AUTH_TIP_TOO_MUCH_MOTION | 9 | The face moves too fast during facial information collection.|
| FACE_AUTH_TIP_TOO_MUCH_MOTION | 9 | The face moves too fast during facial information collection. |
| FACE_AUTH_TIP_POOR_GAZE | 10 | The face is not facing the camera. |
| FACE_AUTH_TIP_NOT_DETECTED | 11 | No face is detected. |
......@@ -577,7 +577,7 @@ Enumerates the tip codes used during the fingerprint authentication process.
| Name | Default Value| Description |
| --------------------------------- | ------ | -------------------------------------------------- |
| FINGERPRINT_AUTH_TIP_GOOD | 0 | The obtained fingerprint image is in good condition. |
| FINGERPRINT_AUTH_TIP_DIRTY | 1 | Large fingerprint image noise is detected due to suspicious or detected dirt on the sensor.|
| FINGERPRINT_AUTH_TIP_DIRTY | 1 | Large fingerprint image noise is detected due to suspicious or detected dirt on the sensor. |
| FINGERPRINT_AUTH_TIP_INSUFFICIENT | 2 | The noise of the fingerprint image is too large to be processed. |
| FINGERPRINT_AUTH_TIP_PARTIAL | 3 | Incomplete fingerprint image is detected. |
| FINGERPRINT_AUTH_TIP_TOO_FAST | 4 | The fingerprint image is incomplete due to fast movement. |
......@@ -592,8 +592,8 @@ Enumerates the identity authentication types.
| Name | Default Value| Description |
| ----------- | ------ | ---------- |
| FACE | 2 | Facial authentication.|
| FINGERPRINT | 4 | Fingerprint authentication.|
| FACE | 2 | Facial authentication. |
| FINGERPRINT | 4 | Fingerprint authentication. |
## AuthTrustLevel<sup>8+</sup>
......@@ -603,7 +603,7 @@ Enumerates the trust levels of the authentication result.
| Name| Default Value| Description |
| ---- | ------ | ------------------------- |
| ATL1 | 10000 | Trust level 1.|
| ATL2 | 20000 | Trust level 2.|
| ATL3 | 30000 | Trust level 3.|
| ATL4 | 40000 | Trust level 4.|
| ATL1 | 10000 | Trust level 1. |
| ATL2 | 20000 | Trust level 2. |
| ATL3 | 30000 | Trust level 3. |
| ATL4 | 40000 | Trust level 4. |
# Vibrator
> ![icon-note.gif](public_sys-resources/icon-note.gif) **Note:**
> **NOTE**<br>
> 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.
......@@ -23,14 +23,14 @@ Triggers vibration with a specific duration. This API uses a promise to return t
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ------ | ---- | ------------ |
| duration | number | Yes | Vibration duration.|
| Name | Type | Mandatory | Description |
| -------- | ------ | ---- | ------------ |
| duration | number | Yes | Vibration duration. |
**Return value**
| Type | Description |
| ------------------- | ----------- |
| Promise&lt;void&gt; | Promise used to indicate whether the vibration is triggered successfully.|
| Type | Description |
| ------------------- | ----------- |
| Promise&lt;void&gt; | Promise used to indicate whether the vibration is triggered successfully. |
**Example**
......@@ -54,10 +54,10 @@ Triggers vibration with a specific duration. This API uses an asynchronous callb
**System capability**: SystemCapability.Sensors.MiscDevice
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ----------------------- |
| duration | number | Yes | Vibration duration. |
| callback | AsyncCallback&lt;void&gt; | No | Callback used to indicate whether the vibration is triggered successfully.|
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ----------------------- |
| duration | number | Yes | Vibration duration. |
| callback | AsyncCallback&lt;void&gt; | No | Callback used to indicate whether the vibration is triggered successfully. |
**Example**
```
......@@ -82,14 +82,14 @@ Triggers vibration with a specific effect. This API uses a promise to return the
**System capability**: SystemCapability.Sensors.MiscDevice
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | --------------------- | ---- | ------------- |
| effectId | [EffectId](#effectid) | Yes | String that indicates the vibration effect.|
| Name | Type | Mandatory | Description |
| -------- | --------------------- | ---- | ------------- |
| effectId | [EffectId](#effectid) | Yes | String that indicates the vibration effect. |
**Return value**
| Type | Description |
| ------------------- | ----------- |
| Promise&lt;void&gt; | Promise used to indicate whether the vibration is triggered successfully.|
| Type | Description |
| ------------------- | ----------- |
| Promise&lt;void&gt; | Promise used to indicate whether the vibration is triggered successfully. |
**Example**
```
......@@ -112,10 +112,10 @@ Triggers vibration with a specific effect. This API uses an asynchronous callbac
**System capability**: SystemCapability.Sensors.MiscDevice
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ----------------------- |
| effectId | [EffectId](#effectid) | Yes | String that indicates the vibration effect. |
| callback | AsyncCallback&lt;void&gt; | No | Callback used to indicate whether the vibration is triggered successfully.|
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ----------------------- |
| effectId | [EffectId](#effectid) | Yes | String that indicates the vibration effect. |
| callback | AsyncCallback&lt;void&gt; | No | Callback used to indicate whether the vibration is triggered successfully. |
**Example**
```
......@@ -140,14 +140,14 @@ Stops the vibration based on the specified **stopMode**. This API uses a promise
**System capability**: SystemCapability.Sensors.MiscDevice
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ------------------------------------- | ---- | --------------- |
| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Vibration mode to stop.|
| Name | Type | Mandatory | Description |
| -------- | ------------------------------------- | ---- | --------------- |
| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Vibration mode to stop. |
**Return value**
| Type | Description |
| ------------------- | ----------- |
| Promise&lt;void&gt; | Promise used to indicate whether the vibration is stopped successfully.|
| Type | Description |
| ------------------- | ----------- |
| Promise&lt;void&gt; | Promise used to indicate whether the vibration is stopped successfully. |
**Example**
```
......@@ -170,10 +170,10 @@ Stops the vibration based on the specified **stopMode**. This API uses an asynch
**System capability**: SystemCapability.Sensors.MiscDevice
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ------------------------------------- | ---- | ----------------------- |
| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Vibration mode to stop. |
| callback | AsyncCallback&lt;void&gt; | No | Callback used to indicate whether the vibration is stopped successfully.|
| Name | Type | Mandatory | Description |
| -------- | ------------------------------------- | ---- | ----------------------- |
| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Vibration mode to stop. |
| callback | AsyncCallback&lt;void&gt; | No | Callback used to indicate whether the vibration is stopped successfully. |
**Example**
```
......@@ -193,9 +193,9 @@ Describes the vibration effect.
**System capability**: SystemCapability.Sensors.MiscDevice
| Name | Default Value | Description |
| ------------------ | -------------------- | --------------- |
| EFFECT_CLOCK_TIMER | "haptic.clock.timer" | Vibration effect of the vibrator when a user adjusts the timer.|
| Name | Default Value | Description |
| ------------------ | -------------------- | --------------------------------------------------------------- |
| EFFECT_CLOCK_TIMER | "haptic.clock.timer" | Vibration effect of the vibrator when a user adjusts the timer. |
## VibratorStopMode
......@@ -204,7 +204,7 @@ Describes the vibration mode to stop.
**System capability**: SystemCapability.Sensors.MiscDevice
| Name | Default Value | Description |
| ------------------------- | -------- | ---------------------------------------- |
| VIBRATOR_STOP_MODE_TIME | "time" | The vibration to stop is in **duration** mode. This vibration is triggered with the parameter **duration** of the **number** type.|
| VIBRATOR_STOP_MODE_PRESET | "preset" | The vibration to stop is in **EffectId** mode. This vibration is triggered with the parameter **effectId** of the **EffectId** type.|
| Name | Default Value | Description |
| ------------------------- | -------- | ---------------------------------------- |
| VIBRATOR_STOP_MODE_TIME | "time" | The vibration to stop is in **duration** mode. This vibration is triggered with the parameter **duration** of the **number** type. |
| VIBRATOR_STOP_MODE_PRESET | "preset" | The vibration to stop is in **EffectId** mode. This vibration is triggered with the parameter **effectId** of the **EffectId** type. |
# TextArea
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
>
The **&lt;TextArea&gt;** component provides multi-line text input.
......@@ -90,7 +90,7 @@ Sets the position of the caret.
```
@Entry
@Component
struct TextAreaExample2 {
struct TextAreaExample1 {
@State text: string = ''
build() {
Column() {
......@@ -126,7 +126,7 @@ struct TextAreaExample2 {
```
@Entry
@Component
struct TextAreaTest {
struct TextAreaExample2 {
controller: TextAreaController = new TextAreaController()
build() {
Column() {
......
......@@ -12,17 +12,17 @@ To implement grid layout, the declarative paradigm provides the [GridContainer](
## Grid System
The grid system works in terms of columns, margins, and gutters.
The grid system works in terms of gutter, margin, and column.
![en-us_image_0000001217236574](figures/en-us_image_0000001217236574.png)
1. Gutters:
1. Gutter:
Spacing between elements. You can define different clutter values for different device sizes as part of the overall grid layout specifications. For better results, make sure the gutter is not greater than the margin.
2. Margins:
2. Margin:
Spacing around an item in the grid container. You can define different margin values for different device sizes as part of the overall grid layout specifications.
3. Columns:
3. Column:
Main tool for positioning items in the grid layout. The grid container is divided into various numbers of columns based on the device size. The width per column is calculated based on the total number of columns while respecting the margin and clutter specifications.
......
此差异已折叠。
......@@ -29,7 +29,6 @@ For details, see [Contribution Process](contribution-process.md).
## Security Issue Disclosure<a name="en-us_topic_0000001051566732_section725624119448"></a>
- [Security Issue Handling and Release Processes](https://gitee.com/openharmony/security/blob/master/en/security-process/README.md)
- [OpenHarmony Security Vulnerability Notice](https://gitee.com/openharmony/security/blob/master/en/security-process/security-disclosure.md)
此差异已折叠。
......@@ -88,7 +88,7 @@ Perform the following steps:
1. Add the touchscreen driver-related descriptions.
Currently, the input driver is developed based on the HDF and is loaded and started by the HDF. Register the driver information, such as whether to load the driver and the loading priority in the configuration file. Then, the HDF starts the registered driver modules one by one. For details about the driver configuration, see [How to Develop](driver-hdf-development.md#how-to-develop).
Currently, the input driver is developed based on the HDF and is loaded and started by the HDF. Register the driver information, such as whether to load the driver and the loading priority in the configuration file. Then, the HDF starts the registered driver modules one by one. For details about the driver configuration, see [How to Develop](driver-hdf-development.md).
2. Complete the board-level configuration and private data configuration of the touchscreen.
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册