diff --git a/en/application-dev/ability/context-userguide.md b/en/application-dev/ability/context-userguide.md
index ba95ade27a3c7cb846be2d254fd3b75d65dd8701..d3e681244166cafecff86575dd1850db4ebf7f90 100644
--- a/en/application-dev/ability/context-userguide.md
+++ b/en/application-dev/ability/context-userguide.md
@@ -7,9 +7,11 @@
The OpenHarmony application framework has two models: Feature Ability (FA) model and stage model. Correspondingly, there are two sets of context mechanisms. **application/BaseContext** is a common context base class. It uses the **stageMode** attribute to specify whether the context is used for the stage model.
- FA model
+
Only the methods in **app/Context** can be used for the context in the FA model. Both the application-level context and ability-level context are instances of this type. If an ability-level method is invoked in the application-level context, an error occurs. Therefore, you must pay attention to the actual meaning of the **Context** instance.
- Stage model
+
The stage model has the following types of contexts: **application/Context**, **application/ApplicationContext**, **application/AbilityStageContext**, **application/ExtensionContext**, **application/AbilityContext**, and **application/FormExtensionContext**. For details about these contexts and how to use them, see [Context in the Stage Model](#context-in-the-stage-model).

diff --git a/en/application-dev/ability/figures/contextIntroduction.png b/en/application-dev/ability/figures/contextIntroduction.png
index 9f49f270750549a5326724dc0db1560dbda07c44..7345a1a5a6a3471782e9399129c98f3d529bbfd5 100644
Binary files a/en/application-dev/ability/figures/contextIntroduction.png and b/en/application-dev/ability/figures/contextIntroduction.png differ
diff --git a/en/application-dev/database/database-datashare-guidelines.md b/en/application-dev/database/database-datashare-guidelines.md
index c8cb5c503329f6dc49c66fe457eb0aa8e6debf78..495f3b538b48b22d2d97f213d0e32189be799560 100644
--- a/en/application-dev/database/database-datashare-guidelines.md
+++ b/en/application-dev/database/database-datashare-guidelines.md
@@ -13,7 +13,7 @@ The **DataShare** module allows an application to manage its own data and share
|query?(uri: string, predicates: DataSharePredicates, columns: Array<string>, callback: AsyncCallback<Object>): void|Queries data from the database.|
|delete?(uri: string, predicates: DataSharePredicates, callback: AsyncCallback<number>): void|Deletes data from the database.|
-For more details, see [DataShareExtensionAbility](../reference/apis/js-apis-application-DataShareExtensionAbility.md).
+For more information, see [DataShareExtensionAbility](../reference/apis/js-apis-application-DataShareExtensionAbility.md).
**Table 2** APIs of the data consumer
@@ -25,11 +25,11 @@ For more details, see [DataShareExtensionAbility](../reference/apis/js-apis-appl
| query(uri: string, predicates: DataSharePredicates, columns: Array<string>, callback: AsyncCallback<DataShareResultSet>): void | Queries data from the database. |
| delete(uri: string, predicates: DataSharePredicates, callback: AsyncCallback<number>): void | Deletes one or more data records from the database.|
-For more details, see [DataShareHelper](../reference/apis/js-apis-data-dataShare.md).
+For more information, see [DataShareHelper](../reference/apis/js-apis-data-dataShare.md).
## When to Use
-There are two roles in **DataShare**.
+There are two roles in **DataShare**:
- Data provider: adds, deletes, modifies, and queries data, opens files, and shares data.
- Data consumer: accesses the data provided by the provider using **DataShareHelper**.
@@ -41,10 +41,10 @@ Examples are given below.
1. Import the dependencies.
```ts
- import Extension from '@ohos.application.DataShareExtensionAbility'
+ import Extension from '@ohos.application.DataShareExtensionAbility';
import rdb from '@ohos.data.rdb';
- import fileIo from '@ohos.fileio'
- import dataSharePredicates from '@ohos.data.dataSharePredicates'
+ import fileIo from '@ohos.fileio';
+ import dataSharePredicates from '@ohos.data.dataSharePredicates';
```
2. Override **DataShareExtensionAbility** APIs based on actual requirements. For example, if the data provider provides only data query, override only the **query()** API.
@@ -80,7 +80,7 @@ Examples are given below.
}
// Override the query() API.
- query(uri, predicates, columns, callback) {
+ query(uri, predicates, columns, callback) {
if (predicates == null || predicates == undefined) {
console.info('invalid predicates');
}
@@ -144,48 +144,49 @@ Examples are given below.
let dseUri = ("datashare:///com.samples.datasharetest.DataShare");
```
-2. Create a **DataShareHelper** instance.
+3. Create a **DataShareHelper** instance.
```ts
let dsHelper;
let abilityContext;
+
export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
abilityContext = this.context;
- dataShare.createDataShareHelper(abilityContext, dseUri, (err,data)=>{
+ dataShare.createDataShareHelper(abilityContext, dseUri, (err, data)=>{
dsHelper = data;
});
}
}
```
-3. Use the APIs provided by **DataShareHelper** to access the services provided by the provider, for example, adding, deleting, modifying, and querying data.
+4. Use the APIs provided by **DataShareHelper** to access the services provided by the provider, for example, adding, deleting, modifying, and querying data.
```ts
// Construct a piece of data.
- var valuesBucket = {"name": "ZhangSan", "age": 21, "isStudent": false, "Binary": new Uint8Array([1,2,3])};
- var updateBucket = {"name": "LiSi", "age": 18, "isStudent": true, "Binary": new Uint8Array([1,2,3])};
- let da = new dataSharePredicates.DataSharePredicates();
- var valArray =new Array("*");
+ var valuesBucket = { "name": "ZhangSan", "age": 21, "isStudent": false, "Binary": new Uint8Array([1, 2, 3]) };
+ var updateBucket = { "name": "LiSi", "age": 18, "isStudent": true, "Binary": new Uint8Array([1, 2, 3]) };
+ let da = new dataSharePredicates.DataSharePredicates();
+ var valArray = new Array("*");
let people = new Array(
- {"name": "LiSi", "age": 41, "Binary": ar},
- {"name": "WangWu", "age": 21, "Binary": arr},
- {"name": "ZhaoLiu", "age": 61, "Binary": arr});
+ { "name": "LiSi", "age": 41, "Binary": ar },
+ { "name": "WangWu", "age": 21, "Binary": arr },
+ { "name": "ZhaoLiu", "age": 61, "Binary": arr });
// Insert a piece of data.
- dsHelper.insert(dseUri, valuesBucket, (err,data) => {
- console.log("dsHelper insert result: " + data);
+ dsHelper.insert(dseUri, valuesBucket, (err, data) => {
+ console.log("dsHelper insert result: " + data);
});
// Delete data.
- dsHelper.delete(dseUri, da, (err,data) => {
- console.log("dsHelper delete result: " + data);
+ dsHelper.delete(dseUri, da, (err, data) => {
+ console.log("dsHelper delete result: " + data);
});
// Update data.
- dsHelper.update(dseUri, da, updateBucket, (err,data) => {
- console.log("dsHelper update result: " + data);
+ dsHelper.update(dseUri, da, updateBucket, (err, data) => {
+ console.log("dsHelper update result: " + data);
});
// Query data.
- dsHelper.query(dseUri, da, valArray, (err,data) => {
- console.log("dsHelper query result: " + data);
+ dsHelper.query(dseUri, da, valArray, (err, data) => {
+ console.log("dsHelper query result: " + data);
});
```
diff --git a/en/application-dev/database/database-distributedobject-guidelines.md b/en/application-dev/database/database-distributedobject-guidelines.md
index eca90200a0d711c91f64643f453ff1d22a3a367f..8cc0a8aca0a6b8f6fad3f1a03f452e8ea9d3eb97 100644
--- a/en/application-dev/database/database-distributedobject-guidelines.md
+++ b/en/application-dev/database/database-distributedobject-guidelines.md
@@ -2,14 +2,13 @@
## When to Use
-Distributed data objects allow data traversing across devices to be processed like local variables by shielding complex data interaction between devices. For the devices that form a Super Device, when data in the distributed data object of an application is added, deleted, or modified on a device, the data for the same application is also updated on the other devices. The devices can listen for data changes and online and offline status changes of other devices.
-
-The distributed data objects support basic data types, such as number, string, and Boolean, as well as complex data types, such as array and nested basic types.
+The **distributedDataObject** module provides APIs to implement data collaboration of the same application across multiple devices. In addition, the devices that form a Super Device can listen for object status and data changes with each other.
+For example, when the data of the a distributed data object is added, deleted, or modified for application A on device 1, application A on device 2 can obtain the updated data. In addition, device 2 can listen for data changes and online/offline of the data objects on device 1.
## Available APIs
-For details about the APIs related to the distributed data object, see [Distributed Data Object](../reference/apis/js-apis-data-distributedobject.md).
+For details about the APIs, see [Distributed Data Object](../reference/apis/js-apis-data-distributedobject.md).
### Creating a Distributed Data Object Instance
@@ -17,7 +16,7 @@ Call **createDistributedObject()** to create a distributed data object instance.
**Table 1** API for creating a distributed data object instance
-| Package | API | Description |
+| Package| API| Description|
| -------- | -------- | -------- |
| ohos.data.distributedDataObject| createDistributedObject(source: object): DistributedObject | Creates a distributed data object instance for data operations.
- **source**: attributes of the **distributedObject** set.
- **DistributedObject**: returns the distributed object created.|
@@ -26,35 +25,36 @@ Call **createDistributedObject()** to create a distributed data object instance.
Call **genSessionId()** to generate a session ID randomly. The generated session ID can be used to set the session ID of a distributed data object.
**Table 2** API for generating a session ID randomly
-| Package | API | Description |
+| Package| API| Description|
| -------- | -------- | -------- |
| ohos.data.distributedDataObject| genSessionId(): string | Generates a session ID, which can be used as the session ID of a distributed data object.|
-### Setting a SessionID for Distributed Data Objects
+### Setting a SessionID for a Distributed Data Object
Call **setSessionId()** to set a session ID for a distributed data object. The session ID is a unique identifier for one collaboration across devices. The distributed data objects to be synchronized must be associated with the same session ID.
**Table 3** API for setting a session ID
| Class| API| Description|
| -------- | -------- | -------- |
-| DistributedDataObject | setSessionId(sessionId?: string): boolean | Sets a session ID for distributed data objects.
**sessionId**: session ID of a distributed object in a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
+| DistributedDataObject | setSessionId(sessionId?: string): boolean | Sets a session ID for a distributed data object.
**sessionId**: session ID of a distributed object in a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
### Observing Data Changes
-Call **on()** to subscribe to data changes of a distributed data object. In the case of data change, a callback will be invoked to return the data changes. You can use **off()** to unsubscribe from the data changes.
+Call **on()** to subscribe to data changes of a distributed data object. When the data changes, a callback will be invoked to return the data changes. You can use **off()** to unsubscribe from the data changes.
**Table 4** APIs for observing data changes of a distributed data object
-| Class | API | Description |
+
+| Class| API| Description|
| -------- | -------- | -------- |
| DistributedDataObject| on(type: 'change', callback: Callback<{ sessionId: string, fields: Array<string> }>): void | Subscribes to data changes.|
-| DistributedDataObject| off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array<string> }>): void | Unsubscribes from data changes.
**Callback**: specifies callback used to return changes of the distributed data object. If this parameter is not specified, all callbacks related to data changes will be unregistered.|
+| DistributedDataObject| off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array<string> }>): void | Unsubscribes from data changes. **Callback**: specifies the data changes to unsubscribe from. If this parameter is not specified, all data changes of this distributed data object will be unsubscribed from.|
### Observing Online or Offline Status
Call **on()** to subscribe to status changes of a distributed data object. The status can be online or offline. When the status changes, a callback will be invoked to return the status. You can use **off()** to unsubscribe from the status changes.
**Table 5** APIs for observing status changes of a distributed data object
-| Class | API | Description |
+| Class| API| Description|
| -------- | -------- | -------- |
| DistributedDataObject| on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }>): void | Subscribes to the status changes of a distributed data object.|
| DistributedDataObject| off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }>): void | Unsubscribes from status changes of a distributed data object.|
@@ -63,7 +63,7 @@ Call **on()** to subscribe to status changes of a distributed data object. The s
Call **save()** to save a distributed data object. When the application is active, the saved data will not be released. When the application exits and restarts, the data saved on the device will be restored.
-Call **revokeSave()** to revoke a distributed data object that is no longer required. If the distributed data object is saved on the local device, **revokeSave()** will delete the data from all trusted devices. If the distributed data object is not saved on the local device, **revokeSave()** will delete the data from the local device.
+Call **revokeSave()** to delete a distributed data object that is no longer required. If the distributed data object is saved on the local device, **revokeSave()** will delete the data from all trusted devices. If the distributed data object is not saved on the local device, **revokeSave()** will delete the data from the local device.
The saved data will be released in the following cases:
@@ -71,13 +71,11 @@ The saved data will be released in the following cases:
- The application has been uninstalled.
- Data is successfully restored.
-**Table 6** APIs for saving a distributed data object and revoking the saving
-| Class | API | Description |
+**Table 6** APIs for saving a distributed data object and revoking the saving operation
+| Class| API| Description|
| -------- | -------- | -------- |
-| DistributedDataObject | save(deviceId: string): Promise<SaveSuccessResponse> | Saves a distributed data object. This API uses a promise to return the result. |
-| DistributedDataObject | save(deviceId: string, callback: AsyncCallback<SaveSuccessResponse>): void | Saves a distributed data object. This API uses an asynchronous callback to return the result. |
-| DistributedDataObject | revokeSave(callback: AsyncCallback<RevokeSaveSuccessResponse>): void | Revokes the data saving operation. This API uses an asynchronous callback to return the result. |
-| DistributedDataObject | revokeSave(): Promise<RevokeSaveSuccessResponse> | Revokes the data saving operation. This API uses a promise to return the result. |
+| DistributedDataObject | save(deviceId: string): Promise<SaveSuccessResponse> | Saves a distributed data object.|
+| DistributedDataObject| revokeSave(): Promise<RevokeSaveSuccessResponse> | Revokes the data saving operation.|
## How to Develop
@@ -89,12 +87,14 @@ The following example shows how to implement distributed data object synchroniza
import distributedObject from '@ohos.data.distributedDataObject';
```
-2. Request the permission.
+2. Apply for the permission.
+
+ Add the required permission (FA model) in the **config.json** file.
+
+ The sample code is as follows:
- Add the required permission in the **config.json** file. The sample code is as follows:
-
- ```
- {
+ ```json
+ {
"module": {
"reqPermissions": [
{
@@ -103,106 +103,125 @@ The following example shows how to implement distributed data object synchroniza
]
}
}
- ```
- This permission must also be authorized by the user through a dialog box when the application is started for the first time. The sample code is as follows:
-
- ```
+ ```
+
+ For the apps based on the stage model, see [Declaring Permissions](../security/accesstoken-guidelines.md#stage-model).
+
+ This permission must also be granted by the user when the application is started for the first time. The sample code is as follows:
+
+ ```json
import featureAbility from '@ohos.ability.featureAbility';
-
- function grantPermission() {
- console.info('grantPermission');
- let context = featureAbility.getContext();
- context.requestPermissionsFromUser(['ohos.permission.DISTRIBUTED_DATASYNC'], 666, function (result) {
- console.info(`result.requestCode=${result.requestCode}`)
-
- })
- console.info('end grantPermission');
- }
- grantPermission();
- ```
-
-
-
+
+ function grantPermission() {
+ console.info('grantPermission');
+ let context = featureAbility.getContext();
+ context.requestPermissionsFromUser(['ohos.permission.DISTRIBUTED_DATASYNC'], 666, function (result) {
+ console.info(`result.requestCode=${result.requestCode}`)
+
+ })
+ console.info('end grantPermission');
+ }
+
+ grantPermission();
+ ```
+
+
+
3. Obtain a distributed data object instance.
The sample code is as follows:
```js
- var local_object = distributedObject.createDistributedObject({name:undefined, age:undefined, isVis:true,
- parent:undefined, list:undefined});
+ var local_object = distributedObject.createDistributedObject({
+ name: undefined,
+ age: undefined,
+ isVis: true,
+ parent: undefined,
+ list: undefined
+ });
var sessionId = distributedObject.genSessionId();
```
-
-4. Add the synchronization network. The data objects in the synchronization network include the local and remote objects.
+4. Add the distributed data object instance to the synchronization network.
- The sample code is as follows:
+ The data objects in the synchronization network include the local and remote objects.
+ The sample code is as follows:
+
```js
// Local object
- var local_object = distributedObject.createDistributedObject({name:"jack", age:18, isVis:true,
- parent:{mother:"jack mom", father:"jack Dad"}, list:[{mother:"jack mom"}, {father:"jack Dad"}]});
+ var local_object = distributedObject.createDistributedObject({
+ name: "jack",
+ age: 18,
+ isVis: true,
+ parent: { mother: "jack mom", father: "jack Dad" },
+ list: [{ mother: "jack mom" }, { father: "jack Dad" }]
+ });
local_object.setSessionId(sessionId);
// Remote object
- var remote_object = distributedObject.createDistributedObject({name:undefined, age:undefined, isVis:true,
- parent:undefined, list:undefined});
- remote_object.setSessionId(sessionId);
+ var remote_object = distributedObject.createDistributedObject({
+ name: undefined,
+ age: undefined,
+ isVis: true,
+ parent: undefined,
+ list: undefined
+ });
// After learning that the device goes online, the remote object synchronizes data. That is, name changes to jack and age to 18.
+ remote_object.setSessionId(sessionId);
```
5. Observe the data changes of the distributed data object.
- You can subscribe to data changes of the peer object. When the data in the peer object changes, a callback will be called to return the data changes.
-
+ You can subscribe to data changes of the remote object. When the data in the remote object changes, a callback will be called to return the data changes.
+
The sample code is as follows:
-
+
```js
function changeCallback(sessionId, changeData) {
- console.info("change" + sessionId);
+ console.info("change" + sessionId);
- if (changeData != null && changeData != undefined) {
- changeData.forEach(element => {
- console.info("changed !" + element + " " + local_object[element]);
- });
- }
- }
+ if (changeData != null && changeData != undefined) {
+ changeData.forEach(element => {
+ console.info("changed !" + element + " " + local_object[element]);
+ });
+ }
+ }
- // To refresh the page in changeCallback, correctly bind (this) to the changeCallback.
- local_object.on("change", this.changeCallback.bind(this));
+ // To refresh the page in changeCallback, correctly bind (this) to the changeCallback.
+ local_object.on("change", this.changeCallback.bind(this));
```
-
-6. Modify object attributes.
+
+6. Modify attributes of the distributed data object.
The object attributes support basic data types (such as number, Boolean, and string) and complex data types (array and nested basic types).
The sample code is as follows:
+
```js
local_object.name = "jack";
local_object.age = 19;
local_object.isVis = false;
- local_object.parent = {mother:"jack mom", father:"jack Dad"};
- local_object.list = [{mother:"jack mom"}, {father:"jack Dad"}];
+ local_object.parent = { mother: "jack mom", father: "jack Dad" };
+ local_object.list = [{ mother: "jack mom" }, { father: "jack Dad" }];
```
- >  **NOTE**
- >
- > For the distributed data object of the complex type, only the root attribute can be modified. The subordinate attributes cannot be modified.
-
- Example:
+ > **NOTE**
+ > For the distributed data object of the complex type, only the root attribute can be modified. The subordinate attributes cannot be modified. Example:
```js
// Supported modification.
- local_object.parent = {mother:"mom", father:"dad"};
+ local_object.parent = { mother: "mom", father: "dad" };
// Modification not supported.
local_object.parent.mother = "mom";
```
7. Access the distributed data object.
- Obtain the distributed data object attribute, which is the latest data on the network.
+ Obtain the distributed data object attributes, which are the latest data on the network.
The sample code is as follows:
+
```js
console.info("name " + local_object["name"]);
```
@@ -221,7 +240,6 @@ The following example shows how to implement distributed data object synchroniza
```
9. Subscribe to the status (online/offline) changes of the distributed data object. A callback will be invoked to report the status change when the target distributed data object goes online or offline.
-
The sample code is as follows:
```js
@@ -234,53 +252,29 @@ The following example shows how to implement distributed data object synchroniza
10. Save a distributed data object and revoke the data saving operation.
- - Callback
-
- ```
- ```js
- // Save a distributed data object.
- local_object.save("local", (result, data) => {
- console.log("save callback");
- console.info("save sessionId " + data.sessionId);
- console.info("save version " + data.version);
- console.info("save deviceId " + data.deviceId);
- });
- // Revoke the data saving operation.
- local_object.revokeSave((result, data) => {
- console.log("revokeSave callback");
- console.info("revokeSave sessionId " + data.sessionId);
- });
- ```
- ```
-
- - Promise
-
- ```
- ```js
- // Save a distributed data object.
- g_object.save("local").then((result) => {
- console.info("save sessionId " + result.sessionId);
- console.info("save version " + result.version);
- console.info("save deviceId " + result.deviceId);
- }, (result)=>{
- console.info("save local failed.");
- });
- // Revoke the data saving operation.
- g_object.revokeSave().then((result) => {
- console.info("revokeSave success.");
- }, (result)=>{
- console.info("revokeSave failed.");
- });
- ```
- ```
-
-
+ ```js
+ // Save a distributed data object.
+ g_object.save("local").then((result) => {
+ console.info("save sessionId " + result.sessionId);
+ console.info("save version " + result.version);
+ console.info("save deviceId " + result.deviceId);
+ }, (result) => {
+ console.info("save local failed.");
+ });
+ // Revoke the data saving operation.
+ g_object.revokeSave().then((result) => {
+ console.info("revokeSave success.");
+ }, (result) => {
+ console.info("revokeSave failed.");
+ });
+ ```
11. Unsubscribe from the status changes of the distributed data object.
- You can specify the callback to unregister. If you do not specify the callback, this API unregisters all callbacks of this distributed data object.
+ You can specify the callback to unregister. If you do not specify the callback, this API unregisters all status change callbacks of this distributed data object.
The sample code is as follows:
+
```js
// Unregister the specified status change callback.
local_object.off("status", this.statusCallback);
@@ -288,9 +282,12 @@ The following example shows how to implement distributed data object synchroniza
local_object.off("status");
```
-12. Remove a distributed data object from the synchronization network. Data changes on the local object will not be synchronized to the removed distributed data object.
+12. Remove a distributed data object from the synchronization network.
- The sample code is as follows:
- ```js
- local_object.setSessionId("");
- ```
+ Data changes on the local object will not be synchronized to the removed distributed data object.
+
+ The sample code is as follows:
+
+ ```js
+ local_object.setSessionId("");
+ ```
diff --git a/en/application-dev/database/database-distributedobject-overview.md b/en/application-dev/database/database-distributedobject-overview.md
index 618bc881d563c11c51c9012831f48357a79830b1..80985ed39b8c91a5c9635e0be8fd00f4be2da702 100644
--- a/en/application-dev/database/database-distributedobject-overview.md
+++ b/en/application-dev/database/database-distributedobject-overview.md
@@ -1,29 +1,29 @@
# Distributed Data Object Overview
-The distributed data object management framework is an object-oriented in-memory data management framework. It provides application developers with basic data object management capabilities, such as creating, querying, deleting, modifying, and subscribing to in-memory objects. This management framework also provides distributed capabilities to implement data object collaboration for the same application between multiple devices that form a Super Device.
+The distributed data object management framework provides object-oriented in-memory data management. It provides basic data management capabilities, such as creating, querying, deleting, and modifying distributed data objects, and observing data and status changes of the distributed data objects. This management framework also provides distributed capabilities to implement data object collaboration for the same application between multiple devices that form a Super Device.
-## Key Concepts
+## Basic Concepts
- **Distributed in-memory database**
- The distributed in-memory database caches data in the memory, so that applications can quickly access data. This database, however, does not store data persistently. If the database is closed, the data is not retained.
+ The distributed in-memory database caches data in the memory so that applications can quickly access data. This database, however, does not store data persistently. If the database is closed, the data is not retained.
- **Distributed data object**
- A distributed data object is an encapsulation of the JS object type. Each distributed data object instance creates a data table in the in-memory database. The in-memory databases created for different applications are isolated from each other. Reading or assigning values to distributed data objects is automatically mapped to the **put** or **get** operation of the corresponding database.
+ A distributed data object is an encapsulation of the JS object type. Each distributed data object instance creates a data table in the in-memory database. The in-memory databases created for different applications are isolated from each other. Reading data from and writing data to a distributed data object are mapped to the **put** and **get** operations in the corresponding database, respectively.
The distributed data object can be in the following states in its lifecycle:
- **Uninitialized**: The distributed data object is not instantiated or has been destroyed.
- **Local**: The data table is created, but the data cannot be synchronized.
- - **Distributed**: The data table is created, there are at least two online with the same session ID, and data can be synchronized across devices. If the device is offline or the session ID is empty, the distributed data object changes to the local state.
+ - **Distributed**: The data table is created, and there are at least two online devices with the same session ID. In this case, data can be synchronized across devices. If a device is offline or the session ID is empty, the distributed data object changes to the local state.
## Working Principles
-The distributed data objects are encapsulated into JS objects in distributed in-memory databases, which allows the distributed data objects to be operated in the same way as local variables. The system automatically implements cross-device data synchronization.
+The distributed data objects are encapsulated into JS objects in distributed in-memory databases. This allows the distributed data objects to be operated in the same way as local variables. The system automatically implements cross-device data synchronization.
**Figure 1** Working mechanism
@@ -34,7 +34,7 @@ The distributed data objects are encapsulated into JS objects in distributed in-
## Constraints
-- Data synchronization can be implemented across devices only for the applications with the same bundleName.
+- Data synchronization can be implemented across devices only for the applications with the same **bundleName**.
- Each distributed data object occupies 100 KB to 150 KB of memory. Therefore, you are advised not to create too many distributed data objects.
diff --git a/en/application-dev/database/database-mdds-guidelines.md b/en/application-dev/database/database-mdds-guidelines.md
index dd1594215a10d1c93c9825444253484ed8956e05..2205df9ceffb51c3c6cb7816f6d11784ba532b20 100644
--- a/en/application-dev/database/database-mdds-guidelines.md
+++ b/en/application-dev/database/database-mdds-guidelines.md
@@ -6,113 +6,144 @@ The Distributed Data Service (DDS) implements synchronization of application dat
## Available APIs
-For details about the APIs related to distributed data, see [Distributed Data Management](../reference/apis/js-apis-distributed-data.md).
+For details about the APIs, see [Distributed Data Management](../reference/apis/js-apis-distributed-data.md).
**Table 1** APIs provided by the DDS
| API | Description |
| ------------------------------------------------------------ | ----------------------------------------------- |
-| createKVManager(config:KVManagerConfig,callback:AsyncCallback<KVManager>):void
createKVManager(config:KVManagerConfig):Promise<KVManager> | Creates a **KVManager** object for database management.|
-| getKVStore<TextendsKVStore>(storeId:string,options:Options,callback:AsyncCallback<T>):void
getKVStore<TextendsKVStore>(storeId:string,options:Options):Promise<T> | Obtains a KV store with the specified **Options** and **storeId**.|
-| put(key:string,value:Uint8Array\|string\|number\|boolean,callback:AsyncCallback<void>):void
put(key:string,value:Uint8Array\|string\|number\|boolean):Promise<void> | Inserts and updates data. |
-| delete(key:string,callback:AsyncCallback<void>):void
delete(key:string):Promise<void> | Deletes data. |
-| get(key:string,callback:AsyncCallback<Uint8Array\|string\|boolean\|number>):void
get(key:string):Promise<Uint8Array\|string\|boolean\|number> | Queries data. |
-| on(event:'dataChange',type:SubscribeType,observer:Callback<ChangeNotification>):void
on(event:'syncComplete',syncCallback:Callback<Array<[string,number]>>):void | Subscribes to data changes in the KV store. |
-| sync(deviceIdList:string[],mode:SyncMode,allowedDelayMs?:number):void | Triggers database synchronization in manual mode. |
-
-
-
+| createKVManager(config: KVManagerConfig, callback: AsyncCallback<KVManager>): void
createKVManager(config: KVManagerConfig): Promise<KVManager> | Creates a **KVManager** object for database management.|
+| getKVStore<TextendsKVStore>(storeId: string, options: Options, callback: AsyncCallback<T>): void
getKVStore<TextendsKVStore>(storeId: string, options: Options): Promise<T> | Obtains a KV store with the specified **Options** and **storeId**.|
+| put(key: string, value: Uint8Array\|string\|number\|boolean, callback: AsyncCallback<void>): void
put(key: string, value: Uint8Array\|string\|number\|boolean): Promise<void> | Inserts and updates data. |
+| delete(key: string, callback: AsyncCallback<void>): void
delete(key: string): Promise<void> | Deletes data. |
+| get(key: string, callback: AsyncCallback<Uint8Array\|string\|boolean\|number>): void
get(key: string): Promise<Uint8Array\|string\|boolean\|number> | Queries data. |
+| on(event: 'dataChange', type: SubscribeType, observer: Callback<ChangeNotification>): void
on(event: 'syncComplete', syncCallback: Callback<Array<[string,number]>>): void | Subscribes to data changes in the KV store. |
+| sync(deviceIdList: string[], mode: SyncMode, allowedDelayMs?: number): void | Triggers database synchronization in manual mode. |
## How to Develop
The following uses a single KV store as an example to describe the development procedure.
1. Import the distributed data module.
+
```js
import distributedData from '@ohos.data.distributedData';
```
+2. Apply for the required permission if data synchronization is required.
-2. Create a **KvManager** instance based on the specified **KvManagerConfig** object.
-
- (1) Create a **KvManagerConfig** object based on the application context.
+ Add the permission required (FA model) in the **config.json** file. The sample code is as follows:
+
+ ```json
+ {
+ "module": {
+ "reqPermissions": [
+ {
+ "name": "ohos.permission.DISTRIBUTED_DATASYNC"
+ }
+ ]
+ }
+ }
+ ```
+ For the apps based on the stage model, see [Declaring Permissions](../security/accesstoken-guidelines.md#stage-model).
+
+ This permission must also be granted by the user when the application is started for the first time. The sample code is as follows:
+
+ ```js
+ import featureAbility from '@ohos.ability.featureAbility';
+
+ function grantPermission() {
+ console.info('grantPermission');
+ let context = featureAbility.getContext();
+ context.requestPermissionsFromUser(['ohos.permission.DISTRIBUTED_DATASYNC'], 666, function (result) {
+ console.info(`result.requestCode=${result.requestCode}`)
+
+ })
+ console.info('end grantPermission');
+ }
+
+ grantPermission();
+ ```
+
+3. Create a **kvManager** instance based on the specified **kvManagerConfig** object.
+
+ 1. Create a **kvManagerConfig** object based on the application context.
+ 2. Create a **kvManager** instance.
- (2) Create a **KvManager** instance.
-
The sample code is as follows:
-
- ```
+
+ ```js
let kvManager;
try {
- const kvManagerConfig = {
- bundleName : 'com.example.datamanagertest',
- userInfo : {
- userId : '0',
- userType : distributedData.UserType.SAME_USER_ID
- }
+ const kvManagerConfig = {
+ bundleName: 'com.example.datamanagertest',
+ userInfo: {
+ userId: '0',
+ userType: distributedData.UserType.SAME_USER_ID
}
- distributedData.createKVManager(kvManagerConfig, function (err, manager) {
- if (err) {
- console.log("createKVManager err: " + JSON.stringify(err));
- return;
- }
- console.log("createKVManager success");
- kvManager = manager;
- });
+ }
+ distributedData.createKVManager(kvManagerConfig, function (err, manager) {
+ if (err) {
+ console.log("createKVManager err: " + JSON.stringify(err));
+ return;
+ }
+ console.log("createKVManager success");
+ kvManager = manager;
+ });
} catch (e) {
- console.log("An unexpected error occurred. Error:" + e);
+ console.log("An unexpected error occurred. Error: " + e);
}
```
-
-
-3. Create and obtain a single KV store.
- (1) Declare the ID of the single KV store to create.
+4. Create and obtain a single KV store.
- (2) Create a single KV store. You are advised to disable automatic synchronization (**autoSync:false**) and call **sync** when a synchronization is required.
+ 1. Declare the ID of the single KV store to create.
+ 2. Create a single KV store. You are advised to disable automatic synchronization (`autoSync:false`) and call `sync` when a synchronization is required.
The sample code is as follows:
+
```js
let kvStore;
try {
- const options = {
- createIfMissing : true,
- encrypt : false,
- backup : false,
- autoSync : false,
- kvStoreType : distributedData.KVStoreType.SINGLE_VERSION,
- securityLevel : distributedData.SecurityLevel.S0,
- };
- kvManager.getKVStore('storeId', options, function (err, store) {
- if (err) {
- console.log("getKVStore err: " + JSON.stringify(err));
- return;
- }
- console.log("getKVStore success");
- kvStore = store;
- });
+ const options = {
+ createIfMissing: true,
+ encrypt: false,
+ backup: false,
+ autoSync: false,
+ kvStoreType: distributedData.KVStoreType.SINGLE_VERSION,
+ securityLevel: distributedData.SecurityLevel.S0
+ };
+ kvManager.getKVStore('storeId', options, function (err, store) {
+ if (err) {
+ console.log("getKVStore err: " + JSON.stringify(err));
+ return;
+ }
+ console.log("getKVStore success");
+ kvStore = store;
+ });
} catch (e) {
- console.log("An unexpected error occurred. Error:" + e);
+ console.log("An unexpected error occurred. Error: " + e);
}
```
- > **NOTE**
+ > **NOTE**
>
> For data synchronization between networked devices, you are advised to open the distributed KV store during application startup to obtain the database handle. With this database handle (`kvStore` in this example), you can perform operations, such as inserting data into the KV store, without creating the KV store repeatedly during the lifecycle of the handle.
+
+5. Subscribe to changes in the distributed data.
-4. Subscribe to changes in the distributed data.
The following is the sample code for subscribing to the data changes of a single KV store:
+
```js
kvStore.on('dataChange', distributedData.SubscribeType.SUBSCRIBE_TYPE_ALL, function (data) {
console.log("dataChange callback call data: " + JSON.stringify(data));
});
```
-5. Write data to the single KV store.
-
- (1) Construct the key and value to be written into the single KV store.
+6. Write data to the single KV store.
- (2) Write key-value pairs into the single KV store.
+ 1. Construct the `Key` and `Value` to be written into the single KV store.
+ 2. Write key-value pairs into the single KV store.
The following is the sample code for writing key-value pairs of the string type into the single KV store:
@@ -120,52 +151,54 @@ The following uses a single KV store as an example to describe the development p
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err,data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
if (err != undefined) {
console.log("put err: " + JSON.stringify(err));
return;
}
console.log("put success");
});
- }catch (e) {
- console.log("An unexpected error occurred. Error:" + e);
+ } catch (e) {
+ console.log("An unexpected error occurred. Error: " + e);
}
```
-6. Query data in the single KV store.
-
- (1) Construct the key to be queried from the single KV store.
+7. Query data in the single KV store.
- (2) Query data from the single KV store.
+ 1. Construct the `Key` to be queried from the single KV store.
+ 2. Query data from the single KV store.
The following is the sample code for querying data of the string type from the single KV store:
+
```js
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err,data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
if (err != undefined) {
console.log("put err: " + JSON.stringify(err));
return;
}
console.log("put success");
- kvStore.get(KEY_TEST_STRING_ELEMENT, function (err,data) {
+ kvStore.get(KEY_TEST_STRING_ELEMENT, function (err, data) {
console.log("get success data: " + data);
});
});
- }catch (e) {
- console.log("An unexpected error occurred. Error:" + e);
+ } catch (e) {
+ console.log("An unexpected error occurred. Error: " + e);
}
```
-7. Synchronize data to other devices.
+8. Synchronize data to other devices.
+
Select the devices in the same network and the synchronization mode to synchronize data.
- > **NOTE**
+ > **NOTE**
>
> The APIs of the `deviceManager` module are system interfaces.
+
+ The following is the example code for synchronizing data in a single KV store:
- The following is the sample code for synchronizing data in a single KV store:
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
@@ -185,8 +218,8 @@ The following uses a single KV store as an example to describe the development p
try{
// 1000 indicates that the maximum delay is 1000 ms.
kvStore.sync(deviceIds, distributedData.SyncMode.PUSH_ONLY, 1000);
- }catch (e) {
- console.log("An unexpected error occurred. Error:" + e);
+ } catch (e) {
+ console.log("An unexpected error occurred. Error: " + e);
}
}
});
diff --git a/en/application-dev/database/database-preference-guidelines.md b/en/application-dev/database/database-preference-guidelines.md
index fdb69297523057f5530ef2f885fbe3e0b5cbf5cf..61aa2294c3f8ee077241e347e47e7780f50c4359 100644
--- a/en/application-dev/database/database-preference-guidelines.md
+++ b/en/application-dev/database/database-preference-guidelines.md
@@ -2,7 +2,7 @@
> **NOTE**
>
-> This feature is supported since API Version 9. For the versions earlier than API version 9, use [Lightweight Storage](../reference/apis/js-apis-data-storage.md) APIs.
+> This feature is supported since API version 9. For the versions earlier than API version 9, use [Lightweight Storage](../reference/apis/js-apis-data-storage.md) APIs.
## When to Use
@@ -88,8 +88,30 @@ Use the following APIs to delete a **Preferences** instance or data file.
2. Obtain a **Preferences** instance.
Read the specified file and load its data to the **Preferences** instance for data operations.
+
+ FA model:
+
```js
- let promise = data_preferences.getPreferences(this.context, 'mystore');
+ // Obtain the context.
+ import featureAbility from '@ohos.ability.featureAbility'
+ var context = featureAbility.getContext()
+
+ let promise = data_preferences.getPreferences(context, 'mystore');
+ ```
+
+ Stage model:
+
+ ```ts
+ // Obtain the context.
+ import Ability from '@ohos.application.Ability'
+ var context
+ class MainAbility extends Ability{
+ onWindowStageCreate(windowStage){
+ context = this.context
+ }
+ }
+
+ let promise = data_preferences.getPreferences(context, 'mystore');
```
3. Write data.
@@ -115,12 +137,12 @@ Use the following APIs to delete a **Preferences** instance or data file.
```js
promise.then((preferences) => {
- let getPromise = preferences.get('startup', 'default');
- getPromise.then((value) => {
- console.info("The value of 'startup' is " + value);
- }).catch((err) => {
- console.info("Failed to get the value of 'startup'. Cause: " + err);
- })
+ let getPromise = preferences.get('startup', 'default');
+ getPromise.then((value) => {
+ console.info("The value of 'startup' is " + value);
+ }).catch((err) => {
+ console.info("Failed to get the value of 'startup'. Cause: " + err);
+ })
}).catch((err) => {
console.info("Failed to get the preferences.")
});
@@ -139,24 +161,24 @@ Use the following APIs to delete a **Preferences** instance or data file.
Specify an observer as the callback to subscribe to data changes for an application. When the value of the subscribed key is changed and saved by **flush()**, the observer callback will be invoked to return the new data.
```js
- var observer = function (key) {
- console.info("The key" + key + " changed.");
- }
- preferences.on('change', observer);
- preferences.put('startup', 'auto', function (err) {
- if (err) {
- console.info("Failed to put the value of 'startup'. Cause: " + err);
- return;
- }
+ var observer = function (key) {
+ console.info("The key" + key + " changed.");
+ }
+ preferences.on('change', observer);
+ preferences.put('startup', 'auto', function (err) {
+ if (err) {
+ console.info("Failed to put the value of 'startup'. Cause: " + err);
+ return;
+ }
console.info("Put the value of 'startup' successfully.");
- preferences.flush(function (err) {
- if (err) {
- console.info("Failed to flush data. Cause: " + err);
- return;
- }
+ preferences.flush(function (err) {
+ if (err) {
+ console.info("Failed to flush data. Cause: " + err);
+ return;
+ }
console.info("Flushed data successfully."); // The observer will be called.
- })
- })
+ })
+ })
```
7. Delete the specified file.
@@ -164,10 +186,10 @@ Use the following APIs to delete a **Preferences** instance or data file.
Use the **deletePreferences** method to delete the **Preferences** instance and its persistent file and backup and corrupted files. After the specified files are deleted, the application cannot use that instance to perform any data operation. Otherwise, data inconsistency will be caused. The deleted data and files cannot be restored.
```js
- let proDelete = data_preferences.deletePreferences(context, 'mystore');
- proDelete.then(() => {
+ let proDelete = data_preferences.deletePreferences(context, 'mystore');
+ proDelete.then(() => {
console.info("Deleted data successfully.");
- }).catch((err) => {
+ }).catch((err) => {
console.info("Failed to delete data. Cause: " + err);
- })
+ })
```
diff --git a/en/application-dev/database/database-relational-guidelines.md b/en/application-dev/database/database-relational-guidelines.md
index f6c7395339d66cb1c79bf71d424c15072f77f1b6..a4acbd9a7b47dca4332c7f6a881939b1928abd78 100644
--- a/en/application-dev/database/database-relational-guidelines.md
+++ b/en/application-dev/database/database-relational-guidelines.md
@@ -30,9 +30,10 @@ The RDB provides APIs for inserting, deleting, updating, and querying data in th
**Table 2** API for inserting data
+
| Class | API | Description |
| -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
- | RdbStore | insert(table:string,values:ValuesBucket):Promise<number> | Inserts a row of data into a table. This API uses a promise to return the result.
If the operation is successful, the row ID will be returned; otherwise, **-1** will be returned.
- **table**: name of the target table.
- **values**: data to be inserted into the table.|
+ | RdbStore | insert(table: string, values: ValuesBucket): Promise<number> | Inserts a row of data into a table. This API uses a promise to return the result.
If the operation is successful, the row ID will be returned; otherwise, **-1** will be returned.
- **table**: name of the target table.
- **values**: data to be inserted into the table.|
- **Updating Data**
@@ -40,9 +41,10 @@ The RDB provides APIs for inserting, deleting, updating, and querying data in th
**Table 3** API for updating data
- | Class | API | Description |
+
+ | Class | API | Description |
| -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
- | RdbStore | update(values:ValuesBucket,predicates:RdbPredicates):Promise<number> | Updates data based on the specified **RdbPredicates** object. This API uses a promise to return the result.
- **values**: data to update, which is stored in **ValuesBucket**.
- **predicates**: conditions for updating data.
Return value: number of rows updated. |
+ | RdbStore | update(values: ValuesBucket, predicates: RdbPredicates): Promise<number> | Updates data based on the specified **RdbPredicates** object. This API uses a promise to return the result.
the number of rows updated.
- **values**: data to update, which is stored in **ValuesBucket**.
- **predicates**: conditions for updating data.|
- **Deleting Data**
@@ -50,11 +52,10 @@ The RDB provides APIs for inserting, deleting, updating, and querying data in th
**Table 4** API for deleting data
- | Class | API | Description |
- | -------- | ------------------------------------------------------ | ------------------------------------------------------------ |
- | RdbStore | delete(predicates:RdbPredicates):Promise<number> | Deletes data from the RDB store based on the specified **RdbPredicates** object. This API uses a promise to return the result.
- **predicates**: conditions for deleting data.
Return value: number of rows updated. |
-
-
+
+ | Class | API | Description |
+ | -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
+ | RdbStore | delete(predicates: RdbPredicates): Promise<number> | Deletes data from the RDB store based on the specified **RdbPredicates** object. This API uses a promise to return
the number of rows updated.
- **predicates**: conditions for deleting data.|
- **Querying Data**
@@ -65,10 +66,11 @@ The RDB provides APIs for inserting, deleting, updating, and querying data in th
**Table 5** APIs for querying data
+
| Class | API | Description |
| -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
- | RdbStore | query(predicates:RdbPredicates,columns?:Array<string>):Promise<ResultSet> | Queries data from the RDB store based on specified conditions. This API uses a promise to return the result.
- **predicates**: conditions for querying data.
- **columns**: columns to query. If this parameter is not specified, the query applies to all columns.|
- | RdbStore | querySql(sql:string,bindArgs?:Array<ValueType>):Promise<ResultSet> | Queries data using the specified SQL statement. This API uses a promise to return the result.
- **sql**: SQL statement.
- **bindArgs**: arguments in the SQL statement.|
+ | RdbStore | query(predicates: RdbPredicates, columns?: Array<string>): Promise<ResultSet> | Queries data from the RDB store based on specified conditions. This API uses a promise to return the result.
- **predicates**: conditions for querying data.
- **columns**: columns to query. If this parameter is not specified, the query applies to all columns.|
+ | RdbStore | querySql(sql: string, bindArgs?: Array<ValueType>): Promise<ResultSet> | Queries data using the specified SQL statement. This API uses a promise to return the result.
- **sql**: SQL statement.
- **bindArgs**: arguments in the SQL statement.|
| RdbStore | remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: Array<string>): Promise<ResultSet> | Queries data from the database of a remote device based on specified conditions. This API uses a promise to return the result.
- **device**: network ID of the remote device.
- **table**: name of the table to be queried.
- **predicates**: **RdbPredicates** that specifies the query condition.
- **columns**: columns to query. If this parameter is not specified, the query applies to all columns.|
### Using Predicates
@@ -81,11 +83,11 @@ The following lists common predicates. For more information about predicates, se
| Class | API | Description |
| ------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
-| RdbPredicates | equalTo(field:string,value:ValueType):RdbPredicates | Sets an **RdbPredicates** to match the field with data type **ValueType** and value equal to the specified value.
- **field**: column name in the database table.
- **value**: value to match the **RdbPredicates**.
- **RdbPredicates**: **RdbPredicates** object that matches the specified field.|
-| RdbPredicates | notEqualTo(field:string,value:ValueType):RdbPredicates | Sets an **RdbPredicates** to match the field with data type **ValueType** and value not equal to the specified value.
- **field**: column name in the database table.
- **value**: value to match the **RdbPredicates**.
- **RdbPredicates**: **RdbPredicates** object that matches the specified field.|
-| RdbPredicates | or():RdbPredicates | Adds the OR condition to the **RdbPredicates**.
- **RdbPredicates**: **RdbPredicates** with the OR condition.|
-| RdbPredicates | and():RdbPredicates | Adds the AND condition to the **RdbPredicates**.
- **RdbPredicates**: **RdbPredicates** with the AND condition.|
-| RdbPredicates | contains(field:string,value:string):RdbPredicates | Sets an **RdbPredicates** to match a string containing the specified value.
- **field**: column name in the database table.
- **value**: value to match the **RdbPredicates**.
- **RdbPredicates**: **RdbPredicates** object that matches the specified field.|
+| RdbPredicates | equalTo(field: string, value: ValueType): RdbPredicates | Sets an **RdbPredicates** to match the field with data type **ValueType** and value equal to the specified value.
- **field**: column name in the database table.
- **value**: value to match the **RdbPredicates**.
- **RdbPredicates**: **RdbPredicates** object that matches the specified field.|
+| RdbPredicates | notEqualTo(field: string, value: ValueType): RdbPredicates | Sets an **RdbPredicates** to match the field with data type **ValueType** and value not equal to the specified value.
- **field**: column name in the database table.
- **value**: value to match the **RdbPredicates**.
- **RdbPredicates**: **RdbPredicates** object that matches the specified field.|
+| RdbPredicates | or(): RdbPredicates | Adds the OR condition to the **RdbPredicates**.
- **RdbPredicates**: **RdbPredicates** with the OR condition.|
+| RdbPredicates | and(): RdbPredicates | Adds the AND condition to the **RdbPredicates**.
- **RdbPredicates**: **RdbPredicates** with the AND condition.|
+| RdbPredicates | contains(field: string, value: string): RdbPredicates | Sets an **RdbPredicates** to match a string containing the specified value.
- **field**: column name in the database table.
- **value**: value to match the **RdbPredicates**.
- **RdbPredicates**: **RdbPredicates** object that matches the specified field.|
### Using the Result Set
@@ -101,12 +103,12 @@ For details about how to use result set APIs, see [Result Set](../reference/apis
| Class | API | Description |
| --------- | ---------------------------------------------------- | ------------------------------------------ |
-| ResultSet | goToFirstRow():boolean | Moves to the first row of the result set. |
-| ResultSet | getString(columnIndex:number):string | Obtains the value in the form of a string based on the specified column and current row. |
-| ResultSet | getBlob(columnIndex:number):Uint8Array | Obtains the value in the form of a byte array based on the specified column and the current row.|
-| ResultSet | getDouble(columnIndex:number):number | Obtains the value in the form of double based on the specified column and current row. |
-| ResultSet | getLong(columnIndex:number):number | Obtains the value in the form of a long integer based on the specified column and current row. |
-| ResultSet | close():void | Closes the result set. |
+| ResultSet | goToFirstRow(): boolean | Moves to the first row of the result set. |
+| ResultSet | getString(columnIndex: number): string | Obtains the value in the form of a string based on the specified column and current row. |
+| ResultSet | getBlob(columnIndex: number): Uint8Array | Obtains the value in the form of a byte array based on the specified column and the current row.|
+| ResultSet | getDouble(columnIndex: number): number | Obtains the value in the form of double based on the specified column and current row. |
+| ResultSet | getLong(columnIndex: number): number | Obtains the value in the form of a long integer based on the specified column and current row. |
+| ResultSet | close(): void | Closes the result set. |
@@ -164,7 +166,7 @@ You can obtain the distributed table name for a remote device based on the local
| Class | API | Description |
| -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
-| RdbStore | backup(destName:string): Promise<void> | Backs up an RDB store. This API uses a promise to return the result.
- **destName**: name of the RDB backup file.|
+| RdbStore | backup(destName: string): Promise<void> | Backs up an RDB store. This API uses a promise to return the result.
- **destName**: name of the RDB backup file.|
**Restoring an RDB Store**
@@ -172,7 +174,7 @@ You can obtain the distributed table name for a remote device based on the local
| Class | API | Description |
| -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
-| RdbStore | restore(srcName:string): Promise<void> | Restores an RDB store from a backup file. This API uses a promise to return the result.
- **srcName**: name of the backup file used to restore the RDB store.|
+| RdbStore | restore(srcName: string): Promise<void> | Restores an RDB store from a backup file. This API uses a promise to return the result.
- **srcName**: name of the backup file used to restore the RDB store.|
**Transaction**
@@ -180,9 +182,9 @@ Table 15 Transaction APIs
| Class | API | Description |
| -------- | ----------------------- | --------------------------------- |
-| RdbStore | beginTransaction():void | Starts the transaction before executing SQL statements.|
-| RdbStore | commit():void | Commits the executed SQL statements. |
-| RdbStore | rollBack():void | Rolls back the SQL statements that have been executed. |
+| RdbStore | beginTransaction(): void | Starts the transaction before executing SQL statements.|
+| RdbStore | commit(): void | Commits the executed SQL statements. |
+| RdbStore | rollBack(): void | Rolls back the SQL statements that have been executed. |
## How to Develop
@@ -200,10 +202,10 @@ Table 15 Transaction APIs
import data_rdb from '@ohos.data.rdb'
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)";
- const STORE_CONFIG = {name: "rdbstore.db"}
+ const STORE_CONFIG = { name: "rdbstore.db" }
data_rdb.getRdbStore(this.context, STORE_CONFIG, 1, function (err, rdbStore) {
- rdbStore.executeSql(CREATE_TABLE_TEST)
- console.info('create table done.')
+ rdbStore.executeSql(CREATE_TABLE_TEST)
+ console.info('create table done.')
})
```
@@ -217,7 +219,7 @@ Table 15 Transaction APIs
```js
var u8 = new Uint8Array([1, 2, 3])
- const valueBucket = {"name": "Tom", "age": 18, "salary": 100.5, "blobType": u8}
+ const valueBucket = { "name": "Tom", "age": 18, "salary": 100.5, "blobType": u8 }
let insertPromise = rdbStore.insert("test", valueBucket)
```
@@ -316,6 +318,7 @@ Table 15 Transaction APIs
console.log('device=' + device[i] + 'data changed')
}
}
+
try {
rdbStore.on('dataChange', data_rdb.SubscribeType.SUBSCRIBE_TYPE_REMOTE, storeObserver)
} catch (err) {
@@ -366,9 +369,7 @@ Table 15 Transaction APIs
(1) Back up the current RDB store.
- (2) Restore the RDB store using the backup file.
-
- The sample code is as follows:
+ The sample code is as follows:
```js
let promiseBackup = rdbStore.backup("dbBackup.db")
@@ -378,6 +379,10 @@ Table 15 Transaction APIs
console.info('Backup failed, err: ' + err)
})
```
+ (2) Restore the RDB store using the backup file.
+
+ The sample code is as follows:
+
```js
let promiseRestore = rdbStore.restore("dbBackup.db")
promiseRestore.then(() => {
@@ -386,4 +391,3 @@ Table 15 Transaction APIs
console.info('Restore failed, err: ' + err)
})
```
-
diff --git a/en/application-dev/device/vibrator-overview.md b/en/application-dev/device/vibrator-overview.md
index 889f6b823cc0bbff99cd9bc9cbb2dde641766420..62e0d0d7b99e8bc4eaf5c38b4fc3006a19264df2 100644
--- a/en/application-dev/device/vibrator-overview.md
+++ b/en/application-dev/device/vibrator-overview.md
@@ -23,4 +23,4 @@ The vibrator is a Misc device that consists of four modules: Vibrator API, Vibra
## Constraints
-When using a vibrator, you must declare the **ohos.permission.VIBRATE** permission before you can control the vibration effect. The sensitivity level of this permission is **system_grant**.
+When using a vibrator, you must declare the **ohos.permission.VIBRATE** permission before you can control the vibration effect. The authorization mode of this permission is **system_grant**.
diff --git a/en/application-dev/media/camera.md b/en/application-dev/media/camera.md
index 5af14112df2959acbcfc606c9cd2938860ad6f85..bdbccf975c64a6df4cef6845c850cc8de1b2de26 100644
--- a/en/application-dev/media/camera.md
+++ b/en/application-dev/media/camera.md
@@ -54,7 +54,7 @@ await cameraManager.getCameras((err, cameras) => {
cameraArray = cameras
})
-for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex) {
+for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log('cameraId : ' + cameraArray[cameraIndex].cameraId) // Obtain the camera ID.
console.log('cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // Obtain the camera position.
console.log('cameraType : ' + cameraArray[cameraIndex].cameraType) // Obtain the camera type.
diff --git a/en/application-dev/reference/apis/js-apis-application-WindowExtensionAbility.md b/en/application-dev/reference/apis/js-apis-application-WindowExtensionAbility.md
index 8a366b1e21bb988c608ba0a5e57251f2bd237d75..c48d33d59a701fb998f82316d5c70a0d86fc5ea1 100644
--- a/en/application-dev/reference/apis/js-apis-application-WindowExtensionAbility.md
+++ b/en/application-dev/reference/apis/js-apis-application-WindowExtensionAbility.md
@@ -25,56 +25,25 @@ import WindowExtensionAbility from '@ohos.application.WindowExtensionAbility';
## WindowExtensionAbility.onConnect
-onConnect(want: Want): rpc.RemoteObject
+onConnect(want: Want): void
Called when this Window Extension ability is connected to an ability for the first time.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
+**Parameters**
+
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| want | [Want](js-apis-application-Want.md) | Yes| Information related to this Window Extension ability, including the ability name and bundle name. |
-
-**Return value**
-| Type | Description |
-| ----------------------------------------------- | -------------------- |
-| [rpc.RemoteObject](js-apis-rpc.md#remoteobject) | Proxy of this Window Extension ability.|
+| want | [Want](js-apis-application-Want.md) | Yes| Information related to this Window Extension ability, including the ability name and bundle name.|
**Example**
```ts
-import rpc from '@ohos.rpc';
-
-class StubTest extends rpc.RemoteObject {
- constructor(des) {
- super(des);
- }
- onRemoteRequest(code, data, reply, option) {
- return true;
- }
- queryLocalInterface(descriptor) {
- return null;
- }
- getInterfaceDescriptor() {
- return "";
- }
- sendRequest(code, data, reply, options) {
- return null;
- }
- getCallingPid() {
- return 1;
- }
- getCallingUid() {
- return 1;
- }
- attachLocalInterface(localInterface, descriptor){}
-}
-
export default class MyWindowExtensionAbility extends WindowExtensionAbility {
- onConnect(want): rpc.RemoteObject {
+ onConnect(want) {
console.info('WindowExtAbility onConnect ' + want.abilityName);
- return new StubTest("test");
}
}
@@ -88,9 +57,11 @@ Called when this Window Extension ability is disconnected from all connected abi
**System capability**: SystemCapability.WindowManager.WindowManager.Core
+**Parameters**
+
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| want | [Want](js-apis-application-Want.md) | Yes| Information related to this Window Extension ability, including the ability name and bundle name. |
+| want | [Want](js-apis-application-Want.md) | Yes| Information related to this Window Extension ability, including the ability name and bundle name.|
**Example**
@@ -105,7 +76,6 @@ export default class MyWindowExtensionAbility extends WindowExtensionAbility {
}
```
-
## WindowExtensionAbility.onWindowReady
onWindowReady(window: Window): void
@@ -114,6 +84,8 @@ Called when a window is ready.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
+**Parameters**
+
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| window | [Window](js-apis-window.md) | Yes| Current **Window** instance.|
diff --git a/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md b/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md
index 499dafec721fd280beee9e9ccfcab76ae895bd14..4c04dd7a835c647889d70dff754d6baf14730efb 100644
--- a/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md
+++ b/en/application-dev/reference/apis/js-apis-continuation-continuationManager.md
@@ -119,6 +119,25 @@ Subscribes to device connection events. This API uses an asynchronous callback t
> This API is deprecated since API version 9. You are advised to use [on](#continuationmanagerondeviceconnect9) instead.
+**System capability**: SystemCapability.Ability.DistributedAbilityManager
+
+**Parameters**
+
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Event type. The value is fixed at **deviceConnect**.|
+ | callback | Callback\<[ContinuationResult](js-apis-continuation-continuationResult.md)> | Yes| Callback invoked when a device is selected from the device list provided by the device selection module. This callback returns the device ID, type, and name.|
+
+**Example**
+
+ ```js
+ continuationManager.on("deviceConnect", (data) => {
+ console.info('onDeviceConnect deviceId: ' + JSON.stringify(data.id));
+ console.info('onDeviceConnect deviceType: ' + JSON.stringify(data.type));
+ console.info('onDeviceConnect deviceName: ' + JSON.stringify(data.name));
+ });
+ ```
+
## continuationManager.on("deviceDisconnect")(deprecated)
on(type: "deviceDisconnect", callback: Callback\
- [Glossary](../glossary.md)|
| Development resources | Preparing for your development | - [Obtaining Source Code](get-code/sourcecode-acquire.md)
- [Obtaining Tools](get-code/gettools-acquire.md) |
| Getting started | Getting started with setup, build, burning, debugging, and running of OpenHarmony | - [Mini and Small System Overview](quick-start/quickstart-ide-lite-overview.md)|
-| Basic capabilities | Using basic capabilities of OpenHarmony | - [Kernel for Mini System](kernel/kernel-mini-overview.md)
- [Kernel for Small System](kernel/kernel-small-overview.md)
- [HDF](driver/driver-hdf-overview.md)
- [Subsystems](subsystems/subsys-build-mini-lite.md)
- [Security Guidelines](security/security-guidelines-overall.md)
- [Privacy Protection](security/security-privacy-protection.md)|
+| Basic capabilities | Using basic capabilities of OpenHarmony | - [Kernel for Mini System](kernel/kernel-mini-overview.md)
- [Kernel for Small System](kernel/kernel-small-overview.md)
- [HDF](driver/driver-hdf-overview.md)
- [Subsystems](subsystems/subsys-build-all.md)
- [Security Guidelines](security/security-guidelines-overall.md)
- [Privacy Protection](security/security-privacy-protection.md) |
| Advanced development | Developing smart devices based on system capabilities | - [WLAN-connected Products](guide/device-wlan-led-control.md)
- [Cameras Without a Screen](guide/device-iotcamera-control-overview.md)
- [Cameras with a Screen](guide/device-camera-control-overview.md) |
| Porting and adaptation | - Porting and adapting OpenHarmony to an SoC
- Porting and adapting OpenHarmony to a third-party library
- Third-party vendor porting cases
| - [Mini System SoC Porting Guide](porting/porting-minichip.md)
- [Small System SoC Porting Guide](porting/porting-smallchip-prepare-needs.md)
- [Third-Party Library Porting Guide for Mini and Small Systems](porting/porting-thirdparty-overview.md)
- [Mini-System Devices with Screens — Bestechnic SoC Porting Case](porting/porting-bes2600w-on-minisystem-display-demo.md)
- [Combo Solution – ASR Chip Porting Case](porting/porting-asr582x-combo-demo.md)
|
| Contributing components | Contributing components to OpenHarmony | - [HPM Part Overview](hpm-part/hpm-part-about.md)
- [HPM Part Development](hpm-part/hpm-part-development.md)
- [HPM Part Reference](hpm-part/hpm-part-reference.md) |
@@ -48,7 +48,7 @@ In addition, OpenHarmony provides a wide array of system components that can be
| About OpenHarmony| Getting familiar with OpenHarmony| - [About OpenHarmony](https://gitee.com/openharmony)
- [Glossary](../glossary.md)|
| Development resources| Preparing for your development| - [Obtaining Source Code](get-code/sourcecode-acquire.md)
- [Obtaining Tools](get-code/gettools-acquire.md)|
| Getting started| Getting started with setup, build, burning, debugging, and running of OpenHarmony| - [Standard System Overview](quick-start/quickstart-ide-standard-overview.md) |
-| Basic capabilities| Using basic capabilities of OpenHarmony| - [Kernel Development](kernel/kernel-standard.md)
- [HDF](driver/driver-hdf-overview.md)
- [Subsystems](subsystems/subsys-build-standard-large.md)
- [Security Guidelines](security/security-guidelines-overall.md)
- [Privacy Protection](security/security-privacy-protection.md)|
+| Basic capabilities| Using basic capabilities of OpenHarmony| - [Kernel Development](kernel/kernel-standard-overview.md)
- [HDF](driver/driver-hdf-overview.md)
- [Subsystems](subsystems/subsys-build-all.md)
- [Security Guidelines](security/security-guidelines-overall.md)
- [Privacy Protection](security/security-privacy-protection.md) |
| Advanced development| Developing smart devices based on system capabilities| - [Development Guidelines on Clock Apps](guide/device-clock-guide.md)
- [Development Example for Platform Drivers](guide/device-driver-demo.md)
- [Development Example for Peripheral Drivers](guide/device-outerdriver-demo.md) |
| Porting and adaptation| - Porting and adapting OpenHarmony to an SoC
- Rapidly porting the OpenHarmony Linux kernel| - [Standard System Porting Guide](porting/standard-system-porting-guide.md)
- [A Method for Rapidly Porting the OpenHarmony Linux Kernel](porting/porting-linux-kernel.md) |
| Contributing components| Contributing components to OpenHarmony| - [HPM Part Overview](hpm-part/hpm-part-about.md)
- [HPM Part Development](hpm-part/hpm-part-development.md)
- [HPM Part Reference](hpm-part/hpm-part-reference.md) |
diff --git a/en/device-dev/driver/driver-peripherals-pinauth-des.md b/en/device-dev/driver/driver-peripherals-pinauth-des.md
index 08a3ac84a224ca046bd7b2439199011f3d934da5..888e229cce93bf29bb78a9b156b180d8237850bd 100644
--- a/en/device-dev/driver/driver-peripherals-pinauth-des.md
+++ b/en/device-dev/driver/driver-peripherals-pinauth-des.md
@@ -25,11 +25,11 @@ The identity authentication consists of User_auth and basic authentication servi
- Executor role
- - Executor: independently completes the entire process of credential registration and identity authentication. The executor can collect, process, store, and compare data to complete the authentication.
+ - Executor: independently completes the entire process of credential registration and identity authentication. The executor can collect, process, store, and compare data to complete the authentication.
- - Collector: only collects data during user authentication. It needs to work with the authenticator to complete user authentication.
+ - Collector: only collects data during user authentication. It needs to work with the authenticator to complete user authentication.
- - Authenticator: only processes data, obtains the stored credential template, and compares it with the authentication information generated.
+ - Authenticator: only processes data, obtains the stored credential template, and compares it with the authentication information generated.
- Executor type
@@ -56,7 +56,7 @@ The identity authentication consists of User_auth and basic authentication servi
The Pin_auth driver provides basic PIN authentication capabilities for the upper-layer User_auth and Pin_auth service to ensure successful PIN authentication. You can develop drivers to call Hardware Device Interface (HDI) APIs based on the HDF and the chip you use.
-**Figure 2** Pin_auth service and pin_auth driver APIs
+**Figure 2** Pin_auth service and Pin_auth driver APIs

@@ -93,24 +93,32 @@ The Pin_auth driver provides basic PIN authentication capabilities for the User_
### How to Develop
-The following uses the RK3568 platform as an example to demonstrate how to develop the Pin_auth driver.
The directory structure is as follows:
+The following uses the RK3568 platform as an example to demonstrate how to develop the Pin_auth driver.
-```
+The directory structure is as follows:
+
+```text
// drivers/peripheral/pin_auth
├── BUILD.gn # Build script
├── bundle.json # Module description file
+├── test # Test cases
└── hdi_service # Pin_auth driver implementation
├── BUILD.gn # Build script
- ├── inc # Header files
- └── src
- ├── executor_impl.cpp # Implementation of authentication and enrollment APIs
- ├── pin_auth_interface_driver.cpp # Pin_auth driver entry
- └── pin_auth_interface_service.cpp # Implementation of the APIs for obtaining the executor list
+ ├── adaptor # Implementation of related algorithms
+ ├── common # Implementation of common interfaces
+ ├── database # Database implementation
+ ├── main # Entry for implementing PIN-related functions
+ └── service # Entry for implementing the Pin_auth driver
+ ├── inc # Header files
+ └── src
+ ├── executor_impl.cpp # Implementation of authentication and enrollment APIs
+ ├── pin_auth_interface_driver.cpp # Pin_auth driver entry
+ └── pin_auth_interface_service.cpp # Implementation of the APIs for obtaining the executor list
```
The development procedure is as follows:
-1. Develop the Pin_auth driver based on the HDF. The **Bind()**, **Init()**, **Release()**, and **Dispatch()** functions are used. For details about the code, see [pin_auth_interface_driver.cpp](https://gitee.com/openharmony/drivers_peripheral/blob/master/pin_auth/hdi_service/src/pin_auth_interface_driver.cpp).
+1. Develop the Pin_auth driver based on the HDF. The **Bind()**, **Init()**, **Release()**, and **Dispatch()** functions are used. For details about the code, see [pin_auth_interface_driver.cpp](https://gitee.com/openharmony/drivers_peripheral/blob/master/pin_auth/hdi_service/service/src/pin_auth_interface_driver.cpp).
```c++
// Create the PinAuthInterfaceService object by using the custom HdfPinAuthInterfaceHost object, which consists of the IoService object and HDI service.
@@ -212,7 +220,7 @@ The development procedure is as follows:
-1. Obtain the executor list. For details about the code, see [pin_auth_interface_service.cpp](https://gitee.com/openharmony/drivers_peripheral/blob/master/pin_auth/hdi_service/src/pin_auth_interface_service.cpp).
+1. Obtain the executor list. For details about the code, see [pin_auth_interface_service.cpp](https://gitee.com/openharmony/drivers_peripheral/blob/master/pin_auth/hdi_service/service/src/pin_auth_interface_service.cpp).
```c++
// Executor implementation class
@@ -285,7 +293,7 @@ The development procedure is as follows:
-1. Implement each function of the executor. For details about the code, see [executor_impl.cpp](https://gitee.com/openharmony/drivers_peripheral/blob/master/pin_auth/hdi_service/src/executor_impl.cpp).
+1. Implement each function of the executor. For details about the code, see [executor_impl.cpp](https://gitee.com/openharmony/drivers_peripheral/blob/master/pin_auth/hdi_service/service/src/executor_impl.cpp).
```c++
// Obtain executor information (example only).
@@ -526,7 +534,8 @@ The development procedure is as follows:
### Verification
Verify whether PIN authentication can be successfully performed on the RK3568 platform as follows:
-1. Set a PIN.
+1. Set a PIN.
+
Touch **Settings** > **Biometrics & passwords** > **Password**, and enter your password.
2. Verify PIN authentication.
diff --git a/en/device-dev/guide/device-driver-demo.md b/en/device-dev/guide/device-driver-demo.md
index ceed4c96f66bb1387814c350dd7e75873d58f61c..69d160ee94d4c8bb258ea12df6fd0262f95c0420 100644
--- a/en/device-dev/guide/device-driver-demo.md
+++ b/en/device-dev/guide/device-driver-demo.md
@@ -430,6 +430,8 @@ Initialize the controller hardware, call core-layer APIs to add or delete device
2. Build source code and burn images to the development board.
- For details, see the related sections in [Getting Started for Standard System](../quick-start/quickstart-standard.md).
+ - For details about the operations using the installation package, see [Building](../quick-start/quickstart-ide-standard-running-hi3516-build.md) and [Burning](../quick-start/quickstart-ide-standard-running-hi3516-burning.md).
+
+ - For details about the operations in IDE mode, see [Building](../quick-start/quickstart-standard-running-hi3516-build.md) and [Burning](../quick-start/quickstart-standard-running-hi3516-burning.md).
diff --git a/en/device-dev/guide/device-outerdriver-demo.md b/en/device-dev/guide/device-outerdriver-demo.md
index b2238b6af22a247927421bec914b118dcbfe18e9..fae7c72d1f7772dc911d59626df099ea4ea1fb22 100644
--- a/en/device-dev/guide/device-outerdriver-demo.md
+++ b/en/device-dev/guide/device-outerdriver-demo.md
@@ -315,7 +315,7 @@ The input driver model consists of three parts of drivers. To develop a brand-ne
**touch\_gt911.o** is the content added in this example.
-2. Build source code and burn images. For details, see the related sections in [Getting Started for Standard System](../quick-start/quickstart-standard.md).
+2. Build source code and burn images. For details, see the related sections in [Standard System Overview](../quick-start/quickstart-standard-overview.md).
## Debugging and Verification
diff --git a/en/device-dev/kernel/kernel-small-start-user.md b/en/device-dev/kernel/kernel-small-start-user.md
index fb34ba4194831b84c2683fd4ab11e2ee2cc2098c..64f0cf6dece3286be85e94b463c4b9549f534f94 100644
--- a/en/device-dev/kernel/kernel-small-start-user.md
+++ b/en/device-dev/kernel/kernel-small-start-user.md
@@ -32,8 +32,9 @@ During system startup, **OsUserInitProcess** is called to start the **init**
- Starts key system programs or services, such as shell.
- > **NOTE:**
- >In OpenHarmony, the **init** process reads the **/etc/init.cfg** file and runs specified commands or starts specified processes based on configurations. For details, see [init Module](../subsystems/subsys-boot-init.md).
+ > **NOTE**
+ >
+ >In OpenHarmony, the **init** process reads the **/etc/init.cfg** file and runs specified commands or starts specified processes based on configurations. For details, see [init Module](../subsystems/subsys-boot-init-cfg.md).
- Monitors the process for reclaiming the orphan process and clears the zombie processes in child processes.
diff --git a/en/device-dev/security/security-guidelines-overall.md b/en/device-dev/security/security-guidelines-overall.md
index 45e1c2262d6c002e8d2bccfb24b317e5189c9796..76dbd5a075069416b1cdae8ca97d76248b9bb8d1 100644
--- a/en/device-dev/security/security-guidelines-overall.md
+++ b/en/device-dev/security/security-guidelines-overall.md
@@ -92,7 +92,7 @@ For devices with 128 KB to 128 MB of memory, the OpenHarmony lite kernel is reco
### Mechanism
-Huawei Universal Keystore Service \(HUKS\) provides key and certificate management. For OpenHarmony, it mainly provides key management for HiChain \(the device identity authentication platform\). The following figure shows the functions of HUKS
+OpenHarmony Universal Keystore Service \(HUKS\) provides key and certificate management. For OpenHarmony, it mainly provides key management for HiChain \(the device identity authentication platform\). The following figure shows the functions of HUKS
**Figure 3** HUKS functions

diff --git a/en/device-dev/subsystems/subsys-application-framework-guide.md b/en/device-dev/subsystems/subsys-application-framework-guide.md
index a3f521760240dbb2fec330557a38ec094c0e2614..508677cb988fad38d7858583010b70e51b65dd3b 100644
--- a/en/device-dev/subsystems/subsys-application-framework-guide.md
+++ b/en/device-dev/subsystems/subsys-application-framework-guide.md
@@ -534,7 +534,7 @@ When uninstalling an application, you can specify whether to retain application
```
sem_init(&g_sem, 0, 0);
const uint32_t WAIT_TIMEOUT = 30;
- std::string BUNDLE_NAME = "com.huawei.demo"; // Bundle name of the application to be uninstalled
+ std::string BUNDLE_NAME = "com.example.demo"; // Bundle name of the application to be uninstalled
Uninstall(BUNDLE_NAME.c_str(), &installParam, UninstallCallback);
struct timespec ts = {};
clock_gettime(CLOCK_REALTIME, &ts);
@@ -557,7 +557,7 @@ You can use the **GetBundleInfo** function provided by **BundleManager** to
2. Call **GetBundleInfo** to obtain bundle information about a specified application. The **bundleName** parameter indicates the pointer to the application bundle name, and the **flags** parameter specifies whether the obtained **BundleInfo** object can contain **AbilityInfo**.
```
- std::string BUNDLE_NAME = "com.huawei.demo";
+ std::string BUNDLE_NAME = "com.example.demo";
uint8_t ret = GetBundleInfo(BUNDLE_NAME.c_str(), 1, &bundleInfo); // When flags is set to 1, the obtained BundleInfo object contains AbilityInfo.
```
diff --git a/en/device-dev/subsystems/subsys-boot-faqs.md b/en/device-dev/subsystems/subsys-boot-faqs.md
index e0b72945a026eaf5dd487f76351cbcec85b38b5e..f4e3eb59371a2cf083f9169c2ae42795eaa0f808 100644
--- a/en/device-dev/subsystems/subsys-boot-faqs.md
+++ b/en/device-dev/subsystems/subsys-boot-faqs.md
@@ -1,6 +1,6 @@
-# FAQs
+# FAQs
-## System startup interrupted due to "parse failed!" error
+## System startup interrupted due to "parse failed!" error
**Problem**
@@ -17,7 +17,7 @@ During the modification of the **init.cfg** file, required commas \(,\) or par
Check the **init.cfg** file and ensure that its format meets the JSON specifications.
-## System automatically restarted again and again
+## System automatically restarted again and again
**Problem**
@@ -25,7 +25,7 @@ After the image burning is complete, the system keeps restarting.
**Cause**
-Each service started by the init process has the **importance** attribute, as described in Table 3 in [init Module](subsys-boot-init.md).
+Each service started by the init process has the **importance** attribute, as described in Table 3 in [Job Management](../subsystems/subsys-boot-init-jobs.md).
- If the attribute value is **0**, the init process does not need to restart the development board when the current service process exits.
- If the attribute value is **1**, the init process needs to restart the development board when the current service process exits.
@@ -37,7 +37,7 @@ During the startup of a service whose **importance** is **1**, if the service
1. View logs to identify the service that encounters a process crash or exits due to an error, rectify the issue, and then burn the image again.
2. Alternatively, change the value of **importance** to **0** for the service that exits due to a process crash or an error, and then burn the image again. In this way, the development board will not be restarted even if the service exits.
-## Failed to call the **SetParameter** or **GetParameter** API with correct parameter values
+## Failed to call the **SetParameter** or **GetParameter** API with correct parameter values
**Problem**
diff --git a/en/device-dev/subsystems/subsys-boot-overview.md b/en/device-dev/subsystems/subsys-boot-overview.md
index c1adc013182349d0a93621bd84db02445cd5a40a..11cdf0f3a91eb965293dd8884a61dff2b9ec8d52 100644
--- a/en/device-dev/subsystems/subsys-boot-overview.md
+++ b/en/device-dev/subsystems/subsys-boot-overview.md
@@ -23,7 +23,7 @@ When the system is powered on, the kernel loads and starts services and applicat
The Startup subsystem consists of the following modules:
- init module
- This module corresponds to the init process, which is the first user-mode process started after the kernel is initialized. After the init process starts, it reads and parses the **init.cfg** file. Based on the parsing result, the init module executes the commands listed in [Table 2](../subsystems/subsys-boot-init.md) and starts the key system service processes in sequence with corresponding permissions granted.
+ This module corresponds to the init process, which is the first user-mode process started after the kernel is initialized. After the init process starts, it reads and parses the **init.cfg** file. Based on the parsing result, the init module executes the commands listed in Table 2 in [Job Management](../subsystems/subsys-boot-init-jobs.md) and starts the key system service processes in sequence with corresponding permissions granted.
- ueventd module
This module listens for **netlink** events about hot swap of kernel device drivers and dynamically manages the **dev** node of the corresponding device based on the event type.
diff --git a/en/device-dev/subsystems/subsys-security-overview.md b/en/device-dev/subsystems/subsys-security-overview.md
index f4e17ed0818e37519cfe6c1b6a1cb8122af5666f..2ed46817e0066bed27c8f3be692451efb43a20b6 100644
--- a/en/device-dev/subsystems/subsys-security-overview.md
+++ b/en/device-dev/subsystems/subsys-security-overview.md
@@ -20,6 +20,10 @@ The OpenHarmony security subsystem provides security capabilities that make your
The Device Security Level Management (DSLM) module is introduced to manage the security levels of OpenHarmony devices. When different types of user data are hopped or processed in OpenHarmony distributed services, the DSLM APIs can be called to obtain the security levels of related devices for subsequent processing.
+- HUKS
+
+ The OpenHarmony Universal Keystore (HUKS) provides system-level key management capabilities, ensuring secure management and use of keys throughout their entire lifecycle (generation, storage, use, and destruction). Applications can call the APIs provided by the HUKS module to perform operations on keys. In addition, the keys in plaintext must be used in a trusted execution environment (TEE).
+
## Basic Concepts
diff --git a/en/device-dev/subsystems/subsys-testguide-test.md b/en/device-dev/subsystems/subsys-testguide-test.md
index bc145cf411b90da15ce9b9ac3f2f20a7ee9aad05..031361ae8970c62ef4e3063b8f605dff8dd4c2f0 100644
--- a/en/device-dev/subsystems/subsys-testguide-test.md
+++ b/en/device-dev/subsystems/subsys-testguide-test.md
@@ -4,7 +4,6 @@ OpenHarmony provides a comprehensive auto-test framework for designing test case
This document describes how to use the OpenHarmony test framework.
## Setting Up the Environment
The test framework depends on the Python running environment. Before using the test framework, set up the environment as follows:
- - [Setting Up the Environment](subsys-testguide-envbuild.md)
- [Obtaining Source Code](../get-code/sourcecode-acquire.md)
@@ -419,21 +418,22 @@ The following provides templates for different languages for your reference.
1. Add comment information for the file header.
- ```
+ ```
# Copyright (c) 2021 XXXX Device Co., Ltd.
```
2. Import the build template.
- ```
+ ```
import("//build/test.gni")
```
3. Specify the file output path.
-
- ```
+
+ ```
module_output_path = "subsystem_examples/calculator"
```
+
> **NOTE**
> The output path is ***Part name*/*Module name***.
@@ -470,15 +470,15 @@ The following provides templates for different languages for your reference.
}
```
- > **NOTE**
- > Set the test type based on actual requirements. The following test types are available:
- > - **ohos_unittest**: unit test
- > - **ohos_moduletest**: module test
- > - **ohos_systemtest**: system test
- > - **ohos_performancetest**: performance test
- > - **ohos_securitytest**: security test
- > - **ohos_reliabilitytest**: reliability test
- > - **ohos_distributedtest**: distributed test
+ > **NOTE**
+ > Set the test type based on actual requirements. The following test types are available:
+ > - **ohos_unittest**: unit test
+ > - **ohos_moduletest**: module test
+ > - **ohos_systemtest**: system test
+ > - **ohos_performancetest**: performance test
+ > - **ohos_securitytest**: security test
+ > - **ohos_reliabilitytest**: reliability test
+ > - **ohos_distributedtest**: distributed test
7. Group the test case files by test type.
@@ -490,7 +490,7 @@ The following provides templates for different languages for your reference.
```
> **NOTE**
> Grouping test cases by test type allows you to execute a specific type of test cases when required.
-
+
- **Test case build file example (JavaScript)**
```
@@ -530,6 +530,7 @@ The following provides templates for different languages for your reference.
```
module_output_path = "subsystem_examples/app_info"
```
+
> **NOTE**
> The output path is ***Part name*/*Module name***.
@@ -539,9 +540,10 @@ The following provides templates for different languages for your reference.
ohos_js_unittest("GetAppInfoJsTest") {
}
```
- > **NOTE**
- >- Use the **ohos\_js\_unittest** template to define the JavaScript test suite. Pay attention to the difference between JavaScript and C++.
- >- The file generated for the JavaScript test suite must be in .hap format and named after the test suite name defined here. The test suite name must end with **JsTest**.
+
+ > **NOTE**
+ > - Use the **ohos\_js\_unittest** template to define the JavaScript test suite. Pay attention to the difference between JavaScript and C++.
+ > - The file generated for the JavaScript test suite must be in .hap format and named after the test suite name defined here. The test suite name must end with **JsTest**.
5. Configure the **config.json** file and signature file, which are mandatory.
@@ -623,6 +625,7 @@ The following provides templates for different languages for your reference.
deps = [ ":GetAppInfoJsTest" ]
}
```
+
> **NOTE**
> Grouping test cases by test type allows you to execute a specific type of test cases when required.
@@ -673,7 +676,7 @@ Perform the following steps:
resource_config_file = "//system/subsystem/partA/test/resource/calculator/ohos_test.xml"
}
```
- >**NOTE**
+ >**NOTE**
>- **target_name** indicates the test suite name defined in the **BUILD.gn** file in the **test** directory.**preparer** indicates the action to perform before the test suite is executed.
>- **src="res"** indicates that the test resources are in the **resource** directory under the **test** directory. **src="out"** indicates that the test resources are in the **out/release/$(*part*)** directory.
@@ -748,7 +751,7 @@ After the build is complete, the test cases are automatically saved in **out/his
2. Copy **developertest** and **xdevice** from the Linux environment to the **Test** directory on Windows, and copy the test cases to the **testcase** directory.
> **NOTE**
- > Port the test framework and test cases from the Linux environment to the Windows environment for subsequent execution.
+ > Port the test framework and test cases from the Linux environment to the Windows environment for subsequent execution.
3. Modify the **user_config.xml** file.
```
@@ -761,9 +764,10 @@ After the build is complete, the test cases are automatically saved in **out/his
> `
> The IP address and port number are default values.
-
+
2. On the HDC client, run the following command:
```
hdc_std -s xx.xx.xx.xx:8710 list targets
```
+
> **NOTE**
> Enter the IP address of the device to test.
-
+
#### Executing Test Cases
1. Start the test framework.
```
diff --git a/en/device-dev/website.md b/en/device-dev/website.md
index 2fc22d58a52c259bd34f6fed15af21505ae4f945..9494abb5a5e2ea35d8db6a345a359ac95159735c 100644
--- a/en/device-dev/website.md
+++ b/en/device-dev/website.md
@@ -1,161 +1,249 @@
# OpenHarmony Device Development Documentation
- [Device Development Guide](device-dev-guide.md)
-
- Getting Started
- Getting Started with Mini and Small Systems (IDE Mode, Recommended)
+
- [Mini and Small System Overview](quick-start/quickstart-ide-lite-overview.md)
+
- Environment Preparation
+
- [Setting Up the Windows+Ubuntu Hybrid Build Environment](quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md)
+
- [Obtaining Source Code](quick-start/quickstart-ide-lite-sourcecode-acquire.md)
+
- [Creating a Source Code Project](quick-start/quickstart-ide-lite-create-project.md)
+
- Running a Hello World Program
+
- Hi3861 Development Board
+
- [Writing a Hello World Program](quick-start/quickstart-ide-lite-steps-hi3861-helloworld.md)
+
- [Building](quick-start/quickstart-ide-lite-steps-hi3861-building.md)
+
- [Burning](quick-start/quickstart-ide-lite-steps-hi3861-burn.md)
+
- [Networking](quick-start/quickstart-ide-lite-steps-hi3861-netconfig.md)
+
- [Debugging and Verification](quick-start/quickstart-ide-lite-steps-hi3861-debug.md)
+
- [Running](quick-start/quickstart-ide-lite-steps-hi3861-running.md)
+
- Hi3516 Development Board
+
- [Writing a Hello World Program](quick-start/quickstart-ide-lite-steps-hi3516-helloworld.md)
+
- [Building](quick-start/quickstart-ide-lite-steps-hi3516-building.md)
+
- [Burning](quick-start/quickstart-ide-lite-steps-hi3516-burn.md)
+
- [Running](quick-start/quickstart-ide-lite-steps-hi3516-running.md)
+
- Appendix
+
- [Introduction to the Hi3861 Development Board](quick-start/quickstart-ide-lite-introduction-hi3861.md)
+
- [Introduction to the Hi3516 Development Board](quick-start/quickstart-ide-lite-introduction-hi3516.md)
+
- [Overall Description of Compilation Form Factors](quick-start/quickstart-build.md)
+
- Getting Started with Mini and Small Systems (Installation Package Mode)
+
- [Mini and Small System Overview](quick-start/quickstart-lite-overview.md)
+
- [Environment Preparation](quick-start/quickstart-lite-env-setup.md)
+
- Running a Hello World Program
+
- Hi3861 Development Board
+
- [Setting Up the Hi3861 Development Board Environment](quick-start/quickstart-lite-steps-hi3861-setting.md)
+
- [Writing a Hello World Program](quick-start/quickstart-lite-steps-hi3861-helloworld.md)
+
- [Building](quick-start/quickstart-lite-steps-hi3861-building.md)
+
- [Burning](quick-start/quickstart-lite-steps-hi3861-burn.md)
+
- [Networking](quick-start/quickstart-lite-steps-hi3861-netconfig.md)
+
- [Debugging and Verification](quick-start/quickstart-lite-steps-hi3861-debug.md)
+
- [Running](quick-start/quickstart-lite-steps-hi3861-running.md)
+
- Hi3516 Development Board
+
- [Setting Up the Hi3516 Development Board Environment](quick-start/quickstart-lite-steps-hi3516-setting.md)
+
- [Writing a Hello World Program](quick-start/quickstart-lite-steps-hi3516-helloworld.md)
+
- [Building](quick-start/quickstart-lite-steps-hi3516-building.md)
+
- [Burning](quick-start/quickstart-lite-steps-hi3516-burn.md)
+
- [Running](quick-start/quickstart-lite-steps-hi3516-running.md)
+
- FAQs
+
- [Fixing hb Installation Issues](quick-start/quickstart-lite-faq-hb.md)
+
- [Fixing Compilation Issues](quick-start/quickstart-lite-faq-compose.md)
+
- [Fixing Burning Issues](quick-start/quickstart-lite-faq-burning.md)
+
- Appendix
+
- Introduction to Development Boards
+
- [Introduction to the Hi3861 Development Board](quick-start/quickstart-lite-introduction-hi3861.md)
+
- [Introduction to the Hi3516 Development Board](quick-start/quickstart-lite-introduction-hi3516.md)
+
- [Reference](quick-start/quickstart-lite-reference.md)
+
- [Burning Code by Using HiTool](quick-start/quickstart-lite-hitool.md)
+
- [Overall Description of Compilation Form Factors](quick-start/quickstart-build.md)
+
- Getting Started with Standard System (IDE Mode, Recommended)
+
- [Standard System Overview](quick-start/quickstart-ide-standard-overview.md)
+
- Environment Preparation
+
- [Setting Up the Windows+Ubuntu Hybrid Build Environment](quick-start/quickstart-ide-standard-env-setup-win-ubuntu.md)
+
- [Obtaining Source Code](quick-start/quickstart-ide-standard-sourcecode-acquire.md)
+
- [Creating a Source Code Project](quick-start/quickstart-ide-standard-create-project.md)
+
- Running a Hello World Program
+
- Hi3516 Development Board
+
- [Writing a Hello World Program](quick-start/quickstart-ide-standard-running-hi3516-create.md)
+
- [Building](quick-start/quickstart-ide-standard-running-hi3516-build.md)
+
- [Burning](quick-start/quickstart-ide-standard-running-hi3516-burning.md)
+
- [Running](quick-start/quickstart-ide-standard-running-hi3516-running.md)
+
- RK3568 Development Board
+
- [Writing a Hello World Program](quick-start/quickstart-ide-standard-running-rk3568-create.md)
+
- [Building](quick-start/quickstart-ide-standard-running-rk3568-build.md)
+
- [Burning](quick-start/quickstart-ide-standard-running-rk3568-burning.md)
+
- [Running](quick-start/quickstart-ide-standard-running-rk3568-running.md)
+
- Appendix
+
- [Introduction to the Hi3516 Development Board](quick-start/quickstart-ide-standard-board-introduction-hi3516.md)
+
- [Introduction to the RK3568 Development Board](quick-start/quickstart-ide-standard-board-introduction-rk3568.md)
+
- [Overall Description of Compilation Form Factors](quick-start/quickstart-build.md)
+
- Getting Started with Standard System (Installation Package Mode)
+
- [Standard System Overview](quick-start/quickstart-standard-overview.md)
+
- [Setting Up Environments for Standard System](quick-start/quickstart-standard-env-setup.md)
+
- Running a Hello World Program
+
- Hi3516 Development Board
+
- [Writing a Hello World Program](quick-start/quickstart-std-3516-create.md)
+
- [Building](quick-start/quickstart-standard-running-hi3516-build.md)
+
- [Burning](quick-start/quickstart-standard-running-hi3516-burning.md)
+
- [Running](quick-start/quickstart-standard-running-hi3516-running.md)
+
- RK3568 Development Board
+
- [Writing a Hello World Program](quick-start/quickstart-standard-running-rk3568-create.md)
+
- [Building](quick-start/quickstart-standard-running-rk3568-build.md)
+
- [Burning](quick-start/quickstart-standard-running-rk3568-burning.md)
+
- [Running](quick-start/quickstart-standard-running-rk3568-running.md)
+
- FAQs
+
- [Fixing hb Installation Issues](quick-start/quickstart-standard-faq-hb.md)
+
- [Fixing Compilation Issues](quick-start/quickstart-standard-faq-compose.md)
+
- [Fixing Burning Issues](quick-start/quickstart-standard-faq-burning.md)
+
- Appendix
+
- Introduction to Development Boards
+
- [Introduction to the Hi3516 Development Board](quick-start/quickstart-standard-board-introduction-hi3516.md)
+
- [Introduction to the RK3568 Development Board](quick-start/quickstart-standard-board-introduction-rk3568.md)
+
- [Reference](quick-start/quickstart-standard-reference.md)
+
- [Burning Code by Using HiTool](quick-start/quickstart-standard-hitool.md)
- - [Overall Description of Compilation Form Factors](quick-start/quickstart-build.md)
+ - [Overall Description of Compilation Form Factors](quick-start/quickstart-build.md)
- [Obtaining Source Code](get-code/sourcecode-acquire.md)
-
-- Compatibility and Security
-
- [Privacy Protection](security/security-privacy-protection.md)
- [Security Guidelines](security/security-guidelines-overall.md)
- Porting
-
- - Mini System SoC Porting Guide
-
- - Porting Preparations
- - [Before You Start](porting/porting-chip-prepare-knows.md)
- - [Building Adaptation Process](porting/porting-chip-prepare-process.md)
- - Kernel Porting
- - [Porting Overview](porting/porting-chip-kernel-overview.md)
- - [Basic Kernel Adaptation](porting/porting-chip-kernel-adjustment.md)
- - [Kernel Porting Verification](porting/porting-chip-kernel-verify.md)
- - Board-Level OS Porting
- - [Porting Overview](porting/porting-chip-board-overview.md)
- - [Board-Level Driver Adaptation](porting/porting-chip-board-driver.md)
- - [Implementation of APIs at the HAL](porting/porting-chip-board-hal.md)
- - [System Modules](porting/porting-chip-board-component.md)
- - [lwIP Module Adaptation](porting/porting-chip-board-lwip.md)
- - [Third-party Module Adaptation](porting/porting-chip-board-bundle.md)
- - [XTS](porting/porting-chip-board-xts.md)
- - [FAQs](porting/porting-chip-faqs.md)
-
- Small System SoC Porting Guide
- Porting Preparations
+
- [Before You Start](porting/porting-smallchip-prepare-needs.md)
+
- [Compilation and Building](porting/porting-smallchip-prepare-building.md)
+
- Kernel Porting
+
- [LiteOS Cortex-A](porting/porting-smallchip-kernel-a.md)
+
- [Linux Kernel](porting/porting-smallchip-kernel-linux.md)
+
- Driver Porting
+
- [Porting Overview](porting/porting-smallchip-driver-overview.md)
+
- [Platform Driver Porting](porting/porting-smallchip-driver-plat.md)
+
- [Device Driver Porting](porting/porting-smallchip-driver-oom.md)
- Standard System SoC Porting Guide
- [Standard System Porting Guide](porting/standard-system-porting-guide.md)
+
- [A Method for Rapidly Porting the OpenHarmony Linux Kernel](porting/porting-linux-kernel.md)
- Third-Party Library Porting Guide for Mini and Small Systems
+
- [Overview](porting/porting-thirdparty-overview.md)
+
- [Porting a Library Built Using CMake](porting/porting-thirdparty-cmake.md)
+
- [Porting a Library Built Using Makefile](porting/porting-thirdparty-makefile.md)
- Mini System SoC Porting Cases
+
- [Mini-System Devices with Screens — Bestechnic SoC Porting Case](porting/porting-bes2600w-on-minisystem-display-demo.md)
+
- [Combo Solution – ASR Chip Porting Case](porting/porting-asr582x-combo-demo.md)
+
- Subsystem Development
- Kernel
@@ -164,10 +252,7 @@
- Basic Kernel
- [Interrupt Management](kernel/kernel-mini-basic-interrupt.md)
- [Task Management](kernel/kernel-mini-basic-task.md)
- - Memory Management
- - [Basic Concepts](kernel/kernel-mini-basic-memory-basic.md)
- - [Static Memory](kernel/kernel-mini-basic-memory-static.md)
- - [Dynamic Memory](kernel/kernel-mini-basic-memory-dynamic.md)
+ - [Memory Management](kernel/kernel-mini-basic-memory.md)
- Kernel Communication Mechanisms
- [Event](kernel/kernel-mini-basic-ipc-event.md)
- [Mutex](kernel/kernel-mini-basic-ipc-mutex.md)
@@ -179,23 +264,16 @@
- [C++ Support](kernel/kernel-mini-extend-support.md)
- [CPUP](kernel/kernel-mini-extend-cpup.md)
- [Dynamic Loading](kernel/kernel-mini-extend-dynamic-loading.md)
- - File System
- - [FAT](kernel/kernel-mini-extend-file-fat.md)
- - [LittleFS](kernel/kernel-mini-extend-file-lit.md)
+ - [File System](kernel/kernel-mini-extend-file.md)
- Kernel Debugging
- - Memory Debugging
- - [Memory Information Statistics](kernel/kernel-mini-memory-debug-mes.md)
- - [Memory Leak Check](kernel/kernel-mini-memory-debug-det.md)
- - [Memory Corruption Check](kernel/kernel-mini-memory-debug-cet.md)
+ - [Memory Debugging](kernel/kernel-mini-memory-debug.md)
- [Exception Debugging](kernel/kernel-mini-memory-exception.md)
- [Trace](kernel/kernel-mini-memory-trace.md)
- [LMS](kernel/kernel-mini-memory-lms.md)
- Appendix
- [Kernel Coding Specification](kernel/kernel-mini-appx-code.md)
- [Doubly Linked List](kernel/kernel-mini-appx-data-list.md)
- - Standard Libraries
- - [CMSIS Support](kernel/kernel-mini-appx-lib-cmsis.md)
- - [POSIX Support](kernel/kernel-mini-appx-lib-posix.md)
+ - [Standard Libraries](kernel/kernel-mini-appx-lib.md)
- Kernel for Small Systems
- [Kernel Overview](kernel/kernel-small-overview.md)
- Kernel Startup
@@ -230,12 +308,7 @@
- [LiteIPC](kernel/kernel-small-bundles-ipc.md)
- File Systems
- [Virtual File System](kernel/kernel-small-bundles-fs-virtual.md)
- - Supported File Systems
- - [FAT](kernel/kernel-small-bundles-fs-support-fat.md)
- - [JFFS2](kernel/kernel-small-bundles-fs-support-jffs2.md)
- - [NFS](kernel/kernel-small-bundles-fs-support-nfs.md)
- - [Ramfs](kernel/kernel-small-bundles-fs-support-ramfs.md)
- - [procfs](kernel/kernel-small-bundles-fs-support-procfs.md)
+ - [Supported File Systems](kernel/kernel-small-bundles-fs-support.md)
- [File System Adaptation](kernel/kernel-small-bundles-fs-new.md)
- Debugging and Tools
- Shell
@@ -313,15 +386,7 @@
- [Memory Information Statistics](kernel/kernel-small-debug-memory-info.md)
- [Memory Leak Check](kernel/kernel-small-debug-memory-leak.md)
- [Memory Corruption Check](kernel/kernel-small-debug-memory-corrupt.md)
- - User-Mode Memory Debugging
- - [Basic Concepts](kernel/kernel-small-debug-user-concept.md)
- - [Working Principles](kernel/kernel-small-debug-user-function.md)
- - Usage
- - [API Description](kernel/kernel-small-debug-user-guide-api.md)
- - How to Use
- - [Calling APIs](kernel/kernel-small-debug-user-guide-use-api.md)
- - [Using the CLI](kernel/kernel-small-debug-user-guide-use-cli.md)
- - [Typical Memory Problems](kernel/kernel-small-debug-user-faqs.md)
+ - [User-Mode Memory Debugging](kernel/kernel-small-debug-user.md)
- Other Kernel Debugging Methods
- [Dying Gasp](kernel/kernel-small-debug-trace-other-lastwords.md)
- [Common Fault Locating Methods](kernel/kernel-small-debug-trace-other-faqs.md)
@@ -400,6 +465,21 @@
- [Compilation and Building Guide](subsystems/subsys-build-all.md)
- [Build System Coding Specifications and Best Practices](subsystems/subsys-build-gn-coding-style-and-best-practice.md)
- [Building the Kconfig Visual Configuration](subsystems/subsys-build-gn-kconfig-visual-config-guide.md)
+ - References
+ - [Subsystem Configuration Rules](subsystems/subsys-build-subsystem.md#configuration-rules)
+ - [Product Configuration Rules](subsystems/subsys-build-product.md#configuration-rules)
+ - [Subsystem Configuration Rules](subsystems/subsys-build-subsystem.md#configuration-rules)
+ - [Component Configuration Rules](subsystems/subsys-build-component.md#configuration-rules)
+ - [Module Configuration Rules](subsystems/subsys-build-module.md#configuration-rules)
+ - [Chipset Solution Configuration Rules](subsystems/subsys-build-chip_solution.md#configuration-rules)
+ - [Feature Configuration Rules](subsystems/subsys-build-feature.md#configuration-rules)
+ - [System Capabilities Configuration Rules](subsystems/subsys-build-syscap.md#configuring-system-capabilities-for-a-component)
+ - [deps and external_deps](subsystems/subsys-build-reference.md#deps-and-external_deps)
+ - [Information Collected by the Open Source Software Notice](subsystems/subsys-build-reference.md#information-collected-by-the-open-source-software-notice)
+ - [Parameters for Accelerating Local Build](subsystems/subsys-build-reference.md#parameters-for-accelerating-local-build)
+ - [Viewing Ninja Build Information](subsystems/subsys-build-reference.md#viewing-ninja-build-information)
+ - [HAP Build Guide](subsystems/subsys-build-gn-hap-compilation-guide.md)
+ - [FAQs](subsystems/subsys-build-FAQ.md)
- [Distributed Remote Startup](subsystems/subsys-remote-start.md)
- Graphics
- [Graphics Overview](subsystems/subsys-graphics-overview.md)
@@ -464,9 +544,9 @@
- [Security Overview](subsystems/subsys-security-overview.md)
- [Development on Application Signature Verification](subsystems/subsys-security-sigverify.md)
- [Development on Application Permission Management](subsystems/subsys-security-rightmanagement.md)
-
- [Development on IPC Authentication](subsystems/subsys-security-communicationverify.md)
- [Development on Device Security Level Management](subsystems/subsys-security-devicesecuritylevel.md)
+
- Startup
- [Startup](subsystems/subsys-boot-overview.md)
- init Module
@@ -500,9 +580,13 @@
- Featured Topics
- HPM Part
- [HPM Part Overview](hpm-part/hpm-part-about.md)
+
- [HPM Part Development](hpm-part/hpm-part-development.md)
+
- [HPM Part Reference](hpm-part/hpm-part-reference.md)
+
- Device Development Examples
+
- Mini- and Small-System Devices
- WLAN-connected Products
- [LED Peripheral Control](guide/device-wlan-led-control.md)
@@ -535,8 +619,9 @@
- [Development Guidelines on Clock Apps](guide/device-clock-guide.md)
- [Development Example for Platform Drivers](guide/device-driver-demo.md)
- [Development Example for Peripheral Drivers](guide/device-outerdriver-demo.md)
-- Debugging
+
+- Debugging
- [Test Case Development](subsystems/subsys-testguide-test.md)
- Debugging Tools
- [bytrace](subsystems/subsys-toolchain-bytrace-guide.md)
@@ -558,3 +643,11 @@
- [Porting](faqs/faqs-porting.md)
- [Startup](faqs/faqs-startup.md)
- [System Applications](faqs/faqs-system-applications.md)
+
+
+
+
+
+
+
+
diff --git a/en/readme/commonlibrary.md b/en/readme/commonlibrary.md
new file mode 100644
index 0000000000000000000000000000000000000000..e2c21fe797d76e4d42a5347e68077945e742057c
--- /dev/null
+++ b/en/readme/commonlibrary.md
@@ -0,0 +1,45 @@
+# commonlibrary
+
+
+## Introduction
+
+The **commonlibrary** subsystem provides common enhanced APIs for development in C, C++ and JS.
+
+**c_utils**
+
+- Enhanced APIs for operations related to files, paths, and strings
+- APIs related to the read-write lock, semaphore, timer, thread, and thread pool
+- APIs related to the security data container and data serialization
+- Error codes for each subsystem
+- Safe functions in C
+
+**ets_utils**
+
+- JSAPIs for operation of URI, URL and xml
+- JSAPIs for character encoder and decoder
+- JSAPIs for operation of process
+- Multithreading ability in JS
+
+**utils_lite**
+
+- Hardware Abstraction Layer (HAL) APIs for performing operations on standard files
+- APIs for internal functions, such as the timer
+
+## Directory Structure
+
+```
+/commonlibrary
+ ├── c_utils # Enhanced basic C/C++ library for developers
+ ├── ets_utils # Enhanced basic JS library for developers
+ └── utils_lite # Basic tools for liteOS, including C and JS.
+```
+
+## Repositories Involved
+
+**commonlibrary subsystem**
+
+[commonlibrary\_c\_utils](https://gitee.com/openharmony/commonlibrary_c_utils)
+
+[commonlibrary\_ets\_utils](https://gitee.com/openharmony/commonlibrary_ets_utils)
+
+[commonlibrary\_utils\_lite](https://gitee.com/openharmony/commonlibrary_utils_lite)
diff --git a/en/readme/utils.md b/en/readme/utils.md
deleted file mode 100644
index a24dc67246c8aebd6a47144a23d502b59d7ae50c..0000000000000000000000000000000000000000
--- a/en/readme/utils.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# utils
-
-
-## Introduction
-
-The **utils** repository provides common enhanced APIs for development in C and C++.
-
-**C++**
-
-- Enhanced APIs for operations related to files, paths, and strings
-- APIs related to the read-write lock, semaphore, timer, thread, and thread pool
-- APIs related to the security data container and data serialization
-- Error codes for each subsystem
-- Safe functions in C
-
-**C**
-
-- Hardware Abstraction Layer (HAL) APIs for performing operations on standard files
-- APIs for internal functions, such as the timer
-
-## Directory Structure
-
-```
-/utils
- ├── native # Utility class implementation at the native layer
- └── system # System-related predefined values and security policy configuration
-```
-
-## Repositories Involved
-
-**utils subsystem**
-
-[utils](https://gitee.com/openharmony/utils)
-
-[utils\_native](https://gitee.com/openharmony/utils_native)
-
-[utils\_native\_lite](https://gitee.com/openharmony/utils_native_lite)
diff --git a/zh-cn/application-dev/device/usb-guidelines.md b/zh-cn/application-dev/device/usb-guidelines.md
index 92559d71cffbe3310e7736925a1dc5c88176bf07..bfe55e352658e49ec59d6c49903ee995c4cb50da 100644
--- a/zh-cn/application-dev/device/usb-guidelines.md
+++ b/zh-cn/application-dev/device/usb-guidelines.md
@@ -40,7 +40,7 @@ USB设备可作为Host设备连接Device设备进行数据传输。开发示例
1. 获取设备列表。
```js
- // 导入usb接口api包。
+ // 导入USB接口api包。
import usb from '@ohos.usb';
// 获取设备列表。
var deviceList = usb.getDevices();
diff --git a/zh-cn/application-dev/media/Readme-CN.md b/zh-cn/application-dev/media/Readme-CN.md
index d0793ffdd3396a75f81a3af585dd59d865078e3f..def905fc036cbbe5a3ac5ced05e4464b1768220d 100755
--- a/zh-cn/application-dev/media/Readme-CN.md
+++ b/zh-cn/application-dev/media/Readme-CN.md
@@ -19,4 +19,5 @@
- [图片开发指导](image.md)
- 相机
- - [相机开发指导](camera.md)
\ No newline at end of file
+ - [相机开发指导](camera.md)
+ - [分布式相机开发指导](remote-camera.md)
\ No newline at end of file
diff --git a/zh-cn/application-dev/napi/native-window-guidelines.md b/zh-cn/application-dev/napi/native-window-guidelines.md
index 69299f3979c8c03c674157563aa93a7d0949524c..3a9d8c136d7005f3df5d4c0c6749e749d3877b2d 100644
--- a/zh-cn/application-dev/napi/native-window-guidelines.md
+++ b/zh-cn/application-dev/napi/native-window-guidelines.md
@@ -86,7 +86,7 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建
SkImageInfo imageInfo = ...
bitmap.setInfo(imageInfo, bufferHandle->stride);
bitmap.setPixels(bufferHandle->virAddr);
- //创建 Skia Canvas 并将内容写入naitve window
+ //创建 Skia Canvas 并将内容写入native window
...
//写入完成后,通过OH_NativeWindow_NativeWindowFlushBuffer 提交给消费者使用,例如:显示在屏幕上
@@ -101,7 +101,13 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建
OH_NativeXComponent_Callback &callback_;
callback_->OnSurfaceCreated = OnSurfaceCreatedCB;
callback_->OnSurfaceChanged = OnSurfaceChangedCB;
- callback_->OnSurfaceDestoryed = OnSurfaceDestoryedCB;
+ callback_->OnSurfaceDestroyed = OnSurfaceDestroyedCB;
callback_->DispatchTouchEvent = DispatchTouchEventCB;
OH_NativeXComponent_RegisterCallback(nativeXComponent, callback_)
```
+
+## 相关实例
+
+针对NativeWindow的使用,有以下相关实例可供参考:
+
+- [使用NativeWindow接口获取Buffer](https://gitee.com/openharmony/graphic_graphic_2d/blob/master/rosen/samples/hello_native_window/hello_native_window.cpp)
diff --git a/zh-cn/application-dev/quick-start/start-with-ets-fa.md b/zh-cn/application-dev/quick-start/start-with-ets-fa.md
index cedecd088917475c8f1ecffb3dcc242be303c446..d76098deee7a4663cc1e83415b44fa760986e984 100644
--- a/zh-cn/application-dev/quick-start/start-with-ets-fa.md
+++ b/zh-cn/application-dev/quick-start/start-with-ets-fa.md
@@ -13,7 +13,7 @@

-2. 进入配置工程界面,**Compile SDK** 选择“**8**”(**Complie SDK**选择“**9**”时注意同步选择**Model** 为“**FA**”,此处以选择“**8**”为例),**Language**选择“**eTS**”,其他参数保持默认设置即可。
+2. 进入配置工程界面,**Compile SDK** 选择“**8**”(**Compile SDK**选择“**9**”时注意同步选择**Model** 为“**FA**”,此处以选择“**8**”为例),**Language**选择“**eTS**”,其他参数保持默认设置即可。

diff --git a/zh-cn/application-dev/quick-start/start-with-js-fa.md b/zh-cn/application-dev/quick-start/start-with-js-fa.md
index 6a34e376e912fbc0aaab8b403b99d786124196b8..e0f641910c490f7d2fbba95a399b4baf7a1fb002 100644
--- a/zh-cn/application-dev/quick-start/start-with-js-fa.md
+++ b/zh-cn/application-dev/quick-start/start-with-js-fa.md
@@ -11,7 +11,7 @@

-2. 进入配置工程界面,**Compile SDK**选择“**8**”(**Complie SDK**选择“**9**”时注意同步选择 **Model** 为“**FA**”,此处以选择“**8**”为例),**Language**选择“**JS**”,其他参数保持默认设置即可。
+2. 进入配置工程界面,**Compile SDK**选择“**8**”(**Compile SDK**选择“**9**”时注意同步选择 **Model** 为“**FA**”,此处以选择“**8**”为例),**Language**选择“**JS**”,其他参数保持默认设置即可。

diff --git a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md
index 112186af0920e6588a9bb9c7b5842f079993aaee..c6d58000ae2a06728fe8fcc463cc3bb558211d04 100755
--- a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md
@@ -141,7 +141,7 @@ bundle.getApplicationInfo(bundleName, bundleFlags, (err, data) => {
## bundle.getApplicationInfoSync9+
-getApplicationInfoSync(bundleName: string, bundleFlags: string, userId: number): ApplicationInfo;
+getApplicationInfoSync(bundleName: string, bundleFlags: number, userId: number): ApplicationInfo;
以同步方法根据给定的包名获取ApplicationInfo,返回ApplicationInfo对象。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md b/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
index d5549075d11ae8e723c1c462a2f55c8aa564c9f2..6f0790203a2dce9f574a00e62a91fa3d3c5ee270 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
@@ -282,6 +282,32 @@ promise.then(data => {
});
```
+### getVersion
+
+getVersion(): Promise<number>
+
+获取当前权限管理的数据版本,使用Promise方式异步返回结果。
+
+此接口为系统接口。
+
+**系统能力:** SystemCapability.Security.AccessToken
+
+**返回值:**
+
+| 类型 | 说明 |
+| :------------ | :---------------------------------- |
+| Promise<number> | Promise实例,用于获取异步返回的版本号。 |
+
+**示例:**
+
+```js
+var AtManager = abilityAccessCtrl.createAtManager();
+let promise = AtManager.getVersion();
+promise.then(data => {
+ console.log(`promise: data->${JSON.stringify(data)}`);
+});
+```
+
### on9+
on(type: 'permissionStateChange', tokenIDList: Array<number>, permissionNameList: Array<string>, callback: Callback<PermissionStateChangeInfo>): void;
@@ -381,7 +407,7 @@ catch(err){
| 名称 | 默认值 | 描述 |
| ----------------------- | ------ | ----------------- |
| PERMISSION_REVOKED_OPER | 0 | 表示权限取消操作。 |
-| PERMISSION_GRANTED | 1 | 表示权限授予操作。 |
+| PERMISSION_GRANTED_OPER | 1 | 表示权限授予操作。 |
### PermissionStateChangeInfo9+
diff --git a/zh-cn/application-dev/reference/apis/js-apis-appAccount.md b/zh-cn/application-dev/reference/apis/js-apis-appAccount.md
index c5c94802eb7ed7fb28a26c3c0f7ccfb9e3e457ac..2ecce44700157d0dd9c3b5f7aabd2eebfb42836b 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-appAccount.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-appAccount.md
@@ -816,7 +816,7 @@ getAssociatedDataSync(name: string, key: string): string;
| 类型 | 说明 |
| :-------------------- | :-------------------- |
-| string | 用于获取同步接口的返回结果。 |
+| string | 目标关联数据的取值。 |
**示例:**
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md b/zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md
index 8b57cc39c399c18415c4488bb37ec579aabe8021..3e283d2b9bee62f9c7145d02c13d5b85ecd93a9e 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md
@@ -26,7 +26,7 @@ onReceiveEvent(event: CommonEventData): void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
- | event | CommonEventData | 是 | 静态订阅者通用事件回调。 |
+ | event | [CommonEventData](js-apis-commonEvent.md#commoneventdata) | 是 | 静态订阅者通用事件回调。 |
**示例:**
diff --git a/zh-cn/application-dev/reference/apis/js-apis-appmanager.md b/zh-cn/application-dev/reference/apis/js-apis-appmanager.md
index 0bb9cf1c93ee5f3058366761ae0e2dd576b656f6..01c486e90e52e531bb75c8301f0df1bbbf6a47a9 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-appmanager.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-appmanager.md
@@ -224,7 +224,7 @@ getProcessRunningInformation(): Promise\
系统能力:SystemCapability.Multimedia.Audio.Core|
-| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | 否 | 表示渲染器信息。
系统能力:SystemCapability.Multimedia.Audio.Renderer|
-| rendererId | number | 否 | 音频流唯一id。
系统能力:SystemCapability.Multimedia.Audio.Renderer|
+| uid | number | 是 | 表示应用ID。
**系统能力:** SystemCapability.Multimedia.Audio.Core|
+| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | 否 | 表示渲染器信息。
**系统能力:** SystemCapability.Multimedia.Audio.Renderer|
+| rendererId | number | 否 | 音频流唯一id。
**系统能力:** SystemCapability.Multimedia.Audio.Renderer|
**示例:**
@@ -4441,7 +4475,7 @@ audioRenderer.on('interrupt', async(interruptEvent) => {
### on('markReach')8+
-on(type: "markReach", frame: number, callback: Callback
- false:毫秒数。
|
+| isNano | boolean | 是 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
| callback | AsyncCallback<number> | 是 | 回调函数,返回自 Unix 纪元以来经过的时间。 |
**示例:**
@@ -120,7 +120,6 @@ getCurrentTime(callback: AsyncCallback<number>): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------------------------------------------ |
-| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
| callback | AsyncCallback<number> | 是 | 回调函数,返回自 Unix 纪元以来经过的时间。 |
**示例:**
@@ -148,7 +147,7 @@ getCurrentTime(isNano?: boolean): Promise<number>
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------- | ---- | ------------------------------------------------------------ |
-| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
+| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
**返回值:**
@@ -179,7 +178,7 @@ getRealActiveTime(isNano: boolean, callback: AsyncCallback<number>): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------------------------------------------ |
-| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
+| isNano | boolean | 是 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
| callback | AsyncCallback<number> | 是 | 回调函数,返回自系统启动以来经过的时间,但不包括度睡眠时间。 |
**示例:**
@@ -207,7 +206,6 @@ getRealActiveTime(callback: AsyncCallback<number>): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------------------------------------------ |
-| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
| callback | AsyncCallback<number> | 是 | 回调函数,返回自系统启动以来经过的时间,但不包括度睡眠时间。 |
**示例:**
@@ -235,7 +233,7 @@ getRealActiveTime(isNano?: boolean): Promise<number>
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------- | ---- | ------------------------------------------------------------ |
-| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
+| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
**返回值:**
@@ -266,7 +264,7 @@ getRealTime(isNano: boolean, callback: AsyncCallback<number>): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------------------------------------------ |
-| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
+| isNano | boolean | 是 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
| callback | AsyncCallback<number> | 是 | 回调函数,返回自系统启动以来经过的时间,包括深度睡眠时间。 |
**示例:**
@@ -294,7 +292,6 @@ getRealTime(callback: AsyncCallback<number>): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------------------------------------------ |
-| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
| callback | AsyncCallback<number> | 是 | 回调函数,返回自系统启动以来经过的时间,包括深度睡眠时间。 |
**示例:**
@@ -321,7 +318,7 @@ getRealTime(isNano?: boolean): Promise<number>
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------- | ---- | ------------------------------------------------------------ |
-| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
+| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
|
**返回值:**
diff --git a/zh-cn/application-dev/reference/apis/js-apis-window.md b/zh-cn/application-dev/reference/apis/js-apis-window.md
index e5474faec26b7596b2da697400e955f5deab9978..37f051e57ddd82ed09243a92ad4c38f8eaa12a61 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-window.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-window.md
@@ -3118,7 +3118,7 @@ let promise = windowClass.setForbidSplitMove(isForbidSplitMove);
promise.then((data)=> {
console.info('Succeeded in forbidding window moving in split screen mode. Data: ' + JSON.stringify(data));
}).catch((err)=>{
- console.error('Failed to forbidd window moving in split screen mode. Cause: ' + JSON.stringify(err));
+ console.error('Failed to forbid window moving in split screen mode. Cause: ' + JSON.stringify(err));
});
```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-xml.md b/zh-cn/application-dev/reference/apis/js-apis-xml.md
index f33be6b32f53aa437164b8684ece4eef5861eed8..7d573cf82dd1203054dc4aaec9465ebfd003971f 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-xml.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-xml.md
@@ -301,7 +301,7 @@ var strXml =
'
默认值:0(表示不隐藏) |
## 占比能力
-在非折行的flex布局中,定义了占比能力的组件,保证指定元素始终在容器的某一个比例空间中进行布局。
+在非折行的flex布局中,定义了占比能力的组件,保证指定组件始终在容器的某一个比例空间中进行布局。
-| 样式 | 类型 | 默认值 | 说明 |
-| -------- | -------- | -------- | -------- |
-| flex-weight | number | - | 指明当前元素在flex主轴方向上尺寸权值。如果容器组件中所有节点均设置此属性,当前元素尺寸为: 容器主轴尺寸 \* 当前权值 / 所有子元素权值和。如果容器组件中某几个节点设置此属性,则容器会对其他未设置此属性的节点进行布局,再将剩余空间分配给设置了此属性的节点。设置了此属性的节点的尺寸为:容器剩余空间 \* 该元素权值 / 所有子元素权值和。 |
+| 样式 | 类型 | 说明 |
+| -------- | -------- | -------- |
+| flex-weight | number | 指明当前元素在flex主轴方向上尺寸权值。如果容器组件中所有节点均设置此属性,当前元素尺寸为: 容器主轴尺寸 \* 当前权值 / 所有子元素权值和。如果容器组件中某几个节点设置此属性,则容器会对其他未设置此属性的节点进行布局,再将剩余空间分配给设置了此属性的节点,如果未设置此属性的节点设置了超过父元素的宽度,那么将没有剩余空间分配给设置了此属性的节点。设置了此属性的节点的尺寸为:容器剩余空间 \* 该元素权值 / 所有子元素权值和。 |
## 固定比例
定义了组件固定比例调整尺寸的能力。
-| 样式 | 类型 | 默认值 | 说明 |
-| -------- | -------- | -------- | -------- |
-| aspect-ratio | number | - | 1. 接受任意大于0的浮点值,定义为该节点的宽度与高度比,设置该属性后,该元素尺寸宽高比按照此属性值进行调整。
2. 遵守最大值与最小值的限制。
3. 在flex布局中,主轴尺寸先进行调整,后根据该尺寸调整交叉轴。 |
+| 样式 | 类型 | 说明 |
+| -------- | -------- | -------- |
+| aspect-ratio | number | 1. 接受任意大于0的浮点值,定义为该节点的宽度与高度比,设置该属性后,该元素尺寸宽高比按照此属性值进行调整。
2. 遵守最大值与最小值的限制。
3. 在flex布局中,主轴尺寸先进行调整,后根据该尺寸调整交叉轴。 |
diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-container-stepper-item.md b/zh-cn/application-dev/reference/arkui-js/js-components-container-stepper-item.md
index 93cb8d57eed7de341c47faa301c310f85b0c149e..1cfc116e21b7ebb1d68c37383abd0963ce0b361b 100644
--- a/zh-cn/application-dev/reference/arkui-js/js-components-container-stepper-item.md
+++ b/zh-cn/application-dev/reference/arkui-js/js-components-container-stepper-item.md
@@ -20,9 +20,9 @@
除支持[通用属性](../arkui-js/js-components-common-attributes.md)外,还支持如下属性:
-| 名称 | 类型 | 默认值 | 必填 | 描述 |
-| -------- | -------- | -------- | -------- | -------- |
-| label | Label | - | 否 | 自定义步骤导航器底部步骤提示文本按钮属性,不支持动态修改。如果没有定义该属性,步骤导航器在中文语言环境下,使用“返回”和“下一步”文本按钮,在非中文语言环境下,使用“BACK”和“NEXT”文本按钮。针对第一个步骤,没有回退文本按钮,针对最后一个步骤,下一步文本按钮文本使用“开始”(中文语言)或者“START”(非中文语言)。 |
+| 名称 | 类型 | 必填 | 描述 |
+| -------- | -------- | -------- | -------- |
+| label | Label | 否 | 自定义步骤导航器底部步骤提示文本按钮属性,不支持动态修改。如果没有定义该属性,步骤导航器在中文语言环境下,使用"返回"和"下一步"文本按钮,在非中文语言环境下,使用"BACK"和"NEXT"文本按钮。针对第一个步骤,没有"返回"文本按钮;针对最后一个步骤,"下一步"文本按钮文本使用"开始"(中文语言)或者"START"(非中文语言)。 |
**表1** Label对象定义
diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-container-tab-content.md b/zh-cn/application-dev/reference/arkui-js/js-components-container-tab-content.md
index 0bde9e1f25bd4445a74c897d3a8bab1cf7f790da..1d80f62b21b550d043a24153720a5e9da190dc4d 100644
--- a/zh-cn/application-dev/reference/arkui-js/js-components-container-tab-content.md
+++ b/zh-cn/application-dev/reference/arkui-js/js-components-container-tab-content.md
@@ -19,9 +19,9 @@
除支持[通用属性](../arkui-js/js-components-common-attributes.md)外,还支持如下属性:
-| 名称 | 类型 | 默认值 | 必填 | 描述 |
-| -------- | -------- | -------- | -------- | -------- |
-| scrollable | boolean | true | 否 | 是否可以通过左右滑动进行页面切换。默认为true,设置为false后,页面的切换只能通过tab-bar的点击实现。 |
+| 名称 | 类型 | 必填 | 描述 |
+| -------- | -------- | -------- | -------- |
+| scrollable | boolean | 否 | 是否可以通过左右滑动进行页面切换。默认为true,设置为false后,页面的切换只能通过tab-bar的点击实现。 |
## 样式
diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-svg-textpath.md b/zh-cn/application-dev/reference/arkui-js/js-components-svg-textpath.md
index cf6779fb5069197f1913c192007e776a2070334d..6cdf54b6260fe21788ffe19365122d48da5a9b74 100644
--- a/zh-cn/application-dev/reference/arkui-js/js-components-svg-textpath.md
+++ b/zh-cn/application-dev/reference/arkui-js/js-components-svg-textpath.md
@@ -26,19 +26,19 @@
支持以下表格中的属性。
-| 名称 | 类型 | 默认值 | 必填 | 描述 |
-| -------------- | ---------------------------------- | ----- | ---- | ---------------------------------------- |
-| id | string | - | 否 | 组件的唯一标识。 |
-| path | string | 0 | 是 | 设置路径的形状。
字母指令表示的意义如下:
- M = moveto
- L = lineto
- H = horizontal lineto
- V = vertical lineto
- C = curveto
- S = smooth curveto
- Q = quadratic Belzier curve
- T = smooth quadratic Belzier curveto
- A = elliptical Arc
- Z = closepath |
-| startOffset | <length>\|<percentage> | 0 | 否 | 设置文本沿path绘制的起始偏移。 |
-| font-size | <length> | 30px | 否 | 设置文本的尺寸。 |
-| fill | <color> | black | 否 | 字体填充颜色 |
-| by | number | - | 否 | 相对被指定动画的属性偏移值,from默认为原属性值。 |
-| opacity | number | 1 | 否 | 元素的透明度,取值范围为0到1,1表示为不透明,0表示为完全透明。支持属性动画。 |
-| fill-opacity | number | 1.0 | 否 | 字体填充透明度 |
-| stroke | <color> | black | 否 | 绘制字体边框并指定颜色 |
-| stroke-width | number | 1px | 否 | 字体边框宽度 |
-| stroke-opacity | number | 1.0 | 否 | 字体边框透明度 |
+| 名称 | 类型 | 默认值 | 描述 |
+| -------------- | ---------------------------------- | ------ | ------------------------------------------------------------ |
+| id | string | - | 组件的唯一标识。 |
+| path | string | 0 | 设置路径的形状。
字母指令表示的意义如下:
- M = moveto
- L = lineto
- H = horizontal lineto
- V = vertical lineto
- C = curveto
- S = smooth curveto
- Q = quadratic Belzier curve
- T = smooth quadratic Belzier curveto
- A = elliptical Arc
- Z = closepath
默认值:0 |
+| startOffset | <length>\|<percentage> | 0 | 设置文本沿path绘制的起始偏移。
默认值:0 |
+| font-size | <length> | 30px | 设置文本的尺寸。
默认值:30px |
+| fill | <color> | black | 字体填充颜色。
默认值:black |
+| by | number | - | 相对被指定动画的属性偏移值,from默认为原属性值。 |
+| opacity | number | 1 | 元素的透明度,取值范围为0到1,1表示为不透明,0表示为完全透明。支持属性动画。
默认值:0 |
+| fill-opacity | number | 1.0 | 字体填充透明度。
默认值:1.0 |
+| stroke | <color> | black | 绘制字体边框并指定颜色。
默认值:balck |
+| stroke-width | number | 1px | 字体边框宽度。
默认值:1px |
+| stroke-opacity | number | 1.0 | 字体边框透明度。
默认值:1.0 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/image-effect.png b/zh-cn/application-dev/reference/arkui-ts/figures/image-effect.png
new file mode 100644
index 0000000000000000000000000000000000000000..fc2c9b7d49f7d698aac11d2ede6b0cc58222c7ca
Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/image-effect.png differ
diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219982725.jpg b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219982725.jpg
index e3d3e1023746c03c9ad426328de0114321ac3f66..51c86ceb26151f6aeb719ad5db5ee5c88218361b 100644
Binary files a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219982725.jpg and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image_0000001219982725.jpg differ
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md
index ea1c55e0a4878d7f963a93c9ed486807639c5ab9..5248b2902f2888429f4510a141a3ba8b2eb22846 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-progress.md
@@ -1,6 +1,6 @@
# Progress
-进度条,用于显示内容加载或操作处理进度。
+进度条组件,用于显示内容加载或操作处理等进度。
> **说明:**
>
@@ -24,27 +24,36 @@ Progress(options: {value: number, total?: number, type?: ProgressType})
| -------- | -------- | -------- | -------- |
| value | number | 是 | 指定当前进度值。 |
| total | number | 否 | 指定进度总长。
默认值:100 |
-| type | ProgressType | 否 | 指定进度条样式。
默认值:ProgressType.Linear |
+| type8+ | ProgressType | 否 | 指定进度条样式。
默认值:ProgressType.Linear |
+| styledeprecated | ProgressStyle | 否 | 指定进度条类型。
该参数从API Version8开始废弃,建议使用type替代。
默认值:ProgressStyle.Linear |
## ProgressType枚举说明
| 名称 | 描述 |
| -------- | -------- |
-| Linear8+ | 线性样式。 |
-| Ring8+ | 环形无刻度样式,环形圆环逐渐填充完成过程。 |
-| Eclipse8+ | 圆形样式,展现类似月圆月缺的进度展示效果,从月牙逐渐到满月的这个过程代表了下载的进度。 |
-| ScaleRing8+ | 环形有刻度样式,类似时钟刻度形式加载进度。 |
-| Capsule8+ | 胶囊样式,头尾两端处,进度条由弧形变成直线和直线变成弧形的过程;中段处,进度条正常往右走的过程。 |
+| Linear | 线性样式。 |
+| Ring8+ | 环形无刻度样式,环形圆环逐渐显示至完全填充效果。 |
+| Eclipse8+ | 圆形样式,显示类似月圆月缺的进度展示效果,从月牙逐渐变化至满月。 |
+| ScaleRing8+ | 环形有刻度样式,显示类似时钟刻度形式的进度展示效果。 |
+| Capsule8+ | 胶囊样式,头尾两端圆弧处的进度展示效果与Eclipse相同;中段处的进度展示效果与Linear相同。 |
+
+## ProgressStyle枚举说明
+
+| 名称 | 描述 |
+| --------- | ------------------------------------------------------------ |
+| Linear | 线性样式。 |
+| Ring | 环形无刻度样式,环形圆环逐渐显示至完全填充效果。 |
+| Eclipse | 圆形样式,显示类似月圆月缺的进度展示效果,从月牙逐渐变化至满月。 |
+| ScaleRing | 环形有刻度样式,显示类似时钟刻度形式的进度展示效果。 |
+| Capsule | 胶囊样式,头尾两端圆弧处的进度展示效果与Eclipse相同;中段处的进度展示效果与Linear相同。 |
## 属性
-除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性:
-
| 名称 | 参数类型 | 描述 |
| -------- | -------- | -------- |
| value | number | 设置当前进度值。 |
| color | [ResourceColor](../../ui/ts-types.md) | 设置进度条前景色。 |
-| style8+ | {
strokeWidth?: [Length](../../ui/ts-types.md),
scaleCount?: number,
scaleWidth?: [Length](../../ui/ts-types.md)
} | 定义组件的样式。
strokeWidth: 设置进度条宽度。
scaleCount: 设置环形进度条总刻度数。
scaleWidth: 设置环形进度条刻度粗细。刻度粗细大于进度条宽度时,刻度粗细为系统默认粗细。 |
+| style8+ | {
strokeWidth?: [Length](../../ui/ts-types.md#length),
scaleCount?: number,
scaleWidth?: [Length](../../ui/ts-types.md#length)
} | 定义组件的样式。
- strokeWidth: 设置进度条宽度。
- scaleCount: 设置环形进度条总刻度数。
- scaleWidth: 设置环形进度条刻度粗细,刻度粗细大于进度条宽度时,为系统默认粗细。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-rating.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-rating.md
index 72934461df0a20aee8797d34d390c8f08b160842..d214fffaf780f0f39efe8cb1f62f61f789a7dbea 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-rating.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-rating.md
@@ -3,12 +3,8 @@
提供在给定范围内选择评分的组件。
> **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
-## 权限列表
-
-无
+>
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
@@ -16,24 +12,25 @@
无
-## 接口说明
+## 接口
Rating(options?: { rating: number, indicator?: boolean })
-- 参数
- | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
- | -------- | -------- | -------- | -------- | -------- |
- | rating | number | 是 | 0 | 设置并接收评分值。 |
- | indicator | boolean | 否 | false | 仅作为指示器使用,不可操作。 |
+**参数:**
+
+| 参数名 | 参数类型 | 必填 | 参数描述 |
+| -------- | -------- | -------- | -------- |
+| rating | number | 是 | 设置并接收评分值。
默认值:0 |
+| indicator | boolean | 否 | 仅作为指示器使用,不可操作。
默认值:false |
## 属性
-| 名称 | 参数类型 | 默认值 | 描述 |
-| -------- | -------- | -------- | -------- |
-| stars | number | 5 | 设置评星总数。 |
-| stepSize | number | 0.5 | 操作评级的步长。 |
-| starStyle | {
backgroundUri: string,
foregroundUri: string,
secondaryUri?: string
} | - | backgroundSrc:未选中的星级的图片链接,可由用户自定义或使用系统默认图片,仅支持本地。
foregroundSrc:选中的星级的图片路径,可由用户自定义或使用系统默认图片,仅支持本地。
secondarySrc:部分选中的星级的图片路径,可由用户自定义或使用系统默认图片,仅支持本地。 |
+| 名称 | 参数类型 | 描述 |
+| -------- | -------- | -------- |
+| stars | number | 设置评星总数。
默认值:5 |
+| stepSize | number | 操作评级的步长。
默认值:0.5 |
+| starStyle | {
backgroundUri: string,
foregroundUri: string,
secondaryUri?: string
} | backgroundUri:未选中的星级的图片链接,可由用户自定义或使用系统默认图片,仅支持本地图片。
foregroundUri:选中的星级的图片路径,可由用户自定义或使用系统默认图片,仅支持本地图片。
secondaryUir:部分选中的星级的图片路径,可由用户自定义或使用系统默认图片,仅支持本地图片。 |
## 事件
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-scrollbar.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-scrollbar.md
index af9d1d00d59ea0ba147cfcaabacac4cfc57642e6..3aa51016e0caf1597f5cd214dbdff9a909a3d169 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-scrollbar.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-scrollbar.md
@@ -1,15 +1,10 @@
# ScrollBar
-> **说明:**
-> 该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
滚动条组件ScrollBar,用于配合可滚动组件使用,如List、Grid、Scroll。
-
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
@@ -21,23 +16,25 @@
ScrollBar(value: { scroller: Scroller, direction?: ScrollBarDirection, state?: BarState })
-- ScrollBarOptions的参数描述
- | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
- | -------- | -------- | -------- | -------- | -------- |
- | scroller | [Scroller](ts-container-scroll.md#scroller) | 是 | - | 可滚动组件的控制器。用于与可滚动组件进行绑定。 |
- | direction | ScrollBarDirection | 否 | ScrollBarDirection.Vertical | 滚动条的方向,控制可滚动组件对应方向的滚动。 |
- | state | [BarState](ts-appendix-enums.md#barstate) | 否 | BarState.Auto | 滚动条状态。 |
-
- > **说明:**
- > ScrollBar组件负责定义可滚动区域的行为样式,ScrollBar的子节点负责定义滚动条的行为样式。
- >
- > 滚动条组件与可滚动组件通过Scroller进行绑定,且只有当两者方向相同时,才能联动,ScrollBar与可滚动组件仅支持一对一绑定。
-
-- ScrollBarDirection枚举说明
- | 名称 | 描述 |
- | -------- | -------- |
- | Vertical | 纵向滚动条。 |
- | Horizontal | 横向滚动条。 |
+**参数:**
+
+| 参数名 | 参数类型 | 必填 | 参数描述 |
+| -------- | -------- | -------- | -------- |
+| scroller | [Scroller](ts-container-scroll.md#scroller) | 是 | 可滚动组件的控制器。用于与可滚动组件进行绑定。 |
+| direction | ScrollBarDirection | 否 | 滚动条的方向,控制可滚动组件对应方向的滚动。
默认值:ScrollBarDirection.Vertical |
+| state | [BarState](ts-appendix-enums.md#barstate) | 否 | 滚动条状态。
默认值:BarState.Auto |
+
+> **说明:**
+> ScrollBar组件负责定义可滚动区域的行为样式,ScrollBar的子节点负责定义滚动条的行为样式。
+>
+> 滚动条组件与可滚动组件通过Scroller进行绑定,且只有当两者方向相同时,才能联动,ScrollBar与可滚动组件仅支持一对一绑定。
+
+## ScrollBarDirection枚举说明
+
+| 名称 | 描述 |
+| -------- | -------- |
+| Vertical | 纵向滚动条。 |
+| Horizontal | 横向滚动条。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md
index ba7a356c549286ec40a10361c27ab8557505c3d7..d6b6e0cdbba6d7e2a1aaf23310525225a5eeaec8 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-select.md
@@ -1,12 +1,10 @@
# Select
-> **说明:** 该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
提供下拉选择菜单,可以让用户在多个选项之间选择。
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
@@ -18,25 +16,25 @@ Select(options: Array\
默认值:ItemState.Normal |
+
+## ItemState枚举说明
+
+| 名称 | 描述 |
+| -------- | -------- |
+| Normal | 正常状态,右侧文本按钮正常显示,可点击进入下一个StepperItem。 |
+| Disabled | 不可用状态,右侧文本按钮灰度显示,不可点击进入下一个StepperItem。 |
+| Waiting | 等待状态,右侧文本按钮不显示,使用等待进度条,不可点击进入下一个StepperItem。 |
+| Skip | 跳过状态,表示跳过当前步骤, 进入下一个StepperItem。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textclock.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textclock.md
index 5d14a6be16867f484cad76501346a357eadb51d8..1cc48434594cdcb7c5e060fb7d3f581c97abbc4f 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textclock.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textclock.md
@@ -42,7 +42,7 @@ TextClock(options?: { timeZoneOffset?: number, controller?: TextClockController
## TextClockController
-TextClock容器组件的控制器,可以将此对象绑定到TextClock组件,再通过它控制文本时钟的启动与停止。
+TextClock容器组件的控制器,可以将此对象绑定到TextClock组件,再通过它控制文本时钟的启动与停止。一个TextClock组件仅支持绑定一个控制器。
### 导入对象
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-texttimer.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-texttimer.md
index 9045b38cd0d6909c30625a4f4f824d2464e7ea69..5cbed372dd3e323e542e2d678ef4d73af406c5f6 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-texttimer.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-texttimer.md
@@ -43,7 +43,7 @@ TextTimer(options: { isCountDown?: boolean, count?: number, controller?: TextTim
## TextTimerController
-TextTimer组件的控制器,用于控制文本计时器。
+TextTimer组件的控制器,用于控制文本计时器。一个TextTimer组件仅支持绑定一个控制器。
### 导入对象
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md
index e74488c562835c6153ba7e8127e8f27a44cdb25d..1df79983e2e4560e438b22fe63e65952917e5fe8 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md
@@ -32,7 +32,7 @@ Canvas(context?: CanvasRenderingContext2D)
| 名称 | 参数 | 描述 |
| ----------------------------- | ---- | -------------------- |
-| onReady(event: () => void) | 无 | 画布组件的事件回调,可以在此时进行绘制。 |
+| onReady(event: () => void) | 无 | Canvas组件初始化完成时的事件回调,该事件之后Canvas组件宽高确定且可获取,可使用Canvas相关API进行绘制。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md
index 15fbf6fc7b4d92416b90432087023ca0a44a6ed1..0c3bb859d8c7bca9980d46a47f2ab734671f4962 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md
@@ -34,7 +34,7 @@ Grid(scroller?: Scroller)
| scrollBar | [BarState](ts-appendix-enums.md#barstate) | BarState.Off | 设置滚动条状态。 |
| scrollBarColor | string \| number \| [Color](ts-appendix-enums.md#color) | - | 设置滚动条的颜色。 |
| scrollBarWidth | number \| string | - | 设置滚动条的宽度。 |
-| cachedCount | number | 1 | 设置预加载的GridItem的数量。 |
+| cachedCount | number | 1 | 设置预加载的GridItem的数量。具体使用可参考[减少应用白块说明](../../ui/ts-performance-improvement-recommendation.md#减少应用滑动白块)。 |
| editMode 8+ | boolean | false | 是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部[GridItem](ts-container-griditem.md)。 |
| layoutDirection8+ | [GridDirection](#griddirection8枚举说明) | GridDirection.Row | 设置布局的主轴方向。 |
| maxCount8+ | number | 1 | 当layoutDirection是Row/RowReverse时,表示可显示的最大行数
当layoutDirection是Column/ColumnReverse时,表示可显示的最大列数。 |
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md
index afb9e9f838c658a155f87240c79fe4f05d0c10a5..92275ecbc18729262785b6a750095bc6ff9d720c 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md
@@ -34,7 +34,7 @@ List(value?: {initialIndex?: number, space?: number | string, scroller?: Scrolle
| listDirection | [Axis](ts-appendix-enums.md#axis) | Axis.Vertical | 设置List组件排列方向参照Axis枚举说明。 |
| divider | {
strokeWidth: Length,
color?:[ResourceColor](../../ui/ts-types.md),
startMargin?: Length,
endMargin?: Length
} | - | 用于设置ListItem分割线样式,默认无分割线。
strokeWidth: 分割线的线宽。
color: 分割线的颜色。
startMargin: 分割线距离列表侧边起始端的距离。
endMargin: 分割线距离列表侧边结束端的距离。 |
| scrollBar | [BarState](ts-appendix-enums.md#barstate) | BarState.Off | 设置滚动条状态。 |
-| cachedCount | number | 1 | 设置预加载的ListItem的数量。 |
+| cachedCount | number | 1 | 设置预加载的ListItem的数量。具体使用可参考[减少应用白块说明](../../ui/ts-performance-improvement-recommendation.md#减少应用滑动白块)。 |
| editMode | boolean | false | 声明当前List组件是否处于可编辑模式。 |
| edgeEffect | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | EdgeEffect.Spring | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 |
| chainAnimation | boolean | false | 用于设置当前list是否启用链式联动动效,开启后列表滑动以及顶部和底部拖拽时会有链式联动的效果。链式联动效果:List内的ListItem或ListItemGroup间隔一定距离,在基本的滑动交互行为下,主动对象驱动从动对象进行联动,驱动效果遵循弹簧物理动效。其中ListItemGroup以一个整体参与链式联动动效,ListItemGroup内的ListITem不参与链式联动动效。
- false:不启用链式联动。
- true:启用链式联动。 |
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md
index 49ab62da5e1e98a2a83fc449e5c3c98a1c02b56f..24692f68638541162d8c3d023ef19b5dbb7bfc3d 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md
@@ -1,15 +1,10 @@
# Navigator
-> **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
路由容器组件,提供路由跳转能力。
-
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
@@ -21,28 +16,28 @@
Navigator(value?: {target: string, type?: NavigationType})
-创建路由组件。
+**参数:**
+
+| 参数名 | 参数类型 | 必填 | 参数描述 |
+| ------ | -------------- | ---- | ---------------------------------------------- |
+| target | string | 是 | 指定跳转目标页面的路径。 |
+| type | NavigationType | 否 | 指定路由方式。
默认值:NavigationType.Push |
-- 参数
- | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
- | ------ | -------------- | ---- | ------------------- | ------------ |
- | target | string | 是 | - | 指定跳转目标页面的路径。 |
- | type | NavigationType | 否 | NavigationType.Push | 指定路由方式。 |
+## NavigationType枚举说明
-- NavigationType枚举说明
- | 名称 | 描述 |
- | ------- | -------------------------- |
- | Push | 跳转到应用内的指定页面。 |
- | Replace | 用应用内的某个页面替换当前页面,并销毁被替换的页面。 |
- | Back | 返回上一页面或指定的页面。 |
+| 名称 | 描述 |
+| ------- | -------------------------- |
+| Push | 跳转到应用内的指定页面。 |
+| Replace | 用应用内的某个页面替换当前页面,并销毁被替换的页面。 |
+| Back | 返回上一页面或指定的页面。 |
## 属性
-| 名称 | 参数 | 默认值 | 描述 |
-| ------ | ------- | --------- | ---------------------------------------- |
-| active | boolean | - | 当前路由组件是否处于激活状态,处于激活状态时,会生效相应的路由操作。 |
-| params | Object | undefined | 跳转时要同时传递到目标页面的数据,可在目标页面使用router.getParams()获得。 |
+| 名称 | 参数 | 描述 |
+| ------ | ------- | ------------------------------------------------------------ |
+| active | boolean | 当前路由组件是否处于激活状态,处于激活状态时,会生效相应的路由操作。 |
+| params | Object | 跳转时要同时传递到目标页面的数据,可在目标页面使用router.getParams()获得。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md
index 8bb8b3941407b4d87c412161d1b0453a75865348..cebd4995112ee15c038b72e4e1e08bbcb595b408 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-panel.md
@@ -1,15 +1,10 @@
# Panel
-> **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
可滑动面板,提供一种轻量的内容展示窗口,方便在不同尺寸中切换。
-
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
@@ -19,47 +14,51 @@
## 接口
-Panel(value:{show:boolean})
+Panel(show:boolean)
-- 参数
- | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
- | -------- | -------- | -------- | -------- | -------- |
- | show | boolean | 是 | - | 控制Panel显示或隐藏。 |
+**参数:**
+
+| 参数名 | 参数类型 | 必填 | 参数描述 |
+| -------- | -------- | -------- | -------- |
+| show | boolean | 是 | 控制Panel显示或隐藏。 |
## 属性
-| 名称 | 参数类型 | 默认值 | 描述 |
-| -------- | -------- | -------- | -------- |
-| type | PanelType | PanelType.Foldable | 设置可滑动面板的类型。 |
-| mode | PanelMode | - | 设置可滑动面板的初始状态。 |
-| dragBar | boolean | true | 设置是否存在dragbar,true表示存在,false表示不存在。 |
-| fullHeight | Length | - | 指定PanelMode.Full状态下的高度。 |
-| halfHeight | Length | - | 指定PanelMode.Half状态下的高度,默认为屏幕尺寸的一半。 |
-| miniHeight | Length | - | 指定PanelMode.Mini状态下的高度。 |
-| backgroundMask9+|(color: ResourceColor)| - |指定Panel的背景蒙层。|
-
-- PanelType枚举说明
- | 名称 | 描述 |
- | -------- | -------- |
- | Minibar | 提供minibar和类全屏展示切换效果。 |
- | Foldable | 内容永久展示类,提供大(类全屏)、中(类半屏)、小三种尺寸展示切换效果。 |
- | Temporary | 内容临时展示区,提供大(类全屏)、中(类半屏)两种尺寸展示切换效果。 |
-
-- PanelMode枚举说明
- | 名称 | 描述 |
- | -------- | -------- |
- | Mini | 类型为minibar和foldable时,为最小状态;类型为temporary,则不生效。 |
- | Half | 类型为foldable和temporary时,为类半屏状态;类型为minibar,则不生效。 |
- | Full | 类全屏状态。 |
+| 名称 | 参数类型 | 描述 |
+| -------- | -------- | -------- |
+| type | PanelType | 设置可滑动面板的类型。
默认值:PanelType.Foldable |
+| mode | PanelMode | 设置可滑动面板的初始状态。 |
+| dragBar | boolean | 设置是否存在dragbar,true表示存在,false表示不存在。
默认值:true |
+| fullHeight | string \| number | 指定PanelMode.Full状态下的高度。 |
+| halfHeight | string \| number | 指定PanelMode.Half状态下的高度,默认为屏幕尺寸的一半。 |
+| miniHeight | string \| number | 指定PanelMode.Mini状态下的高度。 |
+| show | boolean | 当滑动面板弹出时调用。 |
+| backgroundMask9+|[ResourceColor](../../ui/ts-types.md#resourcecolor8)|指定Panel的背景蒙层。|
+
+## PanelType枚举说明
+
+| 名称 | 描述 |
+| -------- | -------- |
+| Minibar | 提供minibar和类全屏展示切换效果。 |
+| Foldable | 内容永久展示类,提供大(类全屏)、中(类半屏)、小三种尺寸展示切换效果。 |
+| Temporary | 内容临时展示区,提供大(类全屏)、中(类半屏)两种尺寸展示切换效果。 |
+
+## PanelMode枚举说明
+
+| 名称 | 描述 |
+| -------- | -------- |
+| Mini | 类型为minibar和foldable时,为最小状态;类型为temporary,则不生效。 |
+| Half | 类型为foldable和temporary时,为类半屏状态;类型为minibar,则不生效。 |
+| Full | 类全屏状态。 |
## 事件
-| 名称 | 功能描述 |
+| 名称 | 功能描述 |
| -------- | -------- |
-| onChange(callback: (width: number, height: number, mode: PanelMode) => void) | 当可滑动面板发生状态变化时触发, 返回的height值为内容区高度值,当dragbar属性为true时,panel本身的高度值为dragbar高度加上内容区高度。 |
-| onHeightChange(callback: (value: number) => void)9+ |当可滑动面板发生高度变化时触发,返回的height值为内容区高度值,当dragbar属性为true时,panel本身的高度值为dragbar高度加上内容区高度。因用户体验设计原因,panel最高只能滑到 fullHeight-8vp |
+| onChange(event: (width: number, height: number, mode: PanelMode) => void) | 当可滑动面板发生状态变化时触发, 返回的height值为内容区高度值,当dragbar属性为true时,panel本身的高度值为dragbar高度加上内容区高度。 |
+| onHeightChange(callback: (value: number) => void)9+ |当可滑动面板发生高度变化时触发,返回的height值为内容区高度值,当dragbar属性为true时,panel本身的高度值为dragbar高度加上内容区高度。因用户体验设计原因,panel最高只能滑到 fullHeight-8vp。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md
index 8c5527430e504aeb5e6bd830db7de0ae43be51ad..d1849a00c4bf3ced1ec7d953c60303b16ea5bd09 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md
@@ -3,11 +3,8 @@
可以进行页面下拉操作并显示刷新动效的容器组件。
> **说明:**
-> 该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-## 权限列表
-
-无
+>
+> 该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
@@ -15,15 +12,15 @@
## 接口
-Refresh\(value: \{ refreshing: boolean, offset?: Length, friction?: number | string \}\)
+Refresh\(value: \{ refreshing: boolean, offset?: number | string , friction?: number | string \}\)
-- 参数
+**参数:**
- | 参数 | 参数名 | 必填 | 默认值 | 参数描述 |
- | -------- | -------- | -------- | -------- | -------- |
- | refreshing | boolean | 是 | - | 当前组件是否正在刷新。
该参数支持[$$](../../ui/ts-syntactic-sugar.md)双向绑定变量。 |
- | offset | Length | 否 | 16 | 刷新组件静止时距离父组件顶部的距离。|
- | friction | number \| string | 否 | 62 | 下拉摩擦系数,取值范围为0到100。
- 0表示下拉刷新容器不跟随手势下拉而下拉。
- 100表示下拉刷新容器紧紧跟随手势下拉而下拉。
- 数值越大,下拉刷新容器跟随手势下拉的反应越灵敏。 |
+| 参数 | 参数名 | 必填 | 参数描述 |
+| -------- | -------- | -------- | -------- |
+| refreshing | boolean | 是 | 当前组件是否正在刷新。
该参数支持[$$](../../ui/ts-syntactic-sugar.md)双向绑定变量。 |
+| offset | string \| number | 否 | 刷新组件静止时距离父组件顶部的距离。
默认值:16,单位vp |
+| friction | number \| string | 否 | 下拉摩擦系数,取值范围为0到100。
默认值:62
- 0表示下拉刷新容器不跟随手势下拉而下拉。
- 100表示下拉刷新容器紧紧跟随手势下拉而下拉。
- 数值越大,下拉刷新容器跟随手势下拉的反应越灵敏。 |
@@ -32,18 +29,18 @@ Refresh\(value: \{ refreshing: boolean, offset?: Length, friction?: number | str
| 名称 | 描述 |
| -------- | -------- |
-| onStateChange(callback: (state: RefreshStatus) => void)| 当前刷新状态变更时,触发回调。
state:刷新状态。 |
+| onStateChange(callback: (state: RefreshStatus) => void)| 当前刷新状态变更时,触发回调。
- state:刷新状态。 |
| onRefreshing(callback: () => void)| 进入刷新状态时触发回调。 |
-- RefreshStatus枚举说明
+## RefreshStatus枚举说明
- | 名称 | 描述 |
- | -------- | -------- |
- | Inactive | 默认未下拉状态。 |
- | Drag | 下拉中,下拉距离小于刷新距离。 |
- | OverDrag | 下拉中,下拉距离超过刷新距离。 |
- | Refresh | 下拉结束,回弹至刷新距离,进入刷新状态。 |
- | Done | 刷新结束,返回初始状态(顶部)。 |
+| 名称 | 描述 |
+| -------- | -------- |
+| Inactive | 默认未下拉状态。 |
+| Drag | 下拉中,下拉距离小于刷新距离。 |
+| OverDrag | 下拉中,下拉距离超过刷新距离。 |
+| Refresh | 下拉结束,回弹至刷新距离,进入刷新状态。 |
+| Done | 刷新结束,返回初始状态(顶部)。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md
index 4179c135dec5b9e3c202039680a5edc361fb1356..8376694073445f0b52b7f283be3a7b44cc2cb1e2 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md
@@ -1,15 +1,10 @@
# Row
-> **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
沿水平方向布局容器。
-
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
@@ -19,20 +14,21 @@
## 接口
-Row(value?:{space?: Length})
+Row(value?:{space?: number | string })
+
+**参数:**
-- 参数
- | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
- | -------- | -------- | -------- | -------- | -------- |
- | space | Length | 否 | 0 | 横向布局元素间距。 |
+| 参数名 | 参数类型 | 必填 | 参数描述 |
+| -------- | -------- | -------- | -------- |
+| space | string \| number | 否 | 横向布局元素间距。
默认值:0 |
## 属性
-| 名称 | 参数类型 | 默认值 | 描述 |
-| -------- | -------- | -------- | -------- |
-| alignItems | [VerticalAlign](ts-appendix-enums.md#verticalalign) | VerticalAlign.Center | 在垂直方向上子组件的对齐格式。 |
-| justifyContent8+ | [FlexAlign](ts-appendix-enums.md#flexalign) | FlexAlign.Start | 设置子组件在水平方向上的对齐格式。 |
+| 名称 | 参数类型 | 描述 |
+| -------- | -------- | -------- |
+| alignItems | [VerticalAlign](ts-appendix-enums.md#verticalalign) | 设置子组件在垂直方向上的对齐格式。
默认值:VerticalAlign.Center |
+| justifyContent8+ | [FlexAlign](ts-appendix-enums.md#flexalign) | 设置子组件在水平方向上的对齐格式。
FlexAlign.Start |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md
index d6f3d8814bf8728ac4fdb48a48c8014d7b55d68a..92875f1243f788be7d71de89af0c66113fe6d141 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md
@@ -1,15 +1,10 @@
# SideBarContainer
-> **说明:**
-> 该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
提供侧边栏可以显示和隐藏的侧边栏容器,通过子组件定义侧边栏和内容区,第一个子组件表示侧边栏,第二个子组件表示内容区。
-
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
@@ -21,52 +16,56 @@
SideBarContainer( type?: SideBarContainerType )
-- 参数
- | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
- | -------- | -------- | -------- | -------- | -------- |
- | type | SideBarContainerType | 否 | SideBarContainerType.Embed | 设置侧边栏的显示类型。 |
+**参数:**
+
+| 参数名 | 参数类型 | 必填 | 参数描述 |
+| -------- | -------- | -------- | -------- |
+| type | SideBarContainerType | 否 | 设置侧边栏的显示类型。
默认值:SideBarContainerType.Embed |
-- SideBarContainerType枚举说明
- | 名称 | 描述 |
- | -------- | -------- |
- | Embed | 侧边栏嵌入到组件内,侧边栏和内容区并列显示。 |
- | Overlay | 侧边栏浮在内容区上面。 |
+## SideBarContainerType枚举说明
+
+| 名称 | 描述 |
+| -------- | -------- |
+| Embed | 侧边栏嵌入到组件内,和内容区并列显示。 |
+| Overlay | 侧边栏浮在内容区上面。 |
## 属性
-| 名称 | 参数类型 | 默认值 | 描述 |
+| 名称 | 参数类型 | 描述 |
+| -------- | -------- | -------- |
+| showSideBar | boolean | 设置是否显示侧边栏。
默认值:true |
+| controlButton | ButtonStyle | 设置侧边栏控制按钮的属性。 |
+| showControlButton | boolean | 设置是否显示控制按钮。
默认值:true |
+| sideBarWidth | number | 设置侧边栏的宽度。
默认值:200,单位vp |
+| minSideBarWidth | number | 设置侧边栏最小宽度。
默认值:200,单位vp |
+| maxSideBarWidth | number | 设置侧边栏最大宽度。
默认值:280,单位vp |
+| autoHide9+ | boolean | 设置当侧边栏拖拽到小于最小宽度后,是否自动隐藏。
默认值:true |
+| sideBarPosition9+ | SideBarPosition | 设置侧边栏显示位置。
默认值:SideBarPosition.Start |
+
+## ButtonStyle对象说明
+
+| 名称 | 参数类型 | 必填 | 描述 |
| -------- | -------- | -------- | -------- |
-| showSideBar | boolean | true | 设置是否显示侧边栏。 |
-| controlButton | ButtonStyle | - | 设置侧边栏控制按钮的属性。 |
-| showControlButton | boolean | true | 设置是否显示控制按钮。 |
-| sideBarWidth | number \| [Length9+](../../ui/ts-types.md#长度类型) | 200 | 设置侧边栏的宽度。 |
-| minSideBarWidth | number \| [Length9+](../../ui/ts-types.md#长度类型) | 200 | 设置侧边栏最小宽度。 |
-| maxSideBarWidth | number \| [Length9+](../../ui/ts-types.md#长度类型) | 280 | 设置侧边栏最大宽度。 |
-| autoHide9+ | boolean | true | 设置当侧边栏拖拽到小于最小宽度后,是否自动隐藏。 |
-| sideBarPosition9+ | SideBarPosition | SideBarPosition.Start | 设置侧边栏显示位置。 |
-
-- ButtonStyle对象说明
- | 名称 | 参数类型 | 必填 | 默认值 | 描述 |
- | -------- | -------- | -------- | -------- | -------- |
- | left | number | 否 | 16 | 设置侧边栏控制按钮距离容器左界限的间距。 |
- | top | number | 否 | 48 | 设置侧边栏控制按钮距离容器上界限的间距。 |
- | width | number | 否 | 32 | 设置侧边栏控制按钮的宽度。 |
- | height | number | 否 | 32 | 设置侧边栏控制按钮的高度。 |
- | icons | {
shown: string \| PixelMap \| [Resource](../../ui/ts-types.md) ,
hidden: string \| PixelMap \| [Resource](../../ui/ts-types.md) ,
switching?: string \| PixelMap \| [Resource](../../ui/ts-types.md)
} | 否 | - | 设置侧边栏控制按钮的图标:
value的true表示显示,false表示隐藏。| +| onChange(callback: (value: boolean) => void) | 当侧边栏的状态在显示和隐藏之间切换时触发回调。
true表示显示,false表示隐藏。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-stack.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-stack.md
index 6acbfc7449061d055a0d38148c8e4a164a21b7c9..52b6a255f541389741f8c49083a510203ee68496 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-container-stack.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-stack.md
@@ -1,15 +1,10 @@
# Stack
-> **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
堆叠容器,子组件按照顺序依次入栈,后一个子组件覆盖前一个子组件。
-
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
@@ -19,12 +14,13 @@
## 接口
-Stack(value:{alignContent?: Alignment})
+Stack({ alignContent?: Alignment })
+
+**参数:**
-- 参数
- | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
- | -------- | -------- | -------- | -------- | -------- |
- | alignContent | [Alignment](ts-appendix-enums.md#alignment枚举说明) | 否 | Center | 设置子组件在容器内的对齐方式。 |
+| 参数名 | 参数类型 | 必填 | 参数描述 |
+| -------- | -------- | -------- | -------- |
+| alignContent | [Alignment](ts-appendix-enums.md#alignment) | 否 | 设置子组件在容器内的对齐方式。
默认值:Alignment.Center |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md
index 4440a82f815fd8a3272a6ee562ab78e2bec3a935..5a523dd57d9a658b14a3dd6050d9cedd4123613a 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md
@@ -1,18 +1,12 @@
# Swiper
+ 滑块视图容器,提供子组件滑动轮播显示的能力。
+
> **说明:**
>
> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-滑动容器,提供切换子组件显示的能力。
-
-
-## 权限列表
-
-无
-
-
## 子组件
可以包含子组件。
@@ -24,14 +18,14 @@ Swiper(value:{controller?: SwiperController})
**参数:**
- | 参数名 | 参数类型 | 必填 | 参数描述 |
- | ---------- | ------------------------------------- | ---- | -------------------- |
- | controller | [SwiperController](#swipercontroller) | 否 | 给组件绑定一个控制器,用来控制组件翻页。
默认值:null |
+| 参数名 | 参数类型 | 必填 | 参数描述 |
+| ---------- | ------------------------------------- | ---- | -------------------- |
+| controller | [SwiperController](#swipercontroller) | 否 | 给组件绑定一个控制器,用来控制组件翻页。 |
## 属性
-不支持[Menu控制](ts-universal-attributes-menu.md)。
+除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性,不支持[Menu控制](ts-universal-attributes-menu.md)。
| 名称 | 参数类型 | 描述 |
| --------------------------- | ---------------------------------------- | ---------------------------------------- |
@@ -42,29 +36,29 @@ Swiper(value:{controller?: SwiperController})
| loop | boolean | 是否开启循环。
设置为true时表示开启循环,在LazyForEach懒循环加载模式下,加载的组件数量建议大于5个。
默认值:true |
| duration | number | 子组件切换的动画时长,单位为毫秒。
默认值:400 |
| vertical | boolean | 是否为纵向滑动。
默认值:false |
-| itemSpace | Length | 设置子组件与子组件之间间隙。
默认值:0 |
+| itemSpace | number \| string | 设置子组件与子组件之间间隙。
默认值:0 |
| displayMode | SwiperDisplayMode | 主轴方向上元素排列的模式,优先以displayCount设置的个数显示,displayCount未设置时本属性生效。
默认值:SwiperDisplayMode.Stretch |
| cachedCount8+ | number | 设置预加载子组件个数。
默认值:1 |
| disableSwipe8+ | boolean | 禁用组件滑动切换功能。
默认值:false |
| curve8+ | [Curve](ts-appendix-enums.md#curve) \| string | 设置Swiper的动画曲线,默认为淡入淡出曲线,常用曲线参考[Curve枚举说明](ts-appendix-enums.md#curve),也可以通过插值计算模块提供的接口创建自定义的Curves([插值曲线对象](ts-interpolation-calculation.md))。
默认值:Curve.Ease |
-| indicatorStyle8+ | {
left?: Length,
top?: Length,
right?: Length,
bottom?: Length,
size?: Length,
mask?: boolean,
color?: [ResourceColor](../../ui/ts-types.md),
selectedColor?: [ResourceColor](../../ui/ts-types.md)
} | - | 设置indicator样式:
- left: 设置导航点距离Swiper组件左边的距离。
- top: 设置导航点距离Swiper组件顶部的距离。
- right: 设置导航点距离Swiper组件右边的距离。
- bottom: 设置导航点距离Swiper组件底部的距离。
- size: 设置导航点的直径。
- mask: 设置是否显示导航点蒙层样式。
- color: 设置导航点的颜色。
- selectedColor: 设置选中的导航点的颜色。 |
+| indicatorStyle8+ | {
left?: [Length](../../ui/ts-types.md#length),
top?: [Length](../../ui/ts-types.md#length),
right?: [Length](../../ui/ts-types.md#length),
bottom?: [Length](../../ui/ts-types.md#length),
size?: [Length](../../ui/ts-types.md#length),
mask?: boolean,
color?: [ResourceColor](../../ui/ts-types.md),
selectedColor?: [ResourceColor](../../ui/ts-types.md)
} | 设置导航点样式:
\- left: 设置导航点距离Swiper组件左边的距离。
\- top: 设置导航点距离Swiper组件顶部的距离。
\- right: 设置导航点距离Swiper组件右边的距离。
\- bottom: 设置导航点距离Swiper组件底部的距离。
\- size: 设置导航点的直径。
\- mask: 设置是否显示导航点蒙层样式。
\- color: 设置导航点的颜色。
\- selectedColor: 设置选中的导航点的颜色。 |
| displayCount8+ | number\|string | 设置元素显示个数。
默认值:1 |
| effectMode8+ | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。
默认值:EdgeEffect.Spring |
## SwiperDisplayMode枚举说明
-
- | 名称 | 描述 |
- | ----------- | ------------------------------------------ |
- | Stretch | Swiper滑动一页的宽度为Swiper组件自身的宽度。|
- | AutoLinear | Swiper滑动一页的宽度为子组件宽度中的最大值。|
+
+| 名称 | 描述 |
+| ----------- | ------------------------------------------ |
+| Stretch | Swiper滑动一页的宽度为Swiper组件自身的宽度。|
+| AutoLinear | Swiper滑动一页的宽度为子组件宽度中的最大值。|
## EdgeEffect枚举说明
-
- | 名称 | 描述 |
- | ------ | ------------------------------------------------------------------------- |
- | Spring | 弹性物理动效,滑动到边缘后可以通过触摸事件继续滑动一段距离,松手后回弹。 |
- | Fade | 滑动到边缘后,可以通过触摸事件继续滑动一段阴影,松手后阴影回弹。 |
- | None | 滑动到边缘后无效果。 |
+
+| 名称 | 描述 |
+| ------ | ------------------------------------------------------------------------- |
+| Spring | 弹性物理动效,滑动到边缘后可以通过触摸事件继续滑动一段距离,松手后回弹。 |
+| Fade | 滑动到边缘后,可以通过触摸事件继续滑动一段阴影,松手后阴影回弹。 |
+| None | 滑动到边缘后无效果。 |
## SwiperController
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md
index fedc4b98f6c25374c1d001c342859e1a659022b1..b2b3785ce0ca51bba69401f9dec96793275cf2f7 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md
@@ -58,7 +58,8 @@ Line(options?: {width?: string | number, height?: string | number})
struct LineExample {
build() {
Column() {
- Line({ width: 50, height: 100 }).startPoint([0, 0]).endPoint([50, 100])
+ Line().startPoint([0, 0]).endPoint([50, 100])
+ Line({ width: 50, height: 50 }).startPoint([0, 0]).endPoint([100, 100])
Line().width(200).height(200).startPoint([50, 50]).endPoint([150, 150])
}.margin({ top: 5 })
}
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md
index 365b8d7700b5ed877dd30a144e60fe017cb7cef3..f9f2674cbe0892bd983de4bd2b45a7f28ab76907 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md
@@ -1,15 +1,10 @@
# Polygon
-> **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
多边形绘制组件。
-
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polyline.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polyline.md
index cc23910962ceb39f2f8c4f2d92bd6fab2651dc77..cf2d0ea085fb49e14aaa9d59ac909af218ef2ba9 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polyline.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polyline.md
@@ -1,15 +1,10 @@
# Polyline
-> **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
折线绘制组件。
-
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md
index 1200e32be5267376ec5f02d0e12a7acf203f2526..53ff413ddd1793b97d0fec303564b28aa85fa857 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md
@@ -1,15 +1,10 @@
# Rect
-> **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
矩形绘制组件。
-
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md
index 0dd21b3fd1e4b733e923a3a4d489e8ec8bac8528..0d75477d8c16d9f8a7bc077977a849f874e93ff1 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-shape.md
@@ -1,21 +1,15 @@
# Shape
-> **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
绘制组件的父组件,父组件中会描述所有绘制组件均支持的通用属性。
1、绘制组件使用Shape作为父组件,实现类似SVG的效果。
-
2、绘制组件单独使用,用于在页面上绘制指定的图形。
-
-## 权限列表
-
-无
+> **说明:**
+>
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 子组件
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md b/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md
index c3cedbcfe3b530df362567af6fcc6f1e153b349a..ec4a119e6bfbcdc5c1546a063a793cc051c7109c 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md
@@ -9,10 +9,10 @@
| 接口名称 | 功能描述 |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
-| animateTo(value: [AnimationOptions](#animationoptions对象说明), event: ()=> void) : void | 提供全局animateTo显式动画接口来指定由于闭包代码导致的状态变化插入过渡动效。
event指定显示动效的闭包函数,在闭包函数中导致的状态变化系统会自动插入过渡动画。 |
+| animateTo(value: [AnimateParam](#animateparam对象说明), event: ()=> void) : void | 提供全局animateTo显式动画接口来指定由于闭包代码导致的状态变化插入过渡动效。
event指定显示动效的闭包函数,在闭包函数中导致的状态变化系统会自动插入过渡动画。 |
-## AnimationOptions对象说明
+## AnimateParam对象说明
| 名称 | 类型 | 描述 |
| -------- | -------- | -------- |
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-page-transition-animation.md b/zh-cn/application-dev/reference/arkui-ts/ts-page-transition-animation.md
index c9f180b3fbfe7d8d9b8af1156a0fb76ef1297bba..f1eea63ecb0523e02667525ff29a4fc0a6838d7e 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-page-transition-animation.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-page-transition-animation.md
@@ -1,61 +1,51 @@
# 页面间转场
-页面转场通过在全局pageTransition方法内配置页面入场组件和页面退场组件来自定义页面转场动效。
+在全局pageTransition方法内配置页面入场和页面退场时的自定义转场动效。
> **说明:**
+>
> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-| 名称 | 参数 | 参数描述 |
-| ------------------- | ------ | ------------------------------- |
-| PageTransitionEnter | Object | 页面入场组件,用于自定义当前页面的入场效果,详见动效参数说明。 |
-| PageTransitionExit | Object | 页面退场组件,用于自定义当前页面的退场效果,详见动效参数说明。 |
+| 名称 | 参数 | 参数描述 |
+| ------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
+| PageTransitionEnter | {
type: RouteType,
duration: number,
curve: Curve \| Curves,
delay: number
} | 设置当前页面的自定义入场动效。
- type:不配置时表明pop为push时效果的逆播。
- duration:动画的时长,单位为毫秒。
- curve:动画曲线,有效值参见[Curve](ts-animatorproperty.md) 。
默认值:Curve.Linear
- delay:动画延迟时长,单位为毫秒,默认不延迟播放。 |
+| PageTransitionExit | {
type: RouteType,
duration: number,
curve: Curve \| Curves,
delay: number
} | 设置当前页面的自定义退场动效。
- type:不配置时表明pop为push时效果的逆播
- duration:动画的时长,单位为毫秒。
- curve:动画曲线,有效值参见[Curve](ts-animatorproperty.md) 。
默认值:Curve.Linear
- delay:动画延迟时长,单位为毫秒,默认不延迟播放。 |
+## RouteType枚举说明
-- 动效参数说明
- | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
- | -------- | ------------------------- | ------ | ---- | ---------------------------------------- |
- | type | RouteType | - | 否 | 不配置时表明pop为push时效果的逆播。 |
- | duration | number | 1000 | 否 | 动画时长,单位为毫秒。 |
- | curve | Curve \| Curves | Linear | 否 | 动画曲线,有效值参见[Curve](ts-animatorproperty.md) 说明。 |
- | delay | number | 0 | 否 | 动画延迟时长,单位为毫秒,默认不延时播放。 |
-
-
-- RouteType枚举说明
- | 名称 | 描述 |
- | ---- | ---------------- |
- | Pop | 重定向指定页面。PageA跳转到PageB时,PageA为Exit+Push,PageB为Enter+Push。 |
- | Push | 跳转到下一页面。PageB返回至PageA时,PageA为Enter+Pop,PageB为Exit+Pop。 |
+| 名称 | 描述 |
+| ---- | ------------------------------------------------------------ |
+| Pop | 重定向指定页面。PageA跳转到PageB时,PageA为Exit+Push,PageB为Enter+Push。 |
+| Push | 跳转到下一页面。PageB返回至PageA时,PageA为Enter+Pop,PageB为Exit+Pop。 |
+| None | 页面未重定向。 |
## 属性
-PageTransitionEnter和PageTransitionExit组件支持的属性:
+| 参数名称 | 参数类型 | 必填 | 参数描述 |
+| --------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
+| slide | SlideEffect | 否 | 设置页面转场时的滑入滑出效果。
默认值:SlideEffect.Right |
+| translate | {
x? : number \| string,
y? : number \| string,
z? : number \| string
} | 否 | 设置页面转场时的平移效果,为入场时起点和退场时终点的值,和slide同时设置时默认生效slide。
- x:横向的平移距离。
- y:纵向的平移距离。
- z:竖向的平移距离。 |
+| scale | {
x? : number,
y? : number,
z? : number,
centerX? : number \| string,
centerY? : number \| string
} | 否 | 设置页面转场时的缩放效果,为入场时起点和退场时终点的值。
- x:横向放大倍数(或缩小比例)。
- y:纵向放大倍数(或缩小比例)。
- z:竖向放大倍数(或缩小比例)。
- centerX、centerY缩放中心点。
- 中心点为0时,默认的是组件的左上角。
|
+| opacity | number | 否 | 设置入场的起点透明度值或者退场的终点透明度值。
默认值:1 |
-| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
-| --------- | ---------------------------------------- | ----------------- | ---- | ---------------------------------------- |
-| slide | SlideEffect | SlideEffect.Right | 否 | 设置转场的滑入效果,有效值参见SlideEffect枚举说明。 |
-| translate | {
x? : number \| string,
y? : number \| string,
z? : number \| string
} | - | 否 | 设置页面转场时的平移效果,为入场时起点和退场时终点的值,和slide同时设置时默认生效slide。 |
-| scale | {
x? : number,
y? : number,
z? : number,
centerX? : number \| string,
centerY? : number \| string
} | - | 否 | 设置页面转场时的缩放效果,为入场时起点和退场时终点的值。 |
-| opacity | number | 1 | 否 | 设置入场的起点透明度值或者退场的终点透明度值。 |
+## SlideEffect枚举说明
-- SlideEffect枚举说明
- | 名称 | 描述 |
- | ------ | ------------------------- |
- | Left | 设置到入场时表示从左边滑入,出场时表示滑出到左边。 |
- | Right | 设置到入场时表示从右边滑入,出场时表示滑出到右边。 |
- | Top | 设置到入场时表示从上边滑入,出场时表示滑出到上边。 |
- | Bottom | 设置到入场时表示从下边滑入,出场时表示滑出到下边。 |
+| 名称 | 描述 |
+| ------ | ------------------------- |
+| Left | 设置到入场时表示从左边滑入,出场时表示滑出到左边。 |
+| Right | 设置到入场时表示从右边滑入,出场时表示滑出到右边。 |
+| Top | 设置到入场时表示从上边滑入,出场时表示滑出到上边。 |
+| Bottom | 设置到入场时表示从下边滑入,出场时表示滑出到下边。 |
## 事件
-PageTransitionEnter和PageTransitionExit组件支持的事件:
-
-| 事件 | 功能描述 |
-| ---------------------------------------- | ----------------------------------- |
-| onEnter(type: RouteType, progress: number) => void | 回调入参为当前入场动画的归一化进度[0 - 1]。 |
-| onExit(type: RouteType, progress: number) => void | 回调入参为当前退场动画的归一化进度[0 - 1]。 |
+| 事件 | 功能描述 |
+| ------------------------------------------------------------ | ------------------------------------------------------------ |
+| onEnter(event: (type: RouteType, progress: number) => void) | 回调入参为当前入场动画的归一化进度[0 - 1]。
- type:跳转方法。
- progress:当前进度。 |
+| onExit(event: (type: RouteType, progress: number) => void) | 回调入参为当前退场动画的归一化进度[0 - 1]。
- type:跳转方法。
- progress:当前进度。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-component.md b/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-component.md
index 3ed7aabe423694da748b107fad33179f3e22c857..73e24d762e8c7e72d8af223e99bca81afc0bede8 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-component.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-component.md
@@ -1,26 +1,28 @@
# 组件内转场
-组件转场主要通过transition属性进行配置转场参数,在组件插入和删除时进行过渡动效,主要用于容器组件子组件插入删除时提升用户体验(需要配合animateTo才能生效,动效时长、曲线、延时跟随animateTo中的配置)。
+组件内转场主要通过transition属性配置转场参数,在组件插入和删除时显示过渡动效,主要用于容器组件中的子组件插入和删除时,提升用户体验(需要配合[animateTo](ts-explicit-animation.md)才能生效,动效时长、曲线、延时跟随animateTo中的配置)。
> **说明:**
-> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
+>
+> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 属性
-| 名称 | 参数类型 | 默认值 | 参数描述 |
+| 名称 | 参数类型 | 参数描述 |
+| -------- | -------- | -------- |
+| transition | TransitionOptions | 所有参数均为可选参数,详细描述见TransitionOptions参数说明。 |
+
+## TransitionOptions参数说明
+
+| 参数名称 | 参数类型 | 必填 | 参数描述 |
| -------- | -------- | -------- | -------- |
-| transition | Object | - | 所有参数均为可选参数,详细描述见transition入参说明。 |
-
-- transition入参说明
- | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
- | -------- | -------- | -------- | -------- | -------- |
- | type | [TransitionType](ts-appendix-enums.md#transitiontype) | TransitionType.All | 否 | 默认包括组件新增和删除。
> **说明:**
> 不指定Type时说明插入删除使用同一种效果。 |
- | opacity | number | 1 | 否 | 设置组件转场时的透明度效果,为插入时起点和删除时终点的值。 |
- | translate | {
x? : number,
y? : number,
z? : number
} | - | 否 | 设置组件转场时的平移效果,为插入时起点和删除时终点的值。
-x:横向的平移距离。
-y:纵向的平移距离。
-z:竖向的平移距离。 |
- | scale | {
x? : number,
y? : number,
z? : number,
centerX? : number,
centerY? : number
} | - | 否 | 设置组件转场时的缩放效果,为插入时起点和删除时终点的值。
-x:横向放大倍数(或缩小比例)。
-y:纵向放大倍数(或缩小比例)。
-z:竖向放大倍数(或缩小比例)。
- centerX、centerY缩放中心点。
- 中心点为0时,默认的是组件的左上角。
|
- | rotate | {
x?: number,
y?: number,
z?: number,
angle?: Angle,
centerX?: Length,
centerY?: Length
} | - | 否 | 设置组件转场时的旋转效果,为插入时起点和删除时终点的值。
-x:横向的旋转向量。
-y:纵向的旋转向量。
-z:竖向的旋转向量。
- centerX,centerY指旋转中心点。
- 中心点为(0,0)时,默认的是组件的左上角。 |
+| type | [TransitionType](ts-appendix-enums.md#transitiontype) | 否 | 默认包括组件新增和删除。
默认值:TransitionType.All
**说明:**
不指定Type时说明插入删除使用同一种效果。 |
+| opacity | number | 否 | 设置组件转场时的透明度效果,为插入时起点和删除时终点的值。
默认值:1 |
+| translate | {
x? : number,
y? : number,
z? : number
} | 否 | 设置组件转场时的平移效果,为插入时起点和删除时终点的值。
-x:横向的平移距离。
-y:纵向的平移距离。
-z:竖向的平移距离。 |
+| scale | {
x? : number,
y? : number,
z? : number,
centerX? : number,
centerY? : number
} | 否 | 设置组件转场时的缩放效果,为插入时起点和删除时终点的值。
-x:横向放大倍数(或缩小比例)。
-y:纵向放大倍数(或缩小比例)。
-z:竖向放大倍数(或缩小比例)。
- centerX、centerY缩放中心点。
- 中心点为0时,默认的是组件的左上角。
|
+| rotate | {
x?: number,
y?: number,
z?: number,
angle?: Angle,
centerX?: Length,
centerY?: Length
} | 否 | 设置组件转场时的旋转效果,为插入时起点和删除时终点的值。
-x:横向的旋转向量。
-y:纵向的旋转向量。
-z:竖向的旋转向量。
- centerX,centerY指旋转中心点。
- 中心点为(0,0)时,默认的是组件的左上角。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-shared-elements.md b/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-shared-elements.md
index 98c94ba07fe153432bcbba1be13c0c41d0ca1265..62c664240b27b57982e3db85cfed4939589fb885 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-shared-elements.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-transition-animation-shared-elements.md
@@ -1,29 +1,23 @@
# 共享元素转场
-共享元素转场支持页面间的转场,如当前页面的图片转场至下一页面中。
+设置页面间转场时共享元素的转场动效。
> **说明:**
+>
> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 属性
-| 名称 | 参数 | 默认值 | 参数描述 |
-| ---------------- | ---------------------------------------- | ---- | ---------------------------------------- |
-| sharedTransition | id: string,
options?: Object | - | 两个页面的组件配置为同一个id,则转场过程中会进行共享元素转场,配置为空字符串时不会有共享元素转场效果。 |
-
-- options参数说明
- | 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
- | -------- | ------------------------- | ------ | ---- | --------------------- |
- | duration | number | 1000 | 否 | 单位为毫秒,默认动画时长为1000毫秒。 |
- | curve | Curve \| Curves | Linear | 否 | 默认曲线为线性,有效值参见Curve说明。 |
- | delay | number | 0 | 否 | 单位为毫秒,默认不延时播放。 |
+| 名称 | 参数 | 参数描述 |
+| ---------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
+| sharedTransition | id: string,
{
duration?: number,
curve?: Curve \| string,
delay?: number,
motionPath?:
{
path: string,
form?: number,
to?: number,
rotatable?: boolean
},
zIndex?: number,
type?: [SharedTransitionEffectType](ts-appendix-enums.md#sharedtransitioneffecttype)
} | 两个页面中id值相同且不为空字符串的组件即为共享元素,在页面转场时可显示共享元素转场动效。
- id:设置组件的id。
- duration:单位为毫秒,默认动画时长为1000毫秒。
- curve:默认曲线为Linear,有效值参见[Curve](ts-animatorproperty.md) 说明。
- delay:单位为毫秒,默认不延时播放。
- motionPath:运动路径信息。
- path:设置路径。
- from:设置起始值。
- to:设置终止值。
- rotatable:是否旋转。
- zIndex:设置Z轴。
- type:动画类型。 |
## 示例
-示例功能为两个页面,共享元素转场页面图片点击后转场至页面B的图片。
+ 示例代码为点击图片跳转页面时,显示共享元素图片的自定义转场动效。
```ts
// xxx.ets
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md
index bc6dbe171b151d5fa70693139f12fac733cb9ac8..0986e03f2b635f689bd5a699c095e34079edefb3 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-background.md
@@ -1,25 +1,21 @@
# 背景设置
-设置组件的背景色。
+设置组件的背景样式。
> **说明:**
-> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
-## 权限列表
-
-无
+>
+> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 属性
-| 名称 | 参数类型 | 默认值 | 描述 |
-| -------- | -------- | -------- | -------- |
-| backgroundColor | [ResourceColor](../../ui/ts-types.md) | - | 设置组件的背景色。 |
-| backgroundImage | src: [ResourceStr](../../ui/ts-types.md),
repeat?: [ImageRepeat](ts-appendix-enums.md#imagerepeat) | - | src参数:图片地址,支持网络图片资源和本地图片资源地址(不支持svg类型的图片)。
repeat参数:设置背景图片的重复样式,默认不重复。 |
-| backgroundImageSize | {
width?: Length,
height?: Length
} \| [ImageSize](ts-appendix-enums.md#imagesize) | Auto | 设置背景图像的高度和宽度。当输入为{width: Length, height: Length}对象时,如果只设置一个属性,则第二个属性保持图片原始宽高比进行调整。默认保持原图的比例不变。 |
-| backgroundImagePosition | {
x?: Length,
y?: Length
} \| [Alignment](ts-appendix-enums.md#alignment) | {
x: 0,
y: 0
} | 设置背景图在组件中显示位置。 |
+| 名称 | 参数类型 | 描述 |
+| -------- | -------- | -------- |
+| backgroundColor | [ResourceColor](../../ui/ts-types.md) | 设置组件的背景色。 |
+| backgroundImage | - src: [ResourceStr](../../ui/ts-types.md),
- repeat?: [ImageRepeat](ts-appendix-enums.md#imagerepeat) | src:图片地址,支持网络图片资源和本地图片资源地址(不支持svg类型的图片)。
repeat:设置背景图片的重复样式,默认不重复。 |
+| backgroundImageSize | {
width?: [Length](../../ui/ts-types.md#length),
height?: [Length](../../ui/ts-types.md#length)
} \| [ImageSize](ts-appendix-enums.md#imagesize) | 设置背景图像的高度和宽度。当输入为{width: Length, height: Length}对象时,如果只设置一个属性,则第二个属性保持图片原始宽高比进行调整。默认保持原图的比例不变。
默认值:ImageSize.Auto |
+| backgroundImagePosition | {
x?: [Length](../../ui/ts-types.md#length),
y?: [Length](../../ui/ts-types.md#length)
} \| [Alignment](ts-appendix-enums.md#alignment) | 设置背景图在组件中显示位置。
默认值:
{
x: 0,
y: 0
} |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-click.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-click.md
index bf3e92c02ec64393cf633b8861f68f15771e8447..6891a6f12b086f0a888e6cb17225d8fe140f43bd 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-click.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-click.md
@@ -3,12 +3,8 @@
设置组件是否可以响应点击事件、触摸事件等手指交互事件。
> **说明:**
-> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
-## 权限列表
-
-无
+>
+> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 属性
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-flex-layout.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-flex-layout.md
index d566eb04e49768ab3c54a3fd693e5364db21ce75..2aa5c67b0f1bb18376a486133bdc7d6aa607cca7 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-flex-layout.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-flex-layout.md
@@ -3,23 +3,18 @@
> **说明:**
> - 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
>
-> - 仅当父组件是Flex组件时生效。
-
-
-## 权限列表
-
-无
+> - 仅当父组件是 Flex、Column、Row 时生效。
## 属性
-| 名称 | 参数说明 | 默认值 | 描述 |
-| -------- | -------- | -------- | -------- |
-| flexBasis | 'auto' \| Length | 'auto' | 此属性所在的组件在Flex容器中主轴方向上基准尺寸。 |
-| flexGrow | number | 0 | Flex容器的剩余空间分配给此属性所在组件的比例。 |
-| flexShrink | number | 1 | Flex容器压缩尺寸分配给此属性所在组件的比例。 |
-| alignSelf | [ItemAlign](ts-appendix-enums.md#itemalign枚举说明) | Auto | 覆盖Flex布局容器中alignItems默认配置。 |
+| 名称 | 参数说明 | 描述 |
+| -------- | -------- | -------- |
+| flexBasis | number \| string | 设置组件在父容器主轴方向上的基准尺寸。
默认值:'auto'(表示组件在主轴方向上的基准尺寸为组件原本的大小) |
+| flexGrow | number | 设置父容器的剩余空间分配给此属性所在组件的比例。
默认值:0 |
+| flexShrink | number | 设置父容器压缩尺寸分配给此属性所在组件的比例。
默认值:1 |
+| alignSelf | [ItemAlign](ts-appendix-enums.md#itemalign) | 子组件在父容器交叉轴的对齐格式,覆盖Flex布局容器中alignItems默认配置。
默认值:ItemAlign.Auto |
## 示例
@@ -34,7 +29,7 @@ struct FlexExample {
Column({ space: 5 }) {
Text('flexBasis').fontSize(9).fontColor(0xCCCCCC).width('90%')
// 基于主轴基准尺寸
- // flexBasis()值可以是'auto'(默认值)元素本来的大小 ,如果是数字则类似于.width()/.height() ,基于主轴
+ // flexBasis()值可以是'auto',表示基准尺寸是元素本来的大小 ,也可以是长度设置,相当于.width()/.height()
Flex() {
Text('flexBasis(100)')
.flexBasis('100').height(100).lineHeight(70)
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md
index d677e345712d41e2fd13f6d5b3517f5be8058a3a..b301bcb2f3dda328ceb909b2d70bfe1f3e14f636 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-image-effect.md
@@ -76,3 +76,5 @@ struct ImageEffectsExample {
}
}
```
+
+
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md
index 2420c855d9ca1cc6c00ff298d718b1ec69e2f18b..739ce3e872594c160bd0aee9f52da360cb9960ad 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md
@@ -3,24 +3,21 @@
设置组件的对齐方式、布局方向和显示位置。
> **说明:**
-> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
-## 权限列表
-
-无
+>
+> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 属性
-| 名称 | 参数类型 | 默认值 | 描述 |
-| -------- | -------- | -------- | -------- |
-| align | [Alignment](ts-appendix-enums.md#alignment) | Center | 设置元素内容的对齐方式,只有当设置的width和height大小超过元素本身内容大小时生效。 |
-| direction | [Direction](ts-appendix-enums.md#direction) | Auto | 设置元素水平方向的布局,可选值参照Direction枚举说明。 |
-| position | {
x: Length,
y: Length
} | - | 使用绝对定位,设置元素锚点相对于父容器顶部起点偏移位置。在布局容器中,设置该属性不影响父容器布局,仅在绘制时进行位置调整。 |
-| markAnchor | {
x: Length,
y: Length
} | {
x: 0,
y: 0
} | 设置元素在位置定位时的锚点,以元素顶部起点作为基准点进行偏移。 |
-| offset | {
x: Length,
y: Length
} | {
x: 0,
y: 0
} | 相对布局完成位置坐标偏移量,设置该属性,不影响父容器布局,仅在绘制时进行位置调整。 |
+| 名称 | 参数类型 | 描述 |
+| -------- | -------- | -------- |
+| align | [Alignment](ts-appendix-enums.md#alignment) | 设置元素内容的对齐方式,只有当设置的width和height大小超过元素本身内容大小时生效。
默认值:Alignment.Center |
+| direction | [Direction](ts-appendix-enums.md#direction) | 设置元素水平方向的布局。
默认值:Direction.Auto |
+| position | {
x: [Length](../../ui/ts-types.md#length),
y: [Length](../../ui/ts-types.md#length)
} | 使用绝对定位,设置元素锚点相对于父容器顶部起点偏移位置。在布局容器中,设置该属性不影响父容器布局,仅在绘制时进行位置调整。 |
+| markAnchor | {
x: [Length](../../ui/ts-types.md#length),
y: [Length](../../ui/ts-types.md#length)
} | 设置元素在位置定位时的锚点,以元素顶部起点作为基准点进行偏移。
默认值:
{
x: 0,
y: 1
} |
+| offset | {
x: [Length](../../ui/ts-types.md#length),
y: [Length](../../ui/ts-types.md#length)
} | 相对布局完成位置坐标偏移量,设置该属性,不影响父容器布局,仅在绘制时进行位置调整。
默认值:
{
x: 0,
y: 1
} |
+| alignRules9+ | {
left?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
right?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
middle?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
top?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) };
bottom?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) };
center?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) }
} | 指定相对容器的对齐规则。
- left:设置左对齐参数。
- right:设置右对齐参数。
- middle:设置中间对齐的参数。
- top:设置顶部对齐的参数。
- bottom:设置底部对齐的参数。
- center:设置中心对齐的参数。
**说明:**
- anchor:设置作为锚点的组件的id值。
- align:设置相对于锚点组件的对齐方式。 |
## 示例
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md
index a5261c90b6ca33c821d856efd398b5d8311fd334..a9e87d40133f5cf24eb3768d15ff7c584654f01a 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md
@@ -3,28 +3,24 @@
为组件绑定弹出式菜单,弹出式菜单以垂直列表形式显示菜单项,可通过长按、点击或鼠标右键触发。
> **说明:**
-> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
-
-## 权限列表
-
-无
+>
+> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 属性
-| 名称 | 参数类型 | 默认值 | 描述 |
-| ---------------------------- | ---------------------------------------- | ---- | ---------------------------------- |
-| bindMenu | Array