From 072dbb2d30a701300baf3b6d6850b506afaed2bc Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Wed, 29 Mar 2023 14:32:49 +0800 Subject: [PATCH] Update docs (16420) Signed-off-by: ester.zhou --- en/application-dev/quick-start/cross-app-hsp.md | 8 ++++---- en/application-dev/quick-start/har-package.md | 2 +- en/application-dev/quick-start/in-app-hsp.md | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/en/application-dev/quick-start/cross-app-hsp.md b/en/application-dev/quick-start/cross-app-hsp.md index 15345c966b..db971e3489 100644 --- a/en/application-dev/quick-start/cross-app-hsp.md +++ b/en/application-dev/quick-start/cross-app-hsp.md @@ -7,7 +7,7 @@ The host application of an inter-application HSP is a special form of applicatio 1. The code of an inter-application HSP runs in the application process. When invoking the code, implement an exception capture and fault tolerance mechanism to avoid stability issues caused by malfunctioning of the inter-application HSP. 2. An application can depend on multiple inter-application HSP files at the same time. 3. The inter-application HSP may slow down the startup of the application that depends on it. To avoid significant increase in the startup delay, limit the number of inter-application HSP dependencies within 16. -4. Third-party developers can only use the system-provided inter-application HSP files. +4. Privilege verification is conducted during inter-application HSP installation. To develop an inter-application HSP, you must configure the **allowAppShareLibrary** application privilege. For details, see [Application Privilege Configuration Guide](../../device-dev/subsystems/subsys-app-privilege-config-guide.md). ## Inter-Application HSP Usage An inter-application HSP works by combining the following parts: @@ -23,7 +23,7 @@ src ├── main | └── module.json5 ├── index.d.ets -└── package.json +└── oh-package.json5 ``` Below is an example of the **index.d.ets** file content: ```ts @@ -40,7 +40,7 @@ export declare function foo2(): string; export declare function nativeHello(): string; ``` -In the example, **UIComponent** is an ArkUI component, **hello()**, **foo1()**, and **foo2()** are TS methods, and **nativeHello()** is an native method. Specific implementation is as follows: +In the example, **UIComponent** is an ArkUI component, **hello()**, **foo1()**, and **foo2()** are TS methods, and **nativeHello()** is a native method. Specific implementation is as follows: #### ArkUI Components The following is an implementation example of ArkUI components in the HSP: ```ts @@ -117,7 +117,7 @@ extern "C" __attribute__((constructor)) void RegisterLibaModule(void) { } ``` ### Using the Capabilities Exported from the HAR -To start with, [configure dependency](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-development-npm-package-0000001222578434#section89674298391) on the HAR. The dependency information will then be generated in the **module.json** file of the corresponding module, as shown in the following: +To start with, [configure dependency](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-development-npm-package-0000001222578434#section89674298391) on the HAR. The dependency information will then be generated in the **module.json5** file of the corresponding module, as shown in the following: ```json "dependencies": [ { diff --git a/en/application-dev/quick-start/har-package.md b/en/application-dev/quick-start/har-package.md index 71cc22a71f..63b5fcfd10 100644 --- a/en/application-dev/quick-start/har-package.md +++ b/en/application-dev/quick-start/har-package.md @@ -30,7 +30,7 @@ When obfuscation is enabled, DevEco Studio compiles, obfuscates, and compresses - The HAR of the stage model cannot reference content in the **AppScope** folder. This is because the content in the **AppScope** folder is not packaged into the HAR during compilation and building. ## Exporting ArkUI Components, APIs, and Resources of the HAR -The **index.ets** file acts as the entry of the HAR export declaration file and is where the HAR exports APIs. This file is automatically generated by DevEco Studio by default. You can specify another file as the entry declaration file in the **main** field in the **package.json** file of the module. The code snippet is as follows: +The **index.ets** file acts as the entry of the HAR export declaration file and is where the HAR exports APIs. This file is automatically generated by DevEco Studio by default. You can specify another file as the entry declaration file in the **main** field in the **oh-package.json5** file of the module. The code snippet is as follows: ```json { "main": "index.ets" diff --git a/en/application-dev/quick-start/in-app-hsp.md b/en/application-dev/quick-start/in-app-hsp.md index 05380e9c6f..cdd06b5dfb 100644 --- a/en/application-dev/quick-start/in-app-hsp.md +++ b/en/application-dev/quick-start/in-app-hsp.md @@ -15,7 +15,7 @@ library │ │ └── index.ets │ ├── resources │ └── module.json5 -└── package.json +└── oh-package.json5 ``` In the **module.json5** file, set **type** to **shared** for the HSP. ```json @@ -24,7 +24,7 @@ In the **module.json5** file, set **type** to **shared** for the HSP. } ``` -The HSP provides capabilities for external systems by exporting APIs in the entry file. Specify the entry file in **main** in the **package.json** file. For example: +The HSP provides capabilities for external systems by exporting APIs in the entry file. Specify the entry file in **main** in the **oh-package.json5** file. For example: ```json { "main": "./src/main/ets/index.ets" @@ -103,9 +103,9 @@ export { nativeMulti } from './utils/nativeTest' ``` ## Using the In-Application HSP -To use APIs in the HSP, first configure the dependency on the HSP in the **package.json** file of the module that needs to call the APIs (called the invoking module). If the HSP and the invoking module are in the same project, the APIs can be referenced locally. The sample code is as follows: +To use APIs in the HSP, first configure the dependency on the HSP in the **oh-package.json5** file of the module that needs to call the APIs (called the invoking module). If the HSP and the invoking module are in the same project, the APIs can be referenced locally. The sample code is as follows: ```json -// entry/src/main/module.json5 +// entry/oh-package.json5 "dependencies": { "library": "file:../library" } -- GitLab