** component. **Margin** is a shorthand attribute. You can specify the margins of the four edges in a unified manner or separately. The configuration method is as follows:
+ 1. To set the margins of the four edges in a unified manner, use the **Margin(Length)** format. For example, **margin(20)** indicates that the outer margins of the top, right, bottom, and left edges are all 20.
+ 2. To set the margins of the four edges separately, use the **{top?: Length, right?: Length, bottom?: Length, left?:Length}** format. For example, **margin({ left: 26, bottom: 17.4 })** indicates that the left margin is 26 and the bottom margin is 17.4.
```
@@ -163,7 +163,8 @@ In this section, we will develop an infographic food details page, by building c

-8. Adjust the structure between components and semanticize component names. Create the FoodDetail page entry component, create a column in **FoodDetail**, and set the alignment to **alignItems(HorizontalAlign.Center)**. Change the name of the MyComponent component to FoodImageDisplay, which is a child component of the FoodDetail component.
+8. Adjust the structure between components and semanticize component names. Create the FoodDetail page entry component, create a column in **FoodDetail**, and set the alignment to **alignItems(HorizontalAlign.Center)**. Change the name of the **MyComponent** component to **FoodImageDisplay**, which is a child component of the **FoodDetail** component.
+
A column is a container component whose child components are vertically arranged. It is a linear layout in essence. Therefore, only the alignment in the cross axis direction can be set.
@@ -239,10 +240,11 @@ You can use the Flex layout to build a food composition table. In this way you d
```
2. Create a Flex component to display two food composition categories in the tomato: Calories and Nutrition.
- Calories contains information about calories. Nutrition contains information about protein, fat, carbohydrates, and vitamin C.
-
- Create the Calories class. Create a Flex component and set its height to 280, and the top, right, and left margins to 30. The Flex component contains three Text child components, which represent the category name (Calories), content name (Calories), and contain value (17 kcal), respectively. By default, child components in the Flex component are arranged horizontally.
-
+
+Calories contains information about calories. Nutrition contains information about protein, fat, carbohydrates, and vitamin C.
+
+Create the Calories class. Create a Flex component and set its height to 280, and the top, right, and left margins to 30. The Flex component contains three Text child components, which represent the category name (Calories), content name (Calories), and contain value (17 kcal), respectively. By default, child components in the Flex component are arranged horizontally.
+
In the following example, code of FoodImageDisplay is omitted, and only code of ContentTable is provided.
@@ -279,7 +281,7 @@ You can use the Flex layout to build a food composition table. In this way you d

-3. Adjust the layout and set the proportion (layoutWeight) of each part. Set the proportion of the category name to 1, and the total proportion of content name and content value to **2**. The content name and content value are in a same Flex, and the content name occupies all remaining space flexGrow(1).
+3. Adjust the layout and set the proportion (layoutWeight) of each part. Set the proportion of the category name to **1**, and the total proportion of content name and content value to **2**. The content name and content value are in a same Flex, and the content name occupies all remaining space flexGrow(1).
```
@Component
@@ -336,6 +338,7 @@ You can use the Flex layout to build a food composition table. In this way you d

4. Create the **Nutrient** class in a similar process. Nutrition consists of four parts: Protein, Fat, Carbohydrates, and VitaminC. The names of the last three parts are omitted in the table and represented by spaces.
+
Set **FlexDirection.Column**, **FlexAlign.SpaceBetween**, and **ItemAlign.Start**.
@@ -467,7 +470,7 @@ You can use the Flex layout to build a food composition table. In this way you d
}
```
- When the IngredientItem API is called in the build method of ContentTable, this needs to be used to invoke the method in the scope of the component to distinguish the global method call.
+When the ` IngredientItem` API is called in the build method of ContentTable, ` this ` needs to be used to invoke the method in the scope of the component to distinguish the global method call.
```
@@ -488,7 +491,7 @@ You can use the Flex layout to build a food composition table. In this way you d
}
```
- The overall code of the ContentTable component is as follows:
+The overall code of the ContentTable component is as follows:
```
@@ -537,6 +540,6 @@ You can use the Flex layout to build a food composition table. In this way you d
}
```
- 
+
You've learned how to build a simple food details page. Read on to learn how to define the page layout and connection.
diff --git a/en/application-dev/ui/ui-ts-layout-grid-container.md b/en/application-dev/ui/ui-ts-layout-grid-container.md
index da57f1c5846db8db5355259df7906acbbab83401..62c6762258110f519c9866165ea3007b9936fd41 100644
--- a/en/application-dev/ui/ui-ts-layout-grid-container.md
+++ b/en/application-dev/ui/ui-ts-layout-grid-container.md
@@ -12,17 +12,17 @@ To implement grid layout, the declarative paradigm provides the [GridContainer](
## Grid System
-The grid system works in terms of columns, margins, and gutters.
+The grid system works in terms of gutter, margin, and column.

-1. Gutters:
+1. Gutter:
Spacing between elements. You can define different clutter values for different device sizes as part of the overall grid layout specifications. For better results, make sure the gutter is not greater than the margin.
-2. Margins:
+2. Margin:
Spacing around an item in the grid container. You can define different margin values for different device sizes as part of the overall grid layout specifications.
-3. Columns:
+3. Column:
Main tool for positioning items in the grid layout. The grid container is divided into various numbers of columns based on the device size. The width per column is calculated based on the total number of columns while respecting the margin and clutter specifications.
diff --git a/en/application-dev/ui/ui-ts-layout-mediaquery.md b/en/application-dev/ui/ui-ts-layout-mediaquery.md
index 7fa8ff03fb2a023509e4ccc7e02685f28b5d046b..e448fb8fce7b3b90edb0bab5b607b326616ba779 100644
--- a/en/application-dev/ui/ui-ts-layout-mediaquery.md
+++ b/en/application-dev/ui/ui-ts-layout-mediaquery.md
@@ -15,11 +15,11 @@ Invoke the **mediaquery** API to set the media query condition and the callback,
First, import the mediaquery module, as shown below:
```
- import mediaquery from '@ohos.mediaquery'
+import mediaquery from '@ohos.mediaquery'
```
Then, use the **matchMediaSync** API to set the media query condition and save the returned listener, as shown below:
```
- listener = mediaquery.matchMediaSync('(orientation: landscape)')
+listener = mediaquery.matchMediaSync('(orientation: landscape)')
```
Finally, register the callback using the saved listener, and change the page layout or implement service logic in the callback. When the media query condition is matched, the callback is triggered. The sample code is as follows:
```
@@ -39,13 +39,13 @@ listener.on('change', onPortrait)
```
Examples are as follows:
-screen and (round-screen: true) // The query is valid when the device screen is round.
+ ` screen and (round-screen: true) ` // The query is valid when the device screen is round.
-(max-height: 800) // The query is valid when the height does not exceed 800.
+ ` (max-height: 800) ` // The query is valid when the height does not exceed 800.
-(height <= 800) // The query is valid when the height does not exceed 800.
+ ` (height <= 800) ` // The query is valid when the height does not exceed 800.
-screen and (device-type: tv) or (resolution < 2) // The query is valid only when all media features are true.
+ ` screen and (device-type: tv) or (resolution < 2) ` // The query is valid only when all media features are true.
### media-type
diff --git a/en/application-dev/website.md b/en/application-dev/website.md
index f861c1efd34f0b1e94c6ac5df6e8edd4330b0afc..0395b61b66797ddc7409bde4239fcb0d650a9fbb 100644
--- a/en/application-dev/website.md
+++ b/en/application-dev/website.md
@@ -22,8 +22,7 @@
- [Page Ability Development](ability/fa-pageability.md)
- [Service Ability Development](ability/fa-serviceability.md)
- [Data Ability Development](ability/fa-dataability.md)
- - [FA Widget Development](ability/fa-formability.md)
-
+ - [FA Widget Development](ability/fa-formability.md)
- Stage Model
- [Stage Model Overview](ability/stage-brief.md)
- [Ability Development](ability/stage-ability.md)
@@ -276,7 +275,9 @@
- Vibrator
- [Vibrator Overview](device/vibrator-overview.md)
- [Vibrator Development](device/vibrator-guidelines.md)
- -
+ - Update
+ - [Sample Server Overview](device/sample-server-overview.md)
+ - [Sample Server Development](device/sample-server-guidelines.md)
- Device Usage Statistics
- [Device Usage Statistics Overview](device-usage-statistics/device-usage-statistics-overview.md)
- [Device Usage Statistics Development](device-usage-statistics/device-usage-statistics-dev-guide.md)
@@ -294,10 +295,10 @@
- [Internationalization Overview](internationalization/international-overview.md)
- [Internationalization Development (intl)](internationalization/intl-guidelines.md)
- [Internationalization Development (i18n)](internationalization/i18n-guidelines.md)
- -
- - [Using Native APIs in Application Projects](napi/napi-guidelines.md)
+ - [OpenHarmony IDL Specifications and User Guide](IDL/idl-guidelines.md)
+ - Native APIs
+ - [Using Native APIs in Application Projects](napi/napi-guidelines.md)
- Tools
-
- [DevEco Studio (OpenHarmony) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md)
- Hands-On Tutorials
- [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md)
@@ -556,7 +557,6 @@
- [Built-in Enums](reference/arkui-ts/ts-appendix-enums.md)
- APIs
- Ability Framework
-
- [@ohos.ability.dataUriUtils](reference/apis/js-apis-DataUriUtils.md)
- [@ohos.ability.errorCode ](reference/apis/js-apis-ability-errorCode.md)
- [@ohos.ability.wantConstant](reference/apis/js-apis-ability-wantConstant.md)
@@ -598,35 +598,29 @@
- [PermissionRequestResult](reference/apis/js-apis-permissionrequestresult.md)
- [ProcessRunningInfo](reference/apis/js-apis-processrunninginfo.md)
- [ServiceExtensionContext](reference/apis/js-apis-service-extension-context.md)
-
- [shellCmdResult](reference/apis/js-apis-application-shellCmdResult.md)
- Common Event and Notification
-
- [@ohos.commonEvent](reference/apis/js-apis-commonEvent.md)
- [@ohos.events.emitter](reference/apis/js-apis-emitter.md)
- [@ohos.notification](reference/apis/js-apis-notification.md)
- [@ohos.reminderAgent](reference/apis/js-apis-reminderAgent.md)
- [EventHub](reference/apis/js-apis-eventhub.md)
- Bundle Management
-
- [@ohos.bundle](reference/apis/js-apis-Bundle.md)
- [@ohos.bundleState ](reference/apis/js-apis-deviceUsageStatistics.md)
- [@ohos.zlib](reference/apis/js-apis-zlib.md)
- UI Page
-
- [@ohos.animator](reference/apis/js-apis-animator.md)
- [@ohos.mediaquery](reference/apis/js-apis-mediaquery.md)
- [@ohos.prompt](reference/apis/js-apis-prompt.md)
- [@ohos.router](reference/apis/js-apis-router.md)
- Graphics
-
- [@ohos.display ](reference/apis/js-apis-display.md)
- [@ohos.screenshot](reference/apis/js-apis-screenshot.md)
- [@ohos.window](reference/apis/js-apis-window.md)
- [webgl](reference/apis/js-apis-webgl.md)
- [webgl2](reference/apis/js-apis-webgl2.md)
- Media
-
- [@ohos.multimedia.audio](reference/apis/js-apis-audio.md)
- [@ohos.multimedia.camera](reference/apis/js-apis-camera.md)
- [@ohos.multimedia.image](reference/apis/js-apis-image.md)
@@ -637,32 +631,26 @@
- [@ohos.intl](reference/apis/js-apis-intl.md)
- [@ohos.resourceManager](reference/apis/js-apis-resource-manager.md)
- Resource Scheduling
-
- [@ohos.backgroundTaskManager](reference/apis/js-apis-backgroundTaskManager.md)
- [@ohos.workScheduler ](reference/apis/js-apis-workScheduler.md)
- [@ohos.WorkSchedulerExtensionAbility](reference/apis/js-apis-WorkSchedulerExtensionAbility.md)
- Custom Management
-
- [@ohos.configPolicy](reference/apis/js-apis-config-policy.md)
- [@ohos.enterpriseDeviceManager](reference/apis/js-apis-enterprise-device-manager.md)
- Security
-
- [@ohos.abilityAccessCtrl](reference/apis/js-apis-abilityAccessCtrl.md)
- [@ohos.security.huks ](reference/apis/js-apis-huks.md)
- [@ohos.userIAM.userAuth ](reference/apis/js-apis-useriam-userauth.md)
- [@system.cipher](reference/apis/js-apis-system-cipher.md)
- Data Management
-
- [@ohos.data.dataAbility ](reference/apis/js-apis-data-ability.md)
- [@ohos.data.distributedData](reference/apis/js-apis-distributed-data.md)
- [@ohos.data.distributedDataObject](reference/apis/js-apis-data-distributedobject.md)
- [@ohos.data.preferences](reference/apis/js-apis-data-preferences.md)
- [@ohos.data.rdb](reference/apis/js-apis-data-rdb.md)
- - [@ohos.settings](reference/apis/js-apis-settings.md)
-
- - [resultSet](reference/apis/js-apis-data-resultset.md)
+ - [@ohos.settings](reference/apis/js-apis-settings.md)
+ - [resultSet](reference/apis/js-apis-data-resultset.md)
- File Management
-
- [@ohos.document](reference/apis/js-apis-document.md)
- [@ohos.environment](reference/apis/js-apis-environment.md)
- [@ohos.fileio](reference/apis/js-apis-fileio.md)
@@ -670,8 +658,7 @@
- [@ohos.statfs](reference/apis/js-apis-statfs.md)
- [@ohos.storageStatistics](reference/apis/js-apis-storage-statistics.md)
- [@ohos.volumeManager](reference/apis/js-apis-volumemanager.md)
- - Telephony Service
-
+ - Telephony
- [@ohos.contact](reference/apis/js-apis-contact.md)
- [@ohos.telephony.call](reference/apis/js-apis-call.md)
- [@ohos.telephony.observer](reference/apis/js-apis-observer.md)
@@ -686,14 +673,12 @@
- [@ohos.net.socket](reference/apis/js-apis-socket.md)
- [@ohos.net.webSocket](reference/apis/js-apis-webSocket.md)
- Connectivity
-
- [@ohos.bluetooth](reference/apis/js-apis-bluetooth.md)
- [@ohos.connectedTag](reference/apis/js-apis-connectedTag.md)
- [@ohos.rpc](reference/apis/js-apis-rpc.md)
- [@ohos.wifi](reference/apis/js-apis-wifi.md)
- [@ohos.wifiext](reference/apis/js-apis-wifiext.md)
- Basic Features
-
- [@ohos.accessibility](reference/apis/js-apis-accessibility.md)
- [@ohos.faultLogger](reference/apis/js-apis-faultLogger.md)
- [@ohos.hiAppEvent](reference/apis/js-apis-hiappevent.md)
@@ -710,7 +695,6 @@
- [@ohos.wallpaper](reference/apis/js-apis-wallpaper.md)
- [Timer](reference/apis/js-apis-timer.md)
- Device Management
-
- [@ohos.batteryInfo ](reference/apis/js-apis-battery-info.md)
- [@ohos.brightness](reference/apis/js-apis-brightness.md)
- [@ohos.deviceInfo](reference/apis/js-apis-device-info.md)
@@ -729,12 +713,10 @@
- [@ohos.usb](reference/apis/js-apis-usb.md)
- [@ohos.vibrator](reference/apis/js-apis-vibrator.md)
- Account Management
-
- [@ohos.account.appAccount](reference/apis/js-apis-appAccount.md)
- [@ohos.account.distributedAccount](reference/apis/js-apis-distributed-account.md)
- [@ohos.account.osAccount](reference/apis/js-apis-osAccount.md)
- Language Base Class Library
-
- [@ohos.convertxml](reference/apis/js-apis-convertxml.md)
- [@ohos.process](reference/apis/js-apis-process.md)
- [@ohos.uri](reference/apis/js-apis-uri.md)
@@ -760,7 +742,6 @@
- [@ohos.application.testRunner](reference/apis/js-apis-testRunner.md)
- [@ohos.uitest](reference/apis/js-apis-uitest.md)
- APIs No Longer Maintained
-
- [@ohos.bytrace](reference/apis/js-apis-bytrace.md)
- [@ohos.data.storage](reference/apis/js-apis-data-storage.md)
- [@system.app](reference/apis/js-apis-system-app.md)
diff --git a/en/contribute/code-contribution.md b/en/contribute/code-contribution.md
index 745343f109f954238b11df0c1eafa20594550176..4c340a50ad319bdb122658d6f6bfea7c034de72d 100644
--- a/en/contribute/code-contribution.md
+++ b/en/contribute/code-contribution.md
@@ -29,7 +29,6 @@ For details, see [Contribution Process](contribution-process.md).
## Security Issue Disclosure
- [Security Issue Handling and Release Processes](https://gitee.com/openharmony/security/blob/master/en/security-process/README.md)
-
- [OpenHarmony Security Vulnerability Notice](https://gitee.com/openharmony/security/blob/master/en/security-process/security-disclosure.md)
diff --git a/en/device-dev/Readme-EN.md b/en/device-dev/Readme-EN.md
index 2e69d001546138f62485054ac99131acaa9a4151..da79e395fe463e47d3606de98f799e3e306d3b0e 100644
--- a/en/device-dev/Readme-EN.md
+++ b/en/device-dev/Readme-EN.md
@@ -43,10 +43,10 @@
- [Mini- and Small-System Devices](guide/device-lite.md)
- [Standard-System Devices](guide/device-standard.md)
- Debugging
- - [Test](subsystems/subsys-testguide-test.md)
+ - [Test Case Development](subsystems/subsys-testguide-test.md)
- [R&D Tools](subsystems/subsys-toolchain.md)
- XTS Certification
- - [XTS](subsystems/subsys-xts-guide.md)
+ - [XTS Test Case Development](subsystems/subsys-xts-guide.md)
- Tools
- [Docker Environment](get-code/gettools-acquire.md)
- [IDE](get-code/gettools-ide.md)
diff --git a/en/device-dev/driver/driver-peripherals-pinauth-des.md b/en/device-dev/driver/driver-peripherals-pinauth-des.md
index 85ea44728678ac23169513ebc96018457d06754f..22a619ae00057269f1adf025c14c86bc1544095f 100644
--- a/en/device-dev/driver/driver-peripherals-pinauth-des.md
+++ b/en/device-dev/driver/driver-peripherals-pinauth-des.md
@@ -4,16 +4,16 @@
### Function
-Personal Identification Number (PIN) authentication provides user authentication capabilities and applies to identity authentication scenarios, such as device unlocking, payment, and app logins. After a user registers a PIN, the PIN authentication (pin_auth) module unlocks the device only when a correct PIN is entered. The figure below shows the architecture of PIN authentication.
+Personal Identification Number (PIN) authentication provides user authentication capabilities in identity authentication scenarios, such as device unlocking, payment, and app logins. After a user registers a PIN, the PIN authentication (pin_auth) module unlocks the device only when a correct PIN is entered. The figure below shows the architecture of PIN authentication.
-The pin_auth driver is developed based on the Hardware Driver Foundation (HDF). The pin_auth driver model shields hardware differences and provides stable PIN authentication capabilities for the user IAM framework(UserIAM) and PIN authentication system ability (SA). The PIN authentication capabilities include obtaining the PIN authentication executor list, executor information, anti-brute force information of the specified template, comparing the template list of the executor and that of UserIAM, enrolling or deleting PINs, and performing PIN authentication.
+The pin_auth driver is developed based on the Hardware Driver Foundation (HDF). The pin_auth driver model shields hardware differences and provides stable PIN authentication capabilities for the user IAM framework(UserIAM) and PIN authentication system ability (SA). The PIN authentication capabilities include obtaining the PIN authentication executor list, executor information, and anti-brute force information of the specified template, comparing the template list of the executor and that of UserIAM, enrolling or deleting PINs, and performing PIN authentication.
**Figure 1** PIN authentication architecture

### Basic Concepts
-The identity authentication consists of UserIAM and basic authentication services (including PIN authentication and facial recognition). It supports basic functions such as setting and deleting user credentials, deletion, and performing authentication.
+The identity authentication consists of UserIAM and basic authentication services (including PIN authentication and facial recognition). It supports basic functions such as setting and deleting user credentials, and performing authentication.
- Executor
@@ -37,7 +37,7 @@ The identity authentication consists of UserIAM and basic authentication service
- UserIAM public key & executor public key
- To ensure user data security and authentication result accuracy, measures must be taken to protect the integrity of the key information exchanged between UserIAM and basic authentication services. Public keys need to be exchanged when the executor provided by a basic authentication service interworks with UserIAM.
+ To ensure user data security and authentication result accuracy, measures must be taken to protect the integrity of the key information exchanged between UserIAM and basic authentication services. Public keys must be exchanged when the executor provided by a basic authentication service interworks with UserIAM.
- The executor uses the UserIAM public key to verify the scheduling instruction.
@@ -50,7 +50,7 @@ The identity authentication consists of UserIAM and basic authentication service
- Data verification by the executor
- UserIAM manages the mappings between user identities and credential IDs in a unified manner. When connecting to UserIAM, the executor obtains the template ID list from UserIAM, compares its template ID list with the template ID list obtained, and updates its template ID list accordingly.
+ UserIAM manages the mappings between user identities and credential IDs in a unified manner. When connecting to UserIAM, the executor obtains the template ID list from UserIAM, and updates its template ID list based on the obtained template ID list.
### Working Principles
@@ -65,7 +65,7 @@ PIN authentication must be implemented in a TEE, and the confidential informatio
## Development Guidelines
### When to Use
-The pin_auth driver provides basic capabilities of PIN authentication for the UserIAM and pin_auth service to ensure successful PIN authentication.
+The pin_auth driver provides basic PIN authentication capabilities for the UserIAM and pin_auth service to ensure successful PIN authentication.
### Available APIs
@@ -499,7 +499,7 @@ The development procedure is as follows:
return HDF_SUCCESS;
}
- // Cancel the operation of the specified scheduleId.
+ // Cancel the operation based on the specified scheduleId.
int32_t ExecutorImpl::Cancel(uint64_t scheduleId)
{
IAM_LOGI("start");
diff --git a/en/device-dev/driver/driver-peripherals-touch-des.md b/en/device-dev/driver/driver-peripherals-touch-des.md
index 4f2a3428a67794eff0fb557d6386c7be111e5f11..84b4929ef27b5524c88c217722abafd44282c75d 100644
--- a/en/device-dev/driver/driver-peripherals-touch-des.md
+++ b/en/device-dev/driver/driver-peripherals-touch-des.md
@@ -88,7 +88,7 @@ Perform the following steps:
1. Add the touchscreen driver-related descriptions.
- Currently, the input driver is developed based on the HDF and is loaded and started by the HDF. Register the driver information, such as whether to load the driver and the loading priority in the configuration file. Then, the HDF starts the registered driver modules one by one. For details about the driver configuration, see [How to Develop](driver-hdf-development.md#how-to-develop).
+ Currently, the input driver is developed based on the HDF and is loaded and started by the HDF. Register the driver information, such as whether to load the driver and the loading priority in the configuration file. Then, the HDF starts the registered driver modules one by one. For details about the driver configuration, see [How to Develop](driver-hdf-development.md).
2. Complete the board-level configuration and private data configuration of the touchscreen.
@@ -105,7 +105,7 @@ This example describes how to develop the touchscreen driver.
### Adding the Touchscreen Driver-related Description
-The information about modules of the input driver model is shown as follows and enables the HDF to load the modules in sequence. For details, see [Driver Development](driver-hdf-development.md).
+The information about modules of the input driver model is shown as follows and enables the HDF to load the modules in sequence. For details, see [Driver Development](driver-hdf-development.md).
```
input :: host {
diff --git a/en/device-dev/driver/driver-platform-adc-des.md b/en/device-dev/driver/driver-platform-adc-des.md
index 96f5fd9458881a7ec11702069977497ff274407a..14cd3630fbf47e4b61a436dc684792664f6410fb 100644
--- a/en/device-dev/driver/driver-platform-adc-des.md
+++ b/en/device-dev/driver/driver-platform-adc-des.md
@@ -5,10 +5,11 @@
An analog-to-digital converter (ADC) is a device that converts analog signals into digital signals.
The ADC APIs provide a set of common functions for ADC data transfer, including:
-- Opening or closing an ADC device
+- Opening or closing an ADC device
+
- Obtaining the analog-to-digital (AD) conversion result
- **Figure 1** ADC physical connection
+ **Figure 1** ADC physical connection

@@ -51,11 +52,11 @@ The ADC APIs provide a set of common functions for ADC data transfer, including:
### How to Use
-[Figure 2](#fig2) shows how an ADC device works.
+The figure below illustrates how to use the APIs.
+
+ **Figure 2** Using ADC driver APIs
- **Figure 2** How ADC works
-
-
+
### Opening an ADC Device
diff --git a/en/device-dev/driver/driver-platform-dac-des.md b/en/device-dev/driver/driver-platform-dac-des.md
index 8d55f1da22283d10b5d6a9e9a5f9707c0faa5968..45cd858317a5affefb3bb285322f73c92b0b380c 100644
--- a/en/device-dev/driver/driver-platform-dac-des.md
+++ b/en/device-dev/driver/driver-platform-dac-des.md
@@ -69,15 +69,15 @@ The table below describes the APIs of the DAC module. For more details, see API
| :------------------------------------------------------------| :------------ |
| DevHandle DacOpen(uint32_t number) | Opens a DAC device. |
| void DacClose(DevHandle handle) | Closes a DAC device. |
-| int32_t DacWrite(DevHandle handle, uint32_t channel, uint32_t val) | Sets the target DA value. |
+| int32_t DacWrite(DevHandle handle, uint32_t channel, uint32_t val) | Sets a target DA value. |
### How to Develop
-The figure below illustrates the process of using a DAC device.
+The figure below illustrates how to use the APIs.
-**Figure 2** Process of using a DAC device
-
-
+**Figure 2** Using DAC driver APIs
+
+
#### Opening a DAC Device
@@ -111,7 +111,7 @@ if (dacHandle == NULL) {
}
```
-#### Setting the Target DA Value
+#### Setting a Target DA Value
```
int32_t DacWrite(DevHandle handle, uint32_t channel, uint32_t val);
diff --git a/en/device-dev/driver/driver-platform-gpio-des.md b/en/device-dev/driver/driver-platform-gpio-des.md
index 78928d8de19810dd39585044c032badb00e4b34f..04a850623ec868bcfb94ec22c345959c783e4303 100644
--- a/en/device-dev/driver/driver-platform-gpio-des.md
+++ b/en/device-dev/driver/driver-platform-gpio-des.md
@@ -7,11 +7,11 @@ Generally, a general-purpose input/output \(GPIO\) controller manages all GPIO p
The GPIO APIs define a set of standard functions for performing operations on GPIO pins, including:
-- Setting the pin direction, which can be input or output \(High impedance is not supported currently.\)
+- Setting the pin direction, which can be input or output \(high impedance is not supported currently\)
- Reading and writing level values, which can be low or high
- Setting an interrupt service routine \(ISR\) function and interrupt trigger mode for a pin
-- Enabling or disabling a pin interrupt
+- Enabling or disabling interrupts for a pin
## Available APIs
@@ -64,17 +64,18 @@ The GPIO APIs define a set of standard functions for performing operations on GP
GpioEnableIrq
|
-Enables a GPIO interrupt.
+ | Enables GPIO interrupts for a pin.
|
GpioDisableIrq
|
-Disables a GPIO interrupt.
+ | Disables GPIO interrupts for a pin.
|
+
> **NOTE**
>All functions provided in this document can be called only in kernel mode.
@@ -82,22 +83,27 @@ The GPIO APIs define a set of standard functions for performing operations on GP
### How to Use
-The GPIO APIs use the GPIO pin number to specify a pin. [Figure 1](#fig16151101653713) shows the general process of using a GPIO.
+The GPIO APIs use the GPIO pin number to specify a pin. The figure below illustrates how to use the APIs.
+
+**Figure 1** Using GPIO driver APIs
+
+
-**Figure 1** Process of using a GPIO
-
+### Determining the GPIO Pin Number
-### Determining a GPIO Pin Number
+The method for converting GPIO pin numbers varies depending on the GPIO controller model, parameters, and controller driver of different system on chips \(SoCs\).
-The method for converting GPIO pin numbers varies according to the GPIO controller model, parameters, and controller driver of different system on chips \(SoCs\).
+- Hi3516DV300
-- Hi3516DV300
+ A controller manages 12 groups of GPIO pins. Each group contains 8 GPIO pins.
- A controller manages 12 groups of GPIO pins. Each group contains 8 GPIO pins.
+ GPIO pin number = GPIO group index x Number of GPIO pins in each group + Offset in the group
- GPIO pin number = GPIO group index \(0–11\) x Number of GPIO pins in each group \(8\) + Offset in the group
+ The group index ranges from 0 to 11.
- Example: GPIO number of GPIO10\_3 = 10 x 8 + 3 = 83
+ Example:
+
+ GPIO pin number of GPIO10\_3 = 10 x 8 + 3 = 83
- Hi3518EV300
@@ -105,14 +111,18 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
GPIO pin number = GPIO group index \(0–9\) x Number of GPIO pins in each group \(10\) + Offset in the group
- Example: GPIO pin number of GPIO7\_3 = 7 x 10 + 3 = 73
+ The group index ranges from 0 to 9.
+
+ Example:
+
+ GPIO pin number of GPIO7\_3 = 7 x 10 + 3 = 73
### Using APIs to Operate GPIO Pins
- Set the direction for a GPIO pin.
- Before performing read/write operations on a GPIO pin, call the following function to set the direction:
+ Before performing read/write operations on a GPIO pin, call **GpioSetDir**() to set the direction.
int32\_t GpioSetDir\(uint16\_t gpio, uint16\_t dir\);
@@ -141,12 +151,12 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
0
|
- Succeeded in setting the direction for a GPIO pin.
+ | The operation is successful.
|
Negative value
|
- Failed to set the direction for a GPIO pin.
+ | The operation failed.
|
@@ -155,7 +165,7 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
- Read or write the level value for a GPIO pin.
- To read the level value of a GPIO pin, call the following function:
+ Call **GpioRead**() to read the level value of a GPIO pin.
int32\_t GpioRead\(uint16\_t gpio, uint16\_t \*val\);
@@ -184,23 +194,24 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
0
|
- Succeeded in reading the level value.
+ | The operation is successful.
|
Negative value
|
- Failed to read the level value.
+ | The operation failed.
|
-
- To write the level value for a GPIO pin, call the following function:
-
+
+
+ Call **GpioWrite()** to write the level value for a GPIO pin.
+
int32\_t GpioWrite\(uint16\_t gpio, uint16\_t val\);
-
+
**Table 4** Description of GpioWrite
-
+
Parameter
|
@@ -224,19 +235,19 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
0
|
- Succeeded in writing the level value.
+ | The operation is successful.
|
Negative value
|
- Failed to write the level value.
+ | The operation failed.
|
-
+
Example:
-
+
```
int32_t ret;
uint16_t val;
@@ -265,7 +276,7 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
- Set the ISR function for a GPIO pin.
- To set the ISR function for a GPIO pin, call the following function:
+ Call **GpioSetIrq()** to set the ISR function for a GPIO pin.
int32\_t GpioSetIrq\(uint16\_t gpio, uint16\_t mode, GpioIrqFunc func, void \*arg\);
@@ -304,21 +315,21 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
0
|
- Succeeded in setting the ISR function for a GPIO pin.
+ | The operation is successful.
|
Negative value
|
- Failed to set the ISR function for a GPIO pin.
+ | The operation failed.
|
- > **CAUTION:**
+ > **CAUTION**
>Only one ISR function can be set for a GPIO pin at a time. If **GpioSetIrq** is called repeatedly, the previous IRS function will be replaced.
- If the ISR function is no longer required, call the following function to cancel the setting:
+ If the ISR function is no longer required, call **GpioUnSetIrq()** to cancel the setting.
int32\_t GpioUnSetIrq\(uint16\_t gpio\);
@@ -342,18 +353,18 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
0
|
- Succeeded in canceling the ISR function.
+ | The operation is successful.
|
Negative value
|
- Failed to cancel the ISR function.
+ | The operation failed.
|
- After the ISR function is set, call the following function to enable a GPIO interrupt:
+ After the ISR function is set, call **GpioEnableIrq()** to enable interrupts.
int32\_t GpioEnableIrq\(uint16\_t gpio\);
@@ -377,21 +388,21 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
0
|
- Succeeded in enabling a GPIO interrupt.
+ | The operation is successful.
|
Negative value
|
- Failed to enable a GPIO interrupt.
+ | The operation failed.
|
- > **CAUTION:**
+ > **CAUTION**
>The configured ISR function can be responded only after the GPIO interrupt is enabled.
- Use the following function to disable the GPIO interrupt:
+ Call **GpioDisableIrq()** to disable interrupts.
int32\_t GpioDisableIrq\(uint16\_t gpio\);
@@ -415,12 +426,12 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
0
|
- Succeeded in disabling a GPIO interrupt.
+ | The operation is successful.
|
Negative value
|
- Failed to disable a GPIO interrupt.
+ | The operation failed.
|
@@ -470,11 +481,15 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
## Usage Example
-In this example, we test the interrupt trigger of a GPIO pin as follows: Set the ISR function for the pin, set the trigger mode to rising edge and failing edge, write high and low levels to the pin alternately to generate level fluctuation, and observe the execution of the ISR function.
+The procedure is as follows:
+
+1. Select an idle GPIO pin.
+
+ This example uses pin GPIO10\_3 on a Hi3516D V300 development board as an example. The pin number is 83. You can select an idle GPIO pin as required.
-Select an idle GPIO pin. This example uses a Hi3516D V300 development board and GPIO pin GPIO10\_3, which is numbered GPIO83.
+2. Set the ISR function for the pin, with the trigger mode of rising edge and failing edge.
-You can select an idle GPIO pin based on the development board and schematic diagram.
+3. Write high and low levels to the pin alternately, and observe the execution of the ISR function.
```
#include "gpio_if.h"
diff --git a/en/device-dev/driver/driver-platform-i2c-des.md b/en/device-dev/driver/driver-platform-i2c-des.md
index 16b1d22f7a2f02985671934100642647f828ad8f..be20c1bf72268eb594a56f86ae55f6b7e4ae8d90 100644
--- a/en/device-dev/driver/driver-platform-i2c-des.md
+++ b/en/device-dev/driver/driver-platform-i2c-des.md
@@ -2,19 +2,20 @@
## Overview
-- The Inter-Integrated Circuit \(I2C\) is a simple, bidirectional, and synchronous serial bus that uses merely two wires.
-- In an I2C communication, one controller communicates with one or more devices through the serial data line \(SDA\) and serial clock line \(SCL\), as shown in [Figure 1](#fig1135561232714).
+The Inter-Integrated Circuit \(I2C\) is a simple, bidirectional, and synchronous serial bus that uses merely two wires.
-- I2C data transfer must begin with a **START** condition and end with a **STOP** condition. Data is transmitted byte-by-byte from the most significant bit to the least significant bit.
-- Each I2C node is recognized by a unique address and can serve as either a controller or a device. When the controller needs to communicate with a device, it writes the device address to the bus through broadcast. A device matching this address sends a response to set up a data transfer channel.
+In an I2C communication, one controller communicates with one or more devices through the serial data line \(SDA\) and serial clock line \(SCL\), as shown in [Figure 1](#fig1135561232714).
-- The I2C APIs define a set of common functions for I2C data transfer, including:
+I2C data transfer must begin with a **START** condition and end with a **STOP** condition. Data is transmitted byte-by-byte from the most significant bit to the least significant bit.
- - I2C controller management: opening or closing an I2C controller
- - I2C message transfer: custom transfer by using a message array
+Each I2C node is recognized by a unique address and can serve as either a controller or a device. When the controller needs to communicate with a device, it writes the device address to the bus through broadcast. A device matching this address sends a response to set up a data transfer channel.
- **Figure 1** Physical connection diagram for I2C
- 
+The I2C APIs define a set of common functions for I2C data transfer, including:
+
+- I2C controller management: opening or closing an I2C controller
+- I2C message transfer: custom transfer by using a message array
+
+**Figure 1** Physical connection diagram for I2C

## Available APIs
@@ -52,21 +53,22 @@
-> **NOTE:**
+> **NOTE**
>All functions provided in this document can be called only in kernel mode.
## Usage Guidelines
### How to Use
-[Figure 2](#fig183017194234) illustrates the process of an I2C device.
+The figure below illustrates how to use the APIs.
-**Figure 2** Process of using an I2C device
-
+**Figure 2** Using I2C driver APIs
+
+
### Opening an I2C Controller
-Call the following function to open an I2C controller:
+Call the **I2cOpen()** function to open an I2C controller.
DevHandle I2cOpen\(int16\_t number\);
@@ -117,7 +119,7 @@ if (i2cHandle == NULL) {
### Performing I2C Communication
-Use the following function for message transfer:
+Call the **I2cTransfer()** function to transfer messages.
int32\_t I2cTransfer\(DevHandle handle, struct I2cMsg \*msgs, int16\_t count\);
@@ -186,15 +188,14 @@ if (ret != 2) {
}
```
-> **CAUTION:**
+> **CAUTION**
>- The device address in the **I2cMsg** structure does not contain the read/write flag bit. The read/write information is transferred by the read/write control bit in the member variable **flags**.
->- The **I2cTransfer** function does not limit the number of message structures, which is determined by the I2C controller.
->- The **I2cTransfer** function does not limit the data length of each message structure, which is determined by the I2C controller.
+>- The **I2cTransfer** function does not limit the number of message structures and the data length of each message structure, which are determined by the I2C controller.
>- The **I2cTransfer** function may cause the system to sleep and therefore cannot be called in the interrupt context.
### Closing an I2C Controller
-Call the following function to close the I2C controller after the communication is complete:
+Call the **I2cClose()** function to close the I2C controller after the communication is complete.
void I2cClose\(DevHandle \*handle\);
@@ -209,12 +210,13 @@ void I2cClose\(DevHandle \*handle\);
handle
|
-Handle of an I2C controller.
+ | Handle of the I2C controller to close.
|
+
```
I2cClose(i2cHandle); /* Close the I2C controller. */
```
@@ -233,7 +235,7 @@ This example shows a simple register read/write operation on TouchPad on a Hi351
In this example, first we reset Touch IC. \(The development board supplies power to Touch IC by default after being powered on, and this use case does not consider the power supply\). Then, we perform a read/write operation on an internal register to test whether the I2C channel is normal.
-> **NOTE:**
+> **NOTE**
>The example focuses on I2C device access and verifies the I2C channel. The read and write values of the device register are not concerned. The behavior caused by the read and write operations on the register is determined by the device itself.
Example:
diff --git a/en/device-dev/driver/driver-platform-mipicsi-des.md b/en/device-dev/driver/driver-platform-mipicsi-des.md
index cd877612d26e3451d2ca57a4d3929c9f14fa6547..90a319f03db175e2019cc71d32130492077d63b9 100644
--- a/en/device-dev/driver/driver-platform-mipicsi-des.md
+++ b/en/device-dev/driver/driver-platform-mipicsi-des.md
@@ -59,12 +59,11 @@ The figure below shows a simplified CSI. The D-PHY transmits data by using one p
### How to Use
-The figure below shows the process of using a MIPI CSI device.
+The figure below illustrates how to use the APIs.
-**Figure 2** MIPI CSI usage process
+**Figure 2** Using MIPI CSI driver APIs
-
-
+
### Opening the MIPI CSI Controller Operation Handle
diff --git a/en/device-dev/driver/driver-platform-mipidsi-des.md b/en/device-dev/driver/driver-platform-mipidsi-des.md
index 3845f8078cbba3d796b8a9061158eef306360aba..889a4ff840d65c67a4bc2ffbf47cc91667bed38c 100644
--- a/en/device-dev/driver/driver-platform-mipidsi-des.md
+++ b/en/device-dev/driver/driver-platform-mipidsi-des.md
@@ -1,6 +1,6 @@
-# MIPI DSI
+# MIPI DSI
-## Overview
+## Overview
The Display Serial Interface \(DSI\) is a specification stipulated by the Mobile Industry Processor Interface \(MIPI\) Alliance, aiming to reduce the cost of display controllers in a mobile device. It defines a serial bus and communication protocol among the host, the source of image data, and the target device. In this way, the DSI can send pixel data or commands to peripherals \(usually LCDs or similar display devices\) in serial mode, or reads information such as status and pixel from the peripherals.
@@ -11,7 +11,7 @@ MIPI DSI is capable of working in both high speed \(HS\) mode and low power \(LP

-## Available APIs
+## Available APIs
**Table 1** APIs for MIPI DSI
@@ -75,17 +75,17 @@ MIPI DSI is capable of working in both high speed \(HS\) mode and low power \(LP
-> **NOTE**
->All functions described in this document can be called only in kernel space.
+> **NOTE**
All functions described in this document can be called only in kernel space.
-## Usage Guidelines
+## Usage Guidelines
-### How to Use
+### How to Use
-[Figure 2](#fig129103491241) shows the process of using a MIPI DSI device.
+The figure below illustrates how to use the APIs.
-**Figure 2** Process of using a MIPI DSI device
-
+**Figure 2** Using MIPI DSI driver APIs
+
+ 
### Obtaining a MIPI DSI Device Handle
diff --git a/en/device-dev/driver/driver-platform-pin-des.md b/en/device-dev/driver/driver-platform-pin-des.md
index fe73cbd7cb9933bad74359070642bb26c5643c46..607807085a5334b9b975e840c44406ad3992ad06 100644
--- a/en/device-dev/driver/driver-platform-pin-des.md
+++ b/en/device-dev/driver/driver-platform-pin-des.md
@@ -68,10 +68,11 @@ The table below describes the APIs of the pin module. For more details, see API
### How to Develop
-The figure below shows the process.
+The figure below illustrates how to use the APIs.
- **Figure 2** Process of using the pin module
-
+ **Figure 2** Using the pin driver APIs
+
+
#### Obtaining the Pin Description Handle
@@ -122,7 +123,7 @@ int32_t PinSetPull(DevHandle handle, enum PinPullType pullType);
| pullType | Pull type to set. |
| **Return Value**| **Description** |
| 0 | The operation is successful.|
-| Negative value | The operation fails.|
+| Negative value | The operation failed.|
Example: Set the pull type to pull-up.
@@ -156,7 +157,7 @@ int32_t PinGetPull(DevHandle handle, enum PinPullType *pullType);
| pullType | Pointer to the pull type obtained.|
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
Example: Obtain the pull type of a pin.
@@ -189,7 +190,7 @@ int32_t PinSetStrength(DevHandle handle, uint32_t strength);
| strength | Pull strength to set. |
| **Return Value**| **Description** |
| 0 | The operation is successful.|
-| Negative value | The operation fails.|
+| Negative value | The operation failed.|
Example: Set the pull strength of the pin to 2.
@@ -223,7 +224,7 @@ int32_t PinGetStrength(DevHandle handle, uint32_t *strength);
| strength | Pointer to the pull strength obtained.|
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
Example: Obtain the pull strength of a pin.
@@ -258,7 +259,7 @@ int32_t PinSetFunc(DevHandle handle, const char *funcName);
| funcName | Pointer to the pin function to set. |
| **Return Value**| **Description** |
| 0 | The operation is successful.|
-| Negative value | The operation fails.|
+| Negative value | The operation failed.|
Example: Set the pin function to LSADC_CH1 (ADC channel 1).
@@ -291,7 +292,7 @@ int32_t PinGetFunc(DevHandle handle, const char **funcName);
| funcName | Pointer to the function name obtained.|
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
Example: Obtain the pin function.
diff --git a/en/device-dev/driver/driver-platform-pwm-des.md b/en/device-dev/driver/driver-platform-pwm-des.md
index c87a2deeb1ef03fbd2f1c309bc04cfbf539d69bc..6330ccc91b558b134b46f5d0f8cea867823466e7 100644
--- a/en/device-dev/driver/driver-platform-pwm-des.md
+++ b/en/device-dev/driver/driver-platform-pwm-des.md
@@ -48,11 +48,11 @@ Pulse width modulation (PWM) is a technology that digitally encodes analog signa
### How to Use
-The figure below shows the general process of using the PWM.
+The figure below illustrates how to use the APIs.
- **Figure 1** Process of using the PWM module
+**Figure 1** Using the PWM driver APIs
-
+
### Opening a PWM Device Handle
@@ -71,7 +71,7 @@ DevHandle PwmOpen(uint32_t num);
| num | PWM device number. |
| **Return Value** | **Description** |
| handle | Handle of the PWM device obtained.|
-| NULL | The operation fails. |
+| NULL | The operation failed. |
Example: Open the device handle of PWM device 0.
@@ -126,7 +126,7 @@ int32_t PwmEnable(DevHandle handle);
| handle | PWM device handle. |
| **Return Value** | **Description** |
| 0 | The operation is successful. |
-| Negative number | The operation fails. |
+| Negative number | The operation failed. |
```
@@ -156,7 +156,7 @@ int32_t PwmDisable(DevHandle handle);
| handle | PWM device handle. |
| **Return Value** | **Description** |
| 0 | The operation is successful. |
-| Negative number | The operation fails. |
+| Negative number | The operation failed. |
```
@@ -187,7 +187,7 @@ int32_t PwmSetPeriod(DevHandle handle, uint32_t period);
| period | PWM period to set, in ns.|
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative number | The operation fails. |
+| Negative number | The operation failed. |
```
@@ -218,7 +218,7 @@ int32_t PwmSetDuty(DevHandle handle, uint32_t duty);
| duty | Time that the signal is in the ON state, in ns.|
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative number | The operation fails. |
+| Negative number | The operation failed. |
```
@@ -249,7 +249,7 @@ int32_t PwmSetPolarity(DevHandle handle, uint8_t polarity);
| polarity | Polarity to set, which can be **PWM\_NORMAL\_POLARITY** or **PWM\_INVERTED\_POLARITY**.|
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative number | The operation fails. |
+| Negative number | The operation failed. |
```
@@ -280,7 +280,7 @@ int32_t PwmSetConfig(DevHandle handle, struct PwmConfig *config);
| \*config | Pointer to PWM parameters. |
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative number | The operation fails. |
+| Negative number | The operation failed. |
```
@@ -317,7 +317,7 @@ int32_t PwmGetConfig(DevHandle handle, struct PwmConfig *config);
| \*config | Pointer to PWM parameters. |
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative number | The operation fails. |
+| Negative number | The operation failed. |
```
diff --git a/en/device-dev/driver/driver-platform-regulator-des.md b/en/device-dev/driver/driver-platform-regulator-des.md
index 0131dae05046bd67c73b0cd625e9cf203f79b6d5..eacf890176325fdfbb8aa9c49ce7c612ed3fdaaa 100644
--- a/en/device-dev/driver/driver-platform-regulator-des.md
+++ b/en/device-dev/driver/driver-platform-regulator-des.md
@@ -42,7 +42,8 @@ The regulator module is divided into the following layers:
- The core layer provides the capabilities of binding, initializing, and releasing devices.
- The adaptation layer implements other functions.
-NOTE
The core layer can call the functions of the interface layer and uses the hook to call functions of the adaptation layer. In this way, the adaptation layer can indirectly call the functions of the interface layer, but the interface layer cannot call the functions of the adaptation layer.
+>  **NOTE**
+> The core layer can call the functions of the interface layer and uses the hook to call functions of the adaptation layer. In this way, the adaptation layer can indirectly call the functions of the interface layer, but the interface layer cannot call the functions of the adaptation layer.
**Figure 1** Unified service mode
@@ -84,11 +85,11 @@ Regulators are used to:
During the OS startup process, the driver management module loads the regulator driver based on the configuration file. Then, the regulator driver detects the regulator devices and initializes the driver.
-The figure below illustrates the process of using a regulator.
+The figure below illustrates how to use the APIs.
-**Figure 2** Process of using a regulator
+**Figure 2** Using regulator driver APIs
-
+
#### Opening a Regulator Device Handle
@@ -105,7 +106,7 @@ DevHandle RegulatorOpen(const char *name);
| name | Name of the target regulator. |
| **Return Value**| **Description** |
| handle | The regulator device handle is returned if the operation is successful.|
-| NULL | The operation fails. |
+| NULL | The operation failed. |
@@ -155,7 +156,7 @@ int32_t RegulatorEnable(DevHandle handle);
| handle | Device handle of the target regulator.|
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
@@ -184,7 +185,7 @@ int32_t RegulatorDisable(DevHandle handle);
| handle | Device handle of the target regulator.|
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
```
int32_t ret;
@@ -212,7 +213,7 @@ int32_t RegulatorForceDisable(DevHandle handle);
| handle | Device handle of the target regulator.|
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
```
int32_t ret;
@@ -241,7 +242,7 @@ int32_t RegulatorSetVoltage(DevHandle handle, uint32_t minUv, uint32_t maxUv);
| maxUv | Maximum voltage to set. |
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
```
int32_t ret;
@@ -272,7 +273,7 @@ int32_t RegulatorGetVoltage(DevHandle handle, uint32_t *voltage);
| *voltage | Pointer to the regulator voltage information. |
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
```
int32_t ret;
@@ -302,7 +303,7 @@ int32_t RegulatorSetCurrent(DevHandle handle, uint32_t minUa, uint32_t maxUa);
| maxUa | Maximum current to set. |
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
```
int32_t ret;
@@ -332,7 +333,7 @@ int32_t RegulatorGetCurrent(DevHandle handle, uint32_t *regCurrent);
| *regCurrent | Pointer to the regulator current information. |
| **Return Value** | **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
```
int32_t ret;
@@ -361,7 +362,7 @@ int32_t RegulatorGetStatus(DevHandle handle, uint32_t *status);
| *status | Pointer to the regulator status information. |
| **Return Value**| **Description** |
| 0 | The operation is successful. |
-| Negative value | The operation fails. |
+| Negative value | The operation failed. |
```
int32_t ret;
diff --git a/en/device-dev/driver/driver-platform-rtc-des.md b/en/device-dev/driver/driver-platform-rtc-des.md
index 529546787b0efa2a3f01185d27a0dfc416fcc208..abfde56ba35b4c1b4754bb0e660534d8397c3dba 100644
--- a/en/device-dev/driver/driver-platform-rtc-des.md
+++ b/en/device-dev/driver/driver-platform-rtc-des.md
@@ -104,12 +104,12 @@ The real-time clock \(RTC\) driver provides precise real time for the operating
During the OS startup, the HDF loads the RTC driver based on the configuration file. The RTC driver detects the RTC component and initializes the driver.
-[Figure 1](#fig1610020107333) illustrates the process of using an RTC device.
+The figure below illustrates how to use the APIs.
-**Figure 1** Process of using an RTC device
-
+**Figure 1** Process of using an RTC device
+
-### Creating an RTC Device Handle
+### Opening the RTC Device Handle
After the RTC driver is loaded, you can use the API provided by the HDF and call APIs of the RTC driver.
@@ -138,17 +138,18 @@ DevHandle RtcOpen\(void\);
handle
|
-Returns the if the operation is successful.
+ | The operation is successful.
|
NULL
|
-The operation fails.
+ | The operation failed.
|
+
```
DevHandle handle = NULL;
@@ -161,7 +162,7 @@ if (handle == NULL) {
### Releasing the RTC Device Handle
-You can call the following function to release the RTC device handle, thereby releasing resources of the device:
+You can call **RtcClose()** function to release the RTC device handle, thereby releasing resources of the device.
void RtcClose\(DevHandle handle\);
@@ -186,7 +187,7 @@ void RtcClose\(DevHandle handle\);
RtcClose(handle);
```
-### Registering RtcAlarmCallback
+### Registering RtcAlarmCallback
After the OS is started, call the following function to register **RtcAlarmCallback**, which will be invoked when an alarm is generated at the specified time:
@@ -228,7 +229,7 @@ int32\_t RtcRegisterAlarmCallback\(DevHandle handle, enum RtcAlarmIndex alarmInd
Negative value
|
-The operation fails.
+ | The operation failed.
|
@@ -257,11 +258,11 @@ if (ret != 0) {
}
```
-### Performing RTC-related Operations
+### Performing RTC-related Operations
- Reading RTC time
-Call the following function to read time information from the RTC driver, including the year, month, the day of the week, day, hour, minute, second, and millisecond:
+Call the **RtcReadTime()** function to read time information from the RTC driver, including the year, month, the day of the week, day, hour, minute, second, and millisecond.
int32\_t RtcReadTime\(DevHandle handle, struct RtcTime \*time\);
@@ -295,7 +296,7 @@ int32\_t RtcReadTime\(DevHandle handle, struct RtcTime \*time\);
Negative value
|
-The operation fails.
+ | The operation failed.
|
@@ -314,7 +315,7 @@ if (ret != 0) {
- Setting RTC time
-Call the following function to set the RTC time:
+Call the **RtcWriteTime()** function to set the RTC time.
int32\_t RtcWriteTime\(DevHandle handle, struct RtcTime \*time\);
@@ -348,7 +349,7 @@ int32\_t RtcWriteTime\(DevHandle handle, struct RtcTime \*time\);
Negative value
|
-The operation fails.
+ | The operation failed.
|
@@ -378,7 +379,7 @@ if (ret != 0) {
- Reading the RTC alarm time
-Call the following function to read the alarm time:
+Call the **RtcReadAlarm()** function to read the alarm time.
int32\_t RtcReadAlarm\(DevHandle handle, enum RtcAlarmIndex alarmIndex, struct RtcTime \*time\);
@@ -417,7 +418,7 @@ int32\_t RtcReadAlarm\(DevHandle handle, enum RtcAlarmIndex alarmIndex, struct R
Negative value
|
-The operation fails.
+ | The operation failed.
|
@@ -436,7 +437,7 @@ if (ret != 0) {
- Setting RTC alarm time
-Call the following function to set the RTC alarm time based on the alarm index:
+Call the **RtcWriteAlarm()** function to set the RTC alarm time based on the alarm index.
int32\_t RtcWriteAlarm\(DevHandle handle, enum RtcAlarmIndex alarmIndex, struct RtcTime \*time\);
@@ -475,7 +476,7 @@ int32\_t RtcWriteAlarm\(DevHandle handle, enum RtcAlarmIndex alarmIndex, struct
Negative value
|
-The operation fails.
+ | The operation failed.
|
@@ -505,7 +506,7 @@ if (ret != 0) {
- Enabling or disabling alarm interrupts
-Before performing alarm operations, use the following function to enable alarm interrupts, so that **RtcAlarmCallback** will be called when the alarm is not generated upon a timeout:
+Before performing alarm operations, use the **RtcAlarmInterruptEnable()** function to enable alarm interrupts, so that **RtcAlarmCallback** will be called when the alarm is not generated upon a timeout.
int32\_t RtcAlarmInterruptEnable\(DevHandle handle, enum RtcAlarmIndex alarmIndex, uint8\_t enable\);
@@ -544,7 +545,7 @@ int32\_t RtcAlarmInterruptEnable\(DevHandle handle, enum RtcAlarmIndex alarmInde
Negative value
|
-The operation fails.
+ | The operation failed.
|
@@ -562,7 +563,7 @@ if (ret != 0) {
- Reading RTC external frequency
-Call the following function to read the frequency of the external crystal oscillator connected to the RTC driver:
+Call the **RtcGetFreq()** function to read the frequency of the external crystal oscillator connected to the RTC driver.
int32\_t RtcGetFreq\(DevHandle handle, uint32\_t \*freq\);
@@ -596,7 +597,7 @@ int32\_t RtcGetFreq\(DevHandle handle, uint32\_t \*freq\);
Negative value
|
-The operation fails.
+ | The operation failed.
|
@@ -615,7 +616,7 @@ if (ret != 0) {
- Setting the frequency of the external crystal oscillator connected to the RTC driver
-Call the following function to set the frequency of the external crystal oscillator connected to the RTC driver:
+Call the **RtcSetFreq()** function to set the frequency of the external crystal oscillator connected to the RTC driver.
int32\_t RtcSetFreq\(DevHandle handle, uint32\_t freq\);
@@ -649,7 +650,7 @@ int32\_t RtcSetFreq\(DevHandle handle, uint32\_t freq\);
Negative value
|
-The operation fails.
+ | The operation failed.
|
@@ -668,7 +669,7 @@ if (ret != 0) {
- Resetting the RTC driver
-Call the following function to perform a reset on the RTC driver \(after the reset, the registers are restored to the default values\):
+Call the **RtcReset()** function to perform a reset on the RTC driver \(after the reset, the registers are restored to the default values\).
int32\_t RtcReset\(DevHandle handle\);
@@ -697,7 +698,7 @@ int32\_t RtcReset\(DevHandle handle\);
Negative value
|
-The operation fails.
+ | The operation failed.
|
@@ -715,7 +716,7 @@ if (ret != 0) {
- Reading the configuration of a custom RTC register
-Call the following function to read the configuration of a custom RTC register based on the register index \(one index corresponds to one byte of the configuration value\):
+Call the **RtcReadReg()** function to read the configuration of a custom RTC register based on the register index \(one index corresponds to one byte of the configuration value\):
int32\_t RtcReadReg\(DevHandle handle, uint8\_t usrDefIndex, uint8\_t \*value\);
@@ -754,7 +755,7 @@ int32\_t RtcReadReg\(DevHandle handle, uint8\_t usrDefIndex, uint8\_t \*value\);
Negative value
|
-The operation fails.
+ | The operation failed.
|
@@ -774,7 +775,7 @@ if (ret != 0) {
- Setting the configuration of a custom RTC register
-Call the following function to configure a register based on the specified register index \(one index corresponds to one byte of the configuration value\):
+Call the **RtcWriteReg()** function to configure a register based on the specified register index \(one index corresponds to one byte of the configuration value\).
int32\_t RtcWriteReg\(DevHandle handle, uint8\_t usrDefIndex, uint8\_t value\);
@@ -813,7 +814,7 @@ int32\_t RtcWriteReg\(DevHandle handle, uint8\_t usrDefIndex, uint8\_t value\);
Negative value
|
-The operation fails.
+ | The operation failed.
|
diff --git a/en/device-dev/driver/driver-platform-sdio-des.md b/en/device-dev/driver/driver-platform-sdio-des.md
index 575148cb787917e5ee5ed005d4416fd39e394194..3957f2a90233180829ba613670f8b31cd071eb43 100644
--- a/en/device-dev/driver/driver-platform-sdio-des.md
+++ b/en/device-dev/driver/driver-platform-sdio-des.md
@@ -1,4 +1,4 @@
-# SDIO
+# SDIO
## Overview
@@ -13,8 +13,7 @@ The SDIO bus has two ends, named host and device. All communication starts when
- D0-3 signal: four data lines. The DAT1 signal cable is multiplexed as the interrupt line. In 1-bit mode, DAT0 is used to transmit data. In 4-bit mode, DAT0 to DAT3 are used to transmit data.
- CMD signal: used by the host to send commands and the device to respond to commands.
-**Figure 1** Connections between the host and devices in SDIO
-
+**Figure 1** Connections between the host and devices in SDIO

@@ -149,12 +148,14 @@ The SDIO interface defines a set of common methods for operating an SDIO device,
### How to Use
-[Figure 2](#fig1343742311264) illustrates the process of using an SDIO.
+The figure below illustrates how to use the APIs.
+
+**Figure 2** Using SDIO driver APIs
-**Figure 2** Process of using an SDIO
+
-
+
### Opening an SDIO Controller
diff --git a/en/device-dev/driver/driver-platform-spi-des.md b/en/device-dev/driver/driver-platform-spi-des.md
index a8b35d2682b0f9c19afd362b9f84600b2c75cea6..066b92ea231bf86f8a0b2688b1119ef3bd832f84 100644
--- a/en/device-dev/driver/driver-platform-spi-des.md
+++ b/en/device-dev/driver/driver-platform-spi-des.md
@@ -104,10 +104,10 @@ SPI communication is usually initiated by the SPI controller and is operated as
### How to Use
-[Figure 2](#fig1586912310348) shows the process of using an SPI device.
+The figure below illustrates how to use the APIs.
-**Figure 2** Process of using an SPI device
-
+**Figure 2** Using SPI driver APIs
+
### Obtaining an SPI Device Handle
diff --git a/en/device-dev/driver/driver-platform-uart-des.md b/en/device-dev/driver/driver-platform-uart-des.md
index 37d4c34d6dbd91440b72f0b502d0b8439379ba14..20340bfd49d68136a9ca711cca35ca5c2cdb0834 100644
--- a/en/device-dev/driver/driver-platform-uart-des.md
+++ b/en/device-dev/driver/driver-platform-uart-des.md
@@ -103,10 +103,10 @@ The UART interface defines a set of common functions for operating a UART port,
### How to Use
-[Figure 3](#fig99673244388) shows the process of using a UART device.
+The figure below illustrates how to use the APIs.
-**Figure 3** Process of using a UART device
-
+**Figure 3** Using UART driver APIs
+
### Obtaining a UART Device Handle
diff --git a/en/device-dev/driver/driver-platform-watchdog-des.md b/en/device-dev/driver/driver-platform-watchdog-des.md
index 2a9b44765c44f637aa97b9c1aab8867da5ad12e6..deb85133a3dde4f11cfb03762f4f4fd9d656d51b 100644
--- a/en/device-dev/driver/driver-platform-watchdog-des.md
+++ b/en/device-dev/driver/driver-platform-watchdog-des.md
@@ -77,10 +77,10 @@ A watchdog, also called a watchdog timer, is a hardware timing device. If an err
### How to Use
-[Figure 1](#fig430533913392) illustrates the process of using a watchdog.
+The figure below illustrates how to use the APIs.
-**Figure 1** Process of using a watchdog
-
+**Figure 1** Using watchdog driver APIs
+
### Opening a Watchdog
diff --git a/en/device-dev/driver/figures/ADC_flowchart.png b/en/device-dev/driver/figures/ADC_flowchart.png
deleted file mode 100644
index cc8e6494c3ddcf5def7962020210e127f68aec5d..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/ADC_flowchart.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/process-of-using-DAC.png b/en/device-dev/driver/figures/process-of-using-DAC.png
deleted file mode 100644
index 7a62db53a3683922d4033ae4cde5e29d3d50fa22..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/process-of-using-DAC.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/process-of-using-PWM.png b/en/device-dev/driver/figures/process-of-using-PWM.png
deleted file mode 100644
index 7d2c8befd805532d94f9742cc3b28248db5f76e3..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/process-of-using-PWM.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/process-of-using-a-gpio.png b/en/device-dev/driver/figures/process-of-using-a-gpio.png
deleted file mode 100644
index 69b779798c759a78a0139ed052a6f6187ba83660..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/process-of-using-a-gpio.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/process-of-using-a-mipi-dsi-device.png b/en/device-dev/driver/figures/process-of-using-a-mipi-dsi-device.png
deleted file mode 100644
index 3e7f6c13b5c7a7b76c472f856e84c855f5380435..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/process-of-using-a-mipi-dsi-device.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/process-of-using-a-uart-device.png b/en/device-dev/driver/figures/process-of-using-a-uart-device.png
deleted file mode 100644
index 6c1997d120e03bc66658b7bb8107c8605c8ad5ce..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/process-of-using-a-uart-device.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/process-of-using-a-watchdog.png b/en/device-dev/driver/figures/process-of-using-a-watchdog.png
deleted file mode 100644
index c2826f6fff6ba9092c0ccb3f9f7bf91e3c23a094..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/process-of-using-a-watchdog.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/process-of-using-an-i2c-device.png b/en/device-dev/driver/figures/process-of-using-an-i2c-device.png
deleted file mode 100644
index 7eda062addfe07011d62763355028964a6fb511f..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/process-of-using-an-i2c-device.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/process-of-using-an-rtc-device.png b/en/device-dev/driver/figures/process-of-using-an-rtc-device.png
deleted file mode 100644
index fdba48eb6ad079dbf0ca1d8675903703b94e4ab0..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/process-of-using-an-rtc-device.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/process-of-using-an-spi-device.png b/en/device-dev/driver/figures/process-of-using-an-spi-device.png
deleted file mode 100644
index aba1a6b3053728121092e634d5ed007b51fbb6fc..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/process-of-using-an-spi-device.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/process-of-using-regulator.png b/en/device-dev/driver/figures/process-of-using-regulator.png
deleted file mode 100644
index 6dddc62b20eba787ee3ca469718a930e2174ca51..0000000000000000000000000000000000000000
Binary files a/en/device-dev/driver/figures/process-of-using-regulator.png and /dev/null differ
diff --git a/en/device-dev/driver/figures/using-ADC-process.png b/en/device-dev/driver/figures/using-ADC-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..e4390a3d7cb3d7ac985f1703d49c02217a0696d2
Binary files /dev/null and b/en/device-dev/driver/figures/using-ADC-process.png differ
diff --git a/en/device-dev/driver/figures/using-DAC-process.png b/en/device-dev/driver/figures/using-DAC-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..9b3d2336d8462d46c06866491876d3b4d06a0258
Binary files /dev/null and b/en/device-dev/driver/figures/using-DAC-process.png differ
diff --git a/en/device-dev/driver/figures/using-GPIO-process.png b/en/device-dev/driver/figures/using-GPIO-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..adfdc259524a89b0aca5d99ecc183c516f92f25f
Binary files /dev/null and b/en/device-dev/driver/figures/using-GPIO-process.png differ
diff --git a/en/device-dev/driver/figures/using-I2C-process.png b/en/device-dev/driver/figures/using-I2C-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..cb92407de96a64d9aab0425f80bf824616a32d3d
Binary files /dev/null and b/en/device-dev/driver/figures/using-I2C-process.png differ
diff --git a/en/device-dev/driver/figures/process-of-using-MIPI-CSI.png b/en/device-dev/driver/figures/using-MIPI-CSI-process.png
similarity index 100%
rename from en/device-dev/driver/figures/process-of-using-MIPI-CSI.png
rename to en/device-dev/driver/figures/using-MIPI-CSI-process.png
diff --git a/en/device-dev/driver/figures/using-MIPI-DSI-process.png b/en/device-dev/driver/figures/using-MIPI-DSI-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..eaab316ff409064eee64fc06d4f3cc5508221fd1
Binary files /dev/null and b/en/device-dev/driver/figures/using-MIPI-DSI-process.png differ
diff --git a/en/device-dev/driver/figures/using-PWM-process.png b/en/device-dev/driver/figures/using-PWM-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..3d70498418c65576fb3dd79046ccb7793a291eab
Binary files /dev/null and b/en/device-dev/driver/figures/using-PWM-process.png differ
diff --git a/en/device-dev/driver/figures/using-RTC-process.png b/en/device-dev/driver/figures/using-RTC-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..850703fbe375ae95d5deb2774aa38d0a45e1ee7f
Binary files /dev/null and b/en/device-dev/driver/figures/using-RTC-process.png differ
diff --git a/en/device-dev/driver/figures/using-SDIO-process.png b/en/device-dev/driver/figures/using-SDIO-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..d7da373cb17d2ee02ebc9a98cfba156cde761d87
Binary files /dev/null and b/en/device-dev/driver/figures/using-SDIO-process.png differ
diff --git a/en/device-dev/driver/figures/using-SPI-process.png b/en/device-dev/driver/figures/using-SPI-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..a8c02b7b99fa7db78e05d7f38bf7ea05fc54401a
Binary files /dev/null and b/en/device-dev/driver/figures/using-SPI-process.png differ
diff --git a/en/device-dev/driver/figures/using-UART-process.png b/en/device-dev/driver/figures/using-UART-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..c0457b5feef6eeb6c1c845aa0755666b135eb448
Binary files /dev/null and b/en/device-dev/driver/figures/using-UART-process.png differ
diff --git a/en/device-dev/driver/figures/process-of-using-pin.png b/en/device-dev/driver/figures/using-pin-process.png
similarity index 100%
rename from en/device-dev/driver/figures/process-of-using-pin.png
rename to en/device-dev/driver/figures/using-pin-process.png
diff --git a/en/device-dev/driver/figures/using-regulator-process.png b/en/device-dev/driver/figures/using-regulator-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..da251499bb7973d46026d6e317627b6ed98120c4
Binary files /dev/null and b/en/device-dev/driver/figures/using-regulator-process.png differ
diff --git a/en/device-dev/driver/figures/using-watchdog-process.png b/en/device-dev/driver/figures/using-watchdog-process.png
new file mode 100644
index 0000000000000000000000000000000000000000..6b99d28fd621e222bd6873ada2c47405a4f55a42
Binary files /dev/null and b/en/device-dev/driver/figures/using-watchdog-process.png differ
diff --git a/en/device-dev/kernel/Readme-EN.md b/en/device-dev/kernel/Readme-EN.md
index 3d8321373b9c1c0b873ad0833b5f3e0fe3b059a8..b7b289d4c0a9814fed92f8829618077b7588f2ad 100644
--- a/en/device-dev/kernel/Readme-EN.md
+++ b/en/device-dev/kernel/Readme-EN.md
@@ -27,7 +27,7 @@
- Kernel Debugging
- [Memory Debugging](kernel-mini-memory-debug.md)
- [Memory Information Statistics](kernel-mini-memory-debug-mes.md)
- - [Memory Leak Check](kernel-mini-imemory-debug-det.md)
+ - [Memory Leak Check](kernel-mini-memory-debug-det.md)
- [Memory Corruption Check](kernel-mini-memory-debug-cet.md)
- [Exception Debugging](kernel-mini-memory-exception.md)
- [Trace](kernel-mini-memory-trace.md)
@@ -180,5 +180,4 @@
- [Enhanced Swap](kernel-standard-mm-eswap.md)
- [Task Scheduling](kernel-standard-sched.md)
- [Related Thread Group](kernel-standard-sched-rtg.md)
- - [Lightweight CPU Isolation](kernel-standard-sched-cpuisolation.md)
-
\ No newline at end of file
+ - [Lightweight CPU Isolation](kernel-standard-sched-cpuisolation.md)
\ No newline at end of file
diff --git a/en/device-dev/kernel/kernel-mini-basic-memory-dynamic.md b/en/device-dev/kernel/kernel-mini-basic-memory-dynamic.md
index 54d04f222e05feee34b86955208de2221753845f..c24f1b1496cb59258b51c53259b8a15e1e75a2fd 100644
--- a/en/device-dev/kernel/kernel-mini-basic-memory-dynamic.md
+++ b/en/device-dev/kernel/kernel-mini-basic-memory-dynamic.md
@@ -4,19 +4,19 @@
Dynamic memory management allows memory blocks of any size to be allocated from a large contiguous memory \(memory pool or heap memory\) configured in the system based on user demands when memory resources are sufficient. The memory block can be released for further use when not required. Compared with static memory management, dynamic memory management allows memory allocation on demand but causes fragmentation of memory.
-The dynamic memory of the OpenHarmony LiteOS-M has optimized the memory space partitioning based on the Two-Level Segregate Fit \(TLSF\) algorithm to achieve higher performance and minimize fragmentation. [Figure 1](#fig1179964042818) shows the core algorithm of the dynamic memory.
+The dynamic memory of the OpenHarmony LiteOS-M has optimized the memory space partitioning based on the Two-Level Segregate Fit \(TLSF\) algorithm to achieve higher performance and minimize fragmentation. The figure below shows the core algorithm of the dynamic memory.
**Figure 1** Dynamic memory algorithm for mini systems

-Multiple free lists are used for management based on the size of the free memory block. The free memory blocks are divided into two parts: \[4, 127\] and \[27, 231\], as indicated by the size class in [Figure 1](#fig1179964042818).
+Multiple free lists are used for management based on the size of the free memory block. The free memory blocks are divided into two parts: \[4, 127\] and \[27, 231\], as indicated by the size class in the above figure.
-1. The memory in the range of \[4, 127\] \(lower part in [Figure 1](#fig1179964042818)\) is divided into 31 parts. The size of the memory block corresponding to each part is a multiple of 4 bytes. Each part corresponds to a free list and a bit that indicates whether the free list is empty. The value **1** indicates that the free list is not empty. There are 31 bits corresponding to the 31 memory parts in the range of \[4, 127\].
-2. The memory greater than 127 bytes is managed in power of two increments. The size of each range is \[2^n, 2^\(n+1\)-1\], where n is an integer in \[7, 30\]. This range is divided into 24 parts, each of which is further divided into 8 second-level \(L2\) ranges, as shown in Size Class and Size SubClass in the upper part of [Figure 1](#fig1179964042818). Each L2 range corresponds to a free list and a bit that indicates whether the free list is empty. There are a total of 192 \(24 x 8\) L2 ranges, corresponding to 192 free lists and 192 bits.
+1. The memory in the range of \[4, 127\] \(lower part in the above figure) is divided into 31 parts. The size of the memory block corresponding to each part is a multiple of 4 bytes. Each part corresponds to a free list and a bit that indicates whether the free list is empty. The value **1** indicates that the free list is not empty. There are 31 bits corresponding to the 31 memory parts in the range of \[4, 127\].
+2. The memory greater than 127 bytes is managed in power of two increments. The size of each range is \[2^n, 2^\(n+1\)-1\], where n is an integer in \[7, 30\]. This range is divided into 24 parts, each of which is further divided into 8 second-level \(L2\) ranges, as shown in Size Class and Size SubClass in the upper part of the above figure. Each L2 range corresponds to a free list and a bit that indicates whether the free list is empty. There are a total of 192 \(24 x 8\) L2 ranges, corresponding to 192 free lists and 192 bits.
For example, insert 40-byte free memory to a free list. The 40-byte free memory corresponds to the 10th free list in the range of \[40, 43\], and the 10th bit indicates the use of the free list. The system inserts the 40-byte free memory to the 10th free list and determines whether to update the bitmap flag. When 40-byte memory is requested, the system obtains the free list corresponding to the memory block of the requested size based on the bitmap flag, and then obtains a free memory node from the free list. If the size of the allocated node is greater than the memory requested, the system splits the node and inserts the remaining node to the free list. If 580-byte free memory needs to be inserted to a free list, the 580-byte free memory corresponds to the 47th \(31 + 2 x 8\) free list in L2 range \[2^9, 2^9+2^6\], and the 47th bit indicates the use of the free list. The system inserts the 580-byte free memory to the 47th free list and determines whether to update the bitmap flag. When 580-byte memory is requested, the system obtains the free list corresponding to the memory block of the requested size based on the bitmap flag, and then obtains a free memory node from the free list. If the size of the allocated node is greater than the memory requested, the system splits the node and inserts the remaining node to the free list. If the corresponding free list is empty, the system checks for a free list meeting the requirements in a larger memory range. In actual application, the system can locate the free list that meets the requirements at a time.
-[Figure 2](#fig10997102213017) shows the memory management structure.
+The figure below shows the memory management structure.
**Figure 2** Dynamic memory management structure for mini systems

@@ -30,7 +30,7 @@ For example, insert 40-byte free memory to a free list. The 40-byte free memory
There are three types of nodes: free node, used node, and end node. Each memory node maintains the size and use flag of the memory node and a pointer to the previous memory node in the memory pool. The free nodes and used nodes have a data area, but the end node has no data area.
-The off-chip physical memory needs to be used because the on-chip RAMs of some chips cannot meet requirements. The OpenHarmony LiteOS-M kernel can logically combine multiple discontiguous memory regions so that users are unaware of the discontiguous memory regions in the underlying layer. The OpenHarmony LiteOS-M kernel memory module inserts discontiguous memory regions into a free list as free memory nodes and marks the discontiguous parts as virtual memory nodes that have been used. In this way, the discontinuous memory regions are logically combined as a unified memory pool. [Figure 3](#fig18471556115917) shows how the discontiguous memory regions are logically integrated.
+The off-chip physical memory needs to be used because the on-chip RAMs of some chips cannot meet requirements. The OpenHarmony LiteOS-M kernel can logically combine multiple discontiguous memory regions so that users are unaware of the discontiguous memory regions in the underlying layer. The OpenHarmony LiteOS-M kernel memory module inserts discontiguous memory regions into a free list as free memory nodes and marks the discontiguous parts as virtual memory nodes that have been used. In this way, the discontinuous memory regions are logically combined as a unified memory pool. The figure below shows how the discontiguous memory regions are logically integrated.
**Figure 3** Integrating discontiguous memory regions

diff --git a/en/device-dev/kernel/kernel-mini-overview.md b/en/device-dev/kernel/kernel-mini-overview.md
index 3ff627c00e0d0569b018b1a15a4113632cc2e7b7..7b86f1a82028e03366eb3441d6257eb7791764c3 100644
--- a/en/device-dev/kernel/kernel-mini-overview.md
+++ b/en/device-dev/kernel/kernel-mini-overview.md
@@ -4,7 +4,7 @@
The OpenHarmony LiteOS-M kernel is a lightweight operating system \(OS\) kernel designed for the IoT field. It features small size, low power consumption, and high performance. The LiteOS-M kernel has simple code structure, including the minimum function set, kernel abstraction layer \(KAL\), optional components, and project directory. It supports the Hardware Driver Foundation \(HDF\), which provides unified driver standards and access mode for device vendors to simplify porting of drivers and allow one-time development for multi-device deployment.
-The OpenHarmony LiteOS-M kernel architecture consists of the hardware layer and hardware-irrelevant layers, as shown in [Figure 1](#fig1287712172318). The hardware layer is classified based on the compiler toolchain and chip architecture, and provides a unified Hardware Abstraction Layer \(HAL\) interface to improve hardware adaptation and facilitate the expansion of various types of AIoT hardware and compilation toolchains. The other modules are irrelevant to the hardware. The basic kernel module provides basic kernel capabilities. The extended modules provide capabilities of components, such as the network and file systems, as well as exception handling and debug tools. The KAL provides unified standard APIs.
+The OpenHarmony LiteOS-M kernel architecture consists of the hardware layer and hardware-irrelevant layers, as shown in the figure below. The hardware layer is classified based on the compiler toolchain and chip architecture, and provides a unified Hardware Abstraction Layer \(HAL\) interface to improve hardware adaptation and facilitate the expansion of various types of AIoT hardware and compilation toolchains. The other modules are irrelevant to the hardware. The basic kernel module provides basic kernel capabilities. The extended modules provide capabilities of components, such as the network and file systems, as well as exception handling and debug tools. The KAL provides unified standard APIs.
**Figure 1** Kernel architecture

@@ -48,11 +48,11 @@ The CPU architecture includes two layers: general architecture definition layer
-LiteOS-M supports mainstream architectures, such as ARM Cortex-M3, ARM Cortex-M4, ARM Cortex-M7, ARM Cortex-M33, and RISC-V. If you need to expand the CPU architecture, see [Chip Architecture Adaptation](../porting/porting-chip-kernel-overview.md#section137431650339).
+LiteOS-M supports mainstream architectures, such as ARM Cortex-M3, ARM Cortex-M4, ARM Cortex-M7, ARM Cortex-M33, and RISC-V. If you need to expand the CPU architecture, see [Chip Architecture Adaptation](../porting/porting-chip-kernel-overview.md#section137431650339).
### Working Principles
-Configure the system clock and number of ticks per second in the **target\_config.h** file of the development board. Configure the task, memory, inter-process communication \(IPC\), and exception handling modules based on service requirements. When the system boots, the modules are initialized based on the configuration. The kernel startup process includes peripheral initialization, system clock configuration, kernel initialization, and OS boot. For details, see [Figure 2](#fig74259220441).
+Configure the system clock and number of ticks per second in the **target\_config.h** file of the development board. Configure the task, memory, inter-process communication \(IPC\), and exception handling modules based on service requirements. When the system boots, the modules are initialized based on the configuration. The kernel startup process includes peripheral initialization, system clock configuration, kernel initialization, and OS boot, as shown in the figure below.
**Figure 2** Kernel startup process

diff --git a/en/device-dev/porting/Readme-EN.md b/en/device-dev/porting/Readme-EN.md
index 581aaf0bfcb8cdfda65617c9025c45cb4651a4ef..086ee39c3207b6666c7d9caef509c51c8cdfdebd 100644
--- a/en/device-dev/porting/Readme-EN.md
+++ b/en/device-dev/porting/Readme-EN.md
@@ -60,7 +60,7 @@ The download steps for other resources are the same as those in the mainline ver
## SoC Porting Cases
-- [Mini System SoC Porting Cases](porting-minichip-cases.md)
+- Mini System SoC Porting Cases
- [Mini-System Devices with Screens — Bestechnic SoC Porting Case](porting-bes2600w-on-minisystem-display-demo.md)
- [Combo Solution – ASR Chip Porting Case](porting-asr582x-combo-demo.md)
diff --git a/en/device-dev/porting/standard-system-porting-guide.md b/en/device-dev/porting/standard-system-porting-guide.md
index bb56dacfd1b8c575d6c5eab01b1f02c23440ee03..98caa433d6170a9d52f0cdbf4e61f55d77d78afa 100644
--- a/en/device-dev/porting/standard-system-porting-guide.md
+++ b/en/device-dev/porting/standard-system-porting-guide.md
@@ -8,11 +8,11 @@ This document uses the process of porting a development board named **MyProduct
### Defining a Product
-Create a config.json file in the directory with the name "//vendor/MyProductVendor/{product_name}. This file is used to describe the SoC used by the product and the required subsystems. configure the file as follows:
+Create a **config.json** file in the directory **//vendor/MyProductVendor/*{product_name}***. This file is used to describe the SoC used by the product and the required subsystems.
+
+For example, if **product_name** is **MyProduct**, configure the **//vendor/MyProductVendor/MyProduct/config.json** file as follows:
-//vendor/MyProductVendor/MyProduct/config.json
-
```
{
"product_name": "MyProduct",
@@ -39,29 +39,29 @@ Create a config.json file in the directory with the name "//vendor/MyProductVend
The main configurations are as follows:
-product_name:The product name.Required
+**product_name**: product name. This parameter is required.
-version:version.Required
+**version**: version. This parameter is required.
-type:Configured at the system level, select from (mini, small, standard).Required
+**type**: system level, which can be **mini**, **small**, or **standard**. This parameter is required.
-target_cpu :The CPU type of the device (depending on the actual situation, the target_cpu here may also be arm64, riscv, x86, etc..).Required
+**target_cpu**: CPU type of the device (depending on the actual situation, the target_cpu here may also be arm64, riscv, x86, etc..). This parameter is required.
-ohos_version:Operating system version.Optional
+**ohos_version**: operating system version. This parameter is optional.
-device_company:device manufacturer name.Required
+**device_company**: device manufacturer name. This parameter is required.
-board:Board name.Required
+**board**: board name. This parameter is required.
-enable_ramdisk:Whether to start ramdisk.Required
+**enable_ramdisk**: whether to enable the RAM disk. This parameter is required.
-kernel_type and kernel_version: kernel_type with kernel_version is fixed in the standard and does not need to be written.Optional
+**kernel_type** and **kernel_version**: fixed in the standard system. They are optional.
-subsystems:The subsystem that the system needs to be enabled. Subsystems can simply understand a piece of function that is built independently. Required
+**subsystems**: subsystem to enable. A subsystem can be treated as an independently built functional block. This parameter is required.
-product_company:Not reflected in the configuration, but in the directory name, the next directory of the vendor is product_company, build.gn script can still be accessed.
+**product_company**: device manufacturer name. It is not set in the configuration, but in the directory name, next to the vendor name. It can be accessed from **build.gn script**.
-You can find available subsystems in **//build/subsystem\_config.json**. You can also customize subsystems.
+You can find predefined subsystems in **//build/subsystem\_config.json**. You can also customize subsystems.
You are advised to copy the configuration file of Hi3516D V300 and delete the **hisilicon\_products** subsystem, which is used to compile the kernel for Hi3516D V300.
diff --git a/en/device-dev/quick-start/Readme-EN.md b/en/device-dev/quick-start/Readme-EN.md
index 1fb06af53be58306f25c68033f8db5dbd811e53f..2afa83a8d1a6e0ea5e79f97018044f86e1be3a1f 100644
--- a/en/device-dev/quick-start/Readme-EN.md
+++ b/en/device-dev/quick-start/Readme-EN.md
@@ -33,7 +33,7 @@
- [Burning](quickstart-lite-steps-hi3861-burn.md)
- [Networking](quickstart-lite-steps-hi3861-netconfig.md)
- [Debugging and Verification](quickstart-lite-steps-hi3861-debug.md)
- - [Running](quickstart-lite-steps-hi3816-running.md)
+ - [Running](quickstart-lite-steps-hi3861-running.md)
- Hi3516 Development Board
- [Setting Up the Hi3516 Development Board Environment](quickstart-lite-steps-hi3516-setting.md)
- [Writing a Hello World Program](quickstart-lite-steps-hi3516-application-framework.md)
diff --git a/en/device-dev/quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md b/en/device-dev/quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md
index b16ef9ebb0e6886773f01d1481b86f51720d1511..f274a5f0ee452334be8fa93eac3844c62c79e73c 100644
--- a/en/device-dev/quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md
+++ b/en/device-dev/quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md
@@ -20,8 +20,6 @@ In the Windows+Ubuntu hybrid development environment, you can enjoy the benefits
## Setting Up the Ubuntu Development Environment
-The setup procedure varies, depending on whether you need a GUI. If you need a GUI, you need to install Visual Studio Code. In this case, follow the instructions in [Setting Up the Ubuntu Development Environment](https://device.harmonyos.com/en/docs/documentation/guide/ide-install-ubuntu-0000001072959308). If you do not need a GUI, perform the steps below:
-
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
diff --git a/en/device-dev/quick-start/quickstart-lite-steps-hi3816-running.md b/en/device-dev/quick-start/quickstart-lite-steps-hi3861-running.md
similarity index 100%
rename from en/device-dev/quick-start/quickstart-lite-steps-hi3816-running.md
rename to en/device-dev/quick-start/quickstart-lite-steps-hi3861-running.md
diff --git a/en/device-dev/quick-start/quickstart-lite-steps-hi3861.md b/en/device-dev/quick-start/quickstart-lite-steps-hi3861.md
index d91f35a59f47a33ca413733901908cbd221964f6..0f637821f518c0edcced32f369eb09eb594990c7 100644
--- a/en/device-dev/quick-start/quickstart-lite-steps-hi3861.md
+++ b/en/device-dev/quick-start/quickstart-lite-steps-hi3861.md
@@ -14,4 +14,5 @@
- **[Debugging and Verification](quickstart-lite-steps-hi3861-debug.md)**
-- **[Running](quickstart-lite-steps-hi3816-running.md)**
+- **[Running](quickstart-lite-steps-hi3861-running.md)**
+
diff --git a/en/device-dev/subsystems/Readme-EN.md b/en/device-dev/subsystems/Readme-EN.md
index 3a88076442ee79d3184f6e683441d2ffae480813..d42e46d92f01eee9d49fc68f1115492f0726dee9 100644
--- a/en/device-dev/subsystems/Readme-EN.md
+++ b/en/device-dev/subsystems/Readme-EN.md
@@ -80,7 +80,7 @@
- [syspara Module](subsys-boot-syspara.md)
- [FAQs](subsys-boot-faqs.md)
- [Reference](subsys-boot-ref.md)
-- [Test](subsys-testguide-test.md)
+- [Test Case Development](subsys-testguide-test.md)
- DFX
- [DFX Overview](subsys-dfx-overview.md)
- [HiLog Development](subsys-dfx-hilog-rich.md)
@@ -96,8 +96,9 @@
- [HiDumper Development](subsys-dfx-hidumper.md)
- [HiChecker Development](subsys-dfx-hichecker.md)
- [FaultLogger Development](subsys-dfx-faultlogger.md)
-- [R&D Tools](subsys-toolchain.md)
- - [bytrace Usage Guidelines](subsys-toolchain-bytrace-guide.md)
- - [hdc\_stds Usage Guidelines](subsys-toolchain-hdc-guide.md)
- - [hiperf Usage Guidelines](subsys-toolchain-hiperf.md)
-- [XTS](subsys-xts-guide.md)
\ No newline at end of file
+- R&D Tools
+ - [bytrace](subsys-toolchain-bytrace-guide.md)
+ - [hdc\_std](subsys-toolchain-hdc-guide.md)
+ - [hiperf](subsys-toolchain-hiperf.md)
+- [XTS Test Case Development](subsys-xts-guide.md)
+
diff --git a/en/device-dev/subsystems/subsys-build-standard-large.md b/en/device-dev/subsystems/subsys-build-standard-large.md
index 8dc0d3f4b08c9df0b1138d69ab3355bec787cce1..588d41c97447e31a06b67f21e226f27e00183efe 100644
--- a/en/device-dev/subsystems/subsys-build-standard-large.md
+++ b/en/device-dev/subsystems/subsys-build-standard-large.md
@@ -61,19 +61,19 @@ The process to build OpenHarmony is as follows:
### Directory Structure
```
-/build # Primary directory
-├── config # Build configuration items
+/build # Primary directory
+├── config # Build configuration items
├── core
│ └── gn # Build entry BUILD.gn configuration
-├── loader # Loader of module configuration, which also generates a template for the module
-├── ohos # Configuration of the process for building and packaging OpenHarmony
+├── loader # Loader of module configuration, which also generates a template for the module
+├── ohos # Configuration of the process for building and packaging OpenHarmony
│ ├── kits # Build and packaging templates and processing flow for kits
│ ├── ndk # NDK template and processing flow
│ ├── notice # Notice template and processing flow
│ ├── packages # Distribution packaging template and processing flow
│ ├── sa_profile # SA template and processing flow
│ ├── sdk # SDK template and processing flow, which contains the module configuration in the SDK
-│ └── testfwk # Processing flow related to the test
+│ └── testfwk # Processing flow related to the test
├── scripts # Build-related Python script
├── templates # C/C++ build templates
└── toolchain # Toolchain configuration
@@ -207,7 +207,7 @@ The process to build OpenHarmony is as follows:
2. Add the module to the product configuration file.
- Add the module to the product configuration file **//vendor/{product_company}/{product-name}/config.json。**.
+ Add the module to the product configuration file **//vendor/{product_company}/{product-name}/config.json**.
Add "subsystem\_examples:partA" to the product configuration file. **partA** will be built and packaged into the distribution.
diff --git a/en/device-dev/subsystems/subsys-testguide-test.md b/en/device-dev/subsystems/subsys-testguide-test.md
index 3440111dfcfbcfaf79b016d4a690aed4b52f7e29..1e27562840bcefc707cbb4916470d7da2eda25a0 100644
--- a/en/device-dev/subsystems/subsys-testguide-test.md
+++ b/en/device-dev/subsystems/subsys-testguide-test.md
@@ -1,4 +1,4 @@
-# Test
+# Test Case Development
OpenHarmony provides a comprehensive auto-test framework for designing test cases. Detecting defects in the development process can improve code quality.
This document describes how to use the OpenHarmony test framework.
diff --git a/en/device-dev/subsystems/subsys-xts-guide.md b/en/device-dev/subsystems/subsys-xts-guide.md
index 8edb14f97ee25a560587fbe9b875e5b9aaf5d50e..8e3413be4f6cbc230bbf470e360fe8ffc713e1b7 100644
--- a/en/device-dev/subsystems/subsys-xts-guide.md
+++ b/en/device-dev/subsystems/subsys-xts-guide.md
@@ -1,4 +1,4 @@
-# XTS
+# XTS Test Case Development
## Introduction
diff --git a/en/device-dev/subsystems/subsys.md b/en/device-dev/subsystems/subsys.md
index 1b2c9674870709f5ae43d34292298387a16dda28..7eb175c7a40640aae1e0bc1de699179be0e91b23 100644
--- a/en/device-dev/subsystems/subsys.md
+++ b/en/device-dev/subsystems/subsys.md
@@ -14,9 +14,9 @@
- **[Telephony](subsys-tel.md)**
- **[Security](subsys-security.md)**
- **[Startup](subsys-boot.md)**
-- **[Test](subsys-testguide-test.md)**
+- **[Test Case Development](subsys-testguide-test.md)**
- **[DFX](subsys-dfx.md)**
- **[R&D Tools](subsys-toolchain.md)**
-- **[XTS](subsys-xts-guide.md)**
+- **[XTS Test Case Development](subsys-xts-guide.md)**
diff --git a/en/device-dev/website.md b/en/device-dev/website.md
index 8f6c8f6d8321de1b4895b7c7227cb873ac137788..ebb4bafa881a3b91dcd436c6a2b4594101744f27 100644
--- a/en/device-dev/website.md
+++ b/en/device-dev/website.md
@@ -35,7 +35,7 @@
- [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-hi3816-running.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-application-framework.md)
@@ -341,40 +341,40 @@
- [Driver Configuration Management](driver/driver-hdf-manage.md)
- [HDF Development Example](driver/driver-hdf-sample.md)
- Platform Driver Development
- - [ADC](driver-platform-adc-develop.md)
- - [DAC](driver-platform-dac-develop.md)
- - [GPIO](driver-platform-gpio-develop.md)
- - [HDMI](driver-platform-hdmi-develop.md)
- - [I2C](driver-platform-i2c-develop.md)
- - [I3C](driver-platform-i3c-develop.md)
- - [MIPI CSI](driver-platform-mipicsi-develop.md)
- - [MIPI DSI](driver-platform-mipidsi-develop.md)
- - [MMC](driver-platform-mmc-develop.md)
- - [PIN](driver-platform-pin-develop.md)
- - [PWM](driver-platform-pwm-develop.md)
- - [Regulator](driver-platform-regulator-develop.md)
- - [RTC](driver-platform-rtc-develop.md)
- - [SDIO](driver-platform-sdio-develop.md)
- - [SPI](driver-platform-spi-develop.md)
- - [UART](driver-platform-uart-develop.md)
- - [WatchDog](driver-platform-watchdog-develop.md)
+ - [ADC](driver/driver-platform-adc-develop.md)
+ - [DAC](driver/driver-platform-dac-develop.md)
+ - [GPIO](driver/driver-platform-gpio-develop.md)
+ - [HDMI](driver/driver-platform-hdmi-develop.md)
+ - [I2C](driver/driver-platform-i2c-develop.md)
+ - [I3C](driver/driver-platform-i3c-develop.md)
+ - [MIPI CSI](driver/driver-platform-mipicsi-develop.md)
+ - [MIPI DSI](driver/driver-platform-mipidsi-develop.md)
+ - [MMC](driver/driver-platform-mmc-develop.md)
+ - [PIN](driver/driver-platform-pin-develop.md)
+ - [PWM](driver/driver-platform-pwm-develop.md)
+ - [Regulator](driver/driver-platform-regulator-develop.md)
+ - [RTC](driver/driver-platform-rtc-develop.md)
+ - [SDIO](driver/driver-platform-sdio-develop.md)
+ - [SPI](driver/driver-platform-spi-develop.md)
+ - [UART](driver/driver-platform-uart-develop.md)
+ - [WatchDog](driver/driver-platform-watchdog-develop.md)
- Platform Driver Usage
- - [ADC](driver-platform-adc-des.md)
- - [DAC](driver-platform-dac-des.md)
- - [GPIO](driver-platform-gpio-des.md)
- - [HDMI](driver-platform-hdmi-des.md)
- - [I2C](driver-platform-i2c-des.md)
- - [I3C](driver-platform-i3c-des.md)
- - [MIPI CSI](driver-platform-mipicsi-des.md)
- - [MIPI DSI](driver-platform-mipidsi-des.md)
- - [PIN](driver-platform-pin-des.md)
- - [PWM](driver-platform-pwm-des.md)
- - [Regulator](driver-platform-regulator-des.md)
- - [RTC](driver-platform-rtc-des.md)
- - [SDIO](driver-platform-sdio-des.md)
- - [SPI](driver-platform-spi-des.md)
- - [UART](driver-platform-uart-des.md)
- - [WatchDog](driver-platform-watchdog-des.md)
+ - [ADC](driver/driver-platform-adc-des.md)
+ - [DAC](driver/driver-platform-dac-des.md)
+ - [GPIO](driver/driver-platform-gpio-des.md)
+ - [HDMI](driver/driver-platform-hdmi-des.md)
+ - [I2C](driver/driver-platform-i2c-des.md)
+ - [I3C](driver/driver-platform-i3c-des.md)
+ - [MIPI CSI](driver/driver-platform-mipicsi-des.md)
+ - [MIPI DSI](driver/driver-platform-mipidsi-des.md)
+ - [PIN](driver/driver-platform-pin-des.md)
+ - [PWM](driver/driver-platform-pwm-des.md)
+ - [Regulator](driver/driver-platform-regulator-des.md)
+ - [RTC](driver/driver-platform-rtc-des.md)
+ - [SDIO](driver/driver-platform-sdio-des.md)
+ - [SPI](driver/driver-platform-spi-des.md)
+ - [UART](driver/driver-platform-uart-des.md)
+ - [WatchDog](driver/driver-platform-watchdog-des.md)
- Peripheral Driver Usage
- [LCD](driver/driver-peripherals-lcd-des.md)
- [Touchscreen](driver/driver-peripherals-touch-des.md)
@@ -520,7 +520,7 @@
- [Development Example for Peripheral Drivers](guide/device-outerdriver-demo.md)
- Debugging
- - [Test](subsystems/subsys-testguide-test.md)
+ - [Test Case Development](subsystems/subsys-testguide-test.md)
- Debugging Tools
- [bytrace](subsystems/subsys-toolchain-bytrace-guide.md)
- [hdc\_std](subsystems/subsys-toolchain-hdc-guide.md)
diff --git a/en/readme.md b/en/readme.md
index 5ca900639a5e2c02862d44681ece181b503cf386..e220bd152b32ff7cdf34c000d283acfab619fcba 100644
--- a/en/readme.md
+++ b/en/readme.md
@@ -8,6 +8,6 @@ This repository stores a complete range of OpenHarmony documentation. The conten
- [Release Notes](release-notes/Readme.md)
- [Subsystems](./readme)
- OpenHarmony Contribution
- - [Contribution Guide](contribute/how-to-contribute.md)
+ - [Contribution Guide](contribute/contribution-guide.md)
- [OpenHarmony Part and API Design Reference](./design)
diff --git a/en/readme/SAMGR.md b/en/readme/SAMGR.md
index 8978b54a33b01f01b4da64deaabace8d1867f5a7..be89cb571dcacb5407fed7e8d0d6765121968acc 100644
--- a/en/readme/SAMGR.md
+++ b/en/readme/SAMGR.md
@@ -19,7 +19,7 @@ The System Ability Manager (SAMGR) subsystem implements the system service frame
├── safwk # System ability framework
├── samgr # System ability manager
├── safwk_lite # Lightweight foundation process
-├── samgr_lite # Lightweight system ability manager
+└── samgr_lite # Lightweight system ability manager
```
## Repositories Involved
diff --git a/en/readme/misc-services.md b/en/readme/misc-services.md
index 3cafe421bcb3e2e91be47a46bc936f708427ba16..8b9c5295f58503f63563afe57347534660a3350f 100755
--- a/en/readme/misc-services.md
+++ b/en/readme/misc-services.md
@@ -4,7 +4,7 @@
The Misc services subsystem provides APIs for setting the system time.
-**Figure 1** Subsystem architecture
+**Figure 1** Subsystem architecture

## Directory Structure
diff --git a/en/website.md b/en/website.md
index 7a5374affa4e0848b8a963ec98521e72e7be5bf6..4ff9a1de38b77e2bd53fb61d8366aaa17b4c0155 100644
--- a/en/website.md
+++ b/en/website.md
@@ -6,12 +6,12 @@
- OpenHarmony 3.x Releases
- [OpenHarmony v3.1 Release (2022-03-30)](release-notes/OpenHarmony-v3.1-release.md)
- [OpenHarmony v3.1 Beta (2021-12-31)](release-notes/OpenHarmony-v3.1-beta.md)
- - [OpenHarmony v3.0.1 LTS (2022-01-12)](release-notes/OpenHarmony-v3.0.1-LTS.md)
-- [OpenHarmony v3.0 LTS (2021-09-30)](release-notes/OpenHarmony-v3.0-LTS.md)
-
+ - [OpenHarmony v3.0.3 LTS (2022-04-08)](release-notes/OpenHarmony-v3.0.3-LTS.md)
+ - [OpenHarmony v3.0 LTS (2021-09-30)](release-notes/OpenHarmony-v3.0-LTS.md)
+
- OpenHarmony 2.x Releases
- [OpenHarmony v2.2 beta2 (2021-08-04)](release-notes/OpenHarmony-v2.2-beta2.md)
- - [OpenHarmony 2.0 Canary (2021-06-01)](release-notes/OpenHarmony-2-0-Canary.md)
+ - [OpenHarmony 2.0 Canary (2021-06-01)](release-notes/OpenHarmony-2-0-Canary.md)
- OpenHarmony 1.x Releases
- [OpenHarmony v1.1.4 LTS (2022-02-11)](release-notes/OpenHarmony-v1-1-4-LTS.md)
- [OpenHarmony v1.1.3 LTS (2021-09-30)](release-notes/OpenHarmony-v1-1-3-LTS.md)
diff --git a/zh-cn/application-dev/ability/fa-dataability.md b/zh-cn/application-dev/ability/fa-dataability.md
index 627089036adcff07a0c70369d7134ef9185c85c2..e9fd630224f21b76c4ebd019d130ba8ee44aea9d 100644
--- a/zh-cn/application-dev/ability/fa-dataability.md
+++ b/zh-cn/application-dev/ability/fa-dataability.md
@@ -32,6 +32,14 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
创建Data的代码示例如下:
```javascript
+ import dataAbility from '@ohos.data.dataAbility'
+ import dataRdb from '@ohos.data.rdb'
+
+ const TABLE_NAME = 'book'
+ const STORE_CONFIG = { name: 'book.db' }
+ const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, introduction TEXT NOT NULL)'
+ let rdbStore: dataRdb.RdbStore = undefined
+
export default {
onInitialized(abilityInfo) {
console.info('DataAbility onInitialized, abilityInfo:' + abilityInfo.bundleName)
@@ -50,7 +58,7 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
for (let i = 0;i < valueBuckets.length; i++) {
console.info('DataAbility batch insert i=' + i)
if (i < valueBuckets.length - 1) {
- rdbStore.insert(TABLE_NAME, valueBuckets[i], (num: number) => {
+ rdbStore.insert(TABLE_NAME, valueBuckets[i], (err: any, num: number) => {
console.info('DataAbility batch insert ret=' + num)
})
} else {
@@ -118,6 +126,10 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
工具接口类对象DataAbilityHelper相关接口可参考[DataAbilityHelper模块](../reference/apis/js-apis-dataAbilityHelper.md)。
```js
// 作为参数传递的Uri,与config中定义的Uri的区别是多了一个"/",是因为作为参数传递的uri中,在第二个与第三个"/"中间,存在一个DeviceID的参数
+ import featureAbility from '@ohos.ability.featureAbility'
+ import ohos_data_ability from '@ohos.data.dataAbility'
+ import ohos_data_rdb from '@ohos.data.rdb'
+
var urivar = "dataability:///com.ix.DataAbility"
var DAHelper = featureAbility.acquireDataAbilityHelper(
urivar
@@ -137,7 +149,7 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
urivar,
valuesBucket,
(error, data) => {
- expect(typeof(data)).assertEqual("number")
+ console.log("DAHelper insert result: " + data)
}
);
```
@@ -156,7 +168,7 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
urivar,
da,
(error, data) => {
- expect(typeof(data)).assertEqual("number")
+ console.log("DAHelper delete result: " + data)
}
);
```
@@ -176,7 +188,7 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
valuesBucket,
da,
(error, data) => {
- expect(typeof(data)).assertEqual("number")
+ console.log("DAHelper update result: " + data)
}
);
```
@@ -197,7 +209,7 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
valArray,
da,
(error, data) => {
- expect(typeof(data)).assertEqual("object")
+ console.log("DAHelper query result: " + data)
}
);
```
@@ -217,7 +229,7 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
urivar,
cars,
(error, data) => {
- expect(typeof(data)).assertEqual("number")
+ console.log("DAHelper batchInsert result: " + data)
}
);
```
@@ -241,12 +253,12 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
valuesBucket: {"executeBatch" : "value1",},
predicates: da,
expectedCount:0,
- PredicatesBackReferences: {},
+ predicatesBackReferences: null,
interrupted:true,
}
],
(error, data) => {
- expect(typeof(data)).assertEqual("object")
+ console.log("DAHelper executeBatch result: " + data)
}
);
```
@@ -265,7 +277,7 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开
},
predicates: da,
expectedCount:0,
- PredicatesBackReferences: {},
+ predicatesBackReferences: null,
interrupted:true,
}
]
diff --git a/zh-cn/application-dev/ability/fa-serviceability.md b/zh-cn/application-dev/ability/fa-serviceability.md
index 188a87b7f68eead3458b0a579f932b173af57d43..f5605b17f9aa711e941138e5e9f14ff0bea19b5c 100644
--- a/zh-cn/application-dev/ability/fa-serviceability.md
+++ b/zh-cn/application-dev/ability/fa-serviceability.md
@@ -32,6 +32,7 @@
},
onConnect(want) {
console.log('ServiceAbility OnConnect');
+ return null;
},
onDisconnect(want) {
console.log('ServiceAbility OnDisConnect');
@@ -78,12 +79,12 @@ Ability为开发者提供了startAbility()方法来启动另外一个Ability。
```javascript
import featureAbility from '@ohos.ability.featureAbility';
-let promise = await featureAbility.startAbility(
+let promise = featureAbility.startAbility(
{
want:
{
- bundleName: "com.jstest.serviceability",
- abilityName: "com.jstest.serviceability.MainAbility",
+ bundleName: "com.jstest.service",
+ abilityName: "com.jstest.service.ServiceAbility",
},
}
);
@@ -110,6 +111,8 @@ let promise = await featureAbility.startAbility(
创建连接本地Service回调实例的代码示例如下:
```javascript
+import prompt from '@system.prompt'
+
let mRemote;
function onConnectCallback(element, remote){
console.log('onConnectLocalService onConnectDone element: ' + element);
@@ -154,8 +157,8 @@ function onFailedCallback(code){
import featureAbility from '@ohos.ability.featureAbility';
let connId = featureAbility.connectAbility(
{
- bundleName: "com.jstest.serviceability",
- abilityName: "com.jstest.serviceability.MainAbility",
+ bundleName: "com.jstest.service",
+ abilityName: "com.jstest.service.ServiceAbility",
},
{
onConnect: onConnectCallback,
@@ -223,6 +226,8 @@ export default {
创建连接远程Service回调实例的代码示例如下:
```ts
+import prompt from '@system.prompt'
+
let mRemote;
function onConnectCallback(element, remote){
console.log('onConnectRemoteService onConnectDone element: ' + element);
@@ -264,7 +269,10 @@ function onFailedCallback(code){
```ts
import deviceManager from '@ohos.distributedHardware.deviceManager';
+
+//dmClass具体实现请参考:相关实例 分布式Demo 章节中的实现
let dmClass;
+
function getRemoteDeviceId() {
if (typeof dmClass === 'object' && dmClass != null) {
let list = dmClass.getTrustedDeviceListSync();
@@ -327,9 +335,6 @@ async function RequestPermission() {
let context = featureAbility.getContext();
context.requestPermissionsFromUser(requestPermissions, 1, (data)=>{
console.info("data:" + JSON.stringify(data));
- console.info("data requestCode:" + data.requestCode);
- console.info("data permissions:" + data.permissions);
- console.info("data authResults:" + data.authResults);
});
console.info('RequestPermission end');
}
diff --git a/zh-cn/application-dev/ability/wantagent.md b/zh-cn/application-dev/ability/wantagent.md
index 260fa41f19dcc9e0c7c4fe5cd3b9593b835bdecc..fe51abab01097b1308480e524d0f454664f03d2a 100644
--- a/zh-cn/application-dev/ability/wantagent.md
+++ b/zh-cn/application-dev/ability/wantagent.md
@@ -1,72 +1,88 @@
# WantAgent开发指导
-### 简介
-wantAgent封装了一个指定行为的意图,可以通过wantAgent.trigger接口主动触发,也可以通过与通知绑定被动触发。
+### 场景简介
+WantAgent封装了一个行为意图信息,可以通过WantAgent.trigger接口主动触发,也可以通过与通知绑定被动触发。
-具体的行为包括:启动ability和发布公共事件。
-
-### 场景介绍
-通过wantAgent,拉起另外一个ability
+具体的行为包括:启动Ability和发布公共事件。
### 接口说明
| 接口名 | 接口描述 |
| ---------------------------------------------------------------------------------------------- | ----------- |
-| wantAgent.getWantAgentInfo(info: WantAgentInfo, callback: AsyncCallback\) | 创建wantAgent对象(callback) |
-| wantAgent.getWantAgent(info: WantAgentInfo): Promise\; | 创建wantAgent对象(promise) |
-| commonEvent.trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback\) | 触发wantAgent |
+| getWantAgentInfo(info: WantAgentInfo, callback: AsyncCallback\) | 以AsyncCallback形式创建WantAgent对象 |
+| getWantAgent(info: WantAgentInfo): Promise\ | 以Promise形式创建WantAgent对象 |
+| trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback\) | 触发WantAgent |
### 开发步骤
1. 导入WantAgent模块。
-```javascript
-import wantAgent from '@ohos.wantAgent';
-```
+ ```
+ import wantAgent from '@ohos.wantAgent';
+ ```
+
+2. 创建拉起Ability的WantAgentInfo信息,详细的WantAgentInfo信息数据类型及包含的参数请见[WantAgentInfo文档](../reference/apis/js-apis-wantAgent.md#wantagentinfo)介绍。
-2. 创建WantAgentInfo信息,详细的WantAgentInfo信息数据类型及包含的参数请见[WantAgentInfo文档](../reference/apis/js-apis-wantAgent.md#WantAgentInfo)介绍。
+ ```
+ private wantAgentObj = null //用于保存创建成功的wantAgent对象,后续使用其完成触发的动作。
+
+ //wantAgentInfo
+ var wantAgentInfo = {
+ wants: [
+ {
+ deviceId: "",
+ bundleName: "com.example.test",
+ abilityName: "com.example.test.MainAbility",
+ action: "",
+ entities: [],
+ uri: "",
+ parameters: {}
+ }
+ ],
+ operationType: OperationType.START_ABILITY,
+ requestCode: 0,
+ wantAgentFlags:[WantAgentFlags.CONSTANT_FLAG]
+ }
+ ```
-```javascript
-private wantAgentObj = null //用于保存创建成功的wantAgent对象,后续使用其完成触发的动作
+3. 创建发布公共事件的WantAgentInfo信息
-//wantAgentInfo
-var wantAgentInfo = {
- wants: [
- {
- deviceId: "",
- bundleName: "com.example.test",
- abilityName: "com.example.test.MainAbility",
- action: "",
- entities: [],
- uri: "",
- parameters: {}
- }
- ],
- operationType: OperationType.START_ABILITY,
- requestCode: 0,
- wantAgentFlags:[WantAgentFlags.CONSTANT_FLAG]
-}
-```
+ ```
+ private wantAgentObj = null //用于保存创建成功的WantAgent对象,后续使用其完成触发的动作。
+
+ //wantAgentInfo
+ var wantAgentInfo = {
+ wants: [
+ {
+ action: "event_name", // 设置事件名
+ parameters: {}
+ }
+ ],
+ operationType: OperationType.SEND_COMMON_EVENT,
+ requestCode: 0,
+ wantAgentFlags:[WantAgentFlags.CONSTANT_FLAG]
+ }
+ ```
-3. 创建wantAgent,保存返回的wantAgent对象wantAgentObj,用于执行后续触发操作。
+4. 创建WantAgent,保存返回的WantAgent对象wantAgentObj,用于执行后续触发操作。
-```javascript
-//创建wantAgent
-wantAgent.getWantAgent(wantAgentInfo, (err, wantAgentObj) => {
- if (err.code) {
- console.error("[WantAgent]getWantAgent err=" + JSON.stringify(err))
- } else {
- console.log("[WantAgent]getWantAgent success")
- this.wantAgentObj = wantAgentObj
- }
-})
-```
+ ```
+ //创建WantAgent
+ wantAgent.getWantAgent(wantAgentInfo, (err, wantAgentObj) => {
+ if (err.code) {
+ console.error("[WantAgent]getWantAgent err=" + JSON.stringify(err))
+ } else {
+ console.log("[WantAgent]getWantAgent success")
+ this.wantAgentObj = wantAgentObj
+ }
+ })
+ ```
-4. 触发wantAgent
+5. 触发WantAgent
-```
-//触发wantAgent
-var triggerInfo = {
- code:0
-}
-wantAgent.trigger(wantAgentObj, triggerInfo, (completeData) => {
- console.log("[WantAgent]getWantAgent success, completeData: ", + JSON.stringify(completeData))
-})
-```
\ No newline at end of file
+ ```
+ //触发WantAgent
+ var triggerInfo = {
+ code:0
+ }
+ wantAgent.trigger(wantAgentObj, triggerInfo, (completeData) => {
+ console.log("[WantAgent]getWantAgent success, completeData: ", + JSON.stringify(completeData))
+ })
+ ```
diff --git a/zh-cn/application-dev/media/Readme-CN.md b/zh-cn/application-dev/media/Readme-CN.md
index 9c39d85302086efca820bb40678674cbfe77f8ae..0188fdbe591a03cc547891d1bb97afdbb4eed64e 100755
--- a/zh-cn/application-dev/media/Readme-CN.md
+++ b/zh-cn/application-dev/media/Readme-CN.md
@@ -15,3 +15,6 @@
- 图片
- [图片开发指导](image.md)
+
+- 相机
+ - [相机开发指导](camera.md)
\ No newline at end of file
diff --git a/zh-cn/application-dev/media/camera.md b/zh-cn/application-dev/media/camera.md
new file mode 100644
index 0000000000000000000000000000000000000000..161cc8864bf06ab02716480d155609bd13ea042f
--- /dev/null
+++ b/zh-cn/application-dev/media/camera.md
@@ -0,0 +1,472 @@
+# 相机开发指导
+
+## 场景介绍
+
+相机模块支持相机相关基础功能的开发,主要包括预览、拍照、录像等。本文将对相机各种基础功能的开发进行介绍说明。
+
+## 开发步骤
+
+### 接口说明
+
+详细API含义请参考:[相机管理API文档](../reference/apis/js-apis-camera.md)
+
+### 全流程场景
+
+包含流程:创建实例、参数设置、会话管理、拍照、录像、释放资源等。
+
+Xcomponent创建方法可参考:[XComponent创建方法](#xcomponent创建方法)
+
+拍照保存接口可参考:[图片处理API文档](../reference/apis/js-apis-image.md)
+
+#### 创建实例
+
+```js
+import camera from '@ohos.multimedia.camera'
+import image from '@ohos.multimedia.image'
+import media from '@ohos.multimedia.media'
+import featureAbility from '@ohos.ability.featureAbility'
+
+//创建CameraManager对象
+let cameraManager
+await camera.getCameraManager(globalThis.Context, (err, manager) => {
+ if (err) {
+ console.error('Failed to get the CameraManager instance ${err.message}');
+ return;
+ }
+ console.log('Callback returned with the CameraManager instance');
+ cameraManager = manager
+})
+
+//注册回调函数监听相机状态变化,获取状态变化的相机信息
+cameraManager.on('cameraStatus', (cameraStatusInfo) => {
+ console.log('camera : ' + cameraStatusInfo.camera.cameraId);
+ console.log('status: ' + cameraStatusInfo.status);
+})
+
+//获取相机列表
+let cameraArray
+await cameraManager.getCameras((err, cameras) => {
+ if (err) {
+ console.error('Failed to get the cameras. ${err.message}');
+ return;
+ }
+ console.log('Callback returned with an array of supported cameras: ' + cameras.length);
+ cameraArray = cameras
+})
+
+ for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex) {
+ console.log('cameraId : ' + cameraArray[cameraIndex].cameraId) //获取相机ID
+ console.log('cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) //获取相机位置
+ console.log('cameraType : ' + cameraArray[cameraIndex].cameraType) //获取相机类型
+ console.log('connectionType : ' + cameraArray[cameraIndex].connectionType) //获取相机连接类型
+ }
+
+ //创建相机输入流
+ let cameraInput
+ await cameraManager.createCameraInput(cameraArray[0].cameraId).then((input) => {
+ console.log('Promise returned with the CameraInput instance');
+ cameraInput = input
+})
+
+//创建预览输出流
+let previewOutput
+camera.createPreviewOutput((globalThis.surfaceId), (err, output) => {
+ if (err) {
+ console.error('Failed to create the PreviewOutput instance. ${err.message}');
+ return;
+ }
+ console.log('Callback returned with previewOutput instance');
+ previewOutput = output
+});
+
+//创建ImageReceiver对象,并设置照片参数
+let imageReceiver = await image.createImageReceiver(1920, 1080, 4, 8)
+//获取照片显示SurfaceId
+let photoSurfaceId = await imageReceiver.getReceivingSurfaceId()
+//创建拍照输出流
+let photoOutput
+camera.createPhotoOutput((photoSurfaceId), (err, output) => {
+ if (err) {
+ console.error('Failed to create the PhotoOutput instance. ${err.message}');
+ return;
+ }
+ console.log('Callback returned with the PhotoOutput instance.');
+ photoOutput = output
+});
+
+//创建视频录制的参数
+let videoProfile = {
+ audioBitrate : 48000,
+ audioChannels : 2,
+ audioCodec : 'audio/mp4a-latm',
+ audioSampleRate : 48000,
+ fileFormat : 'mp4',
+ videoBitrate : 48000,
+ videoCodec : 'video/mp4v-es',
+ videoFrameWidth : 640,
+ videoFrameHeight : 480,
+ videoFrameRate : 30
+}
+let videoConfig = {
+ audioSourceType : 1,
+ videoSourceType : 0,
+ profile : videoProfile,
+ url : 'file:///data/media/01.mp4',
+ orientationHint : 0,
+ location : { latitude : 30, longitude : 130 },
+}
+
+//创建录像输出流
+let videoRecorder
+await media.createVideoRecorder().then((recorder) => {
+ console.log('createVideoRecorder called')
+ videoRecorder = recorder
+})
+//设置视频录制的参数
+await videoRecorder.prepare(videoConfig)
+//获取录像SurfaceId
+await videoRecorder.getInputSurface().then((id) => {
+ console.log('getInputSurface called')
+ videoSurfaceId = id
+})
+```
+videoRecorder详细创建方法可参考:[视频录制开发指导](./video-recorder.md)
+```js
+//创建VideoOutput对象
+let videoOutput
+camera.createVideoOutput((surfaceId), (err, output) => {
+ if (err) {
+ console.error('Failed to create the VideoOutput instance. ${err.message}');
+ return;
+ }
+ console.log('Callback returned with the VideoOutput instance');
+ videoOutput = output
+});
+
+```
+
+#### 参数设置
+
+```js
+//判断设备是否支持闪光灯
+let flashStatus
+await cameraInput.hasFlash().then((status) => {
+ console.log('Promise returned with the flash light support status:' + status);
+ flashStatus = status
+})
+if(flashStatus) {
+ //判断是否支持自动闪光灯模式
+ let flashModeStatus
+ cameraInput.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO, (err, status) => {
+ if (err) {
+ console.error('Failed to check whether the flash mode is supported. ${err.message}');
+ return;
+ }
+ console.log('Callback returned with the flash mode support status: ' + status);
+ flashModeStatus = status
+ })
+ if(flashModeStatus) {
+ //设置自动闪光灯模式
+ cameraInput.setFlashMode(camera.FlashMode.FLASH_MODE_AUTO, (err) => {
+ if (err) {
+ console.error('Failed to set the flash mode ${err.message}');
+ return;
+ }
+ console.log('Callback returned with the successful execution of setFlashMode.');
+ })
+ }
+}
+
+//判断是否支持连续自动变焦模式
+let focusModeStatus
+cameraInput.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, (err, status) => {
+ if (err) {
+ console.error('Failed to check whether the focus mode is supported. ${err.message}');
+ return;
+ }
+ console.log('Callback returned with the focus mode support status: ' + status);
+ focusModeStatus = status
+})
+if(focusModeStatus) {
+ //设置连续自动变焦模式
+ cameraInput.setFocusMode(camera.FocusMode.FOCUS_MODE_CONTINUOUS_AUTO, (err) => {
+ if (err) {
+ console.error('Failed to set the focus mode ${err.message}');
+ return;
+ }
+ console.log('Callback returned with the successful execution of setFocusMode.');
+ })
+}
+
+//获取相机支持的可变焦距比范围
+let zoomRatioRange
+cameraInput.getZoomRatioRange((err, range) => {
+ if (err) {
+ console.error('Failed to get the zoom ratio range. ${err.message}');
+ return;
+ }
+ console.log('Callback returned with zoom ratio range: ' + range.length);
+ zoomRatioRange = range
+})
+
+//设置可变焦距比
+cameraInput.setZoomRatio(zoomRatioRange[0], (err) => {
+ if (err) {
+ console.error('Failed to set the zoom ratio value ${err.message}');
+ return;
+ }
+ console.log('Callback returned with the successful execution of setZoomRatio.');
+})
+```
+
+#### 会话管理
+
+##### 创建会话
+
+```js
+//创建Context对象
+let context = featureAbility.getContext()
+
+//创建会话
+let captureSession
+await camera.createCaptureSession((context), (err, session) => {
+ if (err) {
+ console.error('Failed to create the CaptureSession instance. ${err.message}');
+ return;
+ }
+ console.log('Callback returned with the CaptureSession instance.' + session);
+ captureSession = session
+});
+
+//开始配置会话
+await captureSession.beginConfig((err) => {
+ if (err) {
+ console.error('Failed to start the configuration. ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate the begin config success.');
+});
+
+//向会话中添加相机输入流
+await captureSession.addInput(cameraInput, (err) => {
+ if (err) {
+ console.error('Failed to add the CameraInput instance. ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate that the CameraInput instance is added.');
+});
+
+//向会话中添加预览输入流
+await captureSession.addOutput(previewOutput, (err) => {
+ if (err) {
+ console.error('Failed to add the PreviewOutput instance ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate that the PreviewOutput instance is added.');
+});
+
+//向会话中添加拍照输出流
+await captureSession.addOutput(photoOutput, (err) => {
+ if (err) {
+ console.error('Failed to add the PhotoOutput instance ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate that the PhotoOutput instance is added.');
+});
+
+//提交会话配置
+await captureSession.commitConfig((err) => {
+ if (err) {
+ console.error('Failed to commit the configuration. ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate the commit config success.');
+});
+
+//启动会话
+await captureSession.start().then(() => {
+ console.log('Promise returned to indicate the session start success.');
+})
+```
+
+##### 切换会话
+
+```js
+//停止当前会话
+await captureSession.stop((err) => {
+ if (err) {
+ console.error('Failed to stop the session ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate the session stop success.');
+});
+
+//开始配置会话
+await captureSession.beginConfig((err) => {
+ if (err) {
+ console.error('Failed to start the configuration. ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate the begin config success.');
+});
+
+//从会话中移除拍照输出流
+await captureSession.removeOutput(photoOutput, (err) => {
+ if (err) {
+ console.error('Failed to remove the PhotoOutput instance. ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate that the PhotoOutput instance is removed.');
+});
+
+//向会话中添加录像输出流
+await captureSession.addOutput(videoOutput, (err) => {
+ if (err) {
+ console.error('Failed to add the VideoOutput instance ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate that the VideoOutput instance is added.');
+});
+
+//提交会话配置
+await captureSession.commitConfig((err) => {
+ if (err) {
+ console.error('Failed to commit the configuration. ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate the commit config success.');
+});
+
+//启动会话
+await captureSession.start().then(() => {
+ console.log('Promise returned to indicate the session start success.');
+})
+```
+
+#### 拍照
+
+```js
+let settings = {
+ quality: camera.QualityLevel.QUALITY_LEVEL_HIGH //设置图片质量高
+ rotation: camera.ImageRotation.ROTATION_0, //设置图片旋转角度0
+}
+//使用当前拍照设置进行拍照
+photoOutput.capture(settings, (err) => {
+ if (err) {
+ console.error('Failed to capture the photo ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate the photo capture request success.');
+});
+```
+
+#### 录像
+
+```js
+//启动录像输出流
+videoOutput.start((err) => {
+ if (err) {
+ console.error('Failed to start the video output ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate the video output start success.');
+});
+
+//开始录像
+await videoRecorder.start().then(() => {
+ console.info('videoRecorder start success');
+}
+
+//停止录像
+await videoRecorder.stop().then(() => {
+ console.info('stop success');
+}
+
+//停止录像输出流
+await videoOutput.stop((err) => {
+ if (err) {
+ console.error('Failed to stop the video output ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate the video output stop success.');
+});
+```
+
+#### 释放资源
+
+```js
+//停止当前会话
+await captureSession.stop((err) => {
+ if (err) {
+ console.error('Failed to stop the session ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate the session stop success.');
+});
+//释放相机输入流
+await cameraInput.release((err) => {
+ if (err) {
+ console.error('Failed to release the CameraInput instance ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate that the CameraInput instance is released successfully.');
+});
+//释放预览输出流
+await previewOutput.release((err) => {
+ if (err) {
+ console.error('Failed to release the PreviewOutput instance ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate that the PreviewOutput instance is released successfully.');
+});
+//释放拍照输出流
+await photoOutput.release((err) => {
+ if (err) {
+ console.error('Failed to release the PhotoOutput instance ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate that the PhotoOutput instance is released successfully.');
+});
+//释放录像输出流
+await videoOutput.release((err) => {
+ if (err) {
+ console.error('Failed to release the VideoOutput instance ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate that the VideoOutput instance is released successfully.');
+});
+//释放会话
+await captureSession.release((err) => {
+ if (err) {
+ console.error('Failed to release the CaptureSession instance ${err.message}');
+ return;
+ }
+ console.log('Callback invoked to indicate that the CaptureSession instance is released successfully.');
+});
+```
+
+#### XComponent创建方法
+预览画面显示需要获取SurfaceId
+
+```js
+mXComponentController: XComponentController = new XComponentController //创建XComponentController
+
+build() {
+ Flex() {
+ XComponent({ //创建XComponent
+ id: '',
+ type: 'surface',
+ libraryname: '',
+ controller: this.mXComponentController
+ })
+ .onload(() => { //设置onload回调
+ //设置Surface宽高(1920*1080)
+ this.mXComponentController.setXComponentSurfaceSize({surfaceWidth:1920,surfaceHeight:1080})
+ //获取Surface ID
+ globalThis.surfaceId = mXComponentController.getXComponentSurfaceId()
+ })
+ .width('1920px') //设置XComponent宽度
+ .height('1080px') //设置XComponent高度
+ }
+}
+```
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/apis/js-apis-Context.md b/zh-cn/application-dev/reference/apis/js-apis-Context.md
index a019b4968ef3cd42b1b5e497fa9360892e3cd739..5ded8f0e02c5a92ec5b41166e485988e3e72b60d 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-Context.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-Context.md
@@ -6,10 +6,11 @@
## 导入模块
```js
-import featureAbility from '@ohos.ability.featureAbility'
-import bundle from '@ohos.bundle'
+import Context from "@ohos.app.context";
```
+## 使用说明
+
Context对象是在featureAbility中创建实例,并通过featureAbility的getContext()接口返回,因此在使用Context时,必须导入@ohos.ability.featureAbility库。示例如下:
```js
diff --git a/zh-cn/application-dev/reference/apis/js-apis-ability-context.md b/zh-cn/application-dev/reference/apis/js-apis-ability-context.md
index 91155f36f486238c642c406636e6d80ae48310a5..81e4dacaf4e484d2f7a3822ffabed8d635932b54 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-ability-context.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-ability-context.md
@@ -3,17 +3,17 @@
>  **说明:**
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
-
Ability的上下文环境,继承自Context。
+## 导入模块
+```js
+import AbilityContext from '@ohos.application.abilityContext'
+```
## 使用说明
-
在使用AbilityContext的功能前,需要通过Ability子类实例获取。
-
-
```js
import Ability from '@ohos.application.Ability'
class MainAbility extends Ability {
diff --git a/zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md b/zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md
index 967165a14dea9741c2432716a5f03fe507400b38..a3dd7c921e7dba9e0f6db1a618b0bcedfa9f6246 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md
@@ -6,7 +6,11 @@
Ability运行相关信息。
+## 导入模块
+```js
+import AbilityRunningInfo from '@ohos.application.abilityRunningInfo';
+```
## 使用说明
diff --git a/zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md b/zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md
index 5bf1ffba7de3ded2a797be4db301ae7452aa96af..9542eaf22ac2587ec2c80f616ad77d985680df84 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md
@@ -6,6 +6,11 @@
AbilityStage的上下文环境,继承自[Context](js-apis-application-context.md)。
+## 导入模块
+
+```js
+import AbilityStageContext from '@ohos.application.abilityStageContext';
+```
## 使用说明
diff --git a/zh-cn/application-dev/reference/apis/js-apis-accessibility.md b/zh-cn/application-dev/reference/apis/js-apis-accessibility.md
index 7d3076a1c53ab8f84d5aac56cf6677ba774a155f..b10175b813f6d459b0033aab306c00ba31138c3e 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-accessibility.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-accessibility.md
@@ -266,6 +266,26 @@ off(type: 'styleChange', callback?: Callback<CaptionsStyle>): void;
| endIndex | number | 是 | 是 | 画面显示条目的结束序号。 |
| itemCount | number | 是 | 是 | 条目总数。 |
+### 方法
+
+#### constructor
+
+constructor(jsonObject)
+
+构造函数。
+
+- 参数:
+
+ | 参数名 | 参数类型 | 必填 | 说明 |
+ | -------- | -------- | -------- | -------- |
+ | jsonObject | string | 是 | 创建对象所需要的 JSON 格式字符串。 |
+
+- 示例
+
+ ```typescript
+ let eventInfo = new accessibility.EventInfo({"type":"click","bundleName":"com.example.MyApplication","triggerAction":"click"})
+ ```
+
## EventType
无障碍事件类型。
@@ -310,15 +330,9 @@ off(type: 'styleChange', callback?: Callback<CaptionsStyle>): void;
| -------- | -------- |
| add | 添加窗口的窗口变化事件。 |
| remove | 一个窗口被删除的窗口变化事件。 |
-| title | 窗口标题已更改的窗口变化事件。 |
| bounds | 窗口边界已更改的窗口变化事件。 |
-| layer | 窗口层级发生变化的窗口变化事件。 |
| active | 窗口变为活动或不活动的窗口变化事件。 |
| focus | 窗口焦点发生变化的窗口变化事件。 |
-| accessibilityFocus | 窗口无障碍焦点发生变化的窗口更改事件。 |
-| parent | 父窗口已更改的窗口变化事件。 |
-| children | 子窗口已更改的窗口变化事件。 |
-| pip | 窗口进入或退出画中画(PIP)模式的窗口变化事件。 |
## accessibility.getAbilityLists
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md b/zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md
index 7327a29524cffc8b3db346b5dd1210b578bf2b3b..52d7863e98bd03e9962f1479a7cbc70763433e56 100755
--- a/zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md
@@ -10,13 +10,18 @@
## 导入模块
+```
+import MissionSnapshot from "@ohos.application.missionSnapshot";
+```
+## 使用说明
+
+使用前需要提前引入对应模块。
```
import { ElementName } from '../bundle/elementName';
import { image } from '../@ohos.multimedia.image';
```
-
## MissionSnapshot
表示任务对应的任务快照的枚举。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-Want.md b/zh-cn/application-dev/reference/apis/js-apis-application-Want.md
index 4a6cbf9e813e32e3de6ed004fed329dadb7a2ea1..a982d6794454eb0cf25bef3192187ae303e2ff63 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-application-Want.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-Want.md
@@ -28,4 +28,4 @@ import Want from '@ohos.application.Want';
| action | 只读 | string | 否 | 表示action选项描述。 |
| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述。 |
| entities | 只读 | Array\ | 否 | 表示entities相关描述。 |
-| moduleName9 | 只读 | string | 否 | 表示待启动的Ability所属的模块(module)。同一应用的不同hap的组件可能重名,仅通过BundleName和AbilityName无法区分时,可以通过设置moduleName加以区分,以匹配到指定的Ability。 | |
+| moduleName9+ | 只读 | string | 否 | 表示待启动的Ability所属的模块(module)。同一应用的不同hap的组件可能重名,仅通过BundleName和AbilityName无法区分时,可以通过设置moduleName加以区分,以匹配到指定的Ability。 | |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-ability.md b/zh-cn/application-dev/reference/apis/js-apis-application-ability.md
index 306be5858bbcc592b89484bb149187a67d8376cb..00987cd540405376a4dde2ec55483e537927a811 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-application-ability.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-ability.md
@@ -259,6 +259,31 @@ onConfigurationUpdated(config: Configuration): void;
}
```
+## Ability.dump
+
+dump(params: Array\): Array\;
+
+指示from命令的参数。
+
+**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore
+
+**参数:**
+
+ | 参数名 | 类型 | 必填 | 说明 |
+ | -------- | -------- | -------- | -------- |
+ | params | Array\ | 是 | 指示from命令的参数。|
+
+**示例:**
+
+ ```js
+ class myAbility extends Ability {
+ dump(params) {
+ console.log('dump, params:' + JSON.stringify(params));
+ }
+ }
+ ```
+
+
## Caller
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md b/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md
index 1900632c2e0738d4b7e9fde059aea897c5d5f80d..cfaa22a541b3c3500bc43f6b5d06ffb7ede7bf0a 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md
@@ -7,7 +7,7 @@
## 导入模块
```js
-import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import AbilityDelegator from '@ohos.application.abilityDelegator'
```
@@ -747,7 +747,7 @@ abilityDelegator.executeShellCommand(cmd, timeout, (err : any, data : any) => {
### executeShellCommand
-executeShellCommand(cmd: string, timeoutSecs: number): Promise\
+executeShellCommand(cmd: string, timeoutSecs?: number): Promise\
指定超时时间,并执行指定的shell命令(promise形式)
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md b/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md
index 2fb204540b33ab4c510a21145a89474c02145eaa..b1b16092e204fce1382d373dfe07a89d9b88efb5 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md
@@ -7,7 +7,7 @@
## 导入模块
```js
-import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import AbilityDelegatorArgs from '@ohos.application.abilityDelegatorArgs'
```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md b/zh-cn/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md
index bd4ad4df68876f68e384e639fccf9b912c21d52c..007c4af80328d3821118803610b551c97fc424f2 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md
@@ -6,6 +6,12 @@
应用上下文ApplicationContext的生命周期监听方法的回调类,里面提供了onAbilityCreate、onAbilityWindowStageCreate、onAbilityWindowStageDestroy等方法。
+## 导入模块
+
+```js
+import AbilityLifecycleCallback from "@ohos.application.abilityLifecycleCallback";
+```
+
## AbilityLifecycleCallback.onAbilityCreate
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-context.md b/zh-cn/application-dev/reference/apis/js-apis-application-context.md
index 5aec0d2417ee41692b6b249f17bcdca5c4369412..98fabaea000ed1a0d8fcef18651beb1bf4d0d8cf 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-application-context.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-context.md
@@ -6,7 +6,11 @@
提供开发者运行代码的上下文环境,包括应用信息、ResourceManager等信息。
+## 导入模块
+```js
+import Context from "@ohos.application.context";
+```
## 使用说明
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-missionInfo.md b/zh-cn/application-dev/reference/apis/js-apis-application-missionInfo.md
new file mode 100644
index 0000000000000000000000000000000000000000..11e918744ddf82d4000c1d0eddf0e617ad663385
--- /dev/null
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-missionInfo.md
@@ -0,0 +1,28 @@
+# MissionInfo
+
+>  **说明:**
+> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+
+## 导入模块
+
+```js
+import MissionInfo from '@ohos.application.missionInfo'
+```
+
+
+## MissionInfo
+
+表示Ability对应任务信息的枚举。
+
+**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase
+
+| 名称 | 参数类型 | 可读 | 可写 | 说明 |
+| -------- | -------- | -------- | -------- | -------- |
+| missionId | number | 是 | 是 | 表示任务ID。|
+| runningState | number | 是 | 是 | 表示运行状态。 |
+| lockedState | boolean | 是 | 是 | 表示锁定状态。 |
+| timestamp | string | 是 | 是 | 表示任务的最近创建或更新时间。 |
+| want | [Want](js-apis-application-Want.md) | 是 | 是 | 表示任务的Want信息。 |
+| label | string | 是 | 是 | 表示任务的标签。 |
+| iconPath | string | 是 | 是 | 表示任务的图标路径。 |
+| continuable | boolean | 是 | 是 | 表示任务是否可以继续。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md b/zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md
index 7d6fc93ecf7416cfc0ae381f7276b2e70d08d776..f5b4604103f502c2578e66ec0a3c8f246f39bc6a 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md
@@ -7,7 +7,7 @@
## 导入模块
```js
-import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import ShellCmdResult from '@ohos.application.shellCmdResult'
```
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 d0735c83249f4282d1060fd957354c75de4e39e6..c5f31e58aad9e6e7fc8a63dea9d94f732a64c801 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-appmanager.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-appmanager.md
@@ -160,7 +160,7 @@ getAppMemorySize(callback: AsyncCallback\): void;
```
## appManager.getProcessRunningInfos8+
-getProcessRunningInfos(): Promise>;
+getProcessRunningInfos(): Promise>;
获取有关运行进程的信息。
@@ -184,7 +184,7 @@ getProcessRunningInfos(): Promise>;
## appManager.getProcessRunningInfos8+
-getProcessRunningInfos(callback: AsyncCallback>): void;
+getProcessRunningInfos(callback: AsyncCallback>): void;
获取有关运行进程的信息。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-call.md b/zh-cn/application-dev/reference/apis/js-apis-call.md
index 907d13afcebed25b17aacc68208a3e861735219a..c7afa64a1279f109c0ae1285b52737f13575f677 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-call.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-call.md
@@ -2,7 +2,7 @@
call模块提供呼叫管理功能,包括拨打电话、跳转到拨号界面、获取通话状态、格式化电话号码等。
-如需订阅通话状态请使用[`observer.on('callStateChange')`](../reference/apis/js-apis-observer.md#observeroncallstatechange)。
+如需订阅通话状态请使用[`observer.on('callStateChange')`](js-apis-observer.md#observeroncallstatechange)。
>**说明:**
>
diff --git a/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md b/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md
index 8111e53fe8502ffc811a942441b19e465b376d9b..2a88d01e5b99f51ca9f95e12dba45c36b61b7c58 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md
@@ -21,14 +21,15 @@ isSupported(feature: number): boolean
**系统能力**:SystemCapability.Communication.NFC
-- 返回值:
+**返回值:**
+
| **类型** | **说明** |
| -------- | -------- |
| boolean | true:支持该类型卡模拟, false:不支持该类型卡模拟。 |
## HceService
-管理HCE卡模拟。在调用HceService的接口前,需要先通过getHceService创建实例。
+管理HCE卡模拟。在调用HceService的接口前,需要先通过new cardEmulation.HceService()创建实例。
### startHCE
@@ -91,7 +92,7 @@ sendResponse(responseApdu: number[]): void;
**示例:**
-```
+```js
var hceService = new cardEmulation.HceService();
hceService.startHCE([
"F0010203040506", "A0000000041010"
diff --git a/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md b/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md
index ff076ae0813454d0dfbf033547ecce11ae1fb896..858884076af1a7699c2fe9c3b841eeaa15084157 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md
@@ -5,6 +5,13 @@
## 导入模块
+```js
+import dataAbilityHelper from "@ohos.ability.dataAbilityHelper";
+```
+
+## 使用说明
+
+使用前根据具体情况引入如下模块
```
import featureAbility from '@ohos.ability.featureAbility'
import ohos_data_ability from '@ohos.data.dataability'
diff --git a/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md b/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md
index 9d0b459d822d92c066991609133b1def27bd8f55..1fd8f739e8c7d01855a3d1002284c19ca753305d 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md
@@ -3,6 +3,7 @@
分布式数据管理为应用程序提供不同设备间数据库的分布式协同能力。通过调用分布式数据各个接口,应用程序可将数据保存到分布式数据库中,并可对分布式数据库中的数据进行增/删/改/查等各项操作。
>**说明:**
+>
>本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
@@ -19,7 +20,7 @@ createKVManager(config: KVManagerConfig, callback: AsyncCallback<KVManager>
创建一个KVManager对象实例,用于管理数据库对象,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -58,7 +59,7 @@ createKVManager(config: KVManagerConfig): Promise<KVManager>
创建一个KVManager对象实例,用于管理数据库对象,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -139,7 +140,7 @@ getKVStore<T extends KVStore>(storeId: string, options: Options, callback:
通过指定Options和storeId,创建并获取KVStore数据库,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -183,7 +184,7 @@ getKVStore<T extends KVStore>(storeId: string, options: Options): Promise&
通过指定Options和storeId,创建并获取KVStore数据库,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -230,7 +231,7 @@ closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCa
通过storeId的值关闭指定的KVStore数据库,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -276,7 +277,7 @@ closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise<void&
通过storeId的值关闭指定的KVStore数据库,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -330,7 +331,7 @@ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback<void>
通过storeId的值删除指定的KVStore数据库,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -373,7 +374,7 @@ deleteKVStore(appId: string, storeId: string): Promise<void>
通过storeId的值删除指定的KVStore数据库,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -427,14 +428,14 @@ getAllKVStoreId(appId: string, callback: AsyncCallback<string[]>): void
获取所有通过[getKVStore](#getkvstore)方法创建的且没有调用[deleteKVStore](#deletekvstore8)方法删除的KVStore数据库的storeId,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
| appId | string | 是 | 所调用数据库方的包名。 |
-| callback | AsyncCallback<void> | 是 |回调函数,返回所有创建的 KvStore 数据库的 storeId。 |
+| callback | AsyncCallback<void> | 是 |回调函数,返回所有创建的KvStore数据库的storeId。 |
**示例:**
@@ -457,7 +458,7 @@ getAllKVStoreId(appId: string): Promise<string[]>
获取所有通过[getKVStore](#getkvstore)方法创建的且没有调用[deleteKVStore](#deletekvstore8)方法删除的KVStore数据库的storeId,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -470,7 +471,7 @@ getAllKVStoreId(appId: string): Promise<string[]>
| 类型 | 说明 |
| ------------- | -------------- |
-| Promise<string[]>| Promise实例,返回所有创建的 KvStore 数据库的 storeId。 |
+| Promise<string[]>| Promise实例,返回所有创建的KvStore数据库的storeId。 |
**示例:**
@@ -593,11 +594,11 @@ try {
| 名称 | 默认值 | 说明 |
| --- | ---- | ----------------------- |
| NO_LEVEL | 0 | 表示数据库不设置安全级别。 |
-| S0 | 1 | 表示数据库的安全级别为公共级别安全。 |
-| S1 | 2 | 表示数据库的安全级别为低级别安全,当数据泄露时会产生较低影响。 |
-| S2 | 3 | 表示数据库的安全级别为中级别安全,当数据泄露时会产生较大影响。 |
-| S3 | 5 | 表示数据库的安全级别为高级别安全,当数据泄露时会产生重大影响。 |
-| S4 | 6 | 表示数据库的安全级别为关键级别安全,当数据泄露时会产生严重影响。 |
+| S0 | 1 | 表示数据库的安全级别为公共级别。 |
+| S1 | 2 | 表示数据库的安全级别为低级别,当数据泄露时会产生较低影响。 |
+| S2 | 3 | 表示数据库的安全级别为中级别,当数据泄露时会产生较大影响。 |
+| S3 | 5 | 表示数据库的安全级别为高级别,当数据泄露时会产生重大影响。 |
+| S4 | 6 | 表示数据库的安全级别为关键级别,当数据泄露时会产生严重影响。 |
## Constants
@@ -610,14 +611,14 @@ KVStore常量。
| --- | ---- | ----------------------- |
| MAX_KEY_LENGTH | 1024 | 数据库中Key允许最大长度,单位字节。 |
| MAX_VALUE_LENGTH | 4194303 | 数据库中Value允许的最大长度,单位字节。 |
-| MAX_KEY_LENGTH_DEVICE | 896 | 最大设备坐标密钥长度。 |
+| MAX_KEY_LENGTH_DEVICE | 896 | 最大设备坐标密钥长度,单位字节。 |
| MAX_STORE_ID_LENGTH | 128 | 数据库标识符允许的最大长度,单位字节。 |
-| MAX_QUERY_LENGTH | 512000 | 最大查询长度。 |
-| MAX_BATCH_SIZE | 128 | 最大批处理操作大小。 |
+| MAX_QUERY_LENGTH | 512000 | 最大查询长度,单位字节。 |
+| MAX_BATCH_SIZE | 128 | 最大批处理操作数量。 |
## Schema8+ ##
-表示数据库模式,可以在创建或打开数据库时创建 Schema 对象并将它们放入 Options 中。
+表示数据库模式,可以在创建或打开数据库时创建Schema对象并将它们放入[Options](#options)中。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
@@ -646,7 +647,7 @@ constructor()
| --- | ---- | ----------------------- |
| nullable8+ | boolean | 表示数据库字段是否可以为空。 |
| default8+ | string | 表示Fieldnode的默认值。 |
-| type8+ | number | 表示值。 |
+| type8+ | number | 表示指定节点对应数据类型的值。 |
### constructor8+ ###
@@ -666,7 +667,7 @@ constructor(name: string)
appendChild(child: FieldNode): boolean
-向这个 FieldNode 添加一个子节点。
+在当前 FieldNode 中添加一个子节点。
**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
@@ -680,7 +681,7 @@ appendChild(child: FieldNode): boolean
| 类型 | 说明 |
| ------------- | -------------- |
-| boolean |如果子节点成功添加到这个FieldNode,则返回 true;否则返回 false。 |
+| boolean |如果子节点成功添加到FieldNode,则返回 true,否则返回false。 |
**示例:**
@@ -707,7 +708,7 @@ try {
## KvStoreResultSet8+ ##
-提供获取KVStore数据库结果集的方法,提供查询和移动数据读取位置的方法,在调用KvStoreResultSet的方法前,需要先通过KVStore 构建一个KVStore 实例。
+提供获取KVStore数据库结果集的方法,提供查询和移动数据读取位置的方法,在调用KvStoreResultSet的方法前,需要先通过KVStore构建一个KVStore实例。
### getCount8+ ###
@@ -716,7 +717,7 @@ getCount(): number
获取结果集中的行数。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -731,15 +732,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed:ed: ' + err);
});
const count = resultSet.getCount();
- console.log("GetCount " + count);
+ console.log("getCount succeed:" + count);
} catch (e) {
- console.log("GetCount fail " + e);
+ console.log("getCount failed: " + e);
}
```
@@ -749,7 +750,7 @@ getPosition(): number
获取结果集中当前的读取位置。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -764,15 +765,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed:ed: ' + err);
});
const position = resultSet.getPosition();
- console.log("getPosition " + position);
+ console.log("getPosition succeed:" + position);
} catch (e) {
- console.log("GetPosition fail " + e);
+ console.log("getPosition failed: " + e);
}
```
@@ -783,13 +784,13 @@ moveToFirst(): boolean
将读取位置移动到第一行。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
| 类型 | 说明 |
| ------ | -------------- |
-| boolean |如果操作成功则返回true,否则返回 false。 |
+| boolean |如果操作成功则返回true,否则返回false。 |
**示例:**
@@ -798,15 +799,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.moveToFirst();
- console.log("moveToFirst " + moved);
+ const moved1 = resultSet.moveToFirst();
+ console.log("moveToFirst succeed: " + moved1);
} catch (e) {
- console.log("MoveToFirst fail " + e);
+ console.log("moveToFirst failed " + e);
}
```
@@ -817,13 +818,13 @@ moveToLast(): boolean
将读取位置移动到最后一行。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
| 类型 | 说明 |
| ------ | -------------- |
-| boolean |如果操作成功则返回true,否则返回 false。 |
+| boolean |如果操作成功则返回true,否则返回false。 |
**示例:**
@@ -832,15 +833,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.moveToLast();
- console.log("moveToLast " + moved);
+ const moved2 = resultSet.moveToLast();
+ console.log("moveToLast succeed:" + moved2);
} catch (e) {
- console.log("moveToLast fail " + e);
+ console.log("moveToLast failed: " + e);
}
```
@@ -851,13 +852,13 @@ moveToNext(): boolean
将读取位置移动到下一行。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
| 类型 | 说明 |
| ------ | -------------- |
-| boolean |如果操作成功则返回true,否则返回 false。 |
+| boolean |如果操作成功则返回true,否则返回false。 |
**示例:**
@@ -866,15 +867,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.moveToNext();
- console.log("moveToNext " + moved);
+ const moved3 = resultSet.moveToNext();
+ console.log("moveToNext succeed: " + moved3);
} catch (e) {
- console.log("moveToNext fail " + e);
+ console.log("moveToNext failed: " + e);
}
```
@@ -885,13 +886,13 @@ moveToPrevious(): boolean
将读取位置移动到上一行。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
| 类型 | 说明 |
| ------ | -------------- |
-| boolean |如果操作成功则返回true,否则返回 false。 |
+| boolean |如果操作成功则返回true,否则返回false。 |
**示例:**
@@ -900,15 +901,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.moveToPrevious();
- console.log("moveToPrevious " + moved);
+ const moved4 = resultSet.moveToPrevious();
+ console.log("moveToPrevious succeed:" + moved4);
} catch (e) {
- console.log("moveToPrevious fail " + e);
+ console.log("moveToPrevious failed: " + e);
}
```
@@ -919,7 +920,7 @@ move(offset: number): boolean
将读取位置移动到当前位置的相对偏移量。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -931,7 +932,7 @@ move(offset: number): boolean
| 类型 | 说明 |
| ------ | -------------- |
-| boolean |如果操作成功则返回true,否则返回 false。 |
+| boolean |如果操作成功则返回true,否则返回false。 |
**示例:**
@@ -940,15 +941,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.move();
- console.log("move " + moved);
+ const moved5 = resultSet.move();
+ console.log("move succeed:" + moved5);
} catch (e) {
- console.log("move fail " + e);
+ console.log("move failed: " + e);
}
```
@@ -959,7 +960,7 @@ moveToPosition(position: number): boolean
将读取位置从 0 移动到绝对位置。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -971,7 +972,7 @@ moveToPosition(position: number): boolean
| 类型 | 说明 |
| ------ | -------------- |
-| boolean |如果操作成功则返回true,否则返回 false。 |
+| boolean |如果操作成功则返回true,否则返回false。 |
**示例:**
@@ -980,15 +981,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.moveToPosition();
- console.log("moveToPosition " + moved);
+ const moved6 = resultSet.moveToPosition();
+ console.log("moveToPosition succeed: " + moved6);
} catch (e) {
- console.log("moveToPosition fail " + e);
+ console.log("moveToPosition failed: " + e);
}
```
@@ -999,13 +1000,13 @@ isFirst(): boolean
检查读取位置是否为第一行。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
| 类型 | 说明 |
| ------ | -------------- |
-| boolean |如果读取位置是第一行,则返回 true;否则返回 false。 |
+| boolean |如果操作成功则返回true,否则返回false。 |
**示例:**
@@ -1014,15 +1015,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.isFirst();
- console.log("isFirst " + moved);
+ const isfirst = resultSet.isFirst();
+ console.log("Check isFirst succeed:" + isfirst);
} catch (e) {
- console.log("isFirst fail " + e);
+ console.log("Check isFirst failed: " + e);
}
```
@@ -1033,13 +1034,13 @@ isLast(): boolean
检查读取位置是否为最后一行。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
| 类型 | 说明 |
| ------ | -------------- |
-| boolean |如果读取位置是最后一行,则返回 true;否则返回 false。 |
+| boolean |如果读取位置是最后一行,则返回 true,否则返回false。 |
**示例:**
@@ -1048,15 +1049,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.isLast();
- console.log("isLast " + moved);
+ const islast = resultSet.isLast();
+ console.log("Check isLast succeed: " + islast);
} catch (e) {
- console.log("isLast fail " + e);
+ console.log("Check isLast failed: " + e);
}
```
@@ -1066,13 +1067,13 @@ isBeforeFirst(): boolean
检查读取位置是否在第一行之前。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
| 类型 | 说明 |
| ------ | -------------- |
-| boolean |如果读取位置在第一行之前,则返回 true;否则返回 false。 |
+| boolean |如果读取位置在第一行之前,则返回 true,否则返回false。 |
**示例:**
@@ -1081,15 +1082,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.isBeforeFirst();
- console.log("isBeforeFirst " + moved);
+ const isbeforefirst = resultSet.isBeforeFirst();
+ console.log("Check isBeforeFirst succeed: " + isbeforefirst);
} catch (e) {
- console.log("isBeforeFirst fail " + e);
+ console.log("Check isBeforeFirst failed: " + e);
}
```
@@ -1100,13 +1101,13 @@ isAfterLast(): boolean
检查读取位置是否在最后一行之后。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
| 类型 | 说明 |
| ------ | -------------- |
-| boolean |如果读取位置在最后一行之后,则返回 true;否则返回 false。 |
+| boolean |如果读取位置在最后一行之后,则返回 true,否则返回false。 |
**示例:**
@@ -1115,15 +1116,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.isAfterLast();
- console.log("isAfterLast " + moved);
+ const isafterlast = resultSet.isAfterLast();
+ console.log("Check isAfterLast succeed:" + isafterlast);
} catch (e) {
- console.log("isAfterLast fail " + e);
+ console.log("Check isAfterLast failed: " + e);
}
```
@@ -1134,7 +1135,7 @@ getEntry(): Entry
获取键值对。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -1149,16 +1150,15 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + err);
+ console.log('getResultSet failed: ' + err);
});
- const moved = resultSet.moveToNext();
const entry = resultSet.getEntry();
- console.log("getEntry " + JSON.stringify(entry));
+ console.log("getEntry succeed:" + JSON.stringify(entry));
} catch (e) {
- console.log("getEntry fail " + e);
+ console.log("getEntry failed: " + e);
}
```
@@ -1167,7 +1167,7 @@ try {
使用谓词表示数据库查询,提供创建Query实例、查询数据库中的数据和添加谓词的方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
### constructor8+ ###
@@ -1175,7 +1175,7 @@ constructor()
用于创建Schema实例的构造函数。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
### reset8+ ###
@@ -1184,14 +1184,14 @@ reset(): Query
公共查询重置。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
| 类型 | 说明 |
| ------ | ------- |
-| [Query](#query8) |返回重置的 Query 对象。|
+| [Query](#query8) |返回重置的Query对象。|
**示例:**
@@ -1215,20 +1215,20 @@ equalTo(field: string, value: number|string|boolean): Query
构造一个Query对象来查询具有指定字段的条目,其值等于指定的值。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
-| 参数名 | 参数类型 | 必填 | 说明 |
+| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
| value | number\|string\|boolean | 是 | 表示指定的值。|
**返回值:**
| 类型 | 说明 |
| ------ | ------- |
-| [Query](#query8) |返回重置的 Query 对象。|
+| [Query](#query8) |返回重置的Query对象。|
**示例:**
@@ -1250,20 +1250,20 @@ notEqualTo(field: string, value: number|string|boolean): Query
构造一个Query对象以查询具有指定字段且值不等于指定值的条目。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
| value | number\|string\|boolean | 是 | 表示指定的值。|
**返回值:**
| 类型 | 说明 |
| ------ | ------- |
-| [Query](#query8) |返回重置的 Query 对象。|
+| [Query](#query8) |返回重置的Query对象。|
**示例:**
@@ -1285,13 +1285,13 @@ greaterThan(field: string, value: number|string|boolean): Query
构造一个Query对象以查询具有大于指定值的指定字段的条目。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
| value | number\|string\|boolean | 是 | 表示指定的值。|
**返回值:**
@@ -1320,13 +1320,13 @@ lessThan(field: string, value: number|string): Query
构造一个Query对象以查询具有小于指定值的指定字段的条目。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
| value | number\|string\|boolean | 是 | 表示指定的值。|
**返回值:**
@@ -1355,13 +1355,13 @@ greaterThanOrEqualTo(field: string, value: number|string): Query
构造一个Query对象以查询具有指定字段且值大于或等于指定值的条目。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
| value | number\|string\|boolean | 是 | 表示指定的值。|
**返回值:**
@@ -1390,13 +1390,13 @@ lessThanOrEqualTo(field: string, value: number|string): Query
构造一个Query对象以查询具有指定字段且值小于或等于指定值的条目。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
| value | number\|string\|boolean | 是 | 表示指定的值。|
**返回值:**
@@ -1426,13 +1426,13 @@ isNull(field: string): Query
构造一个Query对象以查询具有值为null的指定字段的条目。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
**返回值:**
@@ -1461,13 +1461,13 @@ inNumber(field: string, valueList: number[]): Query
构造一个Query对象以查询具有指定字段的条目,其值在指定的值列表中。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
| valueList | number[] | 是 | 表示指定的值列表。|
**返回值:**
@@ -1496,13 +1496,13 @@ inString(field: string, valueList: string[]): Query
构造一个Query对象以查询具有指定字段的条目,其值在指定的字符串值列表中。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
| valueList | string[] | 是 | 表示指定的字符串值列表。|
**返回值:**
@@ -1531,13 +1531,13 @@ notInNumber(field: string, valueList: number[]): Query
构造一个Query对象以查询具有指定字段的条目,该字段的值不在指定的值列表中。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
| valueList | number[] | 是 | 表示指定的值列表。|
**返回值:**
@@ -1566,13 +1566,13 @@ notInString(field: string, valueList: string[]): Query
构造一个Query对象以查询具有指定字段且值不在指定字符串值列表中的条目。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
| valueList | string[] | 是 | 表示指定的字符串值列表。|
**返回值:**
@@ -1601,14 +1601,14 @@ like(field: string, value: string): Query
构造一个Query对象以查询具有与指定字符串值相似的指定字段的条目。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
-| valueList | string | 是 | 表示指定的字符串值。|
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
+| value | string | 是 | 表示指定的字符串值。|
**返回值:**
@@ -1636,14 +1636,14 @@ unlike(field: string, value: string): Query
构造一个Query对象以查询具有与指定字符串值不相似的指定字段的条目。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
-| valueList | string | 是 | 表示指定的字符串值。|
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
+| value | string | 是 | 表示指定的字符串值。|
**返回值:**
@@ -1671,7 +1671,7 @@ and(): Query
构造一个带有与条件的查询对象。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -1701,7 +1701,7 @@ or(): Query
构造一个带有或条件的Query对象。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -1731,13 +1731,13 @@ orderByAsc(field: string): Query
构造一个Query对象,将查询结果按升序排序。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
**返回值:**
@@ -1766,13 +1766,13 @@ orderByDesc(field: string): Query
构造一个Query对象,将查询结果按降序排序。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| fieId | string | 是 |表示指定字段,必须以$开头, 并且不能包含' ^ '。 |
+| fieId | string | 是 |表示指定字段,且不能包含' ^ '。 |
**返回值:**
@@ -1801,7 +1801,7 @@ limit(total: number, offset: number): Query
构造一个Query对象来指定结果的数量和开始位置。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -1837,7 +1837,7 @@ isNotNull(field: string): Query
使用不为空的指定字段创建查询条件。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -1871,7 +1871,7 @@ beginGroup(): Query
创建一个带有左括号的查询条件组。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -1901,7 +1901,7 @@ endGroup(): Query
创建一个带有右括号的查询条件组。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -1931,7 +1931,7 @@ prefixKey(prefix: string): Query
创建具有指定键前缀的查询条件。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -1966,7 +1966,7 @@ setSuggestIndex(index: string): Query
设置一个指定的索引,将优先用于查询。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2001,13 +2001,13 @@ deviceId(deviceId:string):Query
添加设备ID作为key的前缀。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| deviceId | string | 是 |指示查询的设备 ID。 |
+| deviceId | string | 是 |指示查询的设备ID。 |
**返回值:**
@@ -2035,13 +2035,13 @@ getSqlLike():string
获取指定Query对象的查询语句。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
| 类型 | 说明 |
| ------ | ------- |
-| [Query](#query8) |返回查询对象。|
+| string |返回一个字段列中包含对应子串的结果。|
**示例:**
@@ -2058,9 +2058,7 @@ try {
## KVStore
-KVStore数据库实例,提供增加数据、删除数据和订阅数据变更、订阅同步完成的方法。在调用KVStore的方法前,需要先通过getKVStore构建一个KVStore实例。
-
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+KVStore数据库实例,提供增加数据、删除数据和订阅数据变更、订阅数据同步完成的方法。在调用KVStore的方法前,需要先通过[getKVStore](#getkvstore)构建一个KVStore实例。
### put
@@ -2068,7 +2066,7 @@ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncC
添加指定类型键值对到数据库,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2104,7 +2102,7 @@ put(key: string, value: Uint8Array | string | number | boolean): Promise<void
添加指定类型键值对到数据库,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2143,7 +2141,7 @@ delete(key: string, callback: AsyncCallback<void>): void
从数据库中删除指定键值的数据,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2185,7 +2183,7 @@ delete(key: string): Promise<void>
从数据库中删除指定键值的数据,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2228,7 +2226,7 @@ on(event: 'dataChange', type: SubscribeType, observer: Callback<ChangeNotific
订阅指定类型的数据变更通知,此方法为同步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2254,7 +2252,7 @@ on(event: 'syncComplete', syncCallback: Callback<Array<[string, number]>
订阅同步完成事件回调通知,此方法为同步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2278,7 +2276,7 @@ off(event:'dataChange', observer?: Callback<ChangeNotification>): void
取消订阅数据变更通知,此方法为同步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2306,7 +2304,7 @@ putBatch(entries: Entry[], callback: AsyncCallback<void>): void
批量插入键值对到KVStore数据库中,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2353,7 +2351,7 @@ putBatch(entries: Entry[]): Promise<void>
批量插入键值对到KVStore数据库中,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2408,7 +2406,7 @@ deleteBatch(keys: string[], callback: AsyncCallback<void>): void
批量删除KVStore数据库中的键值对,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2455,7 +2453,7 @@ deleteBatch(keys: string[]): Promise<void>
批量删除KVStore数据库中的键值对,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2511,7 +2509,7 @@ startTransaction(callback: AsyncCallback<void>): void
启动KVStore数据库中的事务,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2563,7 +2561,7 @@ startTransaction(): Promise<void>
启动KVStore数据库中的事务,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -2598,7 +2596,7 @@ commit(callback: AsyncCallback<void>): void
提交KVStore数据库中的事务,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2630,7 +2628,7 @@ commit(): Promise<void>
提交KVStore数据库中的事务,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -2660,7 +2658,7 @@ rollback(callback: AsyncCallback<void>): void
在KVStore数据库中回滚事务,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2692,7 +2690,7 @@ rollback(): Promise<void>
在KVStore数据库中回滚事务,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -2722,13 +2720,13 @@ enableSync(enabled: boolean, callback: AsyncCallback<void>): void
设定是否开启同步,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| enabled |boolean | 是 |指定是否开启同步,ture表示开启同步,false表示不启用同步。 |
+| enabled |boolean | 是 |设定是否开启同步,true表示开启同步,false表示不启用同步。 |
| callback |AsyncCallback<void> | 是 |回调函数。 |
**示例:**
@@ -2755,13 +2753,13 @@ enableSync(enabled: boolean): Promise<void>
设定是否开启同步,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| enabled |boolean | 是 |指定是否开启同步,ture表示开启同步,false表示不启用同步。 |
+| enabled |boolean | 是 |设定是否开启同步,true表示开启同步,false表示不启用同步。 |
**返回值:**
@@ -2791,7 +2789,7 @@ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: Asy
设置同步范围标签,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2823,7 +2821,7 @@ setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise<v
设置同步范围标签,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2896,14 +2894,14 @@ try {
## Value
-存储在数据库中的对象。
+存储在数据库中的值对象。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.DistributedDataManager.KVStore.Core。
| 名称 | 参数类型 |可读 |可写 | 说明 |
| ----- | ------- | -----| ------|------------------------ |
| type | [ValueType](#value) | 是 | 是 |值类型。 |
-| value | Uint8Array \| string \| number \| boolean| 是 | 是 |值对象。 |
+| value | Uint8Array \| string \| number \| boolean| 是 | 是 |值。 |
## ValueType
@@ -2924,9 +2922,7 @@ try {
## SingleKVStore
-单版本分布式数据库,继承自KVStore,提供查询数据和同步数据的方法。在调用 SingleKVStore 的方法前,需要先通过 [getKVStore](#getkvstore) 构建一个 SingleKVStore 实例。
-
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+单版本分布式数据库,继承自KVStore,提供查询数据和同步数据的方法。在调用SingleKVStore的方法前,需要先通过 [getKVStore](#getkvstore) 构建一个SingleKVStore实例。
### get
@@ -2934,7 +2930,7 @@ get(key: string, callback: AsyncCallback<Uint8Array | string | boolean | numb
获取指定键的值,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -2972,7 +2968,7 @@ get(key: string): Promise<Uint8Array | string | boolean | number>
获取指定键的值,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3015,7 +3011,7 @@ getEntries(keyPrefix: string, callback: AsyncCallback<Entry[]>): void
获取匹配指定键前缀的所有键值对,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3061,7 +3057,7 @@ getEntries(keyPrefix: string): Promise<Entry[]>
获取匹配指定键前缀的所有键值对,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3117,9 +3113,9 @@ try {
getEntries(query: Query, callback: AsyncCallback<Entry[]>): void
-获取与指定 Query 对象匹配的键值对列表,并通过callback方式返回,此方法为异步方法。
+获取与指定Query对象匹配的键值对列表,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3221,13 +3217,13 @@ try {
```
-### getResultSet8+ ###
+### getResultSet8+ ###
getResultSet(keyPrefix: string, callback: AsyncCallback<KvStoreResultSet>): void
-从 KvStore 数据库中获取具有指定前缀的结果集,并通过callback方式返回,此方法为异步方法。
+从KvStore数据库中获取具有指定前缀的结果集,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3257,7 +3253,7 @@ try {
kvStore.putBatch(entries, async function (err, data) {
console.log('GetResultSet putBatch success');
await kvStore.getResultSet('batch_test_string_key', async function (err, result) {
- console.log('GetResultSet getResultSet success');
+ console.log('GetResultSet getResultSet succeed.');
resultSet = result;
kvStore.closeResultSet(resultSet, function (err, data) {
console.log('GetResultSet closeResultSet success');
@@ -3274,9 +3270,9 @@ try {
getResultSet(keyPrefix: string): Promise<KvStoreResultSet>
-从 KVStore 数据库中获取具有指定前缀的结果集,并通过Promise方式返回,此方法为异步方法。
+从KVStore数据库中获取具有指定前缀的结果集,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3314,10 +3310,10 @@ try {
console.log('PutBatch putBatch fail ' + JSON.stringify(err));
});
kvStore.getResultSet('batch_test_string_key').then((result) => {
- console.log('GetResult getResultSet success');
+ console.log('GetResult getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + JSON.stringify(err));
+ console.log('getResultSet failed: ' + JSON.stringify(err));
});
kvStore.closeResultSet(resultSet).then((err) => {
console.log('GetResult closeResultSet success');
@@ -3334,16 +3330,16 @@ try {
getResultSet(query: Query, callback: AsyncCallback<KvStoreResultSet>): void
-获取与指定 Query 对象匹配的 KvStoreResultSet 对象,并通过callback方式返回,此方法为异步方法。
+获取与指定Query对象匹配的KvStoreResultSet对象,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
| query |Query | 是 |表示查询对象。 |
-| callback |AsyncCallback<[KvStoreResultSet](#kvstoreresultset8)> | 是 |回调函数,获取与指定 Query 对象匹配的 KvStoreResultSet 对象。 |
+| callback |AsyncCallback<[KvStoreResultSet](#kvstoreresultset8)> | 是 |回调函数,获取与指定Query对象匹配的KvStoreResultSet对象。 |
**示例:**
@@ -3368,7 +3364,7 @@ try {
const query = new distributedData.Query();
query.prefixKey("batch_test");
await kvStore.getResultSet(query, async function (err, result) {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
});
});
@@ -3382,9 +3378,9 @@ try {
getResultSet(query: Query): Promise<KvStoreResultSet>
-获取与指定 Query 对象匹配的 KvStoreResultSet 对象,并通过Promise方式返回,此方法为异步方法。
+获取与指定Query对象匹配的KvStoreResultSet对象,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3424,10 +3420,10 @@ try {
const query = new distributedData.Query();
query.prefixKey("batch_test");
kvStore.getResultSet(query).then((result) => {
- console.log(' getResultSet success');
+ console.log(' getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + JSON.stringify(err));
+ console.log('getResultSet failed: ' + JSON.stringify(err));
});
}catch(e) {
console.log('GetResultSet e ' + e);
@@ -3438,16 +3434,16 @@ try {
closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback<void>): void
-关闭由 getResultSet 返回的 KvStoreResultSet 对象,并通过callback方式返回,此方法为异步方法。
+关闭由[SingleKvStore.getResultSet](#singlekvstore_getresultset)返回的KvStoreResultSet对象,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| resultSet |[KvStoreResultSet](#kvstoreresultset8) | 是 |表示要关闭的 KvStoreResultSet 对象。 |
-| callback |AsyncCallback<void> | 是 |回调函数,获取由 getResultSet 返回的 KvStoreResultSet 对象。 |
+| resultSet |[KvStoreResultSet](#kvstoreresultset8) | 是 |表示要关闭的KvStoreResultSet对象。 |
+| callback |AsyncCallback<void> | 是 |回调函数。 |
**示例:**
@@ -3472,15 +3468,15 @@ try {
closeResultSet(resultSet: KvStoreResultSet): Promise<void>
-关闭由 getResultSet 返回的 KvStoreResultSet 对象,并通过Promise方式返回,此方法为异步方法。
+关闭由[SingleKvStore.getResultSet](#singlekvstore_getresultset)返回的KvStoreResultSet对象,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| resultSet |[KvStoreResultSet](#kvstoreresultset8) | 是 |表示要关闭的 KvStoreResultSet 对象。 |
+| resultSet |[KvStoreResultSet](#kvstoreresultset8) | 是 |表示要关闭的KvStoreResultSet对象。 |
**返回值:**
@@ -3509,16 +3505,16 @@ try {
getResultSize(query: Query, callback: AsyncCallback<number>): void
-获取与指定 Query 对象匹配的结果数,并通过callback方式返回,此方法为异步方法。
+获取与指定Query对象匹配的结果数,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
| query |[Query](#query8) | 是 |表示查询对象。 |
-| callback |AsyncCallback<number> | 是 |回调函数,获取与指定 Query 对象匹配的结果数。 |
+| callback |AsyncCallback<number> | 是 |回调函数,获取与指定Query对象匹配的结果数。 |
**示例:**
@@ -3542,7 +3538,7 @@ try {
const query = new distributedData.Query();
query.prefixKey("batch_test");
await kvStore.getResultSize(query, async function (err, resultSize) {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
});
});
} catch(e) {
@@ -3555,9 +3551,9 @@ try {
getResultSize(query: Query): Promise<number>
-获取与指定 Query 对象匹配的结果数,并通过Promise方式返回,此方法为异步方法。
+获取与指定Query对象匹配的结果数,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3596,9 +3592,9 @@ try {
const query = new distributedData.Query();
query.prefixKey("batch_test");
kvStore.getResultSize(query).then((resultSize) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
}).catch((err) => {
- console.log('getResultSet fail ' + JSON.stringify(err));
+ console.log('getResultSet failed: ' + JSON.stringify(err));
});
}catch(e) {
console.log('GetResultSize e ' + e);
@@ -3612,7 +3608,7 @@ removeDeviceData(deviceId: string, callback: AsyncCallback<void>): void
删除指定设备的数据,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3654,7 +3650,7 @@ removeDeviceData(deviceId: string): Promise<void>
删除指定设备的数据,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3703,7 +3699,7 @@ on(event: 'syncComplete', syncCallback: Callback<Array<[string, number]>
订阅同步完成事件回调通知,此方法为同步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3739,7 +3735,7 @@ off(event: 'syncComplete', syncCallback?: Callback<Array<[string, number]&
取消订阅同步完成事件回调通知,此方法为同步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3768,18 +3764,18 @@ try {
sync(deviceIdList: string[], mode: SyncMode, allowedDelayMs?: number): void
-在手动模式下,触发数据库同步,此方法为同步方法。
+在手动同步方式下,触发数据库同步,此方法为同步方法。关于分布式数据服务的同步方式说明,请见[分布式数据服务概述](../../database/database-mdds-overview.md)。
**需要权限**: ohos.permission.DISTRIBUTED_DATASYNC。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
| deviceIdList |string[] | 是 |同一组网环境下,需要同步的设备的deviceId列表。 |
-| mode |[SyncMode](#syncmode) | 是 |同步类型。 |
+| mode |[SyncMode](#syncmode) | 是 |同步模式。 |
| allowedDelayMs |number | 否 |可选参数,允许延时时间,单位:ms(毫秒)。 |
**示例:**
@@ -3793,9 +3789,9 @@ kvStore.sync('deviceIds', distributedData.SyncMode.PULL_ONLY, 1000);
setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback<void>): void
-设置允许数据库同步的默认延迟,并通过callback方式返回,此方法为异步方法。
+设置数据库同步允许的默认延迟,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3823,9 +3819,9 @@ try {
setSyncParam(defaultAllowedDelayMs: number): Promise<void>
-设置允许数据库同步的默认延迟,并通过Promise方式返回,此方法为异步方法。
+设置数据库同步允许的默认延迟,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3863,7 +3859,7 @@ getSecurityLevel(callback: AsyncCallback<SecurityLevel>): void
获取数据库的安全级别,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -3891,7 +3887,7 @@ getSecurityLevel(): Promise<SecurityLevel>
获取数据库的安全级别,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**返回值:**
@@ -3919,22 +3915,20 @@ try {
在分布式系统中按设备管理分布式数据,继承自KVStore,提供查询数据和同步数据的方法。在调用DeviceKVStore的方法前,需要先通过[getKVStore](#getkvstore)构建一个DeviceKVStore实例。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
-
### get8+ ###
get(deviceId: string, key: string, callback: AsyncCallback<boolean|string|number|Uint8Array>): void
-获取与指定设备 ID 和 key 匹配的 String 值,并通过callback方式返回,此方法为异步方法。
+获取与指定设备ID和key匹配的string值,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
| deviceId |string | 是 |标识要查询其数据的设备。 |
-| key |string | 是 |表示要查询 key 值的键。 |
+| key |string | 是 |表示要查询key值的键。 |
| callback |AsyncCallback<boolean\|string\|number\|Uint8Array> | 是 |回调函数,返回匹配给定条件的字符串值。 |
**示例:**
@@ -3960,16 +3954,16 @@ try{
get(deviceId: string, key: string): Promise<boolean|string|number|Uint8Array>
-获取与指定设备 ID 和 key 匹配的 String 值,并通过Promise方式返回,此方法为异步方法。
+获取与指定设备ID和key匹配的string值,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
| deviceId |string | 是 |标识要查询其数据的设备。 |
-| key |string | 是 |表示要查询 key 值的键。 |
+| key |string | 是 |表示要查询key值的键。 |
**返回值:**
@@ -4004,9 +3998,9 @@ try {
getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback<Entry[]>): void
-获取与指定设备 ID 和 key 前缀匹配的所有键值对,并通过callback方式返回,此方法为异步方法。
+获取与指定设备ID和key前缀匹配的所有键值对,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4052,9 +4046,9 @@ try {
getEntries(deviceId: string, keyPrefix: string): Promise<Entry[]>
-获取与指定设备 ID 和 key 前缀匹配的所有键值对,并通过Promise方式返回,此方法为异步方法。
+获取与指定设备ID和key前缀匹配的所有键值对,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4111,16 +4105,16 @@ try {
getEntries(query: Query, callback: AsyncCallback<Entry[]>): void
-获取与指定 Query 对象匹配的键值对列表,并通过callback方式返回,此方法为异步方法。
+获取与指定Query对象匹配的键值对列表,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
| query |[Query](#query8) | 是 |表示查询对象。 |
-| callback |AsyncCallback<[Entry](#entry)[]> | 是 |回调函数,返回与指定 Query 对象匹配的键值对列表。 |
+| callback |AsyncCallback<[Entry](#entry)[]> | 是 |回调函数,返回与指定Query对象匹配的键值对列表。 |
**示例:**
@@ -4164,9 +4158,9 @@ try {
getEntries(query: Query): Promise<Entry[]>
-获取与指定 Query 对象匹配的键值对列表,并通过Promise方式返回,此方法为异步方法。
+获取与指定Query对象匹配的键值对列表,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4222,9 +4216,9 @@ try {
getEntries(deviceId: string, query: Query, callback: AsyncCallback<Entry[]>): void
-获取与指定设备 ID 和 Query 对象匹配的键值对列表,并通过callback方式返回,此方法为异步方法。
+获取与指定设备ID和Query对象匹配的键值对列表,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4232,7 +4226,7 @@ getEntries(deviceId: string, query: Query, callback: AsyncCallback<Entry[]>
| ----- | ------ | ---- | ----------------------- |
| deviceId |string | 是 |键值对所属的设备ID。 |
| query |[Query](#query8) | 是 |表示查询对象。 |
-| callback |AsyncCallback<[Entry](#entry)[]> | 是 |回调函数,返回与指定 Query 对象匹配的键值对列表。 |
+| callback |AsyncCallback<[Entry](#entry)[]> | 是 |回调函数,返回与指定Query对象匹配的键值对列表。 |
**示例:**
@@ -4276,9 +4270,9 @@ try {
getEntries(deviceId: string, query: Query): Promise<Entry[]>
-获取与指定设备 ID 和 Query 对象匹配的键值对列表,并通过Promise方式返回,此方法为异步方法。
+获取与指定设备ID和Query对象匹配的键值对列表,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4332,13 +4326,13 @@ try {
```
-### getResultSet8+ ###
+### getResultSet8+ ###
getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback<KvStoreResultSet>): void
-获取与指定设备 ID 和 key 前缀匹配的 KvStoreResultSet 对象,并通过callback方式返回,此方法为异步方法。
+获取与指定设备ID和key前缀匹配的KvStoreResultSet对象,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4346,7 +4340,7 @@ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback<KvS
| ----- | ------ | ---- | ----------------------- |
| deviceId |string | 是 |标识要查询其数据的设备。 |
| keyPrefix |string | 是 |表示要匹配的键前缀。 |
-| callback |AsyncCallback<[KvStoreResultSet](#kvstoreresultset8)[]> | 是 |回调函数,返回 KvStoreResultSet 对象。 |
+| callback |AsyncCallback<[KvStoreResultSet](#kvstoreresultset8)[]> | 是 |回调函数,返回KvStoreResultSet对象。 |
**示例:**
@@ -4355,7 +4349,7 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('localDeviceId', 'batch_test_string_key', async function (err, result) {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
await kvStore.closeResultSet(resultSet, function (err, data) {
console.log('closeResultSet success');
@@ -4371,9 +4365,9 @@ try {
getResultSet(deviceId: string, keyPrefix: string): Promise<KvStoreResultSet>
-获取与指定设备 ID 和 key 前缀匹配的 KvStoreResultSet 对象,并通过Promise方式返回,此方法为异步方法。
+获取与指定设备ID和key前缀匹配的KvStoreResultSet对象,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4395,10 +4389,10 @@ let kvStore;
try {
let resultSet;
kvStore.getResultSet('localDeviceId', 'batch_test_string_key').then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + JSON.stringify(err));
+ console.log('getResultSet failed: ' + JSON.stringify(err));
});
kvStore.closeResultSet(resultSet).then((err) => {
console.log('closeResultSet success');
@@ -4415,16 +4409,16 @@ try {
getResultSet(query: Query, callback: AsyncCallback<KvStoreResultSet>): void
-获取与指定 Query 对象匹配的 KvStoreResultSet 对象,并通过callback方式返回,此方法为异步方法。
+获取与指定Query对象匹配的KvStoreResultSet对象,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
| query |[Query](#query8) | 是 |表示查询对象。 |
-| callback |AsyncCallback<[KvStoreResultSet](#kvstoreresultset8)[]> | 是 |回调函数,返回与指定 Query 对象匹配的 KvStoreResultSet 对象。 |
+| callback |AsyncCallback<[KvStoreResultSet](#kvstoreresultset8)[]> | 是 |回调函数,返回与指定Query对象匹配的KvStoreResultSet对象。 |
**示例:**
@@ -4450,7 +4444,7 @@ try {
query.prefixKey("batch_test");
query.deviceId('localDeviceId');
await kvStore.getResultSet(query, async function (err, result) {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
await kvStore.closeResultSet(resultSet, function (err, data) {
console.log('closeResultSet success');
@@ -4467,9 +4461,9 @@ try {
getResultSet(query: Query): Promise<KvStoreResultSet>
-获取与指定 Query 对象匹配的 KvStoreResultSet 对象,并通过Promise方式返回,此方法为异步方法。
+获取与指定Query对象匹配的KvStoreResultSet对象,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4511,10 +4505,10 @@ try {
query.prefixKey("batch_test");
console.log("GetResultSet " + query.getSqlLike());
kvStore.getResultSet(query).then((result) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('getResultSet fail ' + JSON.stringify(err));
+ console.log('getResultSet failed: ' + JSON.stringify(err));
});
kvStore.closeResultSet(resultSet).then((err) => {
console.log('closeResultSet success');
@@ -4533,7 +4527,7 @@ getResultSet(deviceId: string, query: Query, callback: AsyncCallback<KvStoreR
获取与指定设备ID和Query对象匹配的KvStoreResultSet对象,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4541,7 +4535,7 @@ getResultSet(deviceId: string, query: Query, callback: AsyncCallback<KvStoreR
| ----- | ------ | ---- | ----------------------- |
| deviceId |string | 是 |KvStoreResultSet对象所属的设备ID。 |
| query |[Query](#query8) | 是 |表示查询对象。 |
-| callback |AsyncCallback<[KvStoreResultSet](#kvstoreresultset8)[]> | 是 |回调函数,返回与指定 Query 对象匹配的 KvStoreResultSet 对象。 |
+| callback |AsyncCallback<[KvStoreResultSet](#kvstoreresultset8)[]> | 是 |回调函数,返回与指定Query对象匹配的KvStoreResultSet对象。 |
**示例:**
@@ -4566,7 +4560,7 @@ try {
const query = new distributedData.Query();
query.prefixKey("batch_test");
await kvStore.getResultSet('localDeviceId', query, async function (err, result) {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
resultSet = result;
await kvStore.closeResultSet(resultSet, function (err, data) {
console.log('closeResultSet success');
@@ -4585,7 +4579,7 @@ getResultSet(deviceId: string, query: Query): Promise<KvStoreResultSet>
获取与指定设备ID和Query对象匹配的KvStoreResultSet对象,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4626,10 +4620,10 @@ try {
const query = new distributedData.Query();
query.prefixKey("batch_test");
kvStore.getResultSet('localDeviceId', query).then((result) => {
- console.log('GetResultSet getResultSet success');
+ console.log('GetResultSet getResultSet succeed.');
resultSet = result;
}).catch((err) => {
- console.log('GetResultSet getResultSet fail ' + JSON.stringify(err));
+ console.log('GetResultSet getResultSet failed: ' + JSON.stringify(err));
});
query.deviceId('localDeviceId');
console.log("GetResultSet " + query.getSqlLike());
@@ -4649,15 +4643,15 @@ try {
closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback<void>): void
-关闭由 getResultSet 返回的 KvStoreResultSet 对象,并通过callback方式返回,此方法为异步方法。
+关闭由[DeviceKVStore.getResultSet](#devicekvstore_getresultset)返回的KvStoreResultSet对象,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| resultSet |[KvStoreResultSet](#getresultset8) | 是 |指示要关闭的 KvStoreResultSet 对象。 |
+| resultSet |[KvStoreResultSet](#getresultset8) | 是 |指示要关闭的KvStoreResultSet对象。 |
| callback |AsyncCallback<void> | 是 |回调函数。 |
**示例:**
@@ -4684,15 +4678,15 @@ try {
closeResultSet(resultSet: KvStoreResultSet): Promise<void>
-关闭由 getResultSet 返回的 KvStoreResultSet 对象,并通过Promise方式返回,此方法为异步方法。
+关闭由[DeviceKVStore.getResultSet](#devicekvstore_getresultset)返回的KvStoreResultSet对象,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
-| resultSet |[KvStoreResultSet](#getresultset8) | 是 |指示要关闭的 KvStoreResultSet 对象。 |
+| resultSet |[KvStoreResultSet](#getresultset8) | 是 |指示要关闭的KvStoreResultSet对象。 |
**返回值:**
@@ -4722,16 +4716,16 @@ try {
getResultSize(query: Query, callback: AsyncCallback<number>): void
-获取与指定 Query 对象匹配的结果数,并通过callback方式返回,此方法为异步方法。
+获取与指定Query对象匹配的结果数,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
| query |[Query](#query8) | 是 |表示查询对象。 |
-| callback |AsyncCallback<number> | 是 |回调函数,返回与指定 Query 对象匹配的结果数。 |
+| callback |AsyncCallback<number> | 是 |回调函数,返回与指定Query对象匹配的结果数。 |
**示例:**
@@ -4756,7 +4750,7 @@ try {
query.prefixKey("batch_test");
query.deviceId('localDeviceId');
await kvStore.getResultSize(query, async function (err, resultSize) {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
});
});
} catch(e) {
@@ -4769,9 +4763,9 @@ try {
getResultSize(query: Query): Promise<number>
-获取与指定 Query 对象匹配的结果数,并通过Promise方式返回,此方法为异步方法。
+获取与指定Query对象匹配的结果数,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4811,9 +4805,9 @@ try {
query.prefixKey("batch_test");
query.deviceId('localDeviceId');
kvStore.getResultSize(query).then((resultSize) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
}).catch((err) => {
- console.log('getResultSet fail ' + JSON.stringify(err));
+ console.log('getResultSet failed: ' + JSON.stringify(err));
});
}catch(e) {
console.log('GetResultSize e ' + e);
@@ -4825,9 +4819,9 @@ try {
getResultSize(deviceId: string, query: Query, callback: AsyncCallback<number>): void;
-获取与指定设备 ID 和 Query 对象匹配的结果数,并通过callback方式返回,此方法为异步方法。
+获取与指定设备ID和Query对象匹配的结果数,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4835,7 +4829,7 @@ getResultSize(deviceId: string, query: Query, callback: AsyncCallback<number&
| ----- | ------ | ---- | ----------------------- |
| deviceId |string | 是 |KvStoreResultSet对象所属的设备ID。 |
| query |[Query](#query8) | 是 |表示查询对象。 |
-| callback |AsyncCallback<number> | 是 |回调函数,返回与指定 Query 对象匹配的结果数。 |
+| callback |AsyncCallback<number> | 是 |回调函数,返回与指定Query对象匹配的结果数。 |
**示例:**
@@ -4859,7 +4853,7 @@ try {
const query = new distributedData.Query();
query.prefixKey("batch_test");
await kvStore.getResultSize('localDeviceId', query, async function (err, resultSize) {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
});
});
} catch(e) {
@@ -4872,9 +4866,9 @@ try {
getResultSize(deviceId: string, query: Query): Promise<number>
-获取与指定设备 ID 和 Query 对象匹配的结果数,并通过Promise方式返回,此方法为异步方法。
+获取与指定设备ID和Query对象匹配的结果数,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4914,9 +4908,9 @@ try {
var query = new distributedData.Query();
query.prefixKey("batch_test");
kvStore.getResultSize('localDeviceId', query).then((resultSize) => {
- console.log('getResultSet success');
+ console.log('getResultSet succeed.');
}).catch((err) => {
- console.log('getResultSet fail ' + JSON.stringify(err));
+ console.log('getResultSet failed: ' + JSON.stringify(err));
});
}catch(e) {
console.log('GetResultSize e ' + e);
@@ -4930,7 +4924,7 @@ removeDeviceData(deviceId: string, callback: AsyncCallback<void>): void
从当前数据库中删除指定设备的数据,并通过callback方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -4972,7 +4966,7 @@ removeDeviceData(deviceId: string): Promise<void>
从当前数据库中删除指定设备的数据,并通过Promise方式返回,此方法为异步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.DistributedKVStore
**参数:**
@@ -5019,18 +5013,18 @@ try {
sync(deviceIdList: string[], mode: SyncMode, allowedDelayMs?: number): void
-在手动模式下,触发数据库同步,此方法为同步方法。
+在手动同步方式下,触发数据库同步,此方法为同步方法。关于分布式数据服务的同步方式说明,请见[分布式数据服务概述](../../database/database-mdds-overview.md)。
**需要权限**: ohos.permission.DISTRIBUTED_DATASYNC。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----------------------- |
| deviceIdList |string[] | 是 |需要同步DeviceKvStore数据库的设备ID列表。 |
-| mode |[SyncMode](#syncmode) | 是 |表示同步方式,PUSH、PULL或PUSH_PULL。 |
+| mode |[SyncMode](#syncmode) | 是 |同步模式。 |
| allowedDelayMs |number | 否 |可选参数,允许延时时间,单位:ms(毫秒)。 |
**示例:**
@@ -5060,7 +5054,7 @@ on(event: 'syncComplete', syncCallback: Callback<Array<[string, number]>
订阅同步完成事件回调通知,该方法为同步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -5095,7 +5089,7 @@ off(event: 'syncComplete', syncCallback?: Callback<Array<[string, number]&
取消订阅同步完成事件回调通知,该方法为同步方法。
-**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core。
+**系统能力:** SystemCapability.DistributedDataManager.KVStore.Core
**参数:**
@@ -5122,7 +5116,7 @@ try {
## SyncMode
-用于指定同步模式。
+同步模式枚举。
**系统能力:** 以下各项对应的系统能力均为 SystemCapability.DistributedDataManager.KVStore.Core。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md b/zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md
index d0fb55a47dde7eb4277a3fd98f065286543e3724..bc8c445747e2c5f31cecea108d776ddce2de8957 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md
@@ -550,7 +550,7 @@ enterpriseDeviceManager.getEnterpriseInfo(wantTemp, (error, result) => {
## enterpriseDeviceManager.getEnterpriseInfo
-getDeviceSettingsManager(admin: Want): Promise<EnterpriseInfo>
+getEnterpriseInfo(admin: Want): Promise<EnterpriseInfo>
获取设备管理员应用的企业信息,使用Promise形式返回设备管理员应用的企业信息。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-eventhub.md b/zh-cn/application-dev/reference/apis/js-apis-eventhub.md
index 0a1ed1adcc6b998d195a011bd6eccf4bc8ecf7ae..a32d3f6625b57589b433450879bf404327416ee3 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-eventhub.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-eventhub.md
@@ -6,6 +6,11 @@
事件中心,提供订阅、取消订阅、触发事件能力。
+## 导入模块
+
+```js
+import EventHub from "@ohos.application.eventHub";
+```
## 使用说明
diff --git a/zh-cn/application-dev/reference/apis/js-apis-extension-context.md b/zh-cn/application-dev/reference/apis/js-apis-extension-context.md
index cae9ac3e37de8e608a3d6905b35a576466652d33..30f71ae5d6c6c6d0608948f8dbb845422ec072ff 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-extension-context.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-extension-context.md
@@ -6,6 +6,11 @@
Extension的上下文环境,继承自Context。
+## 导入模块
+
+```js
+import ExtensionContext from "@ohos.application.extensionContext";
+```
## 属性
diff --git a/zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md b/zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md
index 5ebfc6c87bebd752e1e8e65aaa22130d748a333d..60d27d15d902696233afdfb8688426b31d615f7b 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md
@@ -6,6 +6,11 @@
Extension运行相关信息。
+## 导入模块
+
+```js
+import ExtensionRunningInfo from "@ohos.application.extensionRunningInfo";
+```
## 使用说明
diff --git a/zh-cn/application-dev/reference/apis/js-apis-formextension.md b/zh-cn/application-dev/reference/apis/js-apis-formextension.md
index 5062f58bf778060f1a3aaff6fb005df79f101c20..815fe17f87118c38c97cf9c3e7b14d2e48537091 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-formextension.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-formextension.md
@@ -218,4 +218,28 @@ onConfigurationUpdated(config: Configuration): void;
console.log('onConfigurationUpdated, config:' + JSON.stringify(config));
}
}
+ ```
+
+ ## FormExtension.onAcquireFormState
+
+onAcquireFormState?(want: Want): formInfo.FormState;
+
+返回formInfo#FormState对象。
+
+**系统能力**:SystemCapability.Ability.Form
+
+**参数:**
+
+ | 参数名 | 类型 | 必填 | 说明 |
+ | -------- | -------- | -------- | -------- |
+ | want | [Want](js-apis-application-Want.md) | 否 | 返回formInfo#FormState对象。 |
+
+**示例:**
+
+ ```js
+ class MyFormExtension extends MyFormExtension {
+ onAcquireFormState(want) {
+ console.log('FormExtension onAcquireFormState, want:' + want);
+ }
+ }
```
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md b/zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md
index 9297f798d3285c3661bad86d8d62a998d1ab8273..4d9c8bf0ee8dce537fd92f5843141723ca4645bb 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md
@@ -5,6 +5,12 @@
FormExtension的上下文环境,提供FormExtension具有的能力和接口,继承自ExtensionContext。
+## 导入模块
+
+```js
+import FormExtensionContext from '@ohos.application.formExtensionContext';
+```
+
## FormExtensionContext.updateForm
updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback\): void
diff --git a/zh-cn/application-dev/reference/apis/js-apis-formhost.md b/zh-cn/application-dev/reference/apis/js-apis-formhost.md
index 58a427d6dd0336bc89152f6881b0187ae8f9230c..9720fe8b6dee7508d35318e338f2902b1b196529 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-formhost.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-formhost.md
@@ -591,7 +591,7 @@ SystemCapability.Ability.Form
## getAllFormsInfo
-getAllFormsInfo(callback: AsyncCallback<Array<FormInfo>>): void;
+getAllFormsInfo(callback: AsyncCallback<Array<formInfo.FormInfo>>): void;
获取设备上所有应用提供的卡片信息。
@@ -619,7 +619,8 @@ SystemCapability.Ability.Form
## getAllFormsInfo
-getAllFormsInfo(): Promise<Array<FormInfo>>;
+getAllFormsInfo(): Promise<Array<formInfo.FormInfo>>;
+
获取设备上所有应用提供的卡片信息。
@@ -645,7 +646,8 @@ SystemCapability.Ability.Form
## getFormsInfo
-getFormsInfo(bundleName: string, callback: AsyncCallback<Array<FormInfo>>): void;
+getFormsInfo(bundleName: string, callback: AsyncCallback<Array<formInfo.FormInfo>>): void;
+
获取设备上指定应用程序提供的卡片信息。
@@ -674,7 +676,8 @@ SystemCapability.Ability.Form
## getFormsInfo
-getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback<Array<FormInfo>>): void;
+getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback<Array<formInfo.FormInfo>>): void;
+
获取设备上指定应用程序提供的卡片信息。
@@ -704,7 +707,8 @@ SystemCapability.Ability.Form
## getFormsInfo
-getFormsInfo(bundleName: string, moduleName?: string): Promise<Array<FormInfo>>;
+getFormsInfo(bundleName: string, moduleName?: string): Promise<Array<formInfo.FormInfo>>;
+
获取设备上指定应用程序提供的卡片信息。
@@ -767,7 +771,7 @@ SystemCapability.Ability.Form
## deleteInvalidForms
-function deleteInvalidForms(formIds: Array<string>): Promise<number>;
+deleteInvalidForms(formIds: Array<string>): Promise<number>;
根据列表删除应用程序的无效卡片。
@@ -800,7 +804,7 @@ SystemCapability.Ability.Form
## acquireFormState
-acquireFormState(want: Want, callback: AsyncCallback<FormStateInfo>): void;
+acquireFormState(want: Want, callback: AsyncCallback<formInfo.FormStateInfo>): void;
获取卡片状态
@@ -834,7 +838,7 @@ SystemCapability.Ability.Form
## acquireFormState
-function acquireFormState(want: Want): Promise<FormStateInfo>;
+acquireFormState(want: Want): Promise<formInfo.FormStateInfo>;
获取卡片状态。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-formprovider.md b/zh-cn/application-dev/reference/apis/js-apis-formprovider.md
index 197ab4e0c353c20b0e61f34ea2b93bc7a3de52c8..253c97bf7f1f690670d1511d28ee48ce7afbcf8a 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-formprovider.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-formprovider.md
@@ -80,7 +80,7 @@ SystemCapability.Ability.Form
## updateForm
-updateForm(formId: string, formBindingData: FormBindingData, callback: AsyncCallback<void>): void;
+updateForm(formId: string, formBindingData: formBindingData.FormBindingData,callback: AsyncCallback<void>): void;
更新指定的卡片。
@@ -111,7 +111,7 @@ SystemCapability.Ability.Form
## updateForm
-updateForm(formId: string, formBindingData: FormBindingData): Promise<void>;
+updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise<void>;
更新指定的卡片,以promise方式返回。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-hichecker.md b/zh-cn/application-dev/reference/apis/js-apis-hichecker.md
index 61526dd638ce66cddb70e40d2b56f27e18864488..ab3edd6a3ddc5cdd83618d04881f380cbb77b8b3 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-hichecker.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-hichecker.md
@@ -1,5 +1,7 @@
# 检测模式
+HiChecker可以作为应用开发阶段使用的检测工具,用于检测代码运行过程中部分易忽略的问题,如应用线程出现耗时调用、应用进程中Ability资源泄露等问题。开发者可以通过日志记录或进程crash等形式查看具体问题并进行修改,提升应用的使用体验。
+
> **说明:**
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
@@ -15,20 +17,19 @@ import hichecker from '@ohos.hichecker';
提供了所有规则类型的常量。
-**系统能力:** 以下各项对应的系统能力均为SystemCapability.HiviewDFX.HiChecker。
+**系统能力:** SystemCapability.HiviewDFX.HiChecker
| 名称 | 参数类型 | 说明 |
| ---------------------------------- | -------- | ------------------------------------------------------ |
-| RULE_CAUTION_PRINT_LOG | BigInt | 告警规则,当有告警时记录日志。 |
-| RULE_CAUTION_TRIGGER_CRASH | BigInt | 告警规则,当有告警时让应用推出。 |
-| RULE_THREAD_CHECK_SLOW_PROCESS | BigInt | 检测规则,检测是否有耗时函数被调用。 |
-| RULE_CHECK_SLOW_EVENT | BigInt | 检测规则,检测是否有事件分发或处理超过规定的时间阈值。 |
-| RULE_CHECK_ABILITY_CONNECTION_LEAK | BigInt | 检测规则,检测是否发生ability泄露。 |
+| RULE_CAUTION_PRINT_LOG | bigInt | 告警规则,当有告警时记录日志。 |
+| RULE_CAUTION_TRIGGER_CRASH | bigInt | 告警规则,当有告警时让应用推出。 |
+| RULE_THREAD_CHECK_SLOW_PROCESS | bigInt | 检测规则,检测是否有耗时函数被调用。 |
+| RULE_CHECK_ABILITY_CONNECTION_LEAK | bigInt | 检测规则,检测是否发生ability泄露。 |
## hichecker.addRule
-addRule(rule: BigInt): void
+addRule(rule: bigInt): void
添加一条或多条规则到系统,系统根据添加的规则进行检测或反馈。
@@ -38,7 +39,7 @@ addRule(rule: BigInt): void
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ---------------- |
-| rule | BigInt | 是 | 需要添加的规则。 |
+| rule | bigInt | 是 | 需要添加的规则。 |
**示例:**
@@ -53,7 +54,7 @@ hichecker.addRule(
## hichecker.removeRule
-removeRule(rule: BigInt): void
+removeRule(rule: bigInt): void
删除一条或多条规则,删除的规则后续将不再生效。
@@ -63,7 +64,7 @@ removeRule(rule: BigInt): void
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ---------------- |
-| rule | BigInt | 是 | 需要删除的规则。 |
+| rule | bigInt | 是 | 需要删除的规则。 |
**示例:**
@@ -78,7 +79,7 @@ hichecker.removeRule(
## hichecker.getRule
-getRule(): BigInt
+getRule(): bigInt
获取当前线程规则、进程规则、告警规则的合集。
@@ -88,7 +89,7 @@ getRule(): BigInt
| 类型 | 说明 |
| ------ | ---------------------- |
-| BigInt | 当前系统中添加的规则。 |
+| bigInt | 当前系统中添加的规则。 |
**示例:**
@@ -102,7 +103,7 @@ hichecker.getRule(); // return 1n;
## hichecker.contains
-contains(rule: BigInt): boolean
+contains(rule: bigInt): boolean
当前已添加的规则集中是否包含了某一个特定的规则,如果传入的规则级别为线程级别,则仅在当前线程中进行查询。
@@ -112,7 +113,7 @@ contains(rule: BigInt): boolean
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ---------------- |
-| rule | BigInt | 是 | 需要查询的规则。 |
+| rule | bigInt | 是 | 需要查询的规则。 |
**返回值:**
diff --git a/zh-cn/application-dev/reference/apis/js-apis-hilog.md b/zh-cn/application-dev/reference/apis/js-apis-hilog.md
index 7c4caaf8d5579f259df88f87602ce8c447bfa38c..ad45774b8dce4261d453deb6642dc504b4e46fd2 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-hilog.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-hilog.md
@@ -1,7 +1,9 @@
# 日志打印
+hilog日志系统,使应用/服务可以按照指定级别、标识和格式字符串输出日志内容,帮助开发者了解应用/服务的运行状态,更好地调试程序。
+以下文档仅对接口功能进行描述,具体的日志打印要求请参考[OpenHarmony日志打印规范](../../../contribute/OpenHarmony-Log-guide.md)。
+
> **说明:**
->
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
@@ -10,184 +12,201 @@
import hilog from '@ohos.hilog';
```
+## hilog.isLoggable
-## hilog.debug
-
-debug(domain: number, tag: string, format: string, ...args: any[]) : void
+isLoggable(domain: number, tag: string, level: LogLevel) : boolean
-debug日志输出,打印debug级别日志。
+在打印日志前调用该接口,用于检查指定领域标识、日志标识和级别的日志是否可以打印。
**系统能力:** SystemCapability.HiviewDFX.HiLog
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| ------ | -------------- | ---- | ------------------------------------------------------------ |
-| domain | number | 是 | 业务领域。范围0x0~0xFFFFF。 |
-| tag | string | 是 | 字符串常量,标识调用所在的类或者业务行为。 |
-| format | string | 是 | 格式字符串,包含参数类型、隐私标识。未加隐私标识的缺省为隐私参数。 |
-| args | any[] | 是 | 与格式字符串里参数类型对应的可变长度参数列表。参数数目、参数类型必须与格式字符串中的标识一一对应。 |
+| 参数名 | 类型 | 必填 | 说明 |
+| ------ | --------------------- | ---- | ------------------------------------------------------------ |
+| domain | number | 是 | 日志对应的领域标识,范围是0x0~0xFFFF,开发者可根据需要自定义。 |
+| tag | string | 是 | 指定日志标识,可以为任意字符串,建议用于标识调用所在的类或者业务行为。 |
+| level | [LogLevel](#loglevel) | 是 | 日志级别。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| ------- | ------------------------------------------------------------ |
+| boolean | 如果返回true,则该领域标识、日志标识和级别的日志可以打印,否则不能打印。 |
**示例:**
```js
-hilog.debug(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0);
+hilog.isLoggable(0x0001, "testTag", hilog.LogLevel.INFO);
```
-**输出:**
+## LogLevel
-```
-09-08 12:49:35.941 1547 2452 D FF00/testTag: 1: hello World 3.0
-```
+日志级别。
-## hilog.info
+**系统能力:** SystemCapability.HiviewDFX.HiLog
-info(domain: number, tag: string, format: string, ...args: any[]) : void
+| 名称 | 默认值 | 说明 |
+| ----- | ------ | ------------------------------------------------------------ |
+| DEBUG | 3 | 详细的流程记录,通过该级别的日志可以更详细地分析业务流程和定位分析问题。 |
+| INFO | 4 | 用于记录业务关键流程节点,可以还原业务的主要运行过程;
用于记录可预料的非正常情况信息,如无网络信号、登录失败等。
这些日志都应该由该业务内处于支配地位的模块来记录,避免在多个被调用的模块或低级函数中重复记录。 |
+| WARN | 5 | 用于记录较为严重的非预期情况,但是对用户影响不大,应用可以自动恢复或通过简单的操作就可以恢复的问题。 |
+| ERROR | 6 | 应用发生了错误,该错误会影响功能的正常运行或用户的正常使用,可以恢复但恢复代价较高,如重置数据等。 |
+| FATAL | 7 | 重大致命异常,表明应用即将崩溃,故障无法恢复。 |
-info日志输出,打印info级别日志。
+## hilog.debug
+
+debug(domain: number, tag: string, format: string, ...args: any[]) : void
+
+打印DEBUG级别的日志。
+
+DEBUG级别的日志在正式发布版本中默认不被打印,只有在调试版本或打开调试开关的情况下才会打印。
**系统能力:** SystemCapability.HiviewDFX.HiLog
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| ------ | -------------- | ---- | ------------------------------------------------------------ |
-| domain | number | 是 | 业务领域。范围0x0~0xFFFFF。 |
-| tag | string | 是 | 字符串常量,标识调用所在的类或者业务行为。 |
-| format | string | 是 | 格式字符串,包含参数类型、隐私标识。未加隐私标识的缺省为隐私参数。 |
-| args | any[] | 是 | 与格式字符串里参数类型对应的可变长度参数列表。参数数目、参数类型必须与格式字符串中的标识一一对应。 |
+| 参数名 | 类型 | 必填 | 说明 |
+| ------ | ------ | ---- | ------------------------------------------------------------ |
+| domain | number | 是 | 日志对应的领域标识,范围是0x0~0xFFFF,开发者可根据需要自定义。 |
+| tag | string | 是 | 指定日志标识,可以为任意字符串,建议用于标识调用所在的类或者业务行为。 |
+| format | string | 是 | 格式字符串,用于日志的格式化输出。格式字符串中可以设置多个参数,参数需要包含参数类型、隐私标识。
隐私标识分为{public}和{private},缺省为{private}。标识{public}的内容明文输出,标识{private}的内容以\过滤回显。 |
+| args | any[] | 是 | 与格式字符串format对应的可变长度参数列表。参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**示例:**
+输出一条DEBUG信息,格式字符串为`"%{public}s World %{private}d"`。其中变参`%{public}s`为明文显示的字符串;`%{private}d`为隐私的整型数。
+
```js
-hilog.info(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0);
+hilog.debug(0x0001, "testTag", "%{public}s World %{private}d", "hello", 3);
```
-**输出:**
+字符串`"hello"`填入`%{public}s`,整型数`3`填入`%{private}d`,输出日志:
```
-09-08 12:49:35.941 1547 2452 I FF00/testTag: 1: hello World 3.0
+08-05 12:21:47.579 2695-2703/com.example.myapplication D 00001/testTag: hello World
```
-## hilog.warn
+## hilog.info
-warn(domain: number, tag: string, format: string, ...args: any[]) : void
+info(domain: number, tag: string, format: string, ...args: any[]) : void
-warn日志输出,打印warn级别日志。
+打印INFO级别的日志。
**系统能力:** SystemCapability.HiviewDFX.HiLog
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| ------ | -------------- | ---- | ------------------------------------------------------------ |
-| domain | number | 是 | 业务领域。范围0x0~0xFFFFF。 |
-| tag | string | 是 | 字符串常量,标识调用所在的类或者业务行为。 |
-| format | string | 是 | 格式字符串,包含参数类型、隐私标识。未加隐私标识的缺省为隐私参数。 |
-| args | any[] | 是 | 与格式字符串里参数类型对应的可变长度参数列表。参数数目、参数类型必须与格式字符串中的标识一一对应。 |
+| 参数名 | 类型 | 必填 | 说明 |
+| ------ | ------ | ---- | ------------------------------------------------------------ |
+| domain | number | 是 | 日志对应的领域标识,范围是0x0~0xFFFF,开发者可根据需要自定义。 |
+| tag | string | 是 | 指定日志标识,可以为任意字符串,建议用于标识调用所在的类或者业务行为。 |
+| format | string | 是 | 格式字符串,用于日志的格式化输出。格式字符串中可以设置多个参数,参数需要包含参数类型、隐私标识。
隐私标识分为{public}和{private},缺省为{private}。标识{public}的内容明文输出,标识{private}的内容以\过滤回显。 |
+| args | any[] | 是 | 与格式字符串format对应的可变长度参数列表。参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**示例:**
+输出一条INFO信息,格式字符串为`"%{public}s World %{private}d"`。其中变参`%{public}s`为明文显示的字符串;`%{private}d`为隐私的整型数。
+
```js
-hilog.warn(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0);
+hilog.info(0x0001, "testTag", "%{public}s World %{private}d", "hello", 3);
```
-**输出:**
+字符串`"hello"`填入`%{public}s`,整型数`3`填入`%{private}d`,输出日志:
```
-09-08 12:49:35.941 1547 2452 W FF00/testTag: 1: hello World 3.0
+08-05 12:21:47.579 2695-2703/com.example.myapplication I 00001/testTag: hello World
```
-## hilog.error
+## hilog.warn
-error(domain: number, tag: string, format: string, ...args: any[]) : void
+warn(domain: number, tag: string, format: string, ...args: any[]) : void
-error日志输出,打印error级别日志。
+打印WARN级别的日志。
**系统能力:** SystemCapability.HiviewDFX.HiLog
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| ------ | -------------- | ---- | ------------------------------------------------------------ |
-| domain | number | 是 | 业务领域。范围0x0~0xFFFFF。 |
-| tag | string | 是 | 字符串常量,标识调用所在的类或者业务行为。 |
-| format | string | 是 | 格式字符串,包含参数类型、隐私标识。未加隐私标识的缺省为隐私参数。 |
-| args | any[] | 是 | 与格式字符串里参数类型对应的可变长度参数列表。参数数目、参数类型必须与格式字符串中的标识一一对应。 |
+| 参数名 | 类型 | 必填 | 说明 |
+| ------ | ------ | ---- | ------------------------------------------------------------ |
+| domain | number | 是 | 日志对应的领域标识,范围是0x0~0xFFFF,开发者可根据需要自定义。 |
+| tag | string | 是 | 指定日志标识,可以为任意字符串,建议用于标识调用所在的类或者业务行为。 |
+| format | string | 是 | 格式字符串,用于日志的格式化输出。格式字符串中可以设置多个参数,参数需要包含参数类型、隐私标识。
隐私标识分为{public}和{private},缺省为{private}。标识{public}的内容明文输出,标识{private}的内容以\过滤回显。 |
+| args | any[] | 是 | 与格式字符串format对应的可变长度参数列表。参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**示例:**
+输出一条WARN信息,格式字符串为`"%{public}s World %{private}d"`。其中变参`%{public}s`为明文显示的字符串;`%{private}d`为隐私的整型数。
+
```js
-hilog.error(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0);
+hilog.warn(0x0001, "testTag", "%{public}s World %{private}d", "hello", 3);
```
-**输出:**
+字符串`"hello"`填入`%{public}s`,整型数`3`填入`%{private}d`,输出日志:
```
-09-08 12:49:35.941 1547 2452 E FF00/testTag: 1: hello World 3.0
+08-05 12:21:47.579 2695-2703/com.example.myapplication W 00001/testTag: hello World
```
-## hilog.fatal
+## hilog.error
-fatal(domain: number, tag: string, format: string, ...args: any[]) : void
+error(domain: number, tag: string, format: string, ...args: any[]) : void
-fatal日志输出,打印fatal级别日志。
+打印ERROR级别的日志。
**系统能力:** SystemCapability.HiviewDFX.HiLog
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| ------ | -------------- | ---- | ------------------------------------------------------------ |
-| domain | number | 是 | 业务领域。范围0x0~0xFFFFF。 |
-| tag | string | 是 | 字符串常量,标识调用所在的类或者业务行为。 |
-| format | string | 是 | 格式字符串,包含参数类型、隐私标识。未加隐私标识的缺省为隐私参数。 |
-| args | any[] | 是 | 与格式字符串里参数类型对应的可变长度参数列表。参数数目、参数类型必须与格式字符串中的标识一一对应。 |
+| 参数名 | 类型 | 必填 | 说明 |
+| ------ | ------ | ---- | ------------------------------------------------------------ |
+| domain | number | 是 | 日志对应的领域标识,范围是0x0~0xFFFF,开发者可根据需要自定义。 |
+| tag | string | 是 | 指定日志标识,可以为任意字符串,建议用于标识调用所在的类或者业务行为。 |
+| format | string | 是 | 格式字符串,用于日志的格式化输出。格式字符串中可以设置多个参数,参数需要包含参数类型、隐私标识。
隐私标识分为{public}和{private},缺省为{private}。标识{public}的内容明文输出,标识{private}的内容以\过滤回显。 |
+| args | any[] | 是 | 与格式字符串format对应的可变长度参数列表。参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**示例:**
+输出一条ERROR信息,格式字符串为`"%{public}s World %{private}d"`。其中变参`%{public}s`为明文显示的字符串;`%{private}d`为隐私的整型数。
+
```js
-hilog.fatal(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0);
+hilog.error(0x0001, "testTag", "%{public}s World %{private}d", "hello", 3);
```
-**输出:**
+字符串`"hello"`填入`%{public}s`,整型数`3`填入`%{private}d`,输出日志:
```
-09-08 12:49:35.941 1547 2452 F FF00/testTag: 1: hello World 3.0
+08-05 12:21:47.579 2695-2703/com.example.myapplication E 00001/testTag: hello World
```
-## hilog.isLoggable
+## hilog.fatal
-isLoggable(domain: number, tag: string, level: LogLevel) : boolean
+fatal(domain: number, tag: string, format: string, ...args: any[]) : void
-检查一个domain、tag和日志级别是否被禁止打印日志。
+打印FATAL级别的日志。
**系统能力:** SystemCapability.HiviewDFX.HiLog
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| ------ | --------------------- | ---- | ------------------------------------------ |
-| domain | number | 是 | 业务领域。范围0x0~0xFFFFF。 |
-| tag | string | 是 | 字符串常量,标识调用所在的类或者业务行为。 |
-| level | [LogLevel](#loglevel) | 是 | 日志级别。 |
+| 参数名 | 类型 | 必填 | 说明 |
+| ------ | ------ | ---- | ------------------------------------------------------------ |
+| domain | number | 是 | 日志对应的领域标识,范围是0x0~0xFFFF,开发者可根据需要自定义。 |
+| tag | string | 是 | 指定日志标识,可以为任意字符串,建议用于标识调用所在的类或者业务行为。 |
+| format | string | 是 | 格式字符串,用于日志的格式化输出。格式字符串中可以设置多个参数,参数需要包含参数类型、隐私标识。
隐私标识分为{public}和{private},缺省为{private}。标识{public}的内容明文输出,标识{private}的内容以\过滤回显。 |
+| args | any[] | 是 | 与格式字符串format对应的可变长度参数列表。参数数目、参数类型必须与格式字符串中的标识一一对应。 |
**示例:**
+输出一条FATAL信息,格式字符串为`"%{public}s World %{private}d"`。其中变参`%{public}s`为明文显示的字符串;`%{private}d`为隐私的整型数。
+
```js
-hilog.isLoggable(0xFF00, "testTag", hilog.DEBUG);
+hilog.fatal(0x0001, "testTag", "%{public}s World %{private}d", "hello", 3);
```
-## LogLevel
-
-用于表示事件类型。
+字符串`"hello"`填入`%{public}s`,整型数`3`填入`%{private}d`,输出日志:
-**系统能力:** 以下各项对应的系统能力均为SystemCapability.HiviewDFX.HiLog。
-
-| 名称 | 默认值 | 说明 |
-| ----- | ------ | ----------- |
-| DEBUG | 3 | DEBUG级别。 |
-| INFO | 4 | INFO级别。 |
-| WARN | 5 | WARN级别。 |
-| ERROR | 6 | ERROR级别。 |
-| FATAL | 7 | FATAL级别。 |
\ No newline at end of file
+```
+08-05 12:21:47.579 2695-2703/com.example.myapplication F 00001/testTag: hello World
+```
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/apis/js-apis-nfcController.md b/zh-cn/application-dev/reference/apis/js-apis-nfcController.md
index a9c7ef7d72a5b0e11a2e4eda9bb9cc028e1f0550..effcf1ae7ac34bba6142895cdc6e80e1f203a247 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-nfcController.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-nfcController.md
@@ -74,7 +74,7 @@ isNfcOpen(): boolean
## controller.getNfcState
-isNfcOpen(): boolean
+getNfcState(): boolean
查询NFC是否打开。
@@ -88,13 +88,13 @@ isNfcOpen(): boolean
## controller.on('nfcStateChange')
-on(type: "notify", callback: Callback<NfcState>): void
+on(type: "nfcStateChange", callback: Callback<NfcState>): void
注册NFC开关状态事件。
**系统能力**:SystemCapability.Communication.NFC
-- **参数**
+**参数**
| **参数名** | **类型** | **必填** | **说明** |
| -------- | -------- | -------- | -------- |
@@ -111,15 +111,16 @@ off(type: "nfcStateChange", callback?: Callback<NfcState>): void
**系统能力**:SystemCapability.Communication.NFC
-- **参数**
+**参数**
| **参数名** | **类型** | **必填** | **说明** |
| -------- | -------- | -------- | -------- |
| type | string | 是 | 固定填"nfcStateChange"字符串 |
| callback | Callback<NfcState> | 否 | 状态改变回调函数。如果callback不填,将“去注册”该事件关联的所有回调函数。 |
-- 示例
- ```
+**示例**
+
+ ```js
import nfcController from '@ohos.nfcController';
var NFC_STATE_NOTIFY = "nfcStateChange";
diff --git a/zh-cn/application-dev/reference/apis/js-apis-nfcTag.md b/zh-cn/application-dev/reference/apis/js-apis-nfcTag.md
index b9a80c9df2ca6556a13ff39d4885d2ccec753598..87fc40e6959e3da7907f5f70ab18f26893e13854 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-nfcTag.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-nfcTag.md
@@ -17,7 +17,7 @@ import tag from '@ohos.nfc.tag';
getNfcATag(tagInfo: TagInfo): NfcATag
-获取NFC A类型Tag对象
+获取NFC A类型Tag对象,通过该对象访问NfcA技术类型的Tag。
**需要权限**:ohos.permission.NFC_TAG
@@ -33,7 +33,7 @@ getNfcATag(tagInfo: TagInfo): NfcATag
getNfcBTag(tagInfo: TagInfo): NfcBTag
-获取NFC B类型Tag对象
+获取NFC B类型Tag对象,通过该对象访问NfcB技术类型的Tag。
**需要权限**:ohos.permission.NFC_TAG
@@ -49,7 +49,7 @@ getNfcBTag(tagInfo: TagInfo): NfcBTag
getNfcFTag(tagInfo: TagInfo): NfcFTag
-获取NFC F类型Tag对象
+获取NFC F类型Tag对象,通过该对象访问NfcF技术类型的Tag。
**需要权限**:ohos.permission.NFC_TAG
@@ -65,13 +65,13 @@ getNfcFTag(tagInfo: TagInfo): NfcFTag
getNfcVTag(tagInfo: TagInfo): NfcVTag
-获取NFC V类型Tag对象
+获取NFC V类型Tag对象,通过该对象访问NfcV技术类型的Tag。
**需要权限**:ohos.permission.NFC_TAG
**系统能力**:SystemCapability.Communication.NFC
-返回值:
+**返回值:**
| **类型** | **说明** |
| -------- | ---------------- |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-notification.md b/zh-cn/application-dev/reference/apis/js-apis-notification.md
index ad552f645b57ac742d9915fa91713f7f63147589..2c24a38ab6d4162cb1a061ed954c2e82b00fe7b5 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-notification.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-notification.md
@@ -185,7 +185,7 @@ Notification.cancel(0, "label", cancelCallback)
## Notification.cancel
-cancel(id:number, label?: string): Promise\
+cancel(id: number, label?: string): Promise\
取消与指定id相匹配的已发布通知,label可以指定也可以不指定(Promise形式)。
@@ -2614,7 +2614,7 @@ Notification.cancelAsBundle(0, representativeBundle, userId, publishCallback);
## Notification.cancelAsBundle9+
-cancelAsBundle(request: NotificationRequest, representativeBundle: string, userId: number): Promise\
+cancelAsBundle(id: number, representativeBundle: string, userId: number): Promise\
发布代理通知(Promise形式)。
@@ -3212,6 +3212,7 @@ Notification.subscribe(subscriber, subscribeCallback);
| lightEnabled | 是 | 是 | boolean | 否 | 是否闪灯。 |
| lightColor | 是 | 是 | number | 否 | 通知灯颜色。 |
| vibrationValues | 是 | 是 | Array\ | 否 | 通知振动样式。 |
+| enabled | 是 | 否 | boolean | 否 | 此通知插槽中的启停状态。 |
## NotificationSorting
diff --git a/zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md b/zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md
index c61ec7613803479d2ea83ebe04acdbc0ec73ad9d..5bafa546eaa15a896cb7826891d41ba5eb9174d4 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md
@@ -6,6 +6,11 @@
权限请求结果。
+## 导入模块
+
+```js
+import PermissionRequestResult from '@ohos.application.permissionRequestResult'
+```
## 属性
diff --git a/zh-cn/application-dev/reference/apis/js-apis-processrunninginfo.md b/zh-cn/application-dev/reference/apis/js-apis-processrunninginfo.md
index c312c11dd96e2260f981af92574a4baacc48d914..e37475a25ea2c2faea10f15fef6ec1f17f12eda7 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-processrunninginfo.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-processrunninginfo.md
@@ -6,6 +6,11 @@
进程运行信息。
+## 导入模块
+
+```js
+import ProcessRunningInfo from '@ohos.application.processRunningInfo'
+```
## 使用说明
diff --git a/zh-cn/application-dev/reference/apis/js-apis-sms.md b/zh-cn/application-dev/reference/apis/js-apis-sms.md
index e776a9365cd5ba3ffd62924c58fc749f42dae57b..c65dc5491b65db2442ff229b1de3630a3aa72c55 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-sms.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-sms.md
@@ -12,7 +12,7 @@ import sms from '@ohos.telephony.sms';
## sms.createMessage
-createMessage\(pdu: Array, specification: string, callback: AsyncCallback\): void
+createMessage\(pdu: Array<number>, specification: string, callback: AsyncCallback\): void
根据协议数据单元(PDU)和指定的短信协议创建短信实例,使用callback方式作为异步方法。
@@ -40,7 +40,7 @@ sms.createMessage(pdu, specification, (err, data) => {
## sms.createMessage
-createMessage\(pdu: Array, specification: string\): Promise
+createMessage\(pdu: Array<number>, specification: string\): Promise
根据协议数据单元(PDU)和指定的短信协议创建短信实例,使用Promise方式作为异步方法。
@@ -110,7 +110,7 @@ sms.sendMessage(options);
## sms.getDefaultSmsSlotId7+
-getDefaultSmsSlotId\(callback: AsyncCallback\): void
+getDefaultSmsSlotId\(callback: AsyncCallback<number>\): void
获取发送短信的默认SIM卡槽ID,使用callback方式作为异步方法。
@@ -133,7 +133,7 @@ sms.getDefaultSmsSlotId((err, data) => {
## sms.getDefaultSmsSlotId7+
-getDefaultSmsSlotId\(\): Promise
+getDefaultSmsSlotId\(\): Promise<number>
获取发送短信的默认SIM卡槽ID,使用Promise方式作为异步方法。
@@ -143,7 +143,7 @@ getDefaultSmsSlotId\(\): Promise
| 类型 | 说明 |
| --------------- | ------------------------------------------------------------ |
-| Promise | 以Promise形式返回发送短信的默认SIM卡:
- 0:卡槽1
- 1:卡槽2 |
+| Promise<number> | 以Promise形式返回发送短信的默认SIM卡:
- 0:卡槽1
- 1:卡槽2 |
**示例:**
diff --git a/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md b/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md
index ddf3b3ec58fb700f1c8ce187952758c7b092f7f5..f4ca3e8db00705f877ed54a4ccfc212f2f7d7c78 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md
@@ -915,6 +915,53 @@ WantAgent.equal(wantAgent1, wantAgent2).then((data) => {
});
```
+## WantAgent.getOperationType
+
+getOperationType(agent: WantAgent, callback: AsyncCallback\): void;
+
+获取WantAgent的操作类型(callback形式)。
+
+**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
+
+**参数:**
+
+| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
+| ---------- | --- | ---- | ------------------------ | ---- | --------------------------------------- |
+| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 |
+| callback | 是 | 否 | AsyncCallback\ | 是 | 获取WantAgent的操作类型。 |
+
+**示例:**
+
+```js
+
+```
+
+## WantAgent.getOperationType
+
+getOperationType(agent: WantAgent): Promise\;
+
+获取WantAgent的操作类型(Promise形式)。
+
+**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
+
+**参数:**
+
+| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 |
+| ---------- | --- | ---- | --------- | ---- | ------------- |
+| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| ----------------------------------------------------------- | ------------------------------------------------------------ |
+| Promise\ | 以Promise形式返回获取WantAgent的操作类型。 |
+
+**示例:**
+
+```js
+
+```
+
## WantAgentInfo
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 64130a267005cd2cabd62bc83de18d848f849d88..afe5736c23ef44ed362e2d840e41813f77e67e3a 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-window.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-window.md
@@ -58,10 +58,10 @@ import window from '@ohos.window';
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------------------------------------- | -------- | ---- | ---- | ------------------------------------------------------------ |
-| statusBarColor | string | 是 | 是 | 状态栏背景颜色,为16进制RGB或ARGB颜色,例如"\#00FF00"或"\#FF00FF00"。 |
+| statusBarColor | string | 是 | 是 | 状态栏背景颜色,为十六进制RGB或ARGB颜色,不区分大小写,例如"\#00FF00"或"\#FF00FF00"。 |
| isStatusBarLightIcon7+ | boolean | 否 | 是 | 状态栏图标是否为高亮状态。 |
| statusBarContentColor8+ | string | 否 | 是 | 状态栏文字颜色。 |
-| navigationBarColor | string | 是 | 是 | 导航栏背景颜色,为16进制RGB或ARGB颜色,例如"\#00FF00"或"\#FF00FF00"。 |
+| navigationBarColor | string | 是 | 是 | 导航栏背景颜色,为十六进制RGB或ARGB颜色,不区分大小写,例如"\#00FF00"或"\#FF00FF00"。 |
| isNavigationBarLightIcon7+ | boolean | 否 | 否 | 导航栏图标是否为高亮状态。 |
| navigationBarContentColor8+ | string | 否 | 是 | 导航栏文字颜色。 |
@@ -78,7 +78,7 @@ import window from '@ohos.window';
| type | [WindowType](#windowtype) | 是 | 是 | 当前属性改变的系统栏类型,仅支持类型为导航栏、状态栏的系统栏。 |
| isEnable | boolean | 是 | 是 | 当前系统栏是否显示。 |
| region | [Rect](#rect) | 是 | 是 | 当前系统栏的位置及大小。 |
-| backgroundColor | string | 是 | 是 | 系统栏背景颜色,为16进制RGB或ARGB颜色,例如"\#00FF00"或"\#FF00FF00"。 |
+| backgroundColor | string | 是 | 是 | 系统栏背景颜色,为十六进制RGB或ARGB颜色,不区分大小写,例如"\#00FF00"或"\#FF00FF00"。 |
| contentColor | string | 是 | 是 | 系统栏文字颜色。 |
## SystemBarTintState8+
@@ -706,11 +706,11 @@ moveTo(x: number, y: number, callback: AsyncCallback<void>): void
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| -------- | ------------------------- | ---- | --------------------------------------- |
-| x | number | 是 | 窗口在x轴方向移动的值,值为正表示右移。 |
-| y | number | 是 | 窗口在y轴方向移动的值,值为正表示下移。 |
-| callback | AsyncCallback<void> | 是 | 回调函数。 |
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | ------------------------- | ---- | ------------------------------------------------- |
+| x | number | 是 | 窗口在x轴方向移动的值,值为正表示右移,单位为px。 |
+| y | number | 是 | 窗口在y轴方向移动的值,值为正表示下移,单位为px。 |
+| callback | AsyncCallback<void> | 是 | 回调函数。 |
**示例:**
@@ -735,10 +735,10 @@ moveTo(x: number, y: number): Promise<void>
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| ------ | ------ | ---- | --------------------------------------- |
-| x | number | 是 | 窗口在x轴方向移动的值,值为正表示右移。 |
-| y | number | 是 | 窗口在y轴方向移动的值,值为正表示下移。 |
+| 参数名 | 类型 | 必填 | 说明 |
+| ------ | ------ | ---- | ------------------------------------------------- |
+| x | number | 是 | 窗口在x轴方向移动的值,值为正表示右移,单位为px。 |
+| y | number | 是 | 窗口在y轴方向移动的值,值为正表示下移,单位为px。 |
**返回值:**
@@ -767,11 +767,11 @@ resetSize(width: number, height: number, callback: AsyncCallback<void>): v
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| -------- | ------------------------- | ---- | ---------------- |
-| width | number | 是 | 目标窗口的宽度。 |
-| height | number | 是 | 目标窗口的高度。 |
-| callback | AsyncCallback<void> | 是 | 回调函数。 |
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | ------------------------- | ---- | -------------------------- |
+| width | number | 是 | 目标窗口的宽度,单位为px。 |
+| height | number | 是 | 目标窗口的高度,单位为px。 |
+| callback | AsyncCallback<void> | 是 | 回调函数。 |
**示例:**
@@ -795,10 +795,10 @@ resetSize(width: number, height: number): Promise<void>
**参数:**
-| 参数名 | 类型 | 必填 | 说明 |
-| ------ | ------ | ---- | ---------------- |
-| width | number | 是 | 目标窗口的宽度。 |
-| height | number | 是 | 目标窗口的高度。 |
+| 参数名 | 类型 | 必填 | 说明 |
+| ------ | ------ | ---- | -------------------------- |
+| width | number | 是 | 目标窗口的宽度,单位为px。 |
+| height | number | 是 | 目标窗口的高度,单位为px。 |
**返回值:**
@@ -1601,7 +1601,7 @@ setColorSpace(colorSpace:ColorSpace): Promise<void>
promise.then((data)=> {
console.info('Succeeded in setting window colorspace. Data: ' + JSON.stringify(data))
}).catch((err)=>{
- console.error('Failed to set window colorspacet. Cause: ' + JSON.stringify(err));
+ console.error('Failed to set window colorspace. Cause: ' + JSON.stringify(err));
});
```
@@ -1624,10 +1624,10 @@ getColorSpace(callback: AsyncCallback<ColorSpace>): void
```js
windowClass.getColorSpace((err, data) => {
if (err.code) {
- console.error('Failed to get window color space. Cause:' + JSON.stringify(err));
+ console.error('Failed to get window colorspace. Cause:' + JSON.stringify(err));
return;
}
- console.info('Succeeded in getting window color space. Cause:' + JSON.stringify(data))
+ console.info('Succeeded in getting window colorspace. Cause:' + JSON.stringify(data))
})
```
@@ -1652,7 +1652,7 @@ getColorSpace(): Promise<ColorSpace>
promise.then((data)=> {
console.info('Succeeded in getting window color space. Cause:' + JSON.stringify(data))
}).catch((err)=>{
- console.error('Failed to set window colorspacet. Cause: ' + JSON.stringify(err));
+ console.error('Failed to get window colorspace. Cause: ' + JSON.stringify(err));
});
```
@@ -1668,7 +1668,7 @@ setBackgroundColor(color: string, callback: AsyncCallback<void>): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ------------------------------------------------------------ |
-| color | string | 是 | 需要设置的背景色,为16进制颜色,例如"#00FF00"或"#FF00FF00"。 |
+| color | string | 是 | 需要设置的背景色,为十六进制颜色,不区分大小写,例如"#00FF00"或"#FF00FF00"。 |
| callback | AsyncCallback<void> | 是 | 回调函数。 |
**示例:**
@@ -1696,7 +1696,7 @@ setBackgroundColor(color: string): Promise<void>
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------------------------------------------------------------ |
-| color | string | 是 | 需要设置的背景色,为16进制颜色,例如"#00FF00"或"#FF00FF00"。 |
+| color | string | 是 | 需要设置的背景色,为十六进制颜色,不区分大小写,例如"#00FF00"或"#FF00FF00"。 |
**返回值:**
@@ -1848,7 +1848,7 @@ setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): v
| 参数名 | 类型 | 必填 | 说明 |
| -------------- | ------------------------- | ---- | ------------------------ |
-| isKeepScreenOn | boolean | 是 | 是否设置为屏幕常亮状态。 |
+| isKeepScreenOn | boolean | 是 | 设置屏幕是否为常亮状态。 |
| callback | AsyncCallback<void> | 是 | 回调函数。 |
**示例:**
@@ -1876,7 +1876,7 @@ setKeepScreenOn(isKeepScreenOn: boolean): Promise<void>
| 参数名 | 类型 | 必填 | 说明 |
| -------------- | ------- | ---- | ------------------------ |
-| isKeepScreenOn | boolean | 是 | 是否设置为屏幕常亮状态。 |
+| isKeepScreenOn | boolean | 是 | 设置屏幕是否为常亮状态。 |
**返回值:**
diff --git a/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md b/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md
index dc2ca05244d2fdd183942bf724d7fe0ac84680cc..1eeefe3c9a6dc787c90341ff71ce18e5b758c180 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md
@@ -291,6 +291,8 @@ isLastWorkTimeOut(workId: number): Promise\
| repeatCycleTime | number | 否 | 循环间隔 |
| repeatCount | number | 否 | 循环次数 |
| isPersisted | boolean | 否 | 是否持久化保存工作 |
+| isDeepIdle | boolean | 否 | 是否要求设备进入空闲状态 |
+| idleWaitTime | number | 否 | 空闲等待时间 |
## NetworkType
触发工作的网络类型。
diff --git a/zh-cn/application-dev/reference/arkui-js/Readme-CN.md b/zh-cn/application-dev/reference/arkui-js/Readme-CN.md
index a9f0f78cdfb53c52bedc134a22ee7ec0b4fa2be1..4ef8ba58b6092774b74d096a3ab36cf09996661c 100644
--- a/zh-cn/application-dev/reference/arkui-js/Readme-CN.md
+++ b/zh-cn/application-dev/reference/arkui-js/Readme-CN.md
@@ -59,6 +59,7 @@
- [toolbar-item](js-components-basic-toolbar-item.md)
- [toggle](js-components-basic-toggle.md)
- [web](js-components-basic-web.md)
+ - [xcomponent](js-components-basic-xcomponent.md)
- 媒体组件
- [video](js-components-media-video.md)
- 画布组件
diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-basic-xcomponent.md b/zh-cn/application-dev/reference/arkui-js/js-components-basic-xcomponent.md
new file mode 100644
index 0000000000000000000000000000000000000000..8a5093a046dfee2df6dac03569a06544b9d23163
--- /dev/null
+++ b/zh-cn/application-dev/reference/arkui-js/js-components-basic-xcomponent.md
@@ -0,0 +1,72 @@
+# xcomponent
+
+ > **说明:**
+ > 该组件从API Version 9 开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
+
+ 用于显示写入了EGL/OpenGLES或媒体数据的组件。
+
+## 权限列表
+
+ 无
+
+## 子组件
+
+ 不支持。
+
+## 属性
+
+除支持[通用属性](js-components-common-attributes.md)外,还支持如下属性:
+
+| 名称 | 参数类型 | 必填 | 描述 |
+| ----------- | -------- | ---- | ------------------------------------------------------------ |
+| id | string | 是 | 组件的唯一标识,支持最大的字符串长度128。 |
+| type | string | 是 | 用于指定xcomponent组件类型,可选值为:
-surface:组件内容单独送显,直接合成到屏幕。
-component:组件内容与其他组件合成后统一送显。
|
+| libraryname | string | 否 | 应用Native层编译输出动态库名称。 |
+
+## 样式
+
+支持[通用样式](js-components-common-styles.md)。
+
+## 事件
+
+除支持[通用事件](js-components-common-events.md)外,还支持如下事件:
+
+| 名称 | 功能描述 |
+| ------------------------------- | ------------------------------- |
+| onLoad(context?: object) => void | 插件加载完成时回调事件。
context:开发者扩展的xcomponent方法的实例对象,context对象的接口由开发者自定义。 |
+| onDestroy() => void | 插件卸载完成时回调事件。 |
+
+## 方法
+
+除支持[通用方法](js-components-common-methods.md)外,还支持如下方法:
+
+| 名称 | 参数 | 返回值类型 | 描述 |
+| ------------------------ | ------------------------------------------------------------ | ---------- | ------------------------------------------------------------ |
+| getXComponentSurfaceId | - | string | 获取xcomponent对应Surface的ID,供@ohos接口使用,比如camera相关接口。 |
+| setXComponentSurfaceSize | {
surfaceWidth: number,
surfaceHeight: number
} | - | 设置xcomponent持有Surface的宽度和高度。 |
+| getXComponentContext | - | object | 获取开发者扩展的xcomponent方法的实例对象。 |
+
+## 示例
+
+提供surface类型xcomponent,支持相机预览等能力。
+
+ ```
+
+
+ camera_display
+
+
+ ```
+
+ ```
+// xxx.js
+import camera from '@ohos.multimedia.camera';
+export default {
+ onload() {
+ var surfaceId = this.$element('xcomponent').getXComponentSurfaceId();
+ camera.createPreviewOutput(surfaceId).then((previewOutput) => {
+ console.log('Promise returned with the PreviewOutput instance');
+ })
+ }
+}
+ ```
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md b/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md
index daa7a83d5ac49488852dd7a67a62ae66f99ad443..931411f1029df4f7abdc68e53ae7cbf619c8ee7f 100644
--- a/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md
+++ b/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md
@@ -84,7 +84,7 @@
- [TimePicker](ts-basic-components-timepicker.md)
- [Toggle](ts-basic-components-toggle.md)
- [Web](ts-basic-components-web.md)
- - [Xcomponent](ts-basic-components-xcomponent.md)
+ - [XComponent](ts-basic-components-xcomponent.md)
- 容器组件
- [AlphabetIndexer](ts-container-alphabet-indexer.md)
- [Badge](ts-container-badge.md)
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md
index 42fb02b76657c2cd0b5328eabd2f0f2d751586b7..c5b2c3e27b872c5b8c2597664e69bdaf6887d273 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md
@@ -1,15 +1,24 @@
# Image
->  **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
+图片组件,支持本地图片和网络图片的渲染展示。
+> **说明:**
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-图片组件,用来渲染展示图片。
+## 权限说明
-## 权限列表
+使用网络图片时,需要在config.json(FA模型)或者module.json5(Stage模型)对应的"abilities"中添加网络使用权限ohos.permission.INTERNET。
-ohos.permission.INTERNET(使用网络图片)
+```
+"abilities": [
+ {
+ ...
+ "permissions": ["ohos.permission.INTERNET"],
+ ...
+ }
+]
+```
## 子组件
@@ -21,61 +30,71 @@ ohos.permission.INTERNET(使用网络图片)
Image(src: string | PixelMap | Resource)
-- 参数
- | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
- | -------- | -------- | -------- | -------- | -------- |
- | src | string\| [PixelMap](../apis/js-apis-image.md#pixelmap7)\| [Resource](../../ui/ts-types.md#resource类型)| 是 | - | 图片的数据源,支持本地图片和网络图片。
\- 支持的图片格式包括png、jpg、bmp、svg和gif。
\- 支持`Base64`字符串。格式`data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data]`, 其中`[base64 data]`为`Base64`字符串数据。
\- 支持`dataability://`路径前缀的字符串,用于访问通过data ability提供的图片路径。 |
+通过图片数据源获取图片,用于后续渲染展示。
+
+**参数:**
+| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
+| -------- | -------- | -------- | -------- | -------- |
+| src | string\| [PixelMap](../apis/js-apis-image.md#pixelmap7)\| [Resource](../../ui/ts-types.md#resource类型)| 是 | - | 图片的数据源,支持本地图片和网络图片。
\- 支持的图片格式包括png、jpg、bmp、svg和gif。
\- 支持`Base64`字符串。格式`data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data]`, 其中`[base64 data]`为`Base64`字符串数据。
\- 支持`dataability://`路径前缀的字符串,用于访问通过data ability提供的图片路径。 |
## 属性
+除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性:
+
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
-| alt | string | - | 加载时显示的占位图。支持本地图片和网络路径。 |
-| objectFit | ImageFit | Cover | 设置图片的缩放类型。 |
-| objectRepeat | [ImageRepeat](ts-appendix-enums.md#imagerepeat枚举说明) | NoRepeat | 设置图片的重复样式。
>  **说明:**
> - SVG类型图源不支持该属性。 |
-| interpolation | ImageInterpolation | None | 设置图片的插值效果,仅针对图片放大插值。
>  **说明:**
> - SVG类型图源不支持该属性。
>
> - PixelMap资源不支持该属性。 |
-| renderMode | ImageRenderMode | Original | 设置图片渲染的模式。
>  **说明:**
> - SVG类型图源不支持该属性。 |
-| sourceSize | {
width: number,
height: number
} | - | 设置图片解码尺寸,将原始图片解码成指定尺寸的图片,number类型单位为px。
>  **说明:**
> PixelMap资源不支持该属性。 |
+| alt | string \| [Resource](../../ui/ts-types.md#resource类型) | - | 加载时显示的占位图,支持本地图片和网络图片。 |
+| objectFit | [ImageFit](#imagefit枚举说明) | ImageFit.Cover | 设置图片的缩放类型。 |
+| objectRepeat | [ImageRepeat](ts-appendix-enums.md#imagerepeat) | NoRepeat | 设置图片的重复样式。
> **说明:**
> - svg类型图源不支持该属性。 |
+| interpolation | [ImageInterpolation](#imageInterpolation) | ImageInterpolation.None | 设置图片的插值效果,仅针对图片放大插值。
> **说明:**
> - svg类型图源不支持该属性。
> - PixelMap资源不支持该属性。 |
+| renderMode | [ImageRenderMode](#imagerendermode) | ImageRenderMode.Original | 设置图片渲染的模式。
> **说明:**
> - svg类型图源不支持该属性。 |
+| sourceSize | {
width: number,
height: number
} | - | 设置图片裁剪尺寸,将原始图片解码成pixelMap,指定尺寸的图片,单位为px。
> **说明:**
> PixelMap资源不支持该属性。 |
| syncLoad8+ | boolean | false | 设置是否同步加载图片,默认是异步加载。同步加载时阻塞UI线程,不会显示占位图。 |
-- ImageFit枚举说明
- | 名称 | 描述 |
- | -------- | -------- |
- | Cover | 保持宽高比进行缩小或者放大,使得图片两边都大于或等于显示边界。 |
- | Contain | 保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内。 |
- | Fill | 不保持宽高比进行放大缩小,使得图片填充满显示边界。 |
- | None | 保持原有尺寸显示。通常配合objectRepeat属性一起使用。 |
- | ScaleDown | 保持宽高比显示,图片缩小或者保持不变。 |
-
-- ImageInterpolation枚举说明
- | 名称 | 描述 |
- | -------- | -------- |
- | None | 不使用插值图片数据。 |
- | High | 高度使用插值图片数据,可能会影响图片渲染的速度。 |
- | Medium | 中度使用插值图片数据。 |
- | Low | 低度使用插值图片数据。 |
-
-- ImageRenderMode枚举说明
- | 名称 | 描述 |
- | -------- | -------- |
- | Original | 按照原图进行渲染,包括颜色。 |
- | Template | 将图像渲染为模板图像,忽略图片的颜色信息。 |
+### ImageFit
+| 名称 | 描述 |
+| -------- | -------- |
+| Cover | 保持宽高比进行缩小或者放大,使得图片两边都大于或等于显示边界。 |
+| Contain | 保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内。 |
+| Fill | 不保持宽高比进行放大缩小,使得图片充满显示边界。 |
+| None | 保持原有尺寸显示,通常配合objectRepeat属性一起使用。 |
+| ScaleDown | 保持宽高比显示,图片缩小或者保持不变。 |
-## 事件
+### ImageInterpolation
-| 名称 | 功能描述 |
+| 名称 | 描述 |
| -------- | -------- |
-| onComplete(callback: (event?: { width: number, height: number, componentWidth: number,
componentHeight: number, loadingStatus: number }) => void) | 图片成功加载时触发该回调,返回成功加载的图源尺寸。 |
-| onError(callback: (event?: { componentWidth: number, componentHeight: number }) => void) | 图片加载出现异常时触发该回调。 |
-| onFinish(callback: () => void) | 当加载的源文件为带动效的svg图片时,当svg动效播放完成时会触发这个回调,如果动效为无限循环动效,则不会触发这个回调。 |
+| None | 不使用插值图片数据。 |
+| High | 插值图片数据的使用率高,可能会影响图片渲染的速度。 |
+| Medium | 插值图片数据的使用率中。 |
+| Low | 插值图片数据的使用率低。 |
+
+### ImageRenderMode
+
+| 名称 | 描述 |
+| -------- | -------- |
+| Original | 按照原图进行渲染,包括颜色。 |
+| Template | 将图片渲染为模板图片,忽略图片的颜色信息。 |
+
+## 事件
+除支持[通用事件](ts-universal-events-click.md)外,还支持以下事件:
+
+| 名称 | 功能描述 |
+| -------- | -------- |
+| onComplete(callback: (event?: { width: number, height: number, componentWidth: number,
componentHeight: number, loadingStatus: number }) => void) | 图片成功加载时触发该回调,返回成功加载的图片尺寸。
- width:图片的宽,单位为像素。
- height:图片的高,单位为像素。
- componentWidth:组件的宽,单位为像素。
- componentHeight:组件的高,单位为像素。
- loadingStatus:图片加载成功的状态。(几为成功)
|
+| onError(callback: (event?: { componentWidth: number, componentHeight: number }) => void) | 图片加载出现异常时触发该回调。
- componentWidth:组件的宽,单位为像素。
- componentHeight:组件的高,单位为像素。
|
+| onFinish(callback: () => void) | 当加载的源文件为带动效的svg图片时,当svg动效播放完成时会触发这个回调,如果动效为无限循环动效,则不会触发这个回调。 |
## 示例
-```
-// Image1
+### 图片加载
+
+加载显示不同类型的图片,并设置图片的缩放类型。
+
+```ts
@Entry
@Component
struct ImageExample1 {
@@ -141,8 +160,9 @@ struct ImageExample1 {

-```
-// Image2
+### 设置属性
+
+```ts
@Entry
@Component
struct ImageExample2 {
@@ -162,12 +182,12 @@ struct ImageExample2 {
.border({ width: 1 }).borderStyle(BorderStyle.Dashed)
.overlay('Template', { align: Alignment.Bottom, offset: { x: 0, y: 20 } })
}
-
+
Text('alt').fontSize(12).fontColor(0xcccccc).width('96%').height(30)
Image('')
.alt($r('app.media.Image_none'))
.width(100).height(100).border({ width: 1 }).borderStyle(BorderStyle.Dashed)
-
+
Text('sourceSize').fontSize(12).fontColor(0xcccccc).width('96%')
Row({ space: 50 }) {
Image($r('app.media.img_example'))
@@ -187,7 +207,7 @@ struct ImageExample2 {
.border({ width: 1 }).borderStyle(BorderStyle.Dashed)
.overlay('w:200 h:200', { align: Alignment.Bottom, offset: { x: 0, y: 20 } })
}
-
+
Text('objectRepeat').fontSize(12).fontColor(0xcccccc).width('96%').height(30)
Row({ space: 5 }) {
Image($r('app.media.ic_health_heart'))
@@ -210,17 +230,18 @@ struct ImageExample2 {

-```
-// Image3
+### 事件调用
+
+```ts
@Entry
@Component
struct ImageExample3 {
@State width: number = 0
@State height: number = 0
- private on: Resource = $r('app.media.wifi_on')
- private off: Resource = $r('app.media.wifi_off')
- private on2off: Resource = $r('app.media.wifi_on2off')
- private off2on: Resource = $r('app.media.wifi_off2on')
+ private on: Resource = $r('app.media.image_on')
+ private off: Resource = $r('app.media.image_off')
+ private on2off: Resource = $r('app.media.image_on2off')
+ private off2on: Resource = $r('app.media.image_off2on')
@State src: Resource = this.on
build() {
@@ -235,6 +256,7 @@ struct ImageExample3 {
})
.objectFit(ImageFit.Cover)
.height(180).width(180)
+ // 图片加载完成后,获取图片尺寸。
.onComplete((msg: { width: number,height: number }) => {
this.width = msg.width
this.height = msg.height
@@ -247,7 +269,7 @@ struct ImageExample3 {
offset: { x: 0, y: 20 }
})
}
-
+ // 为图片添加点击事件,点击完成后加载特定图片。
Image(this.src)
.width(120).height(120)
.onClick(() => {
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 bc07a54dc0468749fceea7586b6ad2bd02c4e264..6f80bffcacf25c553d6d11f380a4195131ce3cb2 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
@@ -1,8 +1,9 @@
# TextClock
->  **说明:** 该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
+TextClock组件通过文本将当前系统时间显示在设备上。支持不同时区的时间显示,最高精度到秒级。
-TextClock通过文本显示当前系统时间,支持不同时区的时间显示,时间显示最高精度到秒级。
+>**说明:**
+>该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 权限列表
@@ -14,36 +15,39 @@ TextClock通过文本显示当前系统时间,支持不同时区的时间显
## 接口
-TextClock(options?: {timeZoneOffset?: number, contorller?: TextClockController})
+TextClock(options?: { timeZoneOffset?: number, controller?: TextClockController })
-- 参数
+**参数:**
- | 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
- | -------- | -------- | ---- | ------------------ | ------------------------------------------------------------ |
- | timeZoneOffset | number | 否 | 时区偏移量 | 设置时区偏移量。取值范围为[-14, 12],表示东十二区到西十二区,其中负值表示东时区,正值表示西时区,比如东八区为-8;对横跨国际日界线的国家或地区,用-13(UTC+13)和-14(UTC+14)来保证整个国家或者区域处在相同的时间。 |
- | contorller | [TextClockContorller](#TextClockController) | 否 | null | 绑定一个控制器,用来控制文本时钟的状态。|
+| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
+| -------- | -------- | ---- | ------------------ | ------------------------------------------------------------ |
+| timeZoneOffset | number | 否 | 时区偏移量 | 设置时区偏移量。
取值范围为[-14:00, 12:00],表示东十二区到西十二区,其中负值表示东时区,正值表示西时区,比如东八区为-8:00。
对横跨国际日界线的国家或地区,用-13:00(UTC+13)和-14:00(UTC+14)来保证整个国家或者区域处在相同的时间。 |
+| contorller | [TextClockContorller](#textclockcontroller) | 否 | null | 绑定一个控制器,用来控制文本时钟的状态。|
## 属性
+除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性:
+
| 名称 | 参数类型 | 默认值 | 描述 |
| ------ | -------- | -------- | ------------------------------------------------------------ |
-| format | string | 'hhmmss' | 设置显示时间格式,如“yyyy/mm/dd”、“yyyy-mm-dd”等。支持的时间格式化字符串:- yyyy(年份)
- mm(英文月份简写)
- mmm(英文月份简写)
- mmmm(英文月份全称)
- dd(英文星期简写)
- ddd(英文星期简写)
- dddd(英文星期全称)
- HH(24小时制)
- hh(12小时制)
- MM/mm(分钟)
- SS/ss(秒)
|
+| format | string | 'hhmmss' | 设置显示时间格式,如“yyyy/mm/dd”、“yyyy-mm-dd”等。
支持的时间格式化字符串:
- yyyy:年份。
- mm:英文月份简写。
- mmm:英文月份简写。
- mmmm:英文月份全称。
- dd:英文星期简写。
- ddd:英文星期简写。
- dddd:英文星期全称。
- HH:24小时制。
- hh:12小时制。
- MM/mm:分钟。
- SS/ss:秒。 |
## 事件
+除支持[通用事件](ts-universal-events-click.md)外,还支持以下事件:
+
| 名称 | 功能描述 |
| -------------------------------------------- | ------------------------------------------------------------ |
-| onDateChange(event: (value: number) => void) | 提供时间变化回调,该事件最小回调间隔为秒。
value: Unix Time Stamp,即自1970年1月1日(UTC)起经过的毫秒数。 |
+| onDateChange(event: (value: number) => void) | 提供时间变化回调,该事件最小回调间隔为秒。
- value: Unix Time Stamp,即自1970年1月1日(UTC)起经过的毫秒数。 |
## TextClockController
-TextClock容器组件的控制器,可以将此对象绑定至TextClock组件,然后通过它控制文本时钟状态的启动与停止。
+TextClock容器组件的控制器,可以将此对象绑定到TextClock组件,再通过它控制文本时钟的启动与停止。
### 导入对象
-```
+```ts
controller: TextClockController = new TextClockController()
-
```
### start
@@ -61,7 +65,7 @@ stop()
## 示例
-```
+```ts
@Entry
@Component
struct Second {
@@ -70,8 +74,9 @@ struct Second {
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center}) {
- Text('current milliseconds is' + this.accumulateTime)
+ Text('Current milliseconds is ' + this.accumulateTime)
.fontSize(20)
+ // 以12小时制显示东八区的系统时间,精确到秒。
TextClock({timeZoneOffset: -8, controller: this.controller})
.format('hhmmss')
.onDateChange((value: number) => {
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-path.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-path.md
index 2521f303fd32abf7eb675194b2e7271e351fe3e5..f883fbead681e1086960124f68ec3db2e7853366 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-path.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-path.md
@@ -1,10 +1,9 @@
# Path
->  **说明:**
-> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
-
+路径绘制组件,根据绘制路径生成封闭的自定义形状。
-路径绘制组件。
+> **说明:**
+> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 权限列表
@@ -16,69 +15,55 @@
无
-
## 属性
-| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
-| -------- | -------- | -------- | -------- | -------- |
-| width | Length | 0 | 否 | 路径所在矩形的宽度。 |
-| height | Length | 0 | 否 | 路径所在矩形的高度。 |
-| commands | string | '' | 是 | 路径绘制的命令字符串。 |
-
-
-支持的绘制命令如下:
-
-
-- M = moveto
-
-- L = lineto
+除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性:
-- H = horizontal lineto
+| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
+| -------- | --------------------------------------- | ------ | ---- | ------------------------------------------------------------ |
+| width | [Length](../../ui/ts-types.md#长度类型) | 0 | 否 | 路径所在矩形画布的宽度。 |
+| height | [Length](../../ui/ts-types.md#长度类型) | 0 | 否 | 路径所在矩形画布的高度。 |
+| commands | string | '' | 是 | 路径绘制的命令字符串,单位为px。像素单位转换方法请参考[像素单位转换](../../ui/ts-pixel-units.md)。 |
-- V = vertical lineto
+commands支持的绘制命令如下:
-- C = curveto
-
-- S = smooth curveto
-
-- Q = quadratic Belzier curve
-
-- T = smooth quadratic Belzier curveto
-
-- A = elliptical Arc
-
-- Z = closepath
-
-
-如 commands('M0 20 L50 50 L50 100 Z')定义了一条路径,开始于位置(0,20),到达位置(50,50)后再到(50,100),最后在(0,20)处关闭路径。
+| 命令 | 名称 | 参数 | 说明 |
+| ---- | -------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------ |
+| M | moveto | (x y) | 在给定的 (x, y) 坐标处开始一个新的子路径。例如,`M 0 0` 表示将(0, 0)点作为新子路径的起始点。 |
+| L | lineto | (x y) | 从当前点到给定的 (x, y) 坐标画一条线,该坐标成为新的当前点。例如,`L 50 50` 表示绘制当前点到(50, 50)点的直线,并将(50, 50)点作为新子路径的起始点。 |
+| H | horizontal lineto | x | 从当前点绘制一条水平线,等效于将y坐标指定为0的L命令。例如,`H 50 ` 表示绘制当前点到(50, 0)点的直线,并将(50, 0)点作为新子路径的起始点。 |
+| V | vertical lineto | y | 从当前点绘制一条垂直线,等效于将x坐标指定为0的L命令。例如,`V 50 ` 表示绘制当前点到(0, 50)点的直线,并将(0, 50)点作为新子路径的起始点。 |
+| C | curveto | (x1 y1 x2 y2 x y) | 使用 (x1, y1) 作为曲线起点的控制点, (x2, y2) 作为曲线终点的控制点,从当前点到 (x, y) 绘制三次贝塞尔曲线。例如,`C100 100 250 100 250 200 ` 表示绘制当前点到(250, 200)点的三次贝塞尔曲线,并将(250, 200)点作为新子路径的起始点。 |
+| S | smooth curveto | (x2 y2 x y) | (x2, y2) 作为曲线终点的控制点,绘制从当前点到 (x, y) 绘制三次贝塞尔曲线。若前一个命令是C或S,则起点控制点是上一个命令的终点控制点相对于起点的映射。 例如,`C100 100 250 100 250 200 S400 300 400 200`第二段贝塞尔曲线的起点控制点为(250, 300)。如果没有前一个命令或者前一个命令不是 C或S,则第一个控制点与当前点重合。 |
+| Q | quadratic Belzier curve | (x1 y1 x y) | 使用 (x1, y1) 作为控制点,从当前点到 (x, y) 绘制二次贝塞尔曲线。例如,`Q400 50 600 300 ` 表示绘制当前点到(600, 300)点的二次贝塞尔曲线,并将(600, 300)点作为新子路径的起始点。 |
+| T | smooth quadratic Belzier curveto | (x y) | 绘制从当前点到 (x, y) 绘制二次贝塞尔曲线。若前一个命令是Q或T,则控制点是上一个命令的终点控制点相对于起点的映射。 例如,`Q400 50 600 300 T1000 300`第二段贝塞尔曲线的控制点为(800, 350)。 如果没有前一个命令或者前一个命令不是 Q或T,则第一个控制点与当前点重合。 |
+| A | elliptical Arc | (rx ry x-axis-rotation large-arc-flag sweep-flag x y) | 从当前点到 (x, y) 绘制一条椭圆弧。椭圆的大小和方向由两个半径 (rx, ry) 和x-axis-rotation定义,指示整个椭圆相对于当前坐标系如何旋转(以度为单位)。 large-arc-flag 和 sweep-flag确定弧的绘制方式。 |
+| Z | closepath | none | 通过将当前路径连接回当前子路径的初始点来关闭当前子路径。 |
+例如: commands('M0 20 L50 50 L50 100 Z')定义了一个三角形,起始于位置(0,20),接着绘制点(0,20)到点(50,50)的直线,再绘制点(50,50)到点(50,100)的直线,最后绘制点(50,100)到(0,20)的直线关闭路径,形成封闭三角形。
## 示例
-```
+```ts
@Entry
@Component
struct PathExample {
build() {
Column({ space: 5 }) {
Text('Straight line').fontSize(9).fontColor(0xCCCCCC).width('90%')
+ // 绘制一条长900px,宽3vp的直线。
Path().width(300).height(10).commands('M0 0 L900 0').stroke(Color.Black).strokeWidth(3)
Text('Straight line graph').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceAround }) {
- // 先后执行MoveTo(150, 0), LineTo(300, 300), LineTo(0, 300), ClosePath()
Path().width(100).height(100).commands('M150 0 L300 300 L0 300 Z')
- // 先后执行MoveTo(0, 0), HorizontalLineto(300), VerticalLineto(300), HorizontalLineto(0), ClosePath()
Path().width(100).height(100).commands('M0 0 H300 V300 H0 Z')
- // 先后执行MoveTo(150, 0), LineTo(0, 150), LineTo(60, 300), LineTo(240, 300), LineTo(300, 150), ClosePath()
Path().width(100).height(100).commands('M150 0 L0 150 L60 300 L240 300 L300 150 Z')
}.width('100%')
Text('Curve graphics').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: FlexAlign.SpaceAround }) {
- // 先后执行MoveTo(0, 300),(150, 0)(300, 300)两点之间画曲线, ClosePath()
Path().width(100).height(100).commands("M0 300 S150 0 300 300 Z")
- // 先后执行MoveTo(0, 150),(0, 150)(150, 0)(300, 150)三点之间依次画曲线, LineTo(150, 300),ClosePath()
Path().width(100).height(100).commands('M0 150 C0 150 150 0 300 150 L150 300 Z')
}
}.width('100%').margin({ top: 5 })
@@ -86,4 +71,4 @@ struct PathExample {
}
```
-
+
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-gesture-settings.md b/zh-cn/application-dev/reference/arkui-ts/ts-gesture-settings.md
index 395dfa42cbac26e17527ad19f039c4a90f0c152a..498690dcb00b9e93dc70ccd04d26e5b7ecdf5486 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-gesture-settings.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-gesture-settings.md
@@ -79,7 +79,7 @@ struct GestureSettingsExample {
TapGesture()
.onAction((event: GestureEvent) => {
this.value = 'priorityGesture onAction' + '\ncomponent globalPos:('
- + event.target.area.globalPos.x + ',' + event.target.area.globalPos.y + ')\nwidth:'
+ + event.target.area.globalPosition.x + ',' + event.target.area.globalPosition.y + ')\nwidth:'
+ event.target.area.width + '\nheight:' + event.target.area.height
}), GestureMask.IgnoreInternal
)
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-click.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-click.md
index 1d9c61486c3f1cfdfedf13075f30ace03ee3943e..c5da38006bd13fbe276f5b07436c91cf57320611 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-click.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-click.md
@@ -59,7 +59,7 @@ struct ClickExample {
.onClick((event: ClickEvent) => {
console.info(this.text = 'Click Point:' + '\n screenX:' + event.screenX + '\n screenY:' + event.screenY
+ '\n x:' + event.x + '\n y:' + event.y + '\ntarget:' + '\n component globalPos:('
- + event.target.area.globalPos.x + ',' + event.target.area.globalPos.y + ')\n width:'
+ + event.target.area.globalPosition.x + ',' + event.target.area.globalPosition.y + ')\n width:'
+ event.target.area.width + '\n height:' + event.target.area.height)
})
Text(this.text).padding(15)
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md
index ca49bfc099d772425df32ccf6d9eb05c77a99e0f..3aa7ea59de2419093c0c27545d8c8b1e044eb3ba 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-touch.md
@@ -78,7 +78,7 @@ struct TouchExample {
}
console.info(this.text = 'TouchType:' + this.eventType + '\nDistance between touch point and touch element:\nx: '
+ event.touches[0].x + '\n' + 'y: ' + event.touches[0].y + '\ncomponent globalPos:('
- + event.target.area.globalPos.x + ',' + event.target.area.globalPos.y + ')\nwidth:'
+ + event.target.area.globalPosition.x + ',' + event.target.area.globalPosition.y + ')\nwidth:'
+ event.target.area.width + '\nheight:' + event.target.area.height)
})
Text(this.text)
diff --git a/zh-cn/application-dev/security/huks-guidelines.md b/zh-cn/application-dev/security/huks-guidelines.md
index 4ef31c5f519db79a8d21b37509a373a0ba6a797b..c5a8655ee077a94caa959da94d513fade25ab0f5 100644
--- a/zh-cn/application-dev/security/huks-guidelines.md
+++ b/zh-cn/application-dev/security/huks-guidelines.md
@@ -7,16 +7,16 @@
## 接口说明
-| 接口名 | 描述 |
+| 接口名 | 描述 |
| ------------------------------------------------------------ | ---------------- |
-| function generateKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; | 生成密钥 |
-| function generateKey(keyAlias: string, options: HuksOptions) : Promise; | 生成密钥 |
-| function exportKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; | 导出公钥 |
-| function exportKey(keyAlias: string, options: HuksOptions) : Promise; | 导出公钥 |
-| function isKeyExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; | 查询密钥是否存在 |
-| function isKeyExist(keyAlias: string, options: HuksOptions) : Promise; | 查询密钥是否存在 |
-| function deleteKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void; | 删除密钥 |
-| function deleteKey(keyAlias: string, options: HuksOptions) : Promise; | 删除密钥 |
+| generateKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksResult>) : void| 生成密钥 |
+| generateKey(keyAlias: string, options: HuksOptions) : Promise<HuksResult>| 生成密钥 |
+| exportKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksResult>) : void| 导出公钥 |
+| exportKey(keyAlias: string, options: HuksOptions) : Promise<HuksResult>| 导出公钥 |
+| isKeyExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback<boolean>) : void | 查询密钥是否存在 |
+| isKeyExist(keyAlias: string, options: HuksOptions) : Promise<boolean> | 查询密钥是否存在 |
+| deleteKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksResult>) : void| 删除密钥 |
+| deleteKey(keyAlias: string, options: HuksOptions) : Promise<HuksResult>| 删除密钥 |
## 开发步骤
diff --git a/zh-cn/application-dev/ui/ts-component-based-preview.md b/zh-cn/application-dev/ui/ts-component-based-preview.md
index e0d33c93dd14432a0ba8113d5a18a5cf0968a7f5..b7c790de7201fddbf0e6fe68cff729bf06fa9933 100644
--- a/zh-cn/application-dev/ui/ts-component-based-preview.md
+++ b/zh-cn/application-dev/ui/ts-component-based-preview.md
@@ -11,7 +11,6 @@
```
-// Display only Hello Component1 on the preview. The content under MyComponent is displayed on the real device.
@Entry
@Component
struct MyComponent {
diff --git a/zh-cn/contribute/OpenHarmony-security-design-guide.md b/zh-cn/contribute/OpenHarmony-security-design-guide.md
index 2e9da38765fcda1732419a3a570005c7e05b87a8..d0934da52090ec49bd3f752e0dfdbfd88bbe23b1 100644
--- a/zh-cn/contribute/OpenHarmony-security-design-guide.md
+++ b/zh-cn/contribute/OpenHarmony-security-design-guide.md
@@ -6,17 +6,17 @@
1-1 为了防止系统和资源被非法访问,除非标准协议约定,所有能对系统进行管理的接口,应具备接入认证机制并缺省启用。
-**说明:**为减少系统攻击面,对于可对系统进行管理(包括配置、升级、调试等)的接口必须要启用认证机制,避免未授权的访问。
+**说明**:为减少系统攻击面,对于可对系统进行管理(包括配置、升级、调试等)的接口必须要启用认证机制,避免未授权的访问。
1-2 只保留运行维护所必需的对外通信连接,关闭不需要连接、端口。
-**说明:**关闭不必要的通信端口,可大大降低安全威胁,是系统安全防护的基础手段。
+**说明**:关闭不必要的通信端口,可大大降低安全威胁,是系统安全防护的基础手段。
## 2.应用安全
2-1 对于每一个需要授权访问的请求都需核实请求方的会话标识是否合法、请求方是否被授权执行此操作。
-**说明:**避免越权访问。
+**说明**:避免越权访问。
2-2 认证处理过程在客户端实现是不可靠的,可被轻易绕过,因此对用户的最终认证处理过程必须放到服务端进行。
@@ -24,9 +24,9 @@
3-1 应该使用经过验证的、安全的、公开的加密算法。
-**说明:**算法的安全性不在于算法本身的机密性。
+**说明**:算法的安全性不在于算法本身的机密性。
-**示例:**推荐使用的密码算法:
+**示例**:推荐使用的密码算法:
1)分组密码算法:AES(密钥长度在128位及以上)
2)流密码算法:AES(密钥长度在128位及以上)(OFB或CTR模式)
3)非对称加密算法:RSA(推荐3072位)
@@ -38,9 +38,9 @@
3-3 密码算法中使用到的随机数必须是密码学意义上的安全随机数。
-**说明:**使用了不安全的随机数,容易导致密码算法的强度降低甚至算法的失效。
+**说明**:使用了不安全的随机数,容易导致密码算法的强度降低甚至算法的失效。
-**示例:**可使用以下的安全随机数生成接口:
+**示例**:可使用以下的安全随机数生成接口:
1) OpenSSL的RAND_bytes或RAND_priv_bytes;
2) OpenSSL FIPS模块中实现的DRBG;
3) JDK的java.security.SecureRandom;
@@ -48,37 +48,37 @@
3-4 默认使用安全的密码算法,关闭或者禁用不安全的密码算法。在选择密码算法库时,应使用通过认证的或业界开源公认的或经评估认可的密码算法库。
-**说明:**随着密码技术的发展以及计算能力的提升,一些密码算法变得不再安全,使用不安全的密码算法,有可能为用户的数据带来风险。同时非专业人员实现的密码算法,在技术上未经业界分析验证,有可能存在未知的缺陷,因此应使用通过认证的或业界开源公认的或经评估认可的密码算法库。
+**说明**:随着密码技术的发展以及计算能力的提升,一些密码算法变得不再安全,使用不安全的密码算法,有可能为用户的数据带来风险。同时非专业人员实现的密码算法,在技术上未经业界分析验证,有可能存在未知的缺陷,因此应使用通过认证的或业界开源公认的或经评估认可的密码算法库。
-**示例:**密码算法相关示例请参考3-1。
+**示例**:密码算法相关示例请参考3-1。
3-5 使用分组密码算法时,应优先选择GCM模式。
3-6 使用RSA算法进行加密操作时,应优先选择OAEP填充方式。
-**说明:**学术界和业界针对RSA的PKCS1填充方式的攻击已经比较成熟,如果不使用OAEP填充替换PKCS1填充,攻击者解密密文的难度将大大降低。
+**说明**:学术界和业界针对RSA的PKCS1填充方式的攻击已经比较成熟,如果不使用OAEP填充替换PKCS1填充,攻击者解密密文的难度将大大降低。
3-7 使用非对称运算保护数据机密性时,避免使用私钥加密敏感数据。
-**说明:**私钥加密无法保护数据的机密性。
+**说明**:私钥加密无法保护数据的机密性。
3-8 使用非对称算法时,加密和签名要使用不同的密钥对。
3-9 在同时需要对数据进行对称加密和数字签名时,使用先签名后加密的方式。检查程序里的密码算法函数调用次序,避免对密文的hash值进行签名(即对密文的hash值进行私钥运算)。
-**说明:**如果对密文签名(即对密文的hash值签名),一旦攻击者可以通过网络嗅探的方式获得密文(也就可以获取密文hash值),就可以任意篡改密文消息的签名。
+**说明**:如果对密文签名(即对密文的hash值签名),一旦攻击者可以通过网络嗅探的方式获得密文(也就可以获取密文hash值),就可以任意篡改密文消息的签名。
3-10 使用DH算法进行密钥协商的双方在接收到对方发送过来的“公钥”时,应判断公钥是不是0,1,p-1,p这样的特殊值并要求重新发起密钥协商。
-**说明:**如果使用DH算法进行密钥协商的双方在接收到的对方发送的“公钥是某些特殊值“,则协商出的密钥也一定是某些已知的值。在这种情况下,攻击者可以尝试最多5个可能的密钥就可以轻易的解密密文。
+**说明**:如果使用DH算法进行密钥协商的双方在接收到的对方发送的“公钥是某些特殊值“,则协商出的密钥也一定是某些已知的值。在这种情况下,攻击者可以尝试最多5个可能的密钥就可以轻易的解密密文。
3-11 在SSL/TLS中协议中,如使用DH/ECDH算法进行密钥协商,出于前向安全考虑,选取包含DHE或ECDHE密钥交换算法的加密套件,避免选取仅包含DH/ECDH的加密套件。
3-12 密码协议中不要使用截短的消息认证码。
-**说明:**密码协议中(如TLS、SSH、IKE等),使用消息认证码(MAC)验证消息的完整性,协议标准有时支持选取截短的消息认证码。此时,消息认证码安全性也因截短而降低,如针对多种密码协议(如TLS、SSH等)的SLOTH攻击就可以利用截短哈希值构造碰撞。
+**说明**:密码协议中(如TLS、SSH、IKE等),使用消息认证码(MAC)验证消息的完整性,协议标准有时支持选取截短的消息认证码。此时,消息认证码安全性也因截短而降低,如针对多种密码协议(如TLS、SSH等)的SLOTH攻击就可以利用截短哈希值构造碰撞。
-**示例:**截短消息认证码的配置举例:SSH协议中配置HMAC-MD5-96、HMAC-SHA1-96、HMAC-SHA2-256-96
+**示例**:截短消息认证码的配置举例:SSH协议中配置HMAC-MD5-96、HMAC-SHA1-96、HMAC-SHA2-256-96
哈希算法的标准输出长度如下,低于标准长度可视为截短:
1)SHA1/HMAC-SHA1,标准输出长度160比特
2)SHA224/HMAC-SHA224,标准输出长度224比特
@@ -90,33 +90,33 @@
3-13 使用HMAC保护数据完整性时,不能使用hash(key||message)或hash(message||key)的计算结果作为MAC值。
-**说明:**攻击者可以通过在原始明文后面追加任意信息的方式篡改明文,破坏数据的完整性。
+**说明**:攻击者可以通过在原始明文后面追加任意信息的方式篡改明文,破坏数据的完整性。
3-14 同一笔业务中,若既需要加密运算也需要计算MAC时,加密操作和计算MAC操作不能使用同一个对称密钥。
-**说明:**如果加密和MAC密钥相同,一旦密钥泄露,攻击者可以有针对性的篡改机密信息。
+**说明**:如果加密和MAC密钥相同,一旦密钥泄露,攻击者可以有针对性的篡改机密信息。
3-15 加密时避免使用固定的IV(如:硬编码,或固定在配置文件中)。
-**说明:**CBC模式的随机IV值可确保相同的明文、相同的密钥加密出的密文完全不同,如果IV无法确保每次加密都不同,对于CBC模式,攻击者可以轻易的进行密文替换攻击;CBC模式之外的其他分组密码运算模式(如:OFB、CRT等),攻击者可以非常容易的解密密文。
+**说明**:CBC模式的随机IV值可确保相同的明文、相同的密钥加密出的密文完全不同,如果IV无法确保每次加密都不同,对于CBC模式,攻击者可以轻易的进行密文替换攻击;CBC模式之外的其他分组密码运算模式(如:OFB、CRT等),攻击者可以非常容易的解密密文。
3-16 密码协议中避免选择匿名认证、无加密、弱身份认证、弱密钥交换、弱对称加密算法和弱消息认证算法的加密算法套件。
-**说明:**容易造成安全上的薄弱环节从而降低系统的安全性。
+**说明**:容易造成安全上的薄弱环节从而降低系统的安全性。
-**示例:**匿名认证举例:TLS_DH_anon_WITH_3DES_EDE_CBC_SHA、TLS_DH_anon_WITH_AES_256_CBC_SHA
+**示例**:匿名认证举例:TLS_DH_anon_WITH_3DES_EDE_CBC_SHA、TLS_DH_anon_WITH_AES_256_CBC_SHA
弱身份认证举例:密钥长度小于2048比特的RSA/DSA密钥
3-17 推荐仅选择使用ECDHE作为密钥交换算法的加密套件。
3-18 用于数据加解密的密钥不能硬编码在代码中,应采用根密钥等加密保护,同时根密钥也需采用适当的安全机制进行保护(如仅对部分密钥组件进行硬编码)。
-**说明:**硬编码密钥容易被逆向分析破解。
+**说明**:硬编码密钥容易被逆向分析破解。
3-19 功能设计中建议支持工作密钥更新方法(密钥更新方式:手动更新、自动更新等),并规定工作密钥更新规则(在线更新、离线更新、更新时间等)。
-**说明:**密钥使用时间越长,密钥被破解的风险也越大;密钥加密的数据量越多,攻击者能够获取到密文的数据机会也越大,而对被同一个密钥加密的多个密文进行密码学分析相对比较容易,导致密钥越容易被破解;如果密钥已经泄露,那么密钥被使用的时间越久,损失越大。
+**说明**:密钥使用时间越长,密钥被破解的风险也越大;密钥加密的数据量越多,攻击者能够获取到密文的数据机会也越大,而对被同一个密钥加密的多个密文进行密码学分析相对比较容易,导致密钥越容易被破解;如果密钥已经泄露,那么密钥被使用的时间越久,损失越大。
-**示例:**当密钥需要更新时,根据密钥生成的规则,重新生成新密钥,同时使用旧密钥解密已加密的数据,并使用新生成的密钥重新加密,同时销毁旧密钥;对于加密数据量很大的场景,可以考虑保留旧密钥,用于解密旧密钥加密的数据,同时使用更新后的密钥加密新数据。
+**示例**:当密钥需要更新时,根据密钥生成的规则,重新生成新密钥,同时使用旧密钥解密已加密的数据,并使用新生成的密钥重新加密,同时销毁旧密钥;对于加密数据量很大的场景,可以考虑保留旧密钥,用于解密旧密钥加密的数据,同时使用更新后的密钥加密新数据。
3-20 密钥材料及密钥组件在保存时须限定其权限(如权限600或400)。
@@ -128,7 +128,7 @@
4-2 认证凭据不需要还原的场景,应使用PBKDF2等不可逆的算法加密,对于性能敏感且安全性要求不高的场景可使用HMAC(认证凭据,盐值)(注:认证凭据、盐值位置可以互换)。
-**示例:**1、认证凭据使用PBKDF2算法计算口令单向哈希时,迭代次数最低1000次。
+**示例**:1、认证凭据使用PBKDF2算法计算口令单向哈希时,迭代次数最低1000次。
2、盐值Salt为密码学意义上的安全随机数,由系统随机生成,盐值salt至少16字节,并按用户区分。
3、避免使用HASH(用户名||口令)、HMAC(用户名,口令)、HASH(口令 XOR salt)。
@@ -152,40 +152,40 @@
5-4 应使用合适的安全协议,不安全协议应默认关闭。
-**示例:**安全协议举例:SSHv2/TLS1.2/TLS1.3/IPSec/SFTP/SNMPv3等协议,及其业界最新安全版本。对于流密码算法,建议使用AES的OFB和CTR模式或chacha20流加密算法替换RC4算法。
+**示例**:安全协议举例:SSHv2/TLS1.2/TLS1.3/IPSec/SFTP/SNMPv3等协议,及其业界最新安全版本。对于流密码算法,建议使用AES的OFB和CTR模式或chacha20流加密算法替换RC4算法。
不安全协议举例:TFTP、FTP、Telnet、SSL2.0、SSL3.0、TLS1.0、TLS1.1、SNMP v1/v2和SSHv1.x。
5-5 基于权限最小化原则,系统新建账号默认不授予任何权限,或者默认只指派最小权限(如:只读权限)的角色。
-**说明:**保证当授权机制出现问题或授权机制被绕过时非法用户获得的权限也是最少的。
+**说明**:保证当授权机制出现问题或授权机制被绕过时非法用户获得的权限也是最少的。
## 6.隐私保护
6-1 收集或使用个人数据前以及将该个人数据发送给第三方之前,应明确提示用户,并获得用户的同意。
-**说明:**增加透明性及用户控制能力,满足GDPR等法律法规要求。
+**说明**:增加透明性及用户控制能力,满足GDPR等法律法规要求。
6-2 正常业务需要的情况下,采集、处理、存储个人数据,应根据实际安全风险提供必要的安全保护机制(如认证、权限控制、日志记录等),以防止个人数据被泄漏、丢失、破坏。
6-3 在说明文档中对产品涉及用户隐私的功能进行描述:该功能处理用户个人数据的目的、范围、处理方式、时限。要求使用该功能时遵从当地适用的法律法规。
-**说明:**增加透明性,满足GDPR等法律法规要求。
+**说明**:增加透明性,满足GDPR等法律法规要求。
6-4 对于所涉及的个人数据,应支持在呈现界面上(如显示界面、文件存储/导出等)进行过滤或匿名化或假名化。
-**说明:**降低个人隐私泄露的风险。
+**说明**:降低个人隐私泄露的风险。
6-5 为避免位置追踪,除了有明确的需求之外,不能出于故障定位等维护目的进行用户精确位置信息定位。
-**说明:**精确位置信息非常敏感,故障定位无需精确定位。
+**说明**:精确位置信息非常敏感,故障定位无需精确定位。
6-6 收集个人数据需基于使用目的所必需,满足最小化原则。用于问题定位的日志中记录个人数据遵循最小化原则。
-**说明:**用于问题定位的日志如果出现个人数据,会引起用户的质疑。应避免打印个人数据,如果必须打印个人数据(如调试目的),必须对个人数据进行匿名化处理。
+**说明**:用于问题定位的日志如果出现个人数据,会引起用户的质疑。应避免打印个人数据,如果必须打印个人数据(如调试目的),必须对个人数据进行匿名化处理。
6-7 涉及个人数据处理的场景,需要提供相关机制,确保数据主体能够查询、更新以及删除所有数据主体的个人数据。
-**说明:**确保数据主体的权利。
+**说明**:确保数据主体的权利。
## 术语说明
diff --git a/zh-cn/contribute/style-guide/Readme-CN.md b/zh-cn/contribute/style-guide/Readme-CN.md
new file mode 100644
index 0000000000000000000000000000000000000000..2a80e2a32cde98f8d5e5898765152df9a8d090dc
--- /dev/null
+++ b/zh-cn/contribute/style-guide/Readme-CN.md
@@ -0,0 +1,6 @@
+# OpenHarmony开发者文档风格指南
+
+- [关于本指南](style-guide-overview.md)
+- [语言风格](style-guide-language-style.md)
+- [文档结构](style-guide-document-structure.md)
+- [内容元素](style-guide-content-elements.md)
diff --git a/zh-cn/contribute/style-guide/figures/code-block-example.png b/zh-cn/contribute/style-guide/figures/code-block-example.png
new file mode 100644
index 0000000000000000000000000000000000000000..a9516e7ffbede5b0d135ee88ecf8881d8475c0ae
Binary files /dev/null and b/zh-cn/contribute/style-guide/figures/code-block-example.png differ
diff --git a/zh-cn/contribute/style-guide/figures/heading-edit-style.png b/zh-cn/contribute/style-guide/figures/heading-edit-style.png
new file mode 100644
index 0000000000000000000000000000000000000000..560254fc93d8b92c2cffa13d8209cd5a5e6c8763
Binary files /dev/null and b/zh-cn/contribute/style-guide/figures/heading-edit-style.png differ
diff --git a/zh-cn/contribute/style-guide/figures/heading-preview-style.png b/zh-cn/contribute/style-guide/figures/heading-preview-style.png
new file mode 100644
index 0000000000000000000000000000000000000000..5f817d6bf416ff11969dac1eb0a519ba1698a0ee
Binary files /dev/null and b/zh-cn/contribute/style-guide/figures/heading-preview-style.png differ
diff --git a/zh-cn/contribute/style-guide/figures/recommended-colors.png b/zh-cn/contribute/style-guide/figures/recommended-colors.png
new file mode 100644
index 0000000000000000000000000000000000000000..b1b56147bac00df0855e3cc7d63c563c032d7bd6
Binary files /dev/null and b/zh-cn/contribute/style-guide/figures/recommended-colors.png differ
diff --git a/zh-cn/contribute/style-guide/figures/screenshot-example.png b/zh-cn/contribute/style-guide/figures/screenshot-example.png
new file mode 100644
index 0000000000000000000000000000000000000000..96d7f0f334e1f820f25806c1131e0eaf1f9ca2b0
Binary files /dev/null and b/zh-cn/contribute/style-guide/figures/screenshot-example.png differ
diff --git a/zh-cn/contribute/style-guide/style-guide-content-elements.md b/zh-cn/contribute/style-guide/style-guide-content-elements.md
new file mode 100644
index 0000000000000000000000000000000000000000..918f34b1464ccdd8059892b5e1b0c1f0a2d2ee0e
--- /dev/null
+++ b/zh-cn/contribute/style-guide/style-guide-content-elements.md
@@ -0,0 +1,377 @@
+# 内容元素
+
+
+## 项目列表
+
+【规则】无序列表统一使用破折号(-)并紧跟一个空格,有序列表统一使用数字并紧跟一个英文句点和一个空格。
+
+| **正例** | **反例** |
+| ------------------------------------------------------------ | ------------------------------------------------------------ |
+| \- 无序列表第一项
\- 无序列表第二项
\- 无序列表第三项
1. 有序列表第一项
2. 有序列表第二项
3. 有序列表第三项 | \- 无序列表第一项
\* 无序列表第二项
\+ 无序列表第三项
1) 有序列表第一项
2) 有序列表第二项
3) 有序列表第三项 |
+
+【规则】列表项采用相似结构、统一句式,例如,全部采用短语或句子。
+
+| **正例** | **反例** |
+| ------------------------------------------------------------ | ------------------------------------------------------------ |
+| 播放事件回调类型,支持的事件包括 `'play'|'stop'|'dataLoad'` :
- `play`:完成play()调用,音频开始播放,触发该事件。
- `stop`:完成stop()调用,音频停止播放,触发该事件。
- `dataLoad`:完成音频数据加载后触发该事件,即src属性设置完成后触发该事件。 | 播放事件回调类型,支持的事件包括 `'play'|'stop'|'dataLoad'` :
- `play`:音频开始播放时触发。
- `stop`:音频停止事件。
- `dataLoad`:完成音频数据加载后触发该事件,即src属性设置完成后触发。 |
+
+【规则】当项目列表项是术语、短语时,句末统一不加标点符号;当项目列表项是句子时,句末统一加句号。
+
+| 正例 | 反例 |
+| -------- | -------- |
+| 支持格式包括:
- video/h263
- audio/mp4a-latm | 无 |
+
+【建议】一个项目列表的列表项建议为2~9项。
+
+【建议】只有一项的列表和前后上下文的内容合并,采用正文样式。
+
+【建议】列表的层级不超过2层,包括有序列表和无序列表的组合。
+
+
+## 表格
+
+【规则】表格至少为两行两列。
+
+【规则】相同类型的表标题、表头,风格保持一致,采用名词或名词词组的形式。
+
+同样对参数进行说明的表,不应出现“参数说明”、“参数解释”、“参数含义”、“参数意义”等不同的表头内容,需要全文保持统一。
+
+【规则】同一列信息的表达方式一致,句末的标点符号要保持一致。
+
+- 如果表格一列全部为短语,句末不加句号。
+
+- 如果表格一列全是句子或同时存在句子和短语,句末统一加句号。
+
+【规则】不出现空白的单元格,无内容单元区分“无”和“不涉及”。如果大量的“不涉及”导致表格中重要信息不突出,则采用“-”表示“不涉及”。
+
+【规则】Markdown语法不支持合并单元格,遇到对应场景需要进行表格拆分或将行内容直接合并。
+
+【规则】表格内容默认使用左对齐。
+
+
+## 图片
+
+
+### 图片总体要求
+
+【规则】严禁使用无版权图片。如无法确认是否拥有某图片的永久版权,请不要使用,改用自行绘制、拍摄的图片。
+
+【规则】图片应清晰展示目标信息,避免使用人工合成或像素低的图片。
+
+【规则】图片尺寸不能过大,在页面放大比例为100%的情况下,不能大于一屏。
+
+【规则】图片禁止通过URL地址引用,需要取到本地引用。
+
+【规则】图片命名规范:
+
+- 由字母、数字、中划线“-”组成。
+
+- 语义化,图片名能体现图片展示内容的核心名词/动词,可从图标题、上下文、展示内容或目的等维度获取,原则上不超过4个英文单词。例如:typical-service-view.png。
+
+- 同一文件夹下,图片名不允许重复。
+
+【建议】为避免图片过大或过小,影响文档阅读体验,建议的图片宽度为:大图600磅(约800px)、中图360磅(约480px)、小图200磅(约260px)。
+
+
+### 绘图
+
+【建议】字号:中英文正常字号均采用10.5pt(14px)。中文字号下限为9pt(12px),英文字号下限为8pt(11px)。
+
+【建议】优先使用灰色、蓝色两套配色,一张图建议不超过3套配色。
+
+建议配色如下:
+
+
+
+
+### 截图
+
+【规则】界面截图边缘应完整、清晰。没有明显边界的,应手动添加浅灰色外边框(RGB:217/217/217)。
+
+【规则】截图中,不要截取非必要信息,如桌面上的其他图标、工具栏等。
+
+【规则】截图中,不能包含敏感信息,如私人邮箱、公网IP地址等。
+
+
+
+【建议】截图中需要突出显示的关键信息,统一使用1px的蓝色(RGB:37/79/247)线框框选。框选时,应使关键信息位于框线中心位置,且框线尽量贴近关键信息边缘。
+
+
+## 提示与说明
+
+【规则】当需要向用户提供区别于正文的重要提示或补充说明信息时,请使用以下信息标识符,以示强调。
+
+| 标识符 | 用途/含义 | 典型使用场景举例 |
+| -------- | -------- | -------- |
+| 说明
(英文为:Note) | 提供帮助提示或有用的参考信息。 | - 支撑开发者做出决策的信息(参数选取原则、系统实现机制补充说明等)
- 可提升开发效率的信息
- 版本差异说明
- 依赖说明
- 相关参考信息 |
+| 注意
(英文为:Caution) | 如未按该注意事项操作,可能会导致任务中断或结果异常,但是可恢复。 | - 导致功能异常
- 导致测试失败
- 影响系统开销/系统性能
- 特性约束限制/版本要求
- 影响应用成功安装
- 导致进程攻击
- 导致内存访问错误或内存损坏
- 导致安全类问题(如数据安全/设备安全/帐号安全等)
- 导致稳定性问题
- 导致兼容性问题
- 影响应用分发
- 影响设备安全等级评估
- 影响用户体验(影响可用带宽、服务使用、电池续航、对应用信任度等) |
+| 警告
(英文为:Warning) | 如未按该警告内容操作,可能会导致结果异常,且不可恢复。 | - 导致用户数据丢失
- 导致硬件损坏 |
+
+【规则】使用Markdown的引用语法“>”对提示或补充信息进行描述。
+
+> **说明:**
+
+> 该接口从API Version 7 开始不再维护,建议使用newMethod替代。
+
+【规则】提示或补充信息中不能包含表格和图片(图标除外)。
+
+【规则】提示或补充信息内容不能过长,建议内容在一个段落范围内。
+
+【规则】“注意”及更高级别的提示信息统一放在正文或步骤之前,用来提前警示相关事项,提醒用户避免损失。
+
+【规则】禁止滥用“说明”。如果Web页面中一屏幕“说明”的数目超过2个,请考虑将其改为正文信息。
+
+
+## 链接
+
+
+### 链接规则
+
+当需要参考其他手册内容、本手册中其他章节内容时,可添加到对应内容的链接。
+
+【规则】跨文档或跨章节的链接,采用统一表达“请参见xxx”。
+
+【规则】使用动词“单击”表示对网页类链接的操作。
+
+【建议】对于内容很少(小于100字)但必须参考的内容,建议直接重述该内容;对于参考内容很多且不便重述的内容,添加链接。
+
+【建议】一篇文档中应避免出现过多的交叉引用和外部链接。
+
+
+### 链接样式
+
+【规则】将链接URL写入内容,而不是直接在页面中暴露URL地址。
+
+- 链接到其他手册、页面内容:\[术语](glossary/glossary.md)
+
+- 链接到本页面内其他内容段落:\[FAQ](#faq)
+
+- 链接到其他站点:\[示例](www.example.com)
+
+ | **正例** | **反例** |
+ | -------- | -------- |
+ | 请参见\[OpenHarmony开源项目](https://gitee.com/openharmony) | OpenHarmony开源项目请参见https://gitee.com/openharmony |
+
+
+## 术语及缩略语
+
+【规则】术语/缩略语名称要同“[OpenHarmony术语表](https://gitee.com/openharmony/docs/blob/master/zh-cn/glossary.md)”保持一致,且全文统一。
+
+【规则】对于“[OpenHarmony术语表](https://gitee.com/openharmony/docs/blob/master/zh-cn/glossary.md)”中未涵盖的行业通用术语/缩略语(如IP,MAC等),要同国际、国家、行业标准中的名称保持一致。
+
+【规则】禁止随意缩写英文单词,自创缩略语。
+
+【规则】除行业通用术语/缩略语外,正文中出现的所有术语/缩略语都需要在术语表中给出解释。
+
+【规则】中文文档中,缩略语全称中对应的字母大写。
+
+【建议】一篇文档中某缩略语首次出现的位置(标题和表头除外),提供英文全称,可选提供中文全称。
+
+【建议】开发板名称、设备名称等不作为术语或缩略语,不在术语表中体现。建议在文档中单独以表格或其他形式介绍。
+
+
+## 单位符号
+
+【规则】用单位符号代替汉字名称。例如:mm代替毫米。
+
+【规则】不能在组合单位中同时使用中文符号和单位符号。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| km/h | km/小时 |
+
+【规则】词头不得孤立使用。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| 64Kbit/s | 64K |
+
+【规则】常用单位符号请参考下表。
+
+| 单位名称 | 符号 |
+| -------- | -------- |
+| [小]时 | h |
+| 分 | min |
+| 秒 | s |
+| 毫秒 | ms |
+| 比特 | bit |
+| 千比特 | kbit (表示1000概念时,使用小写k;表示1024概念时,使用大写K) |
+| 兆比特 | Mbit |
+| 字节 | Byte |
+| 千字节 | kB(表示1000概念时,使用小写k;表示1024概念时,使用大写K) |
+| 兆字节 | MB |
+| 吉字节 | GB |
+| 比特/秒 | bit/s (bit/s和bps都正确,但前者更正式) |
+| 字节/秒 | Byte/s |
+| 千米 | km |
+| 米 | m |
+| 厘米 | cm |
+| 毫米 | mm |
+| 微米 | μm |
+| 分贝 | dB |
+| 摄氏度 | ℃ |
+| 华氏度 | ℉ |
+| 开[尔文] | K |
+| 赫[兹] | Hz |
+| 帕[斯卡] | Pa |
+| 千克(公斤) | kg |
+| 克 | g |
+
+
+## 标点符号
+
+ 【规则】逗号:不可滥用,不可“一逗到底”。
+| **正例** | **反例** |
+| -------- | -------- |
+| 帐务计费中心主要负责话单处理和帐务处理。帐务计费中心同计费网关之间有一个话单接口,用于帐务计费中心取用户话单。话单文件采用“\*.txt”的形式。 | 帐务计费中心主要负责话单处理和帐务处理,帐务计费中心同计费网关之间有一个话单接口,用于帐务计费中心取用户话单,话单文件采用“\*.txt”的形式。 |
+
+【规则】句号:
+
+- 在正文描述下紧接图或表时,句子说明已完整,以句号结束。
+ | **正例** | **反例** |
+ | -------- | -------- |
+ | 具体参数说明如表1-2所示。 | 具体参数说明如表1-2所示: |
+
+- 当一个句子包含在另一个句子中,并且前者属于后者的一部分时,前者句末不加句号。
+ | **正例** | **反例** |
+ | -------- | -------- |
+ | 在使用xxx(以下简称为x)之前,请先仔细阅读本手册的内容。 | 在使用xxx(以下简称为x。)之前,请先仔细阅读本手册的内容。 |
+
+- 括号中的内容不属于前一个句子,而是作为一个独立句子并且需要带括号时,句尾加句号。
+
+【规则】冒号:不能在一个句子中连续使用冒号,避免导致冒号所提示的范围模糊。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| 正例1:
计费策略:A1 表示计费,A2 表示不计费。
正例2:
计费策略:
- A1:计费
- A2:不计费 | 计费策略:表示计费:A1,表示不计费:A2。 |
+
+【规则】圆括号:
+
+- 中文文档中默认使用全角括号(代码块等特殊位置除外)。
+
+- 不要在括号中出现太长的说明文字。如果有较长的说明信息,建议作为一个单独的“[说明](#提示与说明)”。
+
+【规则】句号、问号、叹号、逗号、顿号、分号和冒号不出现在一行之首。
+
+【规则】引号、括号、书名号的前一半不出现在一行之末,后一半不出现在一行之首。
+
+【规则】破折号和省略号都占两个字的位置,中间不能断开。
+
+【规则】引号:中文文档中默认使用全角引号(代码块等特殊位置除外)。
+
+【建议】问号:界面提示、CLI操作提示、语音提示、FAQ中可以使用问号。其他场景限制使用问号。
+
+【建议】感叹号:任何场景下,不建议使用感叹号。
+
+【建议】省略号:为使文档中描述的信息准确、全面,应尽量少用省略号或“等”。
+
+【建议】其他:谨慎使用“√”“×”,在不同国家对这两个符号的理解可能正好相反。
+
+
+## 字符转义
+
+【规则】要显示原本用于格式化Markdown文档的字符,请在字符前添加反斜杠\进行转义,确保显示正常。
+
+常见的可用于转义的字符有:“\”、“、”、“\*”、“_”、“{}”、“[]”、“()”、“\#”、“+”、“-”、“.”、“!”、“|”等。
+
+| 正例 | 反例 |
+| -------- | -------- |
+| \\* 文本内容 | \* 文本内容 |
+
+【规则】对于特殊字符需使用特定的转义符号:
+
+- “<”使用“<”转义。
+
+- “>”使用“>”转义。
+
+- “&”使用“&”转义。
+
+
+## 文件路径
+
+文件路径指文件在计算机上的位置。
+
+【规则】涉及电脑分区的文件,文件路径需包含明确的根目录。
+
+【建议】文件路径尽量使用斜杠“/”来作为文件夹之间的分隔符。
+
+【建议】尽量避免文件路径过长的情况。
+
+
+## 代码与注释
+
+
+### 行内代码
+
+【规则】对于正文描述中涉及代码的内容,比如实际代码中的方法名、参数名或代码文件名等,使用`包裹显示。
+
+| 正例 | 反例 |
+| -------- | -------- |
+| 在`index.js`文件中实现页面跳转。 | 在index.js文件中实现页面跳转。 |
+
+
+### 代码块
+
+【规则】对代码示例、命令行使用代码样式。在Markdown中,使用```呈现代码样式,同时指定语言类型。
+
+
+
+【规则】代码块内容应符合对应语言的通用编程规范。
+
+【规则】完整举例中的代码块复制后可直接执行,且执行结果与文档描述一致。
+
+【规则】如果代码块中没有标识行号,则不添加行号标识。
+
+【规则】代码块显示符合缩进要求。
+
+【建议】代码块中的关键代码段提供注释说明。
+
+
+### 注释
+
+【规则】适时为代码块添加注释,特别是有解释说明、开发建议或注意事项的位置。恰当的注释可有效提升代码块可读性,帮助开发者快速掌握开发过程。
+
+【规则】注释符与代码块语法保持一致,禁止自创注释符。注释符与注释内容间统一添加一个空格。例如:对于JavaScript代码块,注释写法为“// 注释内容”。
+
+【规则】当一行注释内容过长时,注意断句切分到下一行呈现。
+
+
+## IP及MAC地址
+
+【规则】IP地址举例只能使用私网IP,禁止使用公网IP(严禁使用实际现网数据)。私网IP地址范围如下。
+
+| 组网种类 | 地址范围 |
+| -------- | -------- |
+| A | 10.0.0.0~10.255.255.255 |
+| B | 172.16.0.0~172.31.255.255 |
+| C | 192.168.0.0~192.168.255.255 |
+
+【规则】表示具体组网和路由信息时,IP地址和掩码必须同时出现。
+
+- 图片和表格中可以使用如“x.x.x.x/24”的方式,“24”表示掩码长度。
+
+- 正文中必须使用255.255.255.0格式表示掩码,如“IP地址为10.10.10.1,子网掩码为255.255.255.252”。
+
+【规则】涉及域名示例时,使用开源网址:www.example.com。
+
+【规则】涉及MAC地址示例时,在保持格式正确的情况下,使用“X”进行模糊处理。
+
+| 正例 | 反例 |
+| -------- | -------- |
+| 00-01-XX-XX-XX-XX
00:01:XX:XX:XX:XX | 无 |
+
+
+## 个人信息
+
+【规则】严禁使用真实的个人信息。
+
+【规则】涉及个人电话号码示例时,在保持格式正确的情况下,使用“\*”进行模糊处理。
+
+【规则】国际电话号码前添加国家码和地区码,并分别用括号括起,如(86) (755) \*\*\*\*\*\*\*\* [Shenzhen, China]。
+
+【规则】涉及个人身份证号、帐号名示例时,在保证格式正确的情况下,使用“\*”进行模糊处理。
+
+【规则】涉及邮箱示例时,在保证格式正确的情况下,进行模糊处理,例如:\*\*\*@example.com。
+
+【建议】涉及个人姓名示例时,尽可能使用通用名。
+
diff --git a/zh-cn/contribute/style-guide/style-guide-document-structure.md b/zh-cn/contribute/style-guide/style-guide-document-structure.md
new file mode 100644
index 0000000000000000000000000000000000000000..f03b5d3c0841d31bbda973344b2b5ce2f329698f
--- /dev/null
+++ b/zh-cn/contribute/style-guide/style-guide-document-structure.md
@@ -0,0 +1,140 @@
+# 文档结构
+
+
+## 标题
+
+
+### 标题规则
+
+【规则】标题应概括反映章节的中心内容,体现章节内容的核心关键词。避免使用“概述Overview”、“简介Introduction”等不带有核心关键词的标题,应补充核心关键词如“内核概述”、“OpenHarmony简介”。
+
+【规则】相同级别、相同类型的标题结构保持一致。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| 内核概述
驱动概述
【点评】同为概念类页面,标题风格保持一致。 | 内核介绍
驱动概述 |
+| 音频播放开发指导
音频管理开发指导
【点评】同为操作/指导类页面,标题风格保持一致。 | 音频播放开发指导
音频管理开发 |
+
+【规则】标题中使用的缩略语不必给出全称。标题中出现某一缩略语时,采用以下方式处理:
+
+- 首次出现该缩略语时,需在随后的正文中给出其全称。
+
+- 非首次出现该缩略语时,不需在随后的正文中给出其全称。
+
+- 无法判断是否为首次出现该缩略语时,按首次出现该缩略语处理。
+
+【规则】标题中不能出现特殊字符。
+
+- 这些特殊字符包括:+、-、\*、?、|、^、~、""、'、\、/。由于这些特殊字符带有某些特殊的语义,当这些特殊字符在标题中出现时,会导致标题无法正确显示或无法出现在搜索结果中。
+
+- 当标题中无法避免产品名称、功能或特性连用时,请谨慎使用半角的“/”或“&”。
+
+【规则】标题结尾不允许使用句号、问号、冒号等标点符号。即使是FAQ的标题也不例外。
+
+【规则】标题中不能带上下标。
+
+【规则】标题中存在补充说明文字时,统一使用圆括号标识。补充说明文字区分不同维度时,用中文逗号分隔。如:快速入门(标准系统,安装包方式)。
+
+【建议】中文标题长度不超过15个汉字,英文不超过25个字符(包括空格)。
+
+【建议】概念类/描述类/功能介绍类章节的标题采用名词或名词性词组。
+
+| 建议 | 不建议 |
+| -------- | -------- |
+| OpenHarmony介绍 | 介绍OpenHarmony |
+
+【建议】任务类章节的标题建议采用动宾结构。
+
+| 建议 | 不建议 |
+| -------- | -------- |
+| 开发首个Hello World | 首个Hello World开发 |
+
+
+### 标题样式
+
+【规则】标题包含一级标题、二级标题、三级标题、四级标题……,同一页面内标题层级建议不超过四级。
+
+【规则】标题级别必须遵守一级标题 > 二级标题 > 三级标题 > 四级标题的顺序。
+
+【规则】不能混用标题的级别,例如:一级标题下面不能直接使用三级标题、四级标题;二级标题下面不能直接使用四级标题。
+
+ **图1** Markdown中标题编辑样式
+
+
+ **图2** Markdown中标题预览样式
+
+
+## 段落
+
+【规则】一个段落只能有一个主题句或中心句。主题句或中心句置于段首。
+
+【规则】段落之间要有[清晰的逻辑结构](style-guide-language-style.md#清晰)。
+
+【规则】根据内容特点,段落句子使用陈述、肯定或祈使语气,避免使用感叹语气。
+
+【建议】一个段落的长度≤7行,最佳段落长度≤4行。
+
+【建议】对于技术描述类主题,“字不如表、表不如图”,推荐使用文字、图、表相结合的方式,使内容更易理解。
+
+【建议】不出现连续3个以上的纯文字段落。通过图、表等方式避免文字描述的单一性。
+
+【建议】段落内容使用正文样式,不要加粗。
+
+
+## 句子
+
+【规则】每个句子只有一个主题。
+
+【规则】使用直接陈述,避免双重否定和反问句。
+
+【规则】避免“名词 + 名词 + 名词”修饰方式。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| 无 | 配置管理模块
【点评】该短句可能存在如下断句:配置“管理模块”,或“配置管理”模块,根据实际语义优化描述。 |
+
+【规则】句子的主语应该明确。省略主语时,要保证用户能迅速并正确的确定主语。同一个句子内,避免主语变化。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| 无 | 提示出错
【点评】缺少主语,如“工具提示出错”、“编译子系统提示出错”,在描述时尽量具体、明确。 |
+
+【规则】使用主谓结构、主谓宾结构的简单句,而非复合句。把复合句改为列表或分拆成简单句和简单复合句。
+
+【规则】避免使用长连句,同一个句子中的逗号个数应小于9。
+
+【建议】用祈使句表示动作。
+
+| 建议 | 不建议 |
+| -------- | -------- |
+| 在弹出的对话框中,单击“确定”按钮。 | 在弹出的对话框中,请您单击“确定”按钮。 |
+
+【建议】中文句子长度不超过50个汉字,英文句子长度不超过30个字符。
+
+【建议】句子样式默认采用正文样式,不要加粗或添加背景色。
+
+
+## 目录
+
+文档目录分为手册级目录、页面内目录,便于用户高效浏览、获取关键内容。
+
+【规则】手册级目录:手册级目录定义以Docs仓库内最小文件夹级别管理。在文件夹内新增页面、修改页面名称、删除页面时,都需同步更新手册级目录。
+
+【规则】页面内目录:页面内目录由页面内标题自动生成,写作时请遵循页面内[标题规范及样式](#标题)。
+
+
+## 文件夹及文件命名
+
+【规则】文件夹名:使用文档描述对象的主题英文名称,如:ability、ui等,全小写。
+
+【规则】Markdown文件命名规范:
+
+- 由字母、数字、中划线“-”组成。统一使用“.md”(小写)后缀。
+
+- 除Readme.md外,其他文件名原则上全小写。
+
+- 语义化,文件名能对文档主题内容进行概括,建议取自该文档的英文标题,如:ability-assistant-guidelines.md。
+
+- 原则上不超过4个英文单词。
+
+- 同一文件夹下,文件名不允许重复。
diff --git a/zh-cn/contribute/style-guide/style-guide-language-style.md b/zh-cn/contribute/style-guide/style-guide-language-style.md
new file mode 100644
index 0000000000000000000000000000000000000000..79fb85b067645c6e135b32c23970c2187fbfde68
--- /dev/null
+++ b/zh-cn/contribute/style-guide/style-guide-language-style.md
@@ -0,0 +1,197 @@
+# 语言风格
+
+
+## 人称及语态
+
+【规则】使用第二人称。人称代词默认省略,必须出现时,推荐使用“开发者”而不是“你”。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| 使用IDE创建卡片工程。 | 我们使用IDE创建卡片工程。 |
+
+【建议】尽量使用主动语态。即句子主语是执行动作的人或事物,而不是被操作的事物。
+
+| 建议 | 不建议 |
+| -------- | -------- |
+| 配置参数A,声明支持B功能。 | A参数被配置后,即可支持B功能。 |
+
+
+## 语气及用词
+
+【规则】客观陈述内容,口吻友好。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| 确保配置正确。否则,会导致系统工作不正常。 | 你必须保证配置正确。否则后果自负。 |
+
+【规则】避免使用口语化词语。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| 无 | “不准”、“……的话”、“就可以了”、“做……用”等。 |
+
+【规则】避免行话。行话只有小部分人员能理解,且难以翻译。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| 非法访问内存空间 | 踩内存 |
+
+【规则】避免成语和俗语。成语和俗语翻译时很难有效传达其确切含义,没有必要在技术资料中存在。
+
+【规则】避免使用可能带有偏见或歧视含义的词汇,包括性别、种族、文化、年龄、技能、职业、宗教、经济水平等方面的偏见或歧视。
+
+【规则】避免使用可能会引起操作者负面情绪的词语。
+
+| **正例** | **反例** |
+| -------- | -------- |
+| 无 | “你已被踢出” |
+
+
+## 用户视角
+
+【规则】为目标用户(指目标读者,本文简称用户)写作:
+
+- 明确文档面向的用户(如产品经理、开发者),从而明确用户关注的内容要点,提供且仅提供用户关注的内容。写作中,时刻站在用户视角,思考文章是否覆盖了内容要点、有无冗余。
+
+- 针对不同技能水平(如新手、资深)的用户提供支撑信息。
+
+- 按照用户认知习惯呈现信息(请参考“[清晰](#清晰)”)。
+
+【规则】面向用户场景和用户任务写作:
+
+- 文档内容应面向用户的真实场景和目标/任务,而非产品功能。
+
+- 标题明确体现任务目标。
+
+- 对于复杂任务流(超过5步),在操作开始前提供操作流程图或表。
+
+- 提供清晰的、step-by-step的操作指导。适当配合界面截图使操作更直观,仅截取关键信息。
+
+- 为用户任务就近提供操作支撑信息。
+
+- 提供任务全流程所需的支撑信息,例如必要的背景信息、前提条件、准备动作、操作成功的验证方法、常见的故障处理和错误预防信息。
+
+- 为所呈现的信息提供必要的理由(例如对用户理解或完成开发任务没有帮助的内部实现原理不需要提供)。
+
+
+## 完整
+
+【规则】避免任务场景缺失。开始写作前,应通过用户与任务分析活动,明确文档要提供哪些任务场景的指导信息。
+
+【规则】通过写作模板来保证内容的完整性:
+
+- OpenHarmony文档遵从结构化、模块化理念,对于每类信息,均根据用户的信息需求提供相应内容模板,即“[OpenHarmony文档写作模板](https://gitee.com/openharmony/docs/tree/master/zh-cn/contribute/template)”。请从中选择最贴近待写作内容的模板,保证知识点覆盖完整。
+
+- 写作模板中“必选”的节点,禁止删除。
+
+- 写作模板中“可选”的节点,在确定不涉及的情况下,删除即可。
+
+
+## 具体
+
+【规则】用具体的描述代替抽象/晦涩的描述。
+
+| **正例** | 反例 |
+| -------- | -------- |
+| 在编译构建过程中,提示LABEL_VALUE_ERROR错误信息。 | 编译构建失败。 |
+
+【规则】表示数量或程度时,避免用笼统的“多”“少”“大”,改为具体的、易于感知或衡量的数字。
+
+| **正例** | 反例 |
+| -------- | -------- |
+| 文件大于16MB | 文件超限 |
+| 等待30分钟左右 | 等待较长的时间 |
+| CPU运行速度提升80% | 性能增强 |
+
+
+## 简洁
+
+【规则】使用主谓结构、主谓宾结构的句子,避免添加不必要的修饰成分。
+
+【规则】避免使用长连句。同一句子中的逗号数不能超过5个。
+
+【规则】禁止使用双重否定。
+
+【规则】言简意赅,直接陈述观点。避免无意义的词语,包括表示程度、语气的词。
+
+| **正例** | 反例 |
+| -------- | -------- |
+| 属性不允许重复定义。 | 每个属性最多只允许出现一次。 |
+| 绑定服务与通知。 | 将服务与通知绑定就好了。 |
+
+【规则】根据用户的技能水平,剔除不必要的信息。
+
+
+## 清晰
+
+【规则】确保语言描述清晰,不模糊,不晦涩,易理解(传递一个清楚的意思):
+
+- 遵循“[具体](#具体)”、“[简洁](#简洁)”的要求。
+
+- 确保每个代词都有清晰的指代,能够通过上下文清晰获取其指代对象,便于理解与翻译。
+
+- 参数取值原则、原理描述清晰易懂。
+ | **正例** | 反例 |
+ | -------- | -------- |
+ | 当参数A设置为1时:
- 如果参数B设置为1,表示有下一级跳转,此时页签为方形9宫格。
- 如果参数B设置为0,表示无下一级跳转,此时页签自动变为圆形9宫格。 | 在参数A为1同时参数B为1,如有下一级跳转则页签为方形9宫格,若无下一级跳转则界面页签会自动变为圆形9宫格。 |
+
+- 避免使用引起歧义的词。
+ | **正例** | **反例** |
+ | -------- | -------- |
+ | 接通开发板电源。 | 按下开发板电源开关。 |
+
+- 避免使用含义模糊的词,如表示程度、强调等语气的词。
+ | **正例** | **反例** |
+ | -------- | -------- |
+ | 无 | - 表示程度的词:较多(more)、较好(better)、基本地(basically)、决定性的(decisively)、最后的 ( finally )、很(very)、可能(may/maybe/could)、大概(probably)、通常( usually )、一般 ( generally )。
- 表示转折的词:当然(of course)、然而(however)。
- 表示量的词:有些(some)、非常(very)、大量(large number)、一些(several)、少许(few)。 |
+
+【规则】确保逻辑清晰:
+
+- 采用合理的逻辑结构(写作顺序),使章节/段落/步骤/句子顺序符合用户认知习惯。以下常用写作顺序可以独立使用,也可配合使用。
+ | **逻辑结构(写作顺序)** | 特征 | 适用的典型信息类型(不限于) |
+ | -------- | -------- | -------- |
+ | 先总后分 | 先综述总论点(如特性概述、开发流程概述),再依次展开分论点(子特性详细介绍、开发任务流详细介绍)。
总论点下的分论点做到完全穷尽(不遗漏)、相互独立(无交叠)。 | 功能/场景描述类
开发指导类 |
+ | 按时间顺序 | 时间、流程或因果上的有先有后。 | 开发指导类 |
+ | 按空间/结构顺序 | 从上层到下层;从整体到局部。 | 架构描述类
组网描述类 |
+ | 按重要性顺序 | 从重要到次要;从基础到特殊。 | 开发指导类
问题分析类 |
+ | 按"情境-冲突-问题-回答"顺序 | 通过追溯问题的起源和发展,引入用户熟悉的情境,然后说明冲突,从而提出最初的问题,最后给出解决方案(也就是即将阐述的主题)。 | 功能/场景描述类 |
+
+- 对于开发指导类内容,能让用户直观了解具体场景/任务的完整开发流程。
+
+- 对于存在分支的步骤,提供明确的选取原则。
+
+- 适当使用图、表,使逻辑和表意更直观。
+
+
+## 一致
+
+【规则】用词一致:术语、缩略语、描述同一对象的词汇要全文一致,符合用户的心理预期,禁止使用不同的词汇(包括中英文混用)描述同一事物或操作。
+
+OpenHarmony常用词必须遵从下表。
+
+| 正例 | 反例 |
+| -------- | -------- |
+| 登录 | 登陆 |
+| 单击 | 点击 |
+| 帐户 | 账户 |
+| 帐号 | 账号 |
+| 图像 | 图象 |
+| 计费 | 记费 |
+| 阈值 | 阀值 |
+| 重写 | 复写 |
+| 命令 | 指令 |
+| 外形 | 外型 |
+
+【规则】结构一致:相同文档或者同类信息,保持结构一致,有助于用户对文档结构的把握,方便信息的查找和理解。请优先在“[OpenHarmony文档写作模板](https://gitee.com/openharmony/docs/tree/master/zh-cn/contribute/template)”中选择最贴近待写作内容的模板,遵循模板要求写作。
+
+【规则】句式一致:使用一致的句式,不但使技术文档对外表现出一致的风格,也有助于用户在理解内容时,符合已经形成的思维惯性,理解起来更简单。例如统一使用祈使句描述动作。
+
+【规则】格式一致:同类元素如[代码块](style-guide-content-elements.md#代码与注释)、[文件路径](style-guide-content-elements.md#文件路径)等,格式保持一致,便于用户理解。
+
+【建议】下表给出了另一部分常用词的推荐用法,请参考。
+
+| 建议 | 不建议 |
+| -------- | -------- |
+| 界面 | 页面 |
+| 短消息 | 短信 |
+| 数据包 | 数据报 |
diff --git a/zh-cn/contribute/style-guide/style-guide-overview.md b/zh-cn/contribute/style-guide/style-guide-overview.md
new file mode 100644
index 0000000000000000000000000000000000000000..c411b8bf9dedeef16697b12b8260b00e4bc9affc
--- /dev/null
+++ b/zh-cn/contribute/style-guide/style-guide-overview.md
@@ -0,0 +1,21 @@
+# 关于本指南
+
+
+本指南针对OpenHarmony文档的语言风格、文档结构、内容元素等提供规范要求或参考建议,确保OpenHarmony文档具备一致的风格,同时帮助开发者高效参与文档贡献。
+
+
+在开始OpenHarmony文档写作前,请先浏览本指南内容,参照相应要求或建议进行写作。
+
+
+此外,请优先在“[OpenHarmony文档写作模板](https://gitee.com/openharmony/docs/tree/master/zh-cn/contribute/template)”中选择最贴近待写作内容的模板,遵循模板要求进行写作。写作模板提供特定类型文档的针对性写作指引,充分利用写作模板将事半功倍。
+
+
+本指南持续更新,欢迎提出改进意见。
+
+
+> **说明:**
+> 本指南的内容分为【规则】、【建议】两类:
+>
+> - 【规则】表示规范要求,必须遵从。
+>
+> - 【建议】表示参考建议,可选遵从。
diff --git "a/zh-cn/contribute/\350\256\270\345\217\257\350\257\201\344\270\216\347\211\210\346\235\203\350\247\204\350\214\203.md" "b/zh-cn/contribute/\350\256\270\345\217\257\350\257\201\344\270\216\347\211\210\346\235\203\350\247\204\350\214\203.md"
index 2f40d8081d7e442ab2220be7f6fe1a85ea3a4979..8191df923b8cdfbf033670ceb98340f13530c6ff 100644
--- "a/zh-cn/contribute/\350\256\270\345\217\257\350\257\201\344\270\216\347\211\210\346\235\203\350\247\204\350\214\203.md"
+++ "b/zh-cn/contribute/\350\256\270\345\217\257\350\257\201\344\270\216\347\211\210\346\235\203\350\247\204\350\214\203.md"
@@ -16,8 +16,8 @@
## LICENSE文件
1. 每个开源仓必须有清晰描述的许可证信息,且许可证必须与OpenHarmony整体许可证规则一致,如用户态开源仓使用Apache License 2.0许可协议,LiteOS内核态开源仓使用BSD 3-clause许可协议。
-2. 每个开源仓的许可证文件必须为纯文本格式,放置于代码仓的根目录,里面包含该许可的全文,并且以”LICENSE“命名,不用带".txt",".md"等后缀。
-3. 如果开源仓的不同源码包含多种许可证,请将主许可证描述在以”LICENSE“命名的文件中,其它许可证请以”LICENSE-许可证类型-备注“命名并放置于仓的根目录或该许可证对应源码的根目录,同时在主许可证中描述各许可证文件位置及其适用的范围与场景。
+2. 每个开源仓的许可证文件必须为纯文本格式,放置于代码仓的根目录,里面包含该许可的全文,并且以“LICENSE”命名,不用带".txt",".md"等后缀。
+3. 如果开源仓的不同源码包含多种许可证,请将主许可证描述在以“LICENSE”命名的文件中,其它许可证请以“LICENSE-许可证类型-备注”命名并放置于仓的根目录或该许可证对应源码的根目录,同时在主许可证中描述各许可证文件位置及其适用的范围与场景。
4. 每个开源仓的许可证文件必须要涵盖该仓下所有文件,确保各许可证的涵盖范围描述准确、精简,并且不要包含不在本仓发布的其它源代码许可等不必要的信息,比如要单独下载的依赖软件的许可不要包含在仓和许可证信息中。
5. 如果开源仓在发布时以二进制形式发布,请确保许可证文件位于其发布格式的常规位置,如发布文件夹或压缩包的顶层目录,对于".jar"格式的文件,许可证可位于META-INF目录。
diff --git "a/zh-cn/contribute/\350\264\241\347\214\256\346\226\207\346\241\243.md" "b/zh-cn/contribute/\350\264\241\347\214\256\346\226\207\346\241\243.md"
index 645697e7546c2580d66f50bc33fb0e543fd9d85f..dfcd8a51758adb85cfabaf70b1adc26025f77b68 100755
--- "a/zh-cn/contribute/\350\264\241\347\214\256\346\226\207\346\241\243.md"
+++ "b/zh-cn/contribute/\350\264\241\347\214\256\346\226\207\346\241\243.md"
@@ -23,15 +23,15 @@
高质量的问题反馈有助于我们不断完善文档内容和质量,您提供的信息越详尽,对我们问题改进越有帮助。
-1. 在Gitee页面中,“Issue“页签中单击“新建Issue“,在标题栏中描述问题,在编辑框中添加详细问题描述。
-2. 单击“创建“按钮,提交Issue,耐心等待文档团队成员确认您的问题。
+1. 在Gitee页面中,“Issue”页签中单击“新建Issue”,在标题栏中描述问题,在编辑框中添加详细问题描述。
+2. 单击“创建”按钮,提交Issue,耐心等待文档团队成员确认您的问题。
-> **说明:**
->**如何反馈一个高质量的问题?**
+> **说明**:
+>**如何反馈一个高质量的问题**?
>
>- 提供问题的清晰描述,描述具体缺失、过时、错误的内容或者需要改进的文字。
>- 解释该问题对用户的影响。
->- 将给定问题的范围限定在一个具体内容、任务。如果问题牵涉的领域较大,可以将其分解为多个小一点的问题。例如:"文档需要优化" 是一个过于宽泛的问题,而 "XX开发指南缺少对XXX步骤的介绍" 就是一个足够具体的、可操作的问题。
+>- 将给定问题的范围限定在一个具体内容、任务。如果问题牵涉的领域较大,可以将其分解为多个小一点的问题。例如:“文档需要优化” 是一个过于宽泛的问题,而 “XX开发指南缺少对XXX步骤的介绍” 就是一个足够具体的、可操作的问题。
>- 搜索现有问题的列表,查看是否已经有相关的或者类似的问题已被记录。
>- 如果新问题与某其他问题或PR有关联,可以使用其完整 URL 或带 \# 字符的PR编号来引用它。
@@ -42,7 +42,7 @@
1. 在文档页面右上角单击“编辑“按钮即可跳转到对应的Gitee工程源文件页面。
2. 在Gitee源文件md页面中,在对应内容处完成更改、修复。
3. 修改完成后,可单击“预览“按钮,确认修改结果。
-4. 确认无误后,在“扩展信息框“中填写修改意见和补充信息、Signed-off-by邮箱信息触发DCO校验,单击提交审核。
+4. 确认无误后,在“扩展信息框”中填写修改意见和补充信息、Signed-off-by邮箱信息触发DCO校验,单击提交审核。
例如:Signed-off-by: user.name //与DCO签署邮箱保持一致
diff --git a/zh-cn/device-dev/driver/Readme-CN.md b/zh-cn/device-dev/driver/Readme-CN.md
index 0a3ef42249ef30a21979b2d1611b4a8f502b41fd..3ee6c11799a477f3f9b9178545d23d518ba9c006 100755
--- a/zh-cn/device-dev/driver/Readme-CN.md
+++ b/zh-cn/device-dev/driver/Readme-CN.md
@@ -43,12 +43,15 @@
- [UART](driver-platform-uart-des.md)
- [WatchDog](driver-platform-watchdog-des.md)
- 外设驱动使用
+ - [Audio](driver-peripherals-audio-des.md)
+ - [Camera](driver-peripherals-camera-des.md)
+ - [Face_auth](driver-peripherals-face_auth-des.md)
- [LCD](driver-peripherals-lcd-des.md)
- - [Touchscreen](driver-peripherals-touch-des.md)
+ - [Light](driver-peripherals-light-des.md)
+ - [Pin_auth](driver-peripherals-pinauth-des.md)
- [Sensor](driver-peripherals-sensor-des.md)
- - [WLAN](driver-peripherals-external-des.md)
- - [Audio](driver-peripherals-audio-des.md)
+ - [Touchscreen](driver-peripherals-touch-des.md)
- [USB](driver-peripherals-usb-des.md)
- - [Camera](driver-peripherals-camera-des.md)
+ - [User_auth](driver-peripherals-user-auth-des.md)
- [Vibrator](driver-peripherals-vibrator-des.md)
- - [Light](driver-peripherals-light-des.md)
\ No newline at end of file
+ - [WLAN](driver-peripherals-external-des.md)
\ No newline at end of file
diff --git "a/zh-cn/device-dev/driver/figures/Vibrator\351\251\261\345\212\250\350\277\220\350\241\214\345\233\276.png" "b/zh-cn/device-dev/driver/figures/Vibrator\351\251\261\345\212\250\350\277\220\350\241\214\345\233\276.png"
index d5d5108ea258f52731bfc3b2dee0c5e81b3306ac..52c595d9db32a3023055acea21292772bf2d409a 100755
Binary files "a/zh-cn/device-dev/driver/figures/Vibrator\351\251\261\345\212\250\350\277\220\350\241\214\345\233\276.png" and "b/zh-cn/device-dev/driver/figures/Vibrator\351\251\261\345\212\250\350\277\220\350\241\214\345\233\276.png" differ
diff --git a/zh-cn/device-dev/kernel/kernel-small-basic-time.md b/zh-cn/device-dev/kernel/kernel-small-basic-time.md
index b378ef425340cd8c5f667c5e8dd42d1bfd58ffa6..9dca8cc0a5b64b3e0991d73247b281c3ed105bf5 100644
--- a/zh-cn/device-dev/kernel/kernel-small-basic-time.md
+++ b/zh-cn/device-dev/kernel/kernel-small-basic-time.md
@@ -51,7 +51,7 @@ OpenHarmony LiteOS-A内核的时间管理提供下面几种功能,接口详细
前置条件:
-- 配置好LOSCFG_BASE_CORE_TICK_PER_SECOND,即系统每秒的Tick数。
+- 配置好LOSCFG_BASE_CORE_TICK_PER_SECOND,即系统每秒的Tick数,范围(0, 1000]。
- 配置好OS_SYS_CLOCK 系统时钟频率,单位:Hz。
diff --git a/zh-cn/device-dev/porting/Readme-CN.md b/zh-cn/device-dev/porting/Readme-CN.md
index 1ee96a3cc2883c5190c5868df29bde45aad15a69..80b56ae99e0caa842ec2efea58fab1ba50695da3 100644
--- a/zh-cn/device-dev/porting/Readme-CN.md
+++ b/zh-cn/device-dev/porting/Readme-CN.md
@@ -59,7 +59,7 @@ repo init -u https://gitee.com/openharmony-sig/manifest.git -b master -m devboar
## 芯片移植案例
-- [轻量系统芯片移植案例](porting-minichip-cases.md)
+- 轻量系统芯片移植案例
- [带屏解决方案之恒玄芯片移植案例](porting-bes2600w-on-minisystem-display-demo.md)
- [Combo解决方案之ASR芯片移植案例](porting-asr582x-combo-demo.md)
- [轻量系统STM32F407芯片移植案例](porting-stm32f407-on-minisystem-eth.md)
diff --git a/zh-cn/device-dev/porting/porting-asr582x-combo-demo.md b/zh-cn/device-dev/porting/porting-asr582x-combo-demo.md
index dc07773c0db4d7261471af579db3a7b45924b5b1..8e621698eb4c816d7ee12489c1d4089e1d909d23 100755
--- a/zh-cn/device-dev/porting/porting-asr582x-combo-demo.md
+++ b/zh-cn/device-dev/porting/porting-asr582x-combo-demo.md
@@ -469,13 +469,13 @@ LOSCFG_DRIVERS_HDF_PLATFORM=y
子系统的编译选项入口在相应产品config.json下,以下以`//vendor/asrmicro/wifi_demo/config.json`为例。
-### LWIP组件
+### lwIP组件
-lwip组件的源码在`//third_party/lwip`,Openharmony在kernel中做了定制化,`//kernel/liteos_m/components/net/lwip-2.1`,包括一些接口的重定义,结构体的重定义等。
+lwIP组件的源码在`//third_party/lwip`,OpenHarmony在kernel中做了定制化,`//kernel/liteos_m/components/net/lwip-2.1`,包括一些接口的重定义,结构体的重定义等。
移植过程可参考:[lwIP组件适配](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/porting/porting-chip-board-lwip.md)
-本案例在config.json中设置lwip的路径如下:
+本案例在config.json中设置lwIP的路径如下:
```
"subsystem": "kernel",
@@ -489,7 +489,7 @@ lwip组件的源码在`//third_party/lwip`,Openharmony在kernel中做了定制
]
```
-另外,需在内核编译配置文件kernel_config/debug.config中,打开编译lwIP的开关
+另外,需在内核编译配置文件kernel_config/debug.config中,打开编译lwIP的开关,如下:
```
LOSCFG_NET_LWIP=y
@@ -581,7 +581,7 @@ xts组件的适配,以`//vendor/asrmicro/xts_demo/config.json`为例,需要
dsoftbus组件提供了设备间的发现连接、组网和传输能力,本方案以Wi-Fi设备间的软总线能力为例。
-依赖组件:LWIP组件、security组件、wifi_lite组件。
+依赖组件:lwIP组件、security组件、wifi_lite组件。
前置条件:设备需先连接路由,所有的组网设备需在同一局域网中。
@@ -622,7 +622,7 @@ dsoftbus组件的启动接口可参考`//vendor/asrmicro/wifi_demo/tests/dsoftbu
InitSoftBusServer();
```
-dsoftbus组件的运行需至少预留80KB RAM,如资源不够,可对其它地方进行剪裁,例如LWIP组件,可修改
+dsoftbus组件的运行需至少预留80KB RAM。如资源不够,可对其它地方进行剪裁。例如,可在以下文件修改lwIP组件:
`//kernel_liteos_m/blob/master/components/net/lwip-2.1/porting/include/lwip/lwipopts.h`:
```
@@ -670,7 +670,7 @@ void HandleReceiveDeviceId(AuthManager *auth, uint8_t *data)
}
```
-在正确配置并编译烧录后,设备使用wifi_open指令连接路由,连接成功后,设备会自动进行组网,如下为组网成功截图:
+在正确配置并编译烧录后,设备使用wifi_open指令连接路由,连接成功后,设备会自动进行组网。如下为组网成功截图:

diff --git a/zh-cn/device-dev/quick-start/Readme-CN.md b/zh-cn/device-dev/quick-start/Readme-CN.md
index 93f6cd8a77099718bb886726151c78a1531f0f00..52b8b470b9cedfdfd697e3b117106a0a1dd18a71 100644
--- a/zh-cn/device-dev/quick-start/Readme-CN.md
+++ b/zh-cn/device-dev/quick-start/Readme-CN.md
@@ -33,7 +33,7 @@
- [烧录](quickstart-lite-steps-hi3861-burn.md)
- [联网](quickstart-lite-steps-hi3861-netconfig.md)
- [调试验证](quickstart-lite-steps-hi3861-debug.md)
- - [运行](quickstart-lite-steps-hi3816-running.md)
+ - [运行](quickstart-lite-steps-hi3861-running.md)
- Hi3516开发板
- [安装Hi3516开发板环境](quickstart-lite-steps-hi3516-setting.md)
- [编写“Hello World”程序](quickstart-lite-steps-hi3516-application-framework.md)
diff --git a/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3816-running.md b/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3861-running.md
similarity index 100%
rename from zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3816-running.md
rename to zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3861-running.md
diff --git a/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3861.md b/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3861.md
index 4266d6e5ea673b59b90ac19c571c1c6be397ab4d..3fa241e1f2d8898851898273903e5834b8cdae72 100644
--- a/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3861.md
+++ b/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3861.md
@@ -14,4 +14,5 @@
- **[调试验证](quickstart-lite-steps-hi3861-debug.md)**
-- **[运行](quickstart-lite-steps-hi3816-running.md)**
\ No newline at end of file
+- **[运行](quickstart-lite-steps-hi3861-running.md)**
+
diff --git a/zh-cn/device-dev/subsystems/Readme-CN.md b/zh-cn/device-dev/subsystems/Readme-CN.md
index 575b7c7176e8169cc29860fefb7e1857f11fff36..d8261c7acaf5f437b72d1de3b447ba8a15bf3726 100755
--- a/zh-cn/device-dev/subsystems/Readme-CN.md
+++ b/zh-cn/device-dev/subsystems/Readme-CN.md
@@ -5,6 +5,7 @@
- [标准系统编译构建指导](subsys-build-standard-large.md)
- [构建系统编码规范与最佳实践](subsys-build-gn-coding-style-and-best-practice.md)
- [编译构建Kconfig可视化配置指导](subsys-build-gn-kconfig-visual-config-guide.md)
+ - [HAP编译构建指导](subsys-build-gn-hap-compilation-guide.md)
- [分布式远程启动](subsys-remote-start.md)
- 图形图像
- [图形图像概述](subsys-graphics-overview.md)
@@ -100,4 +101,4 @@
- [bytrace使用指导](subsys-toolchain-bytrace-guide.md)
- [hdc_std使用指导](subsys-toolchain-hdc-guide.md)
- [hiperf使用指导](subsys-toolchain-hiperf.md)
-- [XTS测试用例开发指导](subsys-xts-guide.md)
\ No newline at end of file
+- [XTS测试用例开发指导](subsys-xts-guide.md)
diff --git a/zh-cn/device-dev/subsystems/subsys-build-gn-hap-compilation-guide.md b/zh-cn/device-dev/subsystems/subsys-build-gn-hap-compilation-guide.md
new file mode 100644
index 0000000000000000000000000000000000000000..5a01b95c68a77f83c4ca4366e1ed2d0970e61304
--- /dev/null
+++ b/zh-cn/device-dev/subsystems/subsys-build-gn-hap-compilation-guide.md
@@ -0,0 +1,335 @@
+# HAP编译构建指导
+
+## 概述
+
+### 基本概念
+| 术语 | 含义 |
+| -------------- | ---------------------- |
+| HAP | OpenHarmony Ability Package,一个HAP文件包含应用的所有内容,由代码、资源、三方库及应用配置文件组成,其文件后缀名为.hap。 |
+| Ability | 应用的重要组成部分,是应用所具备能力的抽象。Ability是系统调度应用的最小单元,是能够完成一个独立功能的组件,一个应用可以包含一个或多个Ability。 |
+| FA | Feature Ability,是FA模型的Ability框架下具有UI界面的Ability类型,用于与用户进行交互。Feature Ability唯一对应一种模板,即Page模板(Page Ability)。 |
+| PA | Particle Ability,是在FA模型的Ability框架下无界面的Ability,主要为Feature Ability提供服务与支持,例如作为后台服务提供计算能力,或作为数据仓库提供数据访问能力。Particle Ability有三种模板,分别为Service模板(Service Ability)、Data模板(Data Ability)、以及Form模板(Form Ability)。 |
+| FA模型 | 两种Ability框架模型结构的其中一种。是Ability框架在API 8及更早版本采用FA模型。FA模型将Ability分为FA(Feature Ability)和PA(Particle Ability)两种类型,其中FA支持Page Ability模板,PA支持Service ability、Data ability、以及Form ability模板。详情可参考[FA模型综述](../../application-dev/ability/fa-brief.md)。 |
+| Stage模型 | 两种Ability框架模型结构的其中一种。从API 9开始支持。Stage模型将Ability分为Ability和ExtensionAbility两大类,其中ExtensionAbility又被扩展为ServiceExtensionAbility、FormExtensionAbility、DataShareExtensionAbility等等一系列ExtensionAbility。 |
+
+### 功能简介
+提供HAP编译构建功能,支持FA模型、Stage模型。
+
+## 开发指导
+
+### 编译系统提供的模板
+#### ohos_hap
+
+声明一个HAP目标,该目标会生成一个HAP,最终将会打包到system镜像中。
+
+| 支持的变量 | 说明 |
+| --------- | ---- |
+| hap_profile | HAP的config.json,Stage模型对应module.json。 |
+| raw_assets | 原始assets,这些assets会直接拷贝到HAP的assets目录下。 |
+| resources | 资源文件,编译后放置在assets/entry/resources目录下 |
+| js_assets | js资源,ace编译后放置在assets/js/default目录下。|
+| ets_assets | ets资源,ace编译后放置在assets/js/default目录下 |
+| deps | 当前目标的依赖 |
+| shared_libraries | 当前目标依赖的native库 |
+| hap_name | HAP的名字,可选,默认为目标名 |
+| final_hap_path | 用户可以制定生成的HAP的位置,可选,final_hap_path中会覆盖hap_name。|
+| subsystem_name | HAP从属的子系统名,需要和ohos.build中的名字对应,否则将导致无法安装到system镜像中。|
+| part_name | HAP从属的部件名,同subsystem_name。|
+| js2abc | 是否需要将该HAP的js代码转换为ARK的字节码。|
+| ets2abc | 是否需要将该HAP的ets代码转换为ARK的字节码。|
+| certificate_profile | HAP对应的授权文件,用于签名。|
+| certificate_file | 证书文件,证书文件和授权文件,应用开发者需要去openharmony官网申请。|
+| keystore_path | keystore文件,用于签名。|
+| keystore_password | keystore的密码,用于签名。|
+| key_alias | key的别名。|
+| module_install_name | 安装时的HAP名称。|
+| module_install_dir | 安装到system中的位置,默认安装在system/app目录下。|
+| js_build_mode | 可选,用于配置HAP是“release”还是“debug”模型编译,默认“release”。|
+
+#### ohos_app_scope
+声明一个HAP的AppScope模块,该目标的app_profile和sources会在编译时拼接到具体的entry内编译,该模板只在Stage模型下使用。
+
+| 支持的变量 | 说明 |
+| --------- | ---- |
+| app_profile | HAP的AppScope中的app.json,只在Stage模型下使用。|
+| sources | HAP的AppScope中的资源resources,只在Stage模型下使用。|
+
+#### ohos_js_assets
+js或ets代码,ace编译后放置在assets/js/default目录下,stage模型根据代码分别放置到js或ets目录。
+
+| 支持的变量 | 说明 |
+| --------- | ---- |
+| hap_profile | HAP的config.json,Stage模型对应module.json。|
+| source_dir | js或ets代码路径,兼容FA模型的单ability配置到ability目录。|
+| ets2abc | 当前为ets代码,主要用于卡片配置,其他应用可不配,使用ohos_hap中的配置。|
+| js2abc | 当前为js代码,主要用于卡片配置,其他应用可不配,使用ohos_hap中的配置。|
+
+#### ohos_assets
+原始assets,这些assets会直接拷贝到HAP的assets目录下。
+
+| 支持的变量 | 说明 |
+|---------- | ---- |
+| sources | 原始assets的路径。|
+
+#### ohos_resources
+资源文件,FA模型编译后放置在assets/entry/resources目录下,Stage模型编译后放置在resources目录下。
+
+| 支持的变量 | 说明 |
+| --------- | ---- |
+| hap_profile | HAP的config.json,Stage模型对应module.json。|
+| sources | 资源文件路径。|
+| deps | 当前目标的依赖。Stage模型需要配置对ohos_app_scope目标的依赖。|
+
+### 操作步骤
+
+1. 将开发完成的应用example放到applications/standard/目录下。
+
+2. 配置gn脚本applications/standard/example/BUILD.gn,FA模型简单示例如下(更多BUILD.gn配置见[gn脚本配置示例](#gn脚本配置示例)):
+ ```
+ import("//build/ohos.gni") # 引用ohos.gni
+
+ ohos_hap("example") {
+ hap_profile = "./src/main/config.json" # config.json
+ js_assets = ["./src/main/js/default"]
+ raw_assets = ["./raw_assets"]
+ resources = ["./src/main/resources"]
+ shared_libraries = [
+ "//third_party/libpng:libpng", # native库
+ ]
+ certificate_profile = "../signature/systemui.p7b" # Cer文件
+ hap_name = "SystemUI-NavigationBar" # 名字
+ part_name = "prebuilt_hap"
+ subsystem_name = "applications"
+ }
+ ```
+
+3. 修改applications/standard/hap/ohos.build,示例如下:
+ ```
+ {
+ "subsystem": "applications",
+ "parts": {
+ "prebuilt_hap": {
+ "module_list": [
+ ...
+ "//applications/standard/example:example" # 添加编译目标
+ ]
+ }
+ }
+ }
+ ```
+
+4. 编译命令:
+ ```
+ # 全量编译
+ ./build.sh --product-name {product_name}
+
+ # 单独编译HAP
+ ./build.sh --product-name {product_name} --build-target applications/standard/example:example
+ ```
+
+5. 编译产物,FA模型简单例子HAP解压视图如下:
+ ```
+ Length Date Time Name
+ --------- ---------- ----- ----
+ 1439 2009-01-01 00:00 assets/raw_assets -----> raw_assets
+ 354 2009-01-01 00:00 assets/entry/resources.index ------> resources
+ 1 2009-01-01 00:00 assets/entry/resources/base/media/attributes.key ------> resources
+ 1 2009-01-01 00:00 assets/entry/resources/base/media/constants.key ------> resources
+ 1 2009-01-01 00:00 assets/entry/resources/base/media/contents.key ------> resources
+ 6790 2009-01-01 00:00 assets/entry/resources/base/media/icon.png ------> resources
+ 1 2009-01-01 00:00 assets/entry/resources/base/media/nodes.key ------> resources
+ 11170 2009-01-01 00:00 assets/js/default/app.js ------> js_assets
+ 48 2009-01-01 00:00 assets/js/default/i18n/en-US.json ------> js_assets
+ 50 2009-01-01 00:00 assets/js/default/i18n/zh-CN.json ------> js_assets
+ 224 2009-01-01 00:00 assets/js/default/manifest.json ------> js_assets
+ 41481 2009-01-01 00:00 assets/js/default/pages/index/index.js ------> js_assets
+ 909 2009-01-01 00:00 config.json ------> hap_profile
+ 266248 2009-01-01 00:00 libs/libpng.z.so ------> shared_libraries
+ ```
+
+### gn脚本配置示例
+- FA模型多ability示例
+
+ ```
+ import("//build/ohos.gni")
+
+ ohos_hap("dataability") {
+ hap_profile = "entry/src/main/config.json"
+ deps = [
+ ":dataability_js_assets",
+ ":dataability_resources",
+ ]
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "dataability"
+ part_name = "prebuilt_hap"
+ subsystem_name = "applications"
+ }
+
+ ohos_js_assets("dataability_js_assets") {
+ ets2abc = true
+ source_dir = "entry/src/main/ets"
+ hap_profile = "entry/src/main/config.json"
+ }
+
+ ohos_resources("dataability_resources") {
+ sources = [
+ "entry/src/main/resources",
+ ]
+ hap_profile = "entry/src/main/config.json"
+ }
+
+ ```
+
+- FA模型Js卡片示例
+
+ ```
+ import("//build/ohos.gni")
+
+ ohos_hap("FormOfFaJs") {
+ hap_profile = "entry/src/main/config.json"
+ deps = [
+ ":FormOfFaJs_js_assets",
+ ":FormOfFaJs_resources",
+ ]
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "FormOfFaJs"
+ part_name = "prebuilt_hap"
+ subsystem_name = "applications"
+ }
+
+ ohos_js_assets("FormOfFaJs_js_assets") {
+ hap_profile = "entry/src/main/config.json"
+ js2abc = true
+ source_dir = "entry/src/main/js"
+ }
+
+ ohos_resources("FormOfFaJs_resources") {
+ sources = [
+ "entry/src/main/resources",
+ ]
+ hap_profile = "entry/src/main/config.json"
+ }
+ ```
+
+- FA模型Ets卡片示例
+
+ ```
+ import("//build/ohos.gni")
+
+ ohos_hap("FormOfFaEts") {
+ hap_profile = "entry/src/main/config.json"
+ deps = [
+ ":FormOfFaEts_js_assets",
+ ":FormOfFaEts_form_js_assets",
+ ":FormOfFaEts_resources",
+ ]
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "FormOfFaEts"
+ part_name = "prebuilt_hap"
+ subsystem_name = "applications"
+ }
+
+ ohos_js_assets("FormOfFaEts_js_assets") {
+ hap_profile = "entry/src/main/config.json"
+ ets2abc = true
+ source_dir = "entry/src/main/ets"
+ }
+
+ ohos_js_assets("FormOfFaEts_form_js_assets") {
+ hap_profile = "entry/src/main/config.json"
+ js2abc = true
+ source_dir = "entry/src/main/js"
+ }
+
+ ohos_resources("FormOfFaEts_resources") {
+ sources = [
+ "entry/src/main/resources",
+ ]
+ hap_profile = "entry/src/main/config.json"
+ }
+ ```
+
+- Stage模型简单示例
+
+ ```
+ import("//build/ohos.gni")
+
+ ohos_hap("actmoduletest") {
+ hap_profile = "entry/src/main/module.json"
+ deps = [
+ ":actmoduletest_js_assets",
+ ":actmoduletest_resources",
+ ]
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "actmoduletest"
+ part_name = "prebuilt_hap"
+ subsystem_name = "applications"
+ }
+
+ ohos_app_scope("actmoduletest_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+ }
+
+ ohos_js_assets("actmoduletest_js_assets") {
+ ets2abc = true
+ source_dir = "entry/src/main/ets"
+ }
+
+ ohos_resources("actmoduletest_resources") {
+ sources = [
+ "entry/src/main/resources",
+ ]
+ deps = [
+ ":actmoduletest_app_profile",
+ ]
+ hap_profile = "entry/src/main/module.json"
+ }
+ ```
+
+- Stage模型卡片示例
+
+ ```
+ import("//build/ohos.gni")
+
+ ohos_hap("FormOfStageEts") {
+ hap_profile = "entry/src/main/module.json"
+ deps = [
+ ":FormOfStageEts_js_assets",
+ ":FormOfStageEts_form_js_assets",
+ ":FormOfStageEts_resources",
+ ]
+ js_build_mode = "debug" # 默认release
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "FormOfStageEts"
+ part_name = "prebuilt_hap"
+ subsystem_name = "applications"
+ }
+
+ ohos_js_assets("FormOfStageEts_js_assets") {
+ hap_profile = "entry/src/main/module.json"
+ ets2abc = true
+ source_dir = "entry/src/main/ets"
+ }
+
+ ohos_js_assets("FormOfStageEts_form_js_assets") {
+ hap_profile = "entry/src/main/module.json"
+ js2abc = true
+ source_dir = "entry/src/main/js"
+ }
+
+ ohos_app_scope("FormOfStageEts_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+ }
+
+ ohos_resources("FormOfStageEts_resources") {
+ sources = [
+ "entry/src/main/resources",
+ ]
+ deps = [
+ ":FormOfStageEts_app_profile",
+ ]
+ hap_profile = "entry/src/main/module.json"
+ }
+ ```
diff --git a/zh-cn/device-dev/website.md b/zh-cn/device-dev/website.md
index 0ed58370a2682e3ccd84b48eb4279fbe866a098d..a1803548984b21c701d3804087960d6e8e73ff85 100644
--- a/zh-cn/device-dev/website.md
+++ b/zh-cn/device-dev/website.md
@@ -35,7 +35,7 @@
- [烧录](quick-start/quickstart-lite-steps-hi3861-burn.md)
- [联网](quick-start/quickstart-lite-steps-hi3861-netconfig.md)
- [调试验证](quick-start/quickstart-lite-steps-hi3861-debug.md)
- - [运行](quick-start/quickstart-lite-steps-hi3816-running.md)
+ - [运行](quick-start/quickstart-lite-steps-hi3861-running.md)
- Hi3516开发板
- [安装Hi3516开发板环境](quick-start/quickstart-lite-steps-hi3516-setting.md)
- [编写“Hello World”程序](quick-start/quickstart-lite-steps-hi3516-application-framework.md)
@@ -342,50 +342,53 @@
- [配置管理](driver/driver-hdf-manage.md)
- [HDF开发实例](driver/driver-hdf-sample.md)
- 平台驱动开发
- - [ADC](driver-platform-adc-develop.md)
- - [DAC](driver-platform-dac-develop.md)
- - [GPIO](driver-platform-gpio-develop.md)
- - [HDMI](driver-platform-hdmi-develop.md)
- - [I2C](driver-platform-i2c-develop.md)
- - [I3C](driver-platform-i3c-develop.md)
- - [MIPI CSI](driver-platform-mipicsi-develop.md)
- - [MIPI DSI](driver-platform-mipidsi-develop.md)
- - [MMC](driver-platform-mmc-develop.md)
- - [PIN](driver-platform-pin-develop.md)
- - [PWM](driver-platform-pwm-develop.md)
- - [Regulator](driver-platform-regulator-develop.md)
- - [RTC](driver-platform-rtc-develop.md)
- - [SDIO](driver-platform-sdio-develop.md)
- - [SPI](driver-platform-spi-develop.md)
- - [UART](driver-platform-uart-develop.md)
- - [WatchDog](driver-platform-watchdog-develop.md)
+ - [ADC](driver/driver-platform-adc-develop.md)
+ - [DAC](driver/driver-platform-dac-develop.md)
+ - [GPIO](driver/driver-platform-gpio-develop.md)
+ - [HDMI](driver/driver-platform-hdmi-develop.md)
+ - [I2C](driver/driver-platform-i2c-develop.md)
+ - [I3C](driver/driver-platform-i3c-develop.md)
+ - [MIPI CSI](driver/driver-platform-mipicsi-develop.md)
+ - [MIPI DSI](driver/driver-platform-mipidsi-develop.md)
+ - [MMC](driver/driver-platform-mmc-develop.md)
+ - [PIN](driver/driver-platform-pin-develop.md)
+ - [PWM](driver/driver-platform-pwm-develop.md)
+ - [Regulator](driver/driver-platform-regulator-develop.md)
+ - [RTC](driver/driver-platform-rtc-develop.md)
+ - [SDIO](driver/driver-platform-sdio-develop.md)
+ - [SPI](driver/driver-platform-spi-develop.md)
+ - [UART](driver/driver-platform-uart-develop.md)
+ - [WatchDog](driver/driver-platform-watchdog-develop.md)
- 平台驱动使用
- - [ADC](driver-platform-adc-des.md)
- - [DAC](driver-platform-dac-des.md)
- - [GPIO](driver-platform-gpio-des.md)
- - [HDMI](driver-platform-hdmi-des.md)
- - [I2C](driver-platform-i2c-des.md)
- - [I3C](driver-platform-i3c-des.md)
- - [MIPI CSI](driver-platform-mipicsi-des.md)
- - [MIPI DSI](driver-platform-mipidsi-des.md)
- - [PIN](driver-platform-pin-des.md)
- - [PWM](driver-platform-pwm-des.md)
- - [Regulator](driver-platform-regulator-des.md)
- - [RTC](driver-platform-rtc-des.md)
- - [SDIO](driver-platform-sdio-des.md)
- - [SPI](driver-platform-spi-des.md)
- - [UART](driver-platform-uart-des.md)
- - [WatchDog](driver-platform-watchdog-des.md)
+ - [ADC](driver/driver-platform-adc-des.md)
+ - [DAC](driver/driver-platform-dac-des.md)
+ - [GPIO](driver/driver-platform-gpio-des.md)
+ - [HDMI](driver/driver-platform-hdmi-des.md)
+ - [I2C](driver/driver-platform-i2c-des.md)
+ - [I3C](driver/driver-platform-i3c-des.md)
+ - [MIPI CSI](driver/driver-platform-mipicsi-des.md)
+ - [MIPI DSI](driver/driver-platform-mipidsi-des.md)
+ - [PIN](driver/driver-platform-pin-des.md)
+ - [PWM](driver/driver-platform-pwm-des.md)
+ - [Regulator](driver/driver-platform-regulator-des.md)
+ - [RTC](driver/driver-platform-rtc-des.md)
+ - [SDIO](driver/driver-platform-sdio-des.md)
+ - [SPI](driver/driver-platform-spi-des.md)
+ - [UART](driver/driver-platform-uart-des.md)
+ - [WatchDog](driver/driver-platform-watchdog-des.md)
- 外设驱动使用
+ - [Audio](driver/driver-peripherals-audio-des.md)
+ - [Camera](driver/driver-peripherals-camera-des.md)
+ - [Face_auth](driver/driver-peripherals-face_auth-des.md)
- [LCD](driver/driver-peripherals-lcd-des.md)
- - [TOUCHSCREEN](driver/driver-peripherals-touch-des.md)
- - [SENSOR](driver/driver-peripherals-sensor-des.md)
- - [WLAN](driver/driver-peripherals-external-des.md)
- - [AUDIO](driver/driver-peripherals-audio-des.md)
+ - [Light](driver/driver-peripherals-light-des.md)
+ - [Pin_auth](driver/driver-peripherals-pinauth-des.md)
+ - [Sensor](driver/driver-peripherals-sensor-des.md)
+ - [Touchscreen](driver/driver-peripherals-touch-des.md)
- [USB](driver/driver-peripherals-usb-des.md)
- - [CAMERA](driver/driver-peripherals-camera-des.md)
- - [Vibrator](driver-peripherals-vibrator-des.md)
- - [Light](driver-peripherals-light-des.md)
+ - [User_auth](driver/driver-peripherals-user-auth-des.md)
+ - [Vibrator](driver/driver-peripherals-vibrator-des.md)
+ - [WLAN](driver/driver-peripherals-external-des.md)
- 编译构建
- [轻量和小型系统编译构建指导](subsystems/subsys-build-mini-lite.md)
- [标准系统编译构建指导](subsystems/subsys-build-standard-large.md)