diff --git a/CODEOWNERS b/CODEOWNERS
index 02ff9150c412e86055638ca4cbf6f730f6a54fe2..b2355ad1397df0b851c7d092315fb9c450cc9d46 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -177,7 +177,6 @@ zh-cn/application-dev/napi/napi-guidelines.md @RayShih
zh-cn/application-dev/napi/drawing-guidelines.md @ge-yafang
zh-cn/application-dev/napi/rawfile-guidelines.md @HelloCrease
zh-cn/application-dev/reference/js-service-widget-ui/ @HelloCrease
-zh-cn/application-dev/website.md @zengyawen
zh-cn/application-dev/faqs/ @zengyawen
zh-cn/application-dev/file-management/ @qinxiaowang
zh-cn/application-dev/application-test/ @HelloCrease
@@ -370,7 +369,6 @@ zh-cn/application-dev/reference/apis/js-apis-useriam-faceauth.md @zengyawen
zh-cn/application-dev/reference/apis/js-apis-userfilemanager.md @qinxiaowang
zh-cn/application-dev/reference/apis/js-apis-cryptoFramework.md @zengyawen
zh-cn/application-dev/reference/apis/js-apis-buffer.md @zengyawen
-zh-cn/application-dev/reference/apis/Readme-CN.md @zengyawen
zh-cn/application-dev/reference/apis/development-intro.md @zengyawen
zh-cn/application-dev/reference/apis/js-apis-accessibility-extension-context.md @RayShih
zh-cn/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md @RayShih
diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md
index e580b6bbef7bd71869de1da19a3a3d5c4757370d..beab6e2411714274074d3e0cbdfb13cc60ba574b 100644
--- a/en/application-dev/reference/apis/Readme-EN.md
+++ b/en/application-dev/reference/apis/Readme-EN.md
@@ -1,9 +1,7 @@
# APIs
- [API Reference Document Description](development-intro.md)
-
- Ability Framework
-
- FA Model
- [@ohos.ability.featureAbility](js-apis-featureAbility.md)
- [@ohos.ability.particleAbility](js-apis-particleAbility.md)
@@ -28,8 +26,6 @@
- application/[FormExtensionContext](js-apis-formextensioncontext.md)
- application/[PermissionRequestResult](js-apis-permissionrequestresult.md)
- application/[ServiceExtensionContext](js-apis-service-extension-context.md)
- - [InputMethodExtensionAbility](js-apis-inputmethod-extension-ability.md)
- - [InputMethodExtensionContext](js-apis-inputmethod-extension-context.md)
- FA and Stage Models
- [@ohos.ability.dataUriUtils](js-apis-DataUriUtils.md)
- [@ohos.ability.errorCode](js-apis-ability-errorCode.md)
@@ -60,18 +56,15 @@
- application/[ExtensionRunningInfo](js-apis-extensionrunninginfo.md)
- application/[MissionSnapshot](js-apis-application-MissionSnapshot.md)
- application/[ProcessRunningInfo](js-apis-processrunninginfo.md)
+ - application/[ProcessRunningInformation](js-apis-processrunninginformation.md)
- application/[shellCmdResult](js-apis-application-shellCmdResult.md)
- continuation/[ContinuationResult](js-apis-continuation-continuationResult.md)
- Common Event and Notification
-
- [@ohos.commonEvent](js-apis-commonEvent.md)
- [@ohos.events.emitter](js-apis-emitter.md)
- [@ohos.notification](js-apis-notification.md)
- - [@ohos.reminderAgent](js-apis-reminderAgent.md)
- application/[EventHub](js-apis-eventhub.md)
-
-- Bundle Management
-
+ - Bundle Management
- [@ohos.bundle](js-apis-Bundle.md)
- [@ohos.bundle.defaultAppManager](js-apis-bundle-defaultAppManager.md)
- [@ohos.bundle.innerBundleManager)](js-apis-Bundle-InnerBundleManager.md)
@@ -92,17 +85,13 @@
- bundle/[ModuleInfo](js-apis-bundle-ModuleInfo.md)
- bundle/[PermissionDef](js-apis-bundle-PermissionDef.md)
- bundle/[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)
- - bundle/[ShortcutInfo](js-apis-bundle-ShortcutInfo.md)
+ - bundle/[ShortcutInfo(deprecated) ](js-apis-bundle-ShortcutInfo.md)
- UI Page
-
- [@ohos.animator](js-apis-animator.md)
- [@ohos.mediaquery](js-apis-mediaquery.md)
- - [@ohos.prompt](js-apis-prompt.md)
- [@ohos.router](js-apis-router.md)
- [@ohos.uiAppearance](js-apis-uiappearance.md)
-
-- Graphics
-
+ - Graphics
- [@ohos.animation.windowAnimationManager](js-apis-windowAnimationManager.md)
- [@ohos.display ](js-apis-display.md)
- [@ohos.effectKit](js-apis-effectKit.md)
@@ -111,42 +100,31 @@
- [@ohos.window](js-apis-window.md)
- [webgl](js-apis-webgl.md)
- [webgl2](js-apis-webgl2.md)
-
- Media
-
- [@ohos.multimedia.audio](js-apis-audio.md)
- [@ohos.multimedia.camera](js-apis-camera.md)
- [@ohos.multimedia.image](js-apis-image.md)
- [@ohos.multimedia.media](js-apis-media.md)
- - [@ohos.multimedia.medialibrary](js-apis-medialibrary.md)
-
- Resource Management
-
- [@ohos.i18n](js-apis-i18n.md)
- [@ohos.intl](js-apis-intl.md)
- [@ohos.resourceManager](js-apis-resource-manager.md)
-
-- Resource Scheduling
-
+- Resource Scheduling
- [@ohos.backgroundTaskManager](js-apis-backgroundTaskManager.md)
- [@ohos.distributedMissionManager](js-apis-distributedMissionManager.md)
- [@ohos.workScheduler ](js-apis-workScheduler.md)
- [@ohos.WorkSchedulerExtensionAbility](js-apis-WorkSchedulerExtensionAbility.md)
-
- Custom Management
-
- [@ohos.configPolicy](js-apis-config-policy.md)
- - [@ohos.enterpriseDeviceManager](js-apis-enterprise-device-manager.md)
- [@ohos.EnterpriseAdminExtensionAbility](js-apis-EnterpriseAdminExtensionAbility.md)
+ - [@ohos.enterpriseDeviceManager](js-apis-enterprise-device-manager.md)
- enterpriseDeviceManager/[DeviceSettingsManager](js-apis-enterpriseDeviceManager-DeviceSettingsManager.md)
-
- Security
-
- [@ohos.abilityAccessCtrl](js-apis-abilityAccessCtrl.md)
- [@ohos.privacyManager](js-apis-privacyManager.md)
- [@ohos.security.huks ](js-apis-huks.md)
- - [@ohos.userIAM.userAuth ](js-apis-useriam-userauth.md)
- [@ohos.userIAM.faceAuth](js-apis-useriam-faceauth.md)
+ - [@ohos.userIAM.userAuth ](js-apis-useriam-userauth.md)
- [@system.cipher](js-apis-system-cipher.md)
- Data Management
@@ -167,46 +145,40 @@
- [@ohos.document](js-apis-document.md)
- [@ohos.environment](js-apis-environment.md)
- [@ohos.fileio](js-apis-fileio.md)
- - [@ohos.fileManager](js-apis-filemanager.md)
+ - [@ohos.multimedia.medialibrary](js-apis-medialibrary.md)
+ - [@ohos.securityLabel](js-apis-securityLabel.md)
- [@ohos.statfs](js-apis-statfs.md)
- [@ohos.storageStatistics](js-apis-storage-statistics.md)
- [@ohos.volumeManager](js-apis-volumemanager.md)
- - [@ohos.securityLabel](js-apis-securityLabel.md)
-
- Telephony Service
-
- [@ohos.contact](js-apis-contact.md)
- [@ohos.telephony.call](js-apis-call.md)
+ - [@ohos.telephony.data](js-apis-telephony-data.md)
- [@ohos.telephony.observer](js-apis-observer.md)
- [@ohos.telephony.radio](js-apis-radio.md)
- [@ohos.telephony.sim](js-apis-sim.md)
- [@ohos.telephony.sms](js-apis-sms.md)
- - [@ohos.telephony.data](js-apis-telephony-data.md)
-
- Network Management
-
- [@ohos.net.connection](js-apis-net-connection.md)
- [@ohos.net.http](js-apis-http.md)
- - [@ohos.request](js-apis-request.md)
- [@ohos.net.socket](js-apis-socket.md)
+
- [@ohos.net.webSocket](js-apis-webSocket.md)
-
+ - [@ohos.request](js-apis-request.md)
- Connectivity
-
- [@ohos.bluetooth](js-apis-bluetooth.md)
- [@ohos.connectedTag](js-apis-connectedTag.md)
- [@ohos.nfc.cardEmulation](js-apis-cardEmulation.md)
- [@ohos.nfc.controller](js-apis-nfcController.md)
- [@ohos.nfc.tag](js-apis-nfcTag.md)
- - [@ohos.nfc.tag](js-apis-nfctech.md)
- - [@ohos.nfc.tag](js-apis-tagSession.md)
- [@ohos.rpc](js-apis-rpc.md)
- [@ohos.wifi](js-apis-wifi.md)
- [@ohos.wifiext](js-apis-wifiext.md)
-
+ - [@ohos.nfc.tag](js-apis-nfctech.md)
+ - [@ohos.nfc.tag](js-apis-tagSession.md)
- Basic Features
-
- [@ohos.accessibility](js-apis-accessibility.md)
+ - [@ohos.accessibility.config](js-apis-accessibility-config.md)
- [@ohos.faultLogger](js-apis-faultLogger.md)
- [@ohos.hiAppEvent](js-apis-hiappevent.md)
- [@ohos.hichecker](js-apis-hichecker.md)
@@ -217,13 +189,15 @@
- [@ohos.hiTraceMeter](js-apis-hitracemeter.md)
- [@ohos.inputMethod](js-apis-inputmethod.md)
- [@ohos.inputMethodEngine](js-apis-inputmethodengine.md)
+ - [@ohos.inputmethodextensionability](js-apis-inputmethod-extension-ability.md)
+ - [@ohos.inputmethodextensioncontext](js-apis-inputmethod-extension-context.md)
- [@ohos.pasteboard](js-apis-pasteboard.md)
- [@ohos.screenLock](js-apis-screen-lock.md)
- [@ohos.systemTime](js-apis-system-time.md)
- [@ohos.systemTimer](js-apis-system-timer.md)
- [@ohos.wallpaper](js-apis-wallpaper.md)
- [Timer](js-apis-timer.md)
-
+
- Device Management
- [@ohos.batteryInfo ](js-apis-battery-info.md)
@@ -239,6 +213,7 @@
- [@ohos.multimodalInput.keyCode](js-apis-keycode.md)
- [@ohos.multimodalInput.keyEvent](js-apis-keyevent.md)
- [@ohos.multimodalInput.mouseEvent](js-apis-mouseevent.md)
+ - [@ohos.multimodalInput.pointer](js-apis-pointer.md)
- [@ohos.multimodalInput.touchEvent](js-apis-touchevent.md)
- [@ohos.power](js-apis-power.md)
- [@ohos.runningLock](js-apis-runninglock.md)
@@ -249,15 +224,12 @@
- [@ohos.update](js-apis-update.md)
- [@ohos.usb](js-apis-usb.md)
- [@ohos.vibrator](js-apis-vibrator.md)
-
-- Account Management
-
+- Account Management
- [@ohos.account.appAccount](js-apis-appAccount.md)
- [@ohos.account.distributedAccount](js-apis-distributed-account.md)
- [@ohos.account.osAccount](js-apis-osAccount.md)
-
-- Language Base Class Library
-
+ - Language Base Class Library
+ - [@ohos.buffer](js-apis-buffer.md)
- [@ohos.convertxml](js-apis-convertxml.md)
- [@ohos.process](js-apis-process.md)
- [@ohos.uri](js-apis-uri.md)
@@ -279,16 +251,14 @@
- [@ohos.util.Vector](js-apis-vector.md)
- [@ohos.worker](js-apis-worker.md)
- [@ohos.xml](js-apis-xml.md)
-
- Test
-
- [@ohos.application.testRunner](js-apis-testRunner.md)
- [@ohos.uitest](js-apis-uitest.md)
-
-- APIs No Longer Maintained
-
+- APIs No Longer Maintained
- [@ohos.bytrace](js-apis-bytrace.md)
- [@ohos.data.storage](js-apis-data-storage.md)
+ - [@ohos.prompt](js-apis-prompt.md)
+ - [@ohos.reminderAgent](js-apis-reminderAgent.md)
- [@system.app](js-apis-system-app.md)
- [@system.battery](js-apis-system-battery.md)
- [@system.bluetooth](js-apis-system-bluetooth.md)
diff --git a/en/application-dev/reference/apis/js-apis-filemanager.md b/en/application-dev/reference/apis/js-apis-filemanager.md
deleted file mode 100644
index b80660185cffaf10993bf9c54ba1f88a1f16b7f4..0000000000000000000000000000000000000000
--- a/en/application-dev/reference/apis/js-apis-filemanager.md
+++ /dev/null
@@ -1,282 +0,0 @@
-# User File Access and Management
-
-The **fileManager** module provides APIs for accessing and managing user files. It interworks with the underlying file management services to implement media library and external card management, and provides capabilities for applications to query and create user files.
-
->**NOTE**
->
->- The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
->- The APIs of this module are system APIs and cannot be called by third-party applications. Currently, these APIs can be called only by **filepicker**.
-
-## Modules to Import
-
-```js
-import filemanager from '@ohos.fileManager';
-```
-
-## filemanager.getRoot
-
-getRoot(options? : {dev? : DevInfo}) : Promise<FileInfo[]>
-
-Obtains information about the root album or directory in asynchronous mode. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.FileManagement.UserFileService
-
-**Parameters**
-
-| Name| Type| Mandatory| Description|
-| --- | --- | --- | -- |
-| options | Object | No| The options are as follows: - **dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported.|
-
-**Return value**
-
-| Type| Description|
-| --- | -- |
-| Promise<[FileInfo](#fileinfo)[]> | Promise used to return the root album or directory information obtained.|
-
-**Example**
-
- ```js
- filemanager.getRoot().then((fileInfos) => {
- for (var i = 0; i < fileInfos.length; i++) {
- console.log("files:"+JSON.stringify(fileInfos));
- }
- }).catch((err) => {
- console.log(err)
- });
- ```
-
-## filemanager.getRoot
-
-getRoot(options? : {dev? : DevInfo}, callback : AsyncCallback<FileInfo[]>) : void
-
-Obtains information about the root album or directory in asynchronous mode. This API uses a callback to return the result.
-
-**System capability**: SystemCapability.FileManagement.UserFileService
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------- | ---- | ----------------------------- |
-| options | Object | No| The options are as follows: - **dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported.|
-| callback | AsyncCallback<[FileInfo](#fileinfo)[]> | Yes | Callback invoked to return the root album or directory information obtained. |
-
-**Example**
-
- ```js
- let options = {
- "dev":{
- "name":"local"
- }
- };
- filemanager.getRoot(options, (err, fileInfos)=>{
- for (var i = 0; i < fileInfos.length; i++) {
- console.log("files:"+JSON.stringify(fileInfos));
- }
- });
- ```
-
-## filemanager.listFile
-
-listFile(path : string, type : string, options? : {dev? : DevInfo, offset? : number, count? : number}) : Promise<FileInfo[]>
-
-Obtains information about the second-level album or files in asynchronous mode. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.FileManagement.UserFileService
-
-**Parameters**
-
-| Name| Type| Mandatory| Description|
-| --- | --- | --- | -- |
-| path | string | Yes| URI of the directory to query.|
-| type | string | Yes| Type of the files to query. The file type can be **file**, **image**, **audio**, or **video**.|
-| options | Object | No| The options are as follows: - **dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported. - **offset**: position to start the query. The value is a number. - **count**: number of files to query.|
-
-**Return value**
-
-| Type| Description|
-| --- | -- |
-| Promise<FileInfo[]> | Promise used to return the album or file information obtained.|
-
-**Error**
-
-| Error Info| Error Code|Description|
-| -- | --- | -- |
-| No such file or directory | 2 | The directory or album of the specified URI does not exist.|
-| No such process | 3 | Failed to obtain the FMS service.|
-| Not a directory | 20 | The object specified by the URI is not a directory or album.|
-
-**Example**
-
- ```js
- // Obtain all files in the directory. You can use getRoot to obtain the directory URI.
- filemanager.getRoot().then((fileInfos) => {
- let file = fileInfos.find(item => item.name == "file_folder");
- let path = file.path;
- filemanager.listFile(path, "file").then((files) => {
- console.log("files:" + JSON.stringify(files));
- }).catch((err) => {
- console.log("failed to get files" + err);
- });
- }).catch((err) => {
- console.log("failed to get root" + err);
- });
- ```
-
-## filemanager.listFile
-
-listFile(path : string, type : string, options? : {dev? : DevInfo, offset? : number, count? : number}, callback : AsyncCallback<FileInfo[]>) : void
-
-Obtains information about the second-level album or files in asynchronous mode. This API uses a callback to return the result.
-
-**System capability**: SystemCapability.FileManagement.UserFileService
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------- | ---- | ------------------------------------------------------------ |
-| path | string | Yes | URI of the directory to query. |
-| type | string | Yes | Type of the files to query. The file type can be **file**, **image**, **audio**, or **video**.|
-| options | Object | No| The options are as follows: - **dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported. - **offset**: position to start the query. The value is a number. - **count**: number of files to query.|
-| callback | AsyncCallback<[FileInfo](#fileinfo)[]> | Yes | Callback invoked to return the root album or directory information obtained. |
-
-**Error**
-
-| Error Info | Error Code| Description |
-| ------------------------- | ------ | ------------------------- |
-| No such file or directory | 2 | The directory or album of the specified URI does not exist.|
-| No such process | 3 | Failed to obtain the FMS service. |
-| Not a directory | 20 | The object specified by the URI is not a directory or album.|
-
-**Example**
-
-```js
-// Obtain all files in the directory. You can use getRoot to obtain the directory URI.
-filemanager.getRoot().then((fileInfos) => {
- let file = fileInfos.find(item => item.name == "image_album");
- let path = file.path;
- filemanager.listFile(path, "image",function(err, files){
- console.log("files:" + JSON.stringify(files));
- })
-}).catch((err) => {
- console.log("failed to get root" + err);
-});
-```
-
-## filemanager.createFile
-
-createFile(path : string, filename : string, options? : {dev? : DevInfo}) : Promise<string>
-
-Creates a file in the specified path in asynchronous mode. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.FileManagement.UserFileService
-
-**Parameters**
-
-| Name| Type| Mandatory| Description|
-| --- | --- | --- | -- |
-| filename | string | Yes| Name of the file to create.|
-| path | string | Yes| URI of the file to create.|
-| options | Object | No| The options are as follows: - **dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported.|
-
-**Return value**
-
-| Type| Description|
-| --- | -- |
-| Promise<string> | Promise used to return the URI of the file created.|
-
-**Error**
-
-| Error Info| Error Code|Description|
-| -- | --- | -- |
-| Operation not permitted | 1 | A file with the same name already exists.|
-| No such file or directory | 2 | The directory or album of the specified URI does not exist.|
-| No such process | 3 | Failed to obtain the FMS service.|
-| Not a directory | 20 | The object specified by the URI is not a directory or album.|
-
-**Example**
-
- ```js
- // Create a file.
- let media_path = "" // Obtain the file URI using listFile() and getRoot().
- let name = "xxx.jpg" // File to be saved.
- filemanager.createFile(media_path, name).then((uri) => {
- // The URI of the file created is returned.
- console.log("file uri:"+uri);
- }).catch((err) => {
- console.log(err);
- });
- ```
-
-## filemanager.createFile
-
-createFile(path : string, filename: string, options? : {dev? : DevInfo}, callback : AsyncCallback<string>) : void
-
-Creates a file in the specified path in asynchronous mode. This API uses a callback to return the result.
-
-**System capability**: SystemCapability.FileManagement.UserFileService
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------- | ---- | ----------------------------- |
-| filename | string | Yes | Name of the file to create. |
-| path | string | Yes | URI of the file to create. |
-| options | Object | No| The options are as follows: - **dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported.|
-| callback | AsyncCallback<[FileInfo](#fileinfo)[]> | Yes | Callback invoked to return the root album or directory information obtained. |
-
-**Error**
-
-| Error Info | Error Code| Description |
-| ------------------------- | ------ | ------------------------- |
-| Operation not permitted | 1 | A file with the same name already exists. |
-| No such file or directory | 2 | The directory or album of the specified URI does not exist.|
-| No such process | 3 | Failed to obtain the FMS service. |
-| Not a directory | 20 | The object specified by the URI is not a directory or album.|
-
-**Example**
-
- ```js
- // Create a file.
- // Call listFile() and getRoot() to obtain the file URI.
- let media_path = ""
- // File to be saved.
- let name = "xxx.jpg"
- let options = {
- "dev":{
- "name":"local"
- }
- };
- filemanager.createFile(media_path, name, options, function(err, uri) {
- // The URI of the file created is returned.
- console.log("file uri:"+uri);
- });
-
- ```
-
-## FileInfo
-Defines the file information returned by **getRoot()** or **listFile()**.
-
-**System capability**: SystemCapability.FileManagement.UserFileService
-
-### Attributes
-
-| Name| Type| Readable| Writable| Description|
-| --- | -- | -- | -- | -- |
-| name | string | Yes| No| File name.|
-| path | string | Yes| No| URI of the file.|
-| type | string | Yes| No| File type.|
-| size | number | Yes| No| File size.|
-| addedTime | number | Yes| No| Time when the file was scanned to the database.|
-| modifiedTime | number | Yes| No| Time when the file was modified.|
-
-## DevInfo
-
-Defines the device type.
-
-**System capability**: SystemCapability.FileManagement.UserFileService
-
-### Attributes
-
-| Name| Type | Readable| Writable| Description |
-| ------ | ------ | ---- | ---- | -------- |
-| name | string | Yes | Yes | Device name.|
diff --git a/en/application-dev/ui/Readme-EN.md b/en/application-dev/ui/Readme-EN.md
index 2b4efca72f4786729d4f11234febd406778bc266..e4838da489a5d5bb3ac3651885c9d456ed7322eb 100644
--- a/en/application-dev/ui/Readme-EN.md
+++ b/en/application-dev/ui/Readme-EN.md
@@ -11,49 +11,11 @@
- [Resource File Categories](ui-ts-basic-resource-file-categories.md)
- [Resource Access](ts-resource-access.md)
- [Pixel Units](ts-pixel-units.md)
- - Declarative Syntax
- - [About Usage of UI Description Specifications](ts-syntax-intro.md)
- - About General UI Description Specifications
- - [Basic Concepts](ts-general-ui-concepts.md)
- - Declarative UI Description Specifications
- - [Configuration Without Parameters](ts-parameterless-configuration.md)
- - [Configuration with Mandatory Parameters](ts-configuration-with-mandatory-parameters.md)
- - [Attribute Configuration](ts-attribution-configuration.md)
- - [Event Configuration](ts-event-configuration.md)
- - [Child Component Configuration](ts-child-component-configuration.md)
- - Componentization
- - [@Component](ts-component-based-component.md)
- - [@Entry](ts-component-based-entry.md)
- - [@Preview](ts-component-based-preview.md)
- - [@Builder](ts-component-based-builder.md)
- - [@Extend](ts-component-based-extend.md)
- - [@CustomDialog](ts-component-based-customdialog.md)
- - [@Styles](ts-component-based-styles.md)
- - About UI State Management
- - [Basic Concepts](ts-ui-state-mgmt-concepts.md)
- - Managing Component States
- - [@State](ts-component-states-state.md)
- - [@Prop](ts-component-states-prop.md)
- - [@Link](ts-component-states-link.md)
- - Managing Application States
- - [AppStorage](ts-application-states-appstorage.md)
- - [LocalStorage](ui-ts-local-storage.md)
- - [PersistentStorage](ts-application-states-apis-persistentstorage.md)
- - [Environment](ts-application-states-apis-environment.md)
- - Managing Other States
- - [@Observed and @ObjectLink](ts-other-states-observed-objectlink.md)
- - [@Consume and @Provide](ts-other-states-consume-provide.md)
- - [@Watch](ts-other-states-watch.md)
- - Rendering Control Syntax
- - [if/else](ts-rending-control-syntax-if-else.md)
- - [ForEach](ts-rending-control-syntax-foreach.md)
- - [LazyForEach](ts-rending-control-syntax-lazyforeach.md)
- - About Componentization
- - [build Function](ts-function-build.md)
+
+ - Componentization
- [Initialization of Custom Components' Member Variables](ts-custom-component-initialization.md)
- [Custom Component Lifecycle Callbacks](ts-custom-component-lifecycle-callbacks.md)
- - [Examples: Component Creation and Re-initialization](ts-component-creation-re-initialization.md)
- - [About Syntactic Sugar](ts-syntactic-sugar.md)
+ - [Component Creation and Re-initialization](ts-component-creation-re-initialization.md)
- Common Component Development Guidelines
- [Button](ui-ts-basic-components-button.md)
- [Web](ui-ts-components-web.md)
diff --git a/en/application-dev/ui/ts-application-states-apis-environment.md b/en/application-dev/ui/ts-application-states-apis-environment.md
deleted file mode 100644
index 9da95fc0b83e5cb259e2233275075f734252e953..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-application-states-apis-environment.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# Environment
-
-
-Environment is a singleton object created by the framework when the application is started. It provides the AppStorage with a series of environment state attributes required by the application. These attributes describe the device environment where the application runs. Environment and its attributes are immutable, and all attribute values are of the simple type. The following example shows how to obtain the semantic environment from Environment:
-
-
-```ts
-Environment.EnvProp("accessibilityEnabled", "default");
-var enable = AppStorage.Get("accessibilityEnabled");
-```
-
-
-accessibilityEnabled is the default system variable identifier provided by Environment. You need to bind the corresponding system attribute to the AppStorage. Then, you can use the methods or decorators in the AppStorage to access the corresponding system attribute data.
-
-
-## Environment APIs
-
-| key | Parameter | Return Value | Description |
-| -------- | -------- | -------- | -------- |
-| EnvProp | key: string, defaultValue: any | boolean | Binds this system attribute to the AppStorage. You are advised to use this API during application startup. If the attribute already exists in the AppStorage, false is returned. Do not use the variables in the AppStorage. Instead, call this method to bind environment variables. |
-| EnvProps | keys: { key: string, defaultValue: any }[] | void | Associates this system item array with the AppStorage. |
-| Keys | Array<string> | number | Returns the associated system item array. |
-
-
-## Built-in Environment Variables
-
-| key | Type | Description |
-| -------- | -------- | -------- |
-| accessibilityEnabled | boolean | Whether to enable accessibility. |
-| colorMode | ColorMode | Color mode. The options are as follows: - **ColorMode.LIGHT**: light mode. - **ColorMode.DARK**: dark mode. |
-| fontScale | number | Font scale. The value range is [0.85, 1.45]. |
-| fontWeightScale | number | Font weight scale. The value range is [0.6, 1.6]. |
-| layoutDirection | LayoutDirection | Layout direction. The options are as follows: - **LayoutDirection.LTR**: The direction is from left to right. - **LayoutDirection.RTL**: The direction is from right to left. |
-| languageCode | string | Current system language. The value is in lowercase, for example, zh. |
diff --git a/en/application-dev/ui/ts-application-states-apis-persistentstorage.md b/en/application-dev/ui/ts-application-states-apis-persistentstorage.md
deleted file mode 100644
index 8df5e76e2855c5f5d211aa35d87f54d19f5ce352..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-application-states-apis-persistentstorage.md
+++ /dev/null
@@ -1,48 +0,0 @@
-# PersistentStorage
-
-
-ArkUI provides some static methods in the PersistentStorage class for managing persistent data of applications. Persistent data with specific tags can be linked to the AppStorage, and then the persistent data can be accessed through the AppStorage APIs. Alternatively, the @StorageLink decorator can be used to access the variable of the specific key.
-
-
-| Name | Type | Return Value | Definition |
-| -------- | -------- | -------- | -------- |
-| PersistProp | key : string defaultValue: T | void | Changes the associated named attribute to persistent data in the AppStorage. The value overwriting sequence is as follows: - If the attribute exists in the AppStorage, use it to overwrite the value in Persistent. - If Persistent contains the specified attribute, use the attribute value in Persistent. - If the preceding conditions are not met, use defaultValue. The values null and undefined are not supported. |
-| DeleteProp | key: string | void | Cancels two-way binding. The value of this attribute will be deleted from the persistent storage. |
-| PersistProps | keys: { key: string, defaultValue: any }[] | void | Associates multiple named attribute bindings. |
-| Keys | void | Array <string> | Returns the flags of all persistent attributes. |
-
-
-> **NOTE**
->
-> - When using **PersistProp**, ensure that the input key exists in the AppStorage.
->
-> - **DeleteProp** takes effect only for the data that has been linked during the current startup.
-
-
-```ts
-// xxx.ets
-PersistentStorage.PersistProp("highScore", "0");
-
-@Entry
-@Component
-struct PersistentComponent {
- @StorageLink('highScore') highScore: string = '0'
- @State currentScore: number = 0
- build() {
- Column() {
- if (this.currentScore === Number(this.highScore)) {
- Text(`new highScore : ${this.highScore}`)
- }
- Button() {
- Text(`goal!, currentScore : ${this.currentScore}`)
- .fontSize(10)
- }.onClick(() => {
- this.currentScore++
- if (this.currentScore > Number(this.highScore)) {
- this.highScore = this.currentScore.toString()
- }
- })
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-application-states-appstorage.md b/en/application-dev/ui/ts-application-states-appstorage.md
deleted file mode 100644
index 5877f75ca55ad03cafb78eda50c0b26475f3033e..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-application-states-appstorage.md
+++ /dev/null
@@ -1,89 +0,0 @@
-# AppStorage
-
-
-AppStorage is a singleton object in an application, which is created by the UI framework when the application is started and destroyed when the application exits. It is used to provide central storage for changing state attributes of an application. AppStorage contains all the state attributes that need to be accessed throughout the application. The AppStorage retains all attributes and their values as long as the application remains running, and the attribute values can be accessed through unique key values.
-
-
-The UI component can synchronize the application state data with the AppStorage through the decorators. The application service logic can also be implemented by accessing the AppStorage through APIs.
-
-
-The selection state attribute of the AppStorage can be synchronized with different data sources or data sinks. These data sources and data sinks can be local or remote devices and provide different functions, such as data persistence. Such data sources and data sinks can be implemented independently of the UI in the service logic.
-
-
-By default, the attributes in the AppStorage are changeable. If needed, AppStorage can also use immutable (read-only) attributes.
-
-
-## AppStorage APIs
-
-| Name | Type | Return Value | Definition |
-| -------- | -------- | -------- | -------- |
-| SetAndLink | key: string, defaultValue: T | @Link | Works in a way similar to the Link API. If the current key is stored in the AppStorage, the value corresponding to the key is returned. If the key has not been created, a Link instance corresponding to the default value is created and returned. |
-| Set | key: string, newValue: T | void | Replaces the value of a saved key. |
-| Link | key: string | @Link | Returns two-way binding to this attribute if there is data with a given key. This means that attribute changes made by a variable or component will be synchronized to the AppStorage, and attribute changes made through the AppStorage will be synchronized to the variable or component. If the attribute with this key does not exist or is read-only, undefined is returned. |
-| SetAndProp | propName: string, defaultValue: S | @Prop | Works in a way similar to the Prop API. If the current key is stored in the AppStorage, the value corresponding to the key is returned. If the key has not been created, a Prop instance corresponding to the default value is created and returned. |
-| Prop | key: string | @Prop | Returns one-way binding to an attribute with a given key if the attribute exists. This means that attribute changes made through the AppStorage will be synchronized to the variable or component, but attribute changes made by the variable or component will be synchronized to the AppStorage. The variable returned by this method is an immutable one, which is applicable both to the variable and immutable state attributes. If the attribute with the specified key does not exist, undefined is returned. **NOTE** The attribute value used in the prop method must be of a simple type. |
-| SetOrCreate | key: string, newValue: T | boolean | If an attribute that has the same name as the specified key exists: replaces the value of the attribute and returns true when the attribute can be modified; retains the original value of the attribute and returns false otherwise. If an attribute that has the same name as the specified key does not exist: creates an attribute whose key is key and value is newValue. The values null and undefined are not supported. |
-| Get | key: string | T or undefined | Obtains the value of the specified key. |
-| Has | propName: string | boolean | Checks whether the attribute corresponding to the specified key value exists. |
-| Keys | void | array<string> | Returns an array of strings containing all keys. |
-| Delete | key: string | boolean | Deletes the key-value pair for the specified key. Returns true if the key-value pair exists and is successfully deleted; returns false otherwise. |
-| Clear | void | boolean | Deletes all attributes. If any of the attributes is being referenced by a state variable, false is returned. |
-| IsMutable | key: string | boolean | Specifies whether the attribute exists and can be changed. |
-
-
-## Synchronization Between AppStorage and Components
-
-In [Managing Component States](ts-component-states-state.md), we have defined how to synchronize the state variables of child components with the @State decorated variables in the parent component or ancestor component, including @Prop, @Link, and @Consume.
-
-In this section, we'll describe how to synchronize component variables with the AppStorage through the @StorageLink and @StorageProp decorators.
-
-
-### @StorageLink Decorator
-
-Two-way data binding can be established between components and the AppStorage through state variables decorated by @StorageLink(_key_). Wherein, key is the attribute key value in the AppStorage. When a component containing the @StorageLink decorated variable is created, the variable is initialized using the value in the AppStorage. Changes made to this variable in the component will be first synchronized to the AppStorage, and then to other bound instances, such as PersistentStorage or other bound UI components.
-
-
-### @StorageProp Decorator
-
-One-way data binding can be established between components and the AppStorage through state variables decorated by @StorageProp(_key_). Wherein, key is the attribute key value in the AppStorage. When a component containing the @StorageProp decorated variable is created, the variable is initialized using the value in the AppStorage. Changes made to the value in the AppStorage will cause the bound UI component to update the state.
-
-
-## Example
-
-
-```ts
-// xxx.ets
-
-@Entry
-@Component
-struct ComponentA {
- @StorageLink('varA') varA: number = 2
- @StorageProp('languageCode') lang: string = 'en'
- private label: string = 'count'
-
- aboutToAppear() {
- this.label = (this.lang === 'en') ? 'Number' : 'Count'
- }
-
- build() {
- Row({ space: 20 }) {
-
- Button(`${this.label}: ${this.varA}`)
- .onClick(() => {
- AppStorage.Set('varA', AppStorage.Get('varA') + 1)
- })
- Button(`lang: ${this.lang}`)
- .onClick(() => {
- if (this.lang === 'zh') {
- AppStorage.Set('languageCode', 'en')
- } else {
- AppStorage.Set('languageCode', 'en')
- }
- this.label = (this.lang === 'en') ? 'Number' : 'Count'
- })
- }
- }
-}
-```
-
-Each time the user clicks the **Count** button, the value of **this.varA** will increase by 1. This variable is synchronized with varA in the AppStorage. Each time the user clicks the language icon, the value of **languageCode** in the AppStorage will be changed, and the change will be synchronized to the **this.lang** variable.
diff --git a/en/application-dev/ui/ts-attribution-configuration.md b/en/application-dev/ui/ts-attribution-configuration.md
deleted file mode 100644
index 70d85aff0d3bb3a9b418753655ea33480bf681ff..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-attribution-configuration.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# Attribute Configuration
-
-
-Use attribute methods to configure component attributes. An attribute method follows the corresponding component and is bound to the component using the "." operator.
-
-
-- The following is an example of configuring the font size attribute of the Text component:
-
- ```ts
- Text('123')
- .fontSize(12)
- ```
-
-
-- Use the "." operator to implement chain call to configure multiple attributes at the same time, as shown below:
-
- ```ts
- Image('a.jpg')
- .alt('error.jpg')
- .width(100)
- .height(100)
- ```
-
-
-- In addition to constants, you can also pass variables or expressions, as shown below:
-
- ```ts
- // Size, count, and offset are private variables defined in the component.
- Text('hello')
- .fontSize(this.size)
- Image('a.jpg')
- .width(this.count % 2 === 0 ? 100 : 200)
- .height(this.offset + 100)
- ```
-
-
-- For attributes of preset components, the framework also provides some predefined enumeration types, which you can pass as parameters to methods. Enumeration types must meet the parameter type requirements on the enumeration type definitions for specific attributes. You can configure the font color and weight attributes of the Text component as follows:
-
- ```ts
- Text('hello')
- .fontSize(20)
- .fontColor(Color.Red)
- .fontWeight(FontWeight.Bold)
- ```
diff --git a/en/application-dev/ui/ts-child-component-configuration.md b/en/application-dev/ui/ts-child-component-configuration.md
deleted file mode 100644
index c2fe0c68c3b49e09091be56505cae0bea9e370fb..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-child-component-configuration.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# Child Component Configuration
-
-
-For a component that supports child components, for example, a container component, add the UI descriptions of the child components inside "{ ... }". The **\**, **\**, **\**, **\**, **\**, and **\** components are container components.
-
-
-- The following is a simple example of the **\** component:
-
- ```ts
- Column() {
- Text('Hello')
- .fontSize(100)
- Divider()
- Text(this.myText)
- .fontSize(100)
- .fontColor(Color.Red)
- }
- ```
-
-
-- Multiple child components can be nested in the **\** component, as shown below:
-
- ```ts
- Column() {
- Column() {
- Button() {
- Text('+ 1')
- }.type(ButtonType.Capsule)
- .onClick(() => console.log ('+1 clicked!'))
- Image('1.jpg')
- }
- Divider()
- Column() {
- Button() {
- Text('+ 2')
- }.type(ButtonType.Capsule)
- .onClick(() => console.log ('+2 clicked!'))
- Image('2.jpg')
- }
- Divider()
- Column() {
- Button() {
- Text('+ 3')
- }.type(ButtonType.Capsule)
- .onClick(() => console.log('+3 clicked!'))
- Image('3.jpg')
- }
- }.alignItems(HorizontalAlign.Center) // center align components inside Column
- ```
diff --git a/en/application-dev/ui/ts-component-based-component.md b/en/application-dev/ui/ts-component-based-component.md
deleted file mode 100644
index c8f6453a5bce036c9166ec2e55d9c85f3f6b10bc..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-component-based-component.md
+++ /dev/null
@@ -1,122 +0,0 @@
-# @Component
-
-A struct decorated by **@Component** has the componentization capability and can serve as an independent component. This type of component is also called a custom component, and its UI structure is described in the **build** method. Custom components have the following features:
-
-
-- Composability: Custom components can be used with preset or other components, as well as common attributes and methods.
-- Chain call9+ : Universal attributes can be invoked in chain call mode to change the component style.
-- Reusable: Custom components can be reused by other components and used as different instances in different parent components or containers.
-- Lifecycle: Custom components provide callbacks for service logic processing throughout the lifecycle.
-- Data-driven update: The UI of custom components can be automatically updated based on the data of state variables.
-
-
-For details about componentization, see [About @Component](ts-custom-component-initialization.md).
-
-
-> **NOTE**
->
-> - The **build** method must be defined for a custom component.
->- Custom constructors are prohibited for custom components.
-
-
-The following code illustrates how to create a custom component named **MyComponent**:
-
-
-```ts
-@Component
-struct MyComponent {
- build() {
- Column() {
- Text('my component')
- .fontColor(Color.Red)
- }.alignItems(HorizontalAlign.Center) // center align Text inside Column
- }
-}
-```
-
-
-The **build** method of **MyComponent** is executed during initial rendering. When the component status changes, the **build** method will be executed again.
-
-
-The following code illustrates how to use **MyComponent**:
-
-
-```ts
-@Component
-struct ParentComponent {
- build() {
- Column() {
- MyComponent()
- Text('we use component')
- .fontSize(20)
- }
- }
-}
-```
-
-
-**MyComponent** can be applied multiple times and reused in different components, as shown in the code below:
-
-
-```ts
-@Component
-struct ParentComponent {
- build() {
- Row() {
- Column() {
- MyComponent()
- Text('first column')
- .fontSize(20)
- }
- Column() {
- MyComponent()
- Text('second column')
- .fontSize(20)
- }
- }
- }
-
- aboutToAppear() {
- console.log('ParentComponent: Just created, about to become rendered first time.')
- }
-
- aboutToDisappear() {
- console.log('ParentComponent: About to be removed from the UI.')
- }
-}
-```
-
-Universal attributes can be invoked in chain call mode to diversify component styles.
-
-> **NOTE**
->
-> This feature is supported since API version 9.
->
-> The chain call for custom components does not support trailing closures in the following scenario: When the custom component is initialized, the component name is followed by a pair of braces ({}) to form a trailing closure (as in `Index(){}`). You can consider a trailing closure as a container and add content to it, as in `{Column(){Text("content")}`.
-
-```ts
-@Entry
-@Component
-struct Index {
- @State bannerValue: string = 'Hello,world';
- build() {
- Column() {
- Chind({ ChindBannerValue:$bannerValue })
- .height(60)
- .width(250)
- .border({ width:5, color:Color.Red, radius:10, style: BorderStyle.Dotted })
- }
- }
-}
-
-@Component
-struct Chind {
- @Link ChindBannerValue: string;
- build() {
- Column() {
- Text(this.ChindBannerValue)
- .fontSize(30)
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-component-based-customdialog.md b/en/application-dev/ui/ts-component-based-customdialog.md
deleted file mode 100644
index cde90b487f544424f8ba4bd7a06388b456391bb3..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-component-based-customdialog.md
+++ /dev/null
@@ -1,50 +0,0 @@
-# @CustomDialog
-
-
-The @CustomDialog decorator is used to decorate custom pop-up dialog boxes.
-
-
-```ts
-// custom-dialog-demo.ets
-@CustomDialog
-struct DialogExample {
- controller: CustomDialogController;
- action: () => void;
-
- build() {
- Row() {
- Button ("Close CustomDialog")
- .onClick(() => {
- this.controller.close();
- this.action();
- })
- }.padding(20)
- }
-}
-
-@Entry
-@Component
-struct CustomDialogUser {
- dialogController : CustomDialogController = new CustomDialogController({
- builder: DialogExample({action: this.onAccept}),
- cancel: this.existApp,
- autoCancel: true
- });
-
- onAccept() {
- console.log("onAccept");
- }
- existApp() {
- console.log("Cancel dialog!");
- }
-
- build() {
- Column() {
- Button("Click to open Dialog")
- .onClick(() => {
- this.dialogController.open()
- })
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-component-based-entry.md b/en/application-dev/ui/ts-component-based-entry.md
deleted file mode 100644
index 54f1d97a5fc6cc4e1575744fdc56520d674f545a..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-component-based-entry.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# @Entry
-
-
-The custom component decorated by @Entry functions as the default entry component of the respective page. When the page is loaded, the custom component decorated by @Entry is created and displayed first.
-
-
-> **NOTE**
->
-> A source file can contain at most one custom component decorated by @Entry.
-
-
-Example of using @Entry:
-
-```ts
-// Only MyComponent decorated by @Entry is rendered and displayed. "hello world" is displayed, but "goodbye" is not displayed.
-@Entry
-@Component
-struct MyComponent {
- build() {
- Column() {
- Text('hello world')
- .fontColor(Color.Red)
- }
- }
-}
-
-@Component
-struct HideComponent {
- build() {
- Column() {
- Text('goodbye')
- .fontColor(Color.Blue)
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-component-based-extend.md b/en/application-dev/ui/ts-component-based-extend.md
deleted file mode 100644
index fcf7b71d60fd3491d491bc67298256a5f976d789..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-component-based-extend.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# @Extend
-
-The @Extend decorator adds new attribute functions to preset components, such as **\**, **\**, and **\**. You can use the @Extend decorator to quickly define and reuse the custom styles of a component.
-
-
-```ts
-// xxx.ets
-@Extend(Text) function fancy(fontSize: number) {
- .fontColor(Color.Red)
- .fontSize(fontSize)
- .fontStyle(FontStyle.Italic)
-}
-
-@Entry
-@Component
-struct FancyUse {
- build() {
- Row({ space: 10 }) {
- Text("Fancy")
- .fancy(16)
- Text("Fancy")
- .fancy(24)
- }
- }
-}
-```
-
-> **NOTE**
->
-> The @Extend decorator cannot be used in the struct definition of a custom component.
\ No newline at end of file
diff --git a/en/application-dev/ui/ts-component-based-preview.md b/en/application-dev/ui/ts-component-based-preview.md
deleted file mode 100644
index eee9d34082a398dccb2ed5021cc91d69c08b8d83..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-component-based-preview.md
+++ /dev/null
@@ -1,62 +0,0 @@
-# @Preview
-
-You can use **@Preview** to decorate a custom component so that it can be previewed in real time in DevEco Studio. This component is created and displayed when the page where it is located is loaded. Dynamic pictures and dynamic preview are not yet supported.
-
-
-> **NOTE**
->
-> In a source file, at most 10 custom components can be decorated by **@Preview**. For details, see [@Preview](https://developer.harmonyos.com/en/docs/documentation/doc-guides/ohos-previewing-app-service-0000001218760596#section146052489820).
-
-
-Example of using **@Preview**:
-
-
-```ts
-// xxx.ets
-@Entry
-@Component
-struct MyComponent {
- build() {
- Column() {
- Row() {
- Text('Hello World!')
- .fontSize("50lpx")
- .fontWeight(FontWeight.Bold)
- }
- Row() {
- Component1()
- }
- Row() {
- Component2()
- }
- }
- }
-}
-
-@Preview
-@Component
-struct Component1 {
- build() {
- Column() {
- Row() {
- Text('Hello Component1')
- .fontSize("50lpx")
- .fontWeight(FontWeight.Bold)
- }
- }
- }
-}
-
-@Component
-struct Component2 {
- build() {
- Column() {
- Row() {
- Text('Hello Component2')
- .fontSize("50lpx")
- .fontWeight(FontWeight.Bold)
- }
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-component-based-styles.md b/en/application-dev/ui/ts-component-based-styles.md
deleted file mode 100644
index 606ef2d983aff371fac549fd0dff26fdb697316d..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-component-based-styles.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# @Styles
-
-
-The **@Styles** decorator adds new attribute functions to basic components, such as **\**, **\**, and **\**. Currently, **@Styles** supports only universal attributes. You can use the **@Styles** decorator to quickly define and reuse the custom styles of a component.
-
-**@Styles** can be defined inside or outside a component. When it is defined outside a component, the keyword **function** must be added before the API name.
-
-
-
-```ts
-// xxx.ets
-@Styles function globalFancy() {
- .backgroundColor(Color.Red)
-}
-
-@Entry
-@Component
-struct FancyUse {
- @Styles componentFancy() {
- .backgroundColor(Color.Blue)
- }
- build() {
- Column({ space: 10 }) {
- Text("Fancy")
- .globalFancy()
- .width(100)
- .height(100)
- .fontSize(30)
- Text("Fancy")
- .componentFancy()
- .width(100)
- .height(100)
- .fontSize(30)
- }
- }
-}
-```
-
-**@Styles** can also be used inside the **StateStyles** attribute to assign state-specific attributes to components.
-
-
-In **StateStyles**, styles defined outside the component can be directly called. However, the keyword **this** must be used to call styles defined in the component.
-
-```ts
-// xxx.ets
-@Styles function globalFancy() {
- .width(100)
- .height(100)
-}
-
-@Entry
-@Component
-struct FancyUse {
- @Styles componentFancy() {
- .width(50)
- .height(50)
- }
- build() {
- Row({ space: 10 }) {
- Button() {
- Text("Fancy")
- }
- .stateStyles({
- normal: {
- .width(80)
- .height(80)
- },
- disabled: this.componentFancy,
- pressed: globalFancy
- })
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-component-states-link.md b/en/application-dev/ui/ts-component-states-link.md
deleted file mode 100644
index a02719f163f5fe36f4c8bed1e7e8f96d20c628e8..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-component-states-link.md
+++ /dev/null
@@ -1,139 +0,0 @@
-# @Link
-
-
-Two-way binding can be established between the @Link decorated variable and the @State decorated variable of the parent component. The @Link data has the following features:
-
-
-- Support for multiple types: The value of the @Link decorated variable can be of the same type as the @State decorated variable; that is, the value can be of the following types: class, number, string, boolean, or arrays of these types.
-
-- Private: Data is accessed only within the component.
-
-- Single data source: The variable of the parent component for initializing the @Link decorated variable must be the @State decorated variable.
-
-- Two-way binding: When a child component changes the @Link decorated variable, the @State decorated variable of its parent component is also changed.
-
-- Support for initialization with the variable reference passed to the @Link decorated variable: When creating a new instance of the component, you must use the naming parameter to initialize all @Link decorated variables. The @Link decorated variable can be initialized by using the reference of the @State or @Link decorated variable. Wherein, the @State decorated variable can be referenced using the ` '$' ` operator.
-
-
-> **NOTE**
->
-> The @Link decorated variable cannot be initialized within the component.
-
-
-## Simple Type Example
-
-```ts
-// xxx.ets
-@Entry
-@Component
-struct Player {
- @State isPlaying: boolean = false
- build() {
- Column() {
- PlayButton({buttonPlaying: $isPlaying})
- Text(`Player is ${this.isPlaying? '':'not'} playing`)
- }
- }
-}
-
-@Component
-struct PlayButton {
- @Link buttonPlaying: boolean
- build() {
- Column() {
- Button() {
- Image(this.buttonPlaying? 'play.png' : 'pause.png')
- }.onClick(() => {
- this.buttonPlaying = !this.buttonPlaying
- })
- }
- }
-}
-```
-
-The @Link semantics are derived from the `'$'` operator. In other words, `$isPlaying` is the two-way binding of the internal state ` this.isPlaying ` . When you click **PlayButton**, the **\** and **\** components of **PlayButton** are refreshed at the same time.
-
-
-## Complex Type Example
-
-```ts
-// xxx.ets
-@Entry
-@Component
-struct Parent {
- @State arr: number[] = [1, 2, 3]
- build() {
- Column() {
- Child({items: $arr})
- ForEach(this.arr,
- item => Text(`${item}`),
- item => item.toString())
- }
- }
-}
-
-@Component
-struct Child {
- @Link items: number[]
- build() {
- Column() {
- Button() {
- Text('Button1: push')
- }.onClick(() => {
- this.items.push(100)
- })
- Button() {
- Text('Button2: replace whole item')
- }.onClick(() => {
- this.items = [100, 200, 300]
- })
- }
- }
-}
-```
-
-In the example above, click **Button1** and **Button2** to change the list of text items displayed in the parent component.
-
-
-## Example of Using @Link, @State, and @Prop Together
-
-```ts
-// xxx.ets
-@Entry
-@Component
-struct ParentView {
- @State counter: number = 0
- build() {
- Column() {
- ChildA({counterVal: this.counter}) // pass by value
- ChildB({counterRef: $counter}) // $ creates a Reference that can be bound to counterRef
- }
- }
-}
-
-@Component
-struct ChildA {
- @Prop counterVal: number
- build() {
- Button() {
- Text(`ChildA: (${this.counterVal}) + 1`)
- }.onClick(() => {this.counterVal+= 1})
- }
-}
-
-@Component
-struct ChildB {
- @Link counterRef: number
- build() {
- Button() {
- Text(`ChildB: (${this.counterRef}) + 1`)
- }.onClick(() => {this.counterRef+= 1})
- }
-}
-```
-
-In the preceding example, ParentView contains two child components: ChildA and ChildB. They are initialized by the state variable counter of ParentView.
-
-- ChildB uses @Link to establish two-way state binding. When the value of the counterRef state variable is changed in ChildB, the change is synchronized to ParentView and ChildA.
-
-- ChildA uses @Prop to establish one-way state binding from ParentView to itself. When ChildA changes the state, it is re-rendered, but the change is not updated to ParentView or ChildB.
diff --git a/en/application-dev/ui/ts-component-states-prop.md b/en/application-dev/ui/ts-component-states-prop.md
deleted file mode 100644
index 6de395e9a921e9c690b793d52d21f35883f2820e..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-component-states-prop.md
+++ /dev/null
@@ -1,73 +0,0 @@
-# @Prop
-
-
-@Prop and @State have the same semantics but different initialization modes. Variables decorated by @Prop must be initialized using the @State decorated variable provided by their parent components. The @Prop decorated variable can be modified in the component, but the modification is not updated to the parent component; that is, @Prop uses one-way data binding.
-
-
-The @Prop state data has the following features:
-
-
-- Support for simple types: The number, string, and boolean types are supported.
-
-- Private: Data is accessed only within the component.
-
-- Support for multiple instances: A component can have multiple attributes decorated by @Prop.
-
-- Support for initialization with a value passed to the @Prop decorated variable: When a new instance of the component is created, all @Prop decorated variables must be initialized. Initialization inside the component is not supported.
-
-
-## Example
-
-```ts
-// xxx.ets
-@Entry
-@Component
-struct ParentComponent {
- @State countDownStartValue: number = 10 // 10 Nuggets default start value in a Game
- build() {
- Column() {
- Text(`Grant ${this.countDownStartValue} nuggets to play.`)
- Button() {
- Text('+1 - Nuggets in New Game')
- }.onClick(() => {
- this.countDownStartValue += 1
- })
- Button() {
- Text('-1 - Nuggets in New Game')
- }.onClick(() => {
- this.countDownStartValue -= 1
- })
- // When creating a child component, you must provide the initial value of its @Prop decorated variable in the constructor parameter and initialize the regular variable CostOfOneAttump (not Prop).
- CountDownComponent({ count: this.countDownStartValue, costOfOneAttempt: 2})
- }
- }
-}
-
-@Component
-struct CountDownComponent {
- @Prop count: number
- private costOfOneAttempt: number
-
- build() {
- Column() {
- if (this.count > 0) {
- Text(`You have ${this.count} Nuggets left`)
- } else {
- Text('Game over!')
- }
-
- Button() {
- Text('Try again')
- }.onClick(() => {
- this.count -= this.costOfOneAttempt
- })
- }
- }
-}
-```
-
-In the preceding example, when you press +1 or -1, the status of the parent component changes and the build method is executed again. In this case, a new CountDownComponent is created. The countDownStartValue property of the parent component is used to initialize the @Prop decorated variable of the child component. When you tap the Try again button of the child component, the value of the @Prop decorated variable count is changed. As a result, the CountDownComponent is rendered again. However, the change of the count value does not affect the countDownStartValue value of the parent component.
-
-> **NOTE**
->
-> When a new component instance is created, all its @Prop decorated variables must be initialized.
diff --git a/en/application-dev/ui/ts-component-states-state.md b/en/application-dev/ui/ts-component-states-state.md
deleted file mode 100644
index 49f0b75863afa00c4033f3c64369e708c131901c..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-component-states-state.md
+++ /dev/null
@@ -1,107 +0,0 @@
-# @State
-
-
-The @State decorated variable is the internal state data of the component. When the state data is modified, the build method of the component is called to refresh the UI. Note that the @State decorator cannot listen for data changes at the inner layer.
-
-
-The @State data has the following features:
-
-
-- Support for multiple types: The following types are supported: strong types by value and by reference, including class, number, boolean, string, as well as arrays of these types, that is, Array<class>, Array<string>, Array<boolean>, and Array<number>. object and any are not allowed.
-
-- Support for multiple instances: Multiple instances can coexist in a component. The internal state data of different instances is independent.
-
-- Private: An attribute marked with @State can only be accessed within the component.
-
-- Local initialization required: Initial values must be allocated to all @State decorated variables through the initialization process. Otherwise, they may become undefined in the framework.
-
-- Support for setting of initial attribute values based on the state variable name: When creating a component instance, you can explicitly specify the initial value of the @State decorated attribute based on the variable name.
-
-
-## Simple Example of @State Decorated Attribute
-
-```ts
-// xxx.ets
-@Entry
-@Component
-struct MyComponent {
- @State count: number = 0
- // MyComponent provides a method for modifying the @State status data member.
- private toggleClick() {
- this.count += 1
- }
-
- build() {
- Column() {
- Button() {
- Text(`click times: ${this.count}`)
- .fontSize(10)
- }.onClick(this.toggleClick.bind(this))
- }
- }
-}
-```
-
-
-## Complex Example of @State Decorated Variable
-
-```ts
-// Customize the status data class.
-// xxx.ets
-class Model {
- value: string
- constructor(value: string) {
- this.value = value
- }
-}
-
-@Entry
-@Component
-struct EntryComponent {
- build() {
- Column() {
- MyComponent({count: 1, increaseBy: 2}) // MyComponent1 in this document
- MyComponent({title: {value: 'Hello, World 2'}, count: 7}) //MyComponent2 in this document
- }
- }
-}
-
-@Component
-struct MyComponent {
- @State title: Model = {value: 'Hello World'}
- @State count: number = 0
- private toggle: string = 'Hello World'
- private increaseBy: number = 1
-
- build() {
- Column() {
- Text(`${this.title.value}`).fontSize(30)
- Button() {
- Text(`Click to change title`).fontSize(20).fontColor(Color.White)
- }.onClick(() => {
- this.title.value = (this.toggle == this.title.value) ? 'Hello World' : 'Hello UI'
- }) // Modify the internal state of MyComponent using the anonymous method.
-
- Button() {
- Text(`Click to increase count=${this.count}`).fontSize(20).fontColor(Color.White)
- }.onClick(() => {
- this.count += this.increaseBy
- }) // Modify the internal state of MyComponent using the anonymous method.
- }
- }
-}
-```
-
-
-In the preceding example:
-
-
-- Two @State decorated variables, count and title, have been defined for MyComponent. If the value of count or title changes, the build method of MyComponent needs to be called to render the component again.
-
-- The EntryComponent has multiple MyComponent instances. The internal status change of the first MyComponent does not affect the second MyComponent.
-
-- When creating a MyComponent instance, initialize the variables in the component based on the variable name. For example:
-
- ```ts
- MyComponent({title: {value: 'Hello, World 2'}, count: 7})
- ```
diff --git a/en/application-dev/ui/ts-configuration-with-mandatory-parameters.md b/en/application-dev/ui/ts-configuration-with-mandatory-parameters.md
deleted file mode 100644
index e342b56c0aaad43dd62d449fe2d6c2fe3f631499..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-configuration-with-mandatory-parameters.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# Configuration with Mandatory Parameters
-
-
-If the API definition of a component contains any mandatory parameter, set the parameters in the parentheses next to the component. Use constants to assign values to the parameters.
-
-
-Examples:
-
-
-- Set the mandatory parameter src of the <Image> component as follows:
-
- ```ts
- Image('http://xyz/a.jpg')
- ```
-
-
-- Set the mandatory parameter content of the **\** component as follows:
-
- ```ts
- Text('123')
- ```
-
-
-You can also use variables or expressions to assign values to parameters. The result type returned by an expression must meet the parameter type requirements. For example, to pass a variable or expression to construct the Image and Text components:
-
-```ts
-// imagePath, where imageUrl is a private data variable defined in the component.
-Image(this.imagePath)
-Image('http://' + this.imageUrl)
-// count is a private data variable defined in the component.
-// (``) and (${}) are the template character string features supported by the TS language and comply with the
-// features of the corresponding language. This specification is not limited.
-Text(`count: ${this.count}`)
-```
diff --git a/en/application-dev/ui/ts-event-configuration.md b/en/application-dev/ui/ts-event-configuration.md
deleted file mode 100644
index 8711bd168093769c0ff908d96c965cc802e4535b..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-event-configuration.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# Event Configuration
-
-You can use event methods to configure events supported by components. Since API version 9, you can obtain the context associated with the current component from the callback. For details, see [Obtaining the Context on an eTS Page](../ability/context-userguide.md).
-
-
-- Example of using a lambda expression to configure the event of a component:
- ```ts
- // Counter is a private data variable defined in the component.
- Button('add counter')
- .onClick(() => {
- this.counter += 2
- })
- ```
-
-
-- When using an anonymous function expression to configure the event of a component, **bind** must be used to ensure that the contained components are referenced by **this** in the function body.
- ```ts
- // Counter is a private data variable defined in the component.
- Button('add counter')
- .onClick(function () {
- this.counter += 2
- }.bind(this))
- ```
-
-
-- Example of using a component's member function to configure the event of the component:
- ```ts
- myClickHandler(): void {
- // do something
- }
-
- ...
-
- Button('add counter')
- .onClick(this.myClickHandler)
- ```
diff --git a/en/application-dev/ui/ts-function-build.md b/en/application-dev/ui/ts-function-build.md
deleted file mode 100644
index b26487a1cd7cf127d03f0729083ef8abafea0cbd..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-function-build.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# build Function
-
-
-The build function meets the definition of the **Builder** API and is used to define the declarative UI description of components. Components must comply with the preceding **Builder** API constraints. Custom or preset components are combined in declarative mode in the build method. The **build** API is called when a component is created or updated.
-
-
-```ts
-interface Builder {
- build: () => void
-}
-```
-
-
-> **NOTE**
->
-> The build method supports only composite components and uses the rendering control syntax.
diff --git a/en/application-dev/ui/ts-general-ui-concepts.md b/en/application-dev/ui/ts-general-ui-concepts.md
deleted file mode 100644
index 13f51e40c52929b4af01f9539ab91a288b7d3997..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-general-ui-concepts.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# Basic Concepts
-
-
-The TypeScript-based declarative development paradigm provides a wide array of basic components, which can be combined and extended in a declarative manner to describe the UI of an application. It also provides basic data binding and event processing mechanisms to help you implement the application interaction logic.
-
-
-## HelloWorld Example
-
-```ts
-// An example of displaying Hello World. After you click the button, Hello UI is displayed.
-// xxx.ets
-@Entry
-@Component
-struct Hello {
- @State myText: string = 'World'
- build() {
- Column() {
- Text('Hello')
- .fontSize(30)
- Text(this.myText)
- .fontSize(32)
- Divider()
- Button() {
- Text('Click me')
- .fontColor(Color.Red)
- }.onClick(() => {
- this.myText = 'UI'
- })
- .width(500)
- .height(200)
- }
- }
-}
-```
-
-
-## Basic Concepts
-
-The preceding sample code shows the structure of a simple page. It involves the following basic concepts:
-
-- Decorator: a special kind of declaration that can be applied to classes, structures, methods, and variables. In the sample code, @Entry, @Component, and @State are decorators.
-
-- Custom component: a reusable UI unit, which can be combined with other components. In the sample code, struct Hello decorated by @Component is a custom component.
-
-- UI description: declaratively describes the UI structure. In the sample code, the block of code in the build() method provides the UI description.
-
-- Built-in component: the default basic or layout component preset in the framework. You can directly invoke these components, such as <Column>, <Text>, <Divider>, and <Button> components in the sample code.
-
-- Attribute method: a method used to configure component attributes, such as fontSize(), width(), height(), and color().
-
-- Event method: a method used to add the component response logic to an event. In the sample code, the onClick method is added for the Button component for defining the click response logic.
diff --git a/en/application-dev/ui/ts-other-states-consume-provide.md b/en/application-dev/ui/ts-other-states-consume-provide.md
deleted file mode 100644
index 4d238cc188b0927a8299660dff77ac10633c8ad0..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-other-states-consume-provide.md
+++ /dev/null
@@ -1,77 +0,0 @@
-# @Consume and @Provide
-
-
-As the data provider, @Provide can update the data of child nodes and trigger page rendering. After @Consume detects that the @Provide data is updated, it will initiate re-rendering of the current view.
-
-
-Table 1 @Provide
-
-| Name | Description |
-| -------- | -------- |
-| Decorator parameter | A constant of the string type, which is used to set an alias for a decorated variable. If an alias is specified, implement the data update for this alias. If there is no alias, use the variable name as the alias. @Provide("_alias_") is recommended. |
-| Synchronization mechanism | The @Provide decorated variable is similar to the @state variable. You can modify the variable to re-render the page. You can also modify the @Consume decorated variable to modify the @State decorated variable reversely. |
-| Initial value | The initial value must be set. |
-| Page re-rendering scenarios | The following will trigger page re-rendering: - Changes of variables in primitive types (boolean, string, and number) - Changes of the @Observed decorated classes or their attributes - Adding, deleting, or updating elements in an array |
-
-
-Table 2 @Consume
-
-| Type | Description |
-| -------- | -------- |
-| Initial value | No default value can be set. |
-
-
-> **NOTE**
->
-> To avoid infinite loops caused by circular reference, exercise caution when using @Provide and @Consume.
-
-
-The description of other attributes is the same as that of @Provide.
-
-
-```ts
-// xxx.ets
-@Entry
-@Component
-struct CompA {
- @Provide("reviewVote") reviewVotes : number = 0;
-
- build() {
- Column() {
- CompB()
- Button() {
- Text(`${this.reviewVotes}`)
- .fontSize(30)
- }
- .onClick(() => {
- this.reviewVotes += 1;
- })
- }
- }
-}
-
-@Component
-struct CompB {
- build() {
- Column() {
- CompC()
- }
- }
-}
-
-@Component
-struct CompC {
- @Consume("reviewVote") reviewVotes : number;
- build() {
- Column() {
- Button() {
- Text(`${this.reviewVotes}`)
- .fontSize(30)
- }
- .onClick(() => {
- this.reviewVotes += 1;
- })
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-other-states-observed-objectlink.md b/en/application-dev/ui/ts-other-states-observed-objectlink.md
deleted file mode 100644
index da8fa81930c23522a3d70a7cec15a46585b64dfc..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-other-states-observed-objectlink.md
+++ /dev/null
@@ -1,185 +0,0 @@
-# @Observed and @ObjectLink
-
-
-This section introduces to you two new decorators: @Observed and @ObjectLink.
-
-
-- @Observed applies to a class, indicating that the data changes in the class are managed by the UI page, for example, @Observed class ClassA {}.
-
-- @ObjectLink applies to an object decorated by @Observed, for example, @ObjectLink a: ClassA.
-
-
-## Background
-
-When you need to set bidirectional synchronization in a child component for a variable (parent_a) of its parent component, you can use @State to decorate the variable (parent_a) in the parent component and use @Link to decorate the corresponding variable (child_a) in the child component. In this way, data can be synchronized between the parent component and the specific child component, and between the parent component and its other child components. As shown below, bidirectional synchronization is configured for variables of ClassA in the parent and child components. If attribute c of the variable in child component 1 has its value changed, the parent component will be notified to synchronize the change. If attribute c in the parent component has its value changed, all child components will be notified to synchronize the change.
-
-![en-us_image_0000001267647861](figures/en-us_image_0000001267647861.png)
-
-In the preceding example, full synchronization is performed for a data object. If you want to synchronize partial information of a data object in a parent component, and if the information is a class object, use @ObjectLink and @Observed instead, as shown below.
-
-![en-us_image_0000001267607881](figures/en-us_image_0000001267607881.png)
-
-
-## Configuration Requirement
-
-- @Observed applies to classes, and @ObjectLink applies to variables.
-
-- The variables decorated by @ObjectLink must be of the class type.
- - The classes must be decorated by @Observed.
- - Parameters of the primitive types are not supported. You can use @Prop to perform unidirectional synchronization.
-
-- @ObjectLink decorated variables are immutable.
- - Attribute changes are allowed. If an object is referenced by multiple @ObjectLink decorated variables, all custom components that have these variables will be notified for re-rendering.
-
-- Default values cannot be set for @ObjectLink decorated variables.
- - The parent component must be initialized with a TypeScript expression that involves variables decorated by @State, @Link, @StorageLink, @Provide, or @Consume.
-
-- @ObjectLink decorated variables are private variables and can be accessed only within the component.
-
-
-## Examples
-
-
-### Example 1
-
-
-```ts
-// When the data of the ClassA object in the parent component ViewB's class object ClassB is synchronized with that of the child component ViewA, use @ObjectLink to synchronize the changes in the value of c are synchronized to the parent component.
-@Observed
-class ClassA {
- public name : string;
- public c: number;
- constructor(c: number, name: string = 'OK') {
- this.name = name;
- this.c = c;
- }
-}
-
-class ClassB {
- public a: ClassA;
- constructor(a: ClassA) {
- this.a = a;
- }
-}
-
-@Component
-struct ViewA {
- label : string = "ep1";
- @ObjectLink a : ClassA;
- build() {
- Column() {
- Text(`ViewA [${this.label}]: a.c=${this.a.c}`)
- .fontSize(20)
- Button(`+1`)
- .width(100)
- .margin(2)
- .onClick(() => {
- this.a.c += 1;
- })
- Button(`reset`)
- .width(100)
- .margin(2)
- .onClick(() => {
- this.a = new ClassA(0); // Error: Variable a decorated by @ObjectLink is immutable.
- })
- }
- }
-}
-
-@Entry
-@Component
-struct ViewB {
- @State b : ClassB = new ClassB(new ClassA(10));
- build() {
- Flex({direction: FlexDirection.Column, alignItems: ItemAlign.Center}) {
- ViewA({label: "ViewA #1", a: this.b.a})
- ViewA({label: "ViewA #2", a: this.b.a})
-
- Button(`ViewB: this.b.a.c += 1` )
- .width(320)
- .margin(4)
- .onClick(() => {
- this.b.a.c += 1;
- })
- Button(`ViewB: this.b.a = new ClassA(0)`)
- .width(240)
- .margin(4)
- .onClick(() => {
- this.b.a = new ClassA(0);
- })
- Button(`ViewB: this.b = new ClassB(ClassA(0))`)
- .width(240)
- .margin(4)
- .onClick(() => {
- this.b = new ClassB(new ClassA(0));
- })
- }
- }
-}
-```
-
-
-### Example 2
-
-```ts
-// When the data of class object ClassA in the parent component ViewB is synchronized with that of the child component ViewA, use @ObjectLink and @Observed to synchronize data changes to the parent component and its other child components.
-var nextID: number = 0;
-@Observed
-class ClassA {
- public name : string;
- public c: number;
- public id : number;
- constructor(c: number, name: string = 'OK') {
- this.name = name;
- this.c = c;
- this.id = nextID++;
- }
-}
-
-@Component
-struct ViewA {
- label : string = "ViewA1";
- @ObjectLink a: ClassA;
- build() {
- Row() {
- Button(`ViewA [${this.label}] this.a.c= ${this.a.c} +1`)
- .onClick(() => {
- this.a.c += 1;
- })
- }.margin({ top: 10 })
- }
-}
-
-@Entry
-@Component
-struct ViewB {
- @State arrA : ClassA[] = [ new ClassA(0), new ClassA(0) ];
- build() {
- Column() {
- ForEach (this.arrA, (item) => {
- ViewA({label: `#${item.id}`, a: item})
- },
- (item) => item.id.toString()
- )
- ViewA({label: `ViewA this.arrA[first]`, a: this.arrA[0]})
- ViewA({label: `ViewA this.arrA[last]`, a: this.arrA[this.arrA.length-1]})
-
- Button(`ViewB: reset array`)
- .margin({ top: 10 })
- .onClick(() => {
- this.arrA = [ new ClassA(0), new ClassA(0) ];
- })
- Button(`ViewB: push`)
- .margin({ top: 10 })
- .onClick(() => {
- this.arrA.push(new ClassA(0))
- })
- Button(`ViewB: shift`)
- .margin({ top: 10 })
- .onClick(() => {
- this.arrA.shift()
- })
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-other-states-watch.md b/en/application-dev/ui/ts-other-states-watch.md
deleted file mode 100644
index dfb2c57481f2d65dc553077ca0e6adeb72923548..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-other-states-watch.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# @Watch
-
-
-@Watch is used to listen for changes of state variables. The syntax structure is as follows:
-
-
-```ts
-@State @Watch("onChanged") count : number = 0
-```
-
-
-As shown above, add an @Watch decorator to the target state variable to register an onChanged callback. When the state variable count is changed, the onChanged callback will be triggered.
-
-
-@Watch can be used to listen for changes of variables decorated by @State, @Prop, @Link, @ObjectLink, @Provide, @Consume, @StorageProp, or @StorageLink.
-
-
-```ts
-// xxx.ets
-@Entry
-@Component
-struct CompA {
- @State @Watch("onBasketUpdated") shopBasket : Array = [ 7, 12, 47, 3 ];
- @State totalPurchase : number = 0;
-
- updateTotal() : number {
- let sum = 0;
- this.shopBasket.forEach((i) => { sum += i; });
- // Calculate the total amount of items in the shopping basket. If the amount exceeds CNY100, the specified discount will be applied.
- this.totalPurchase = (sum < 100) ? sum : 0.9 * sum;
- return this.totalPurchase;
- }
-
- // @Watch cb
- onBasketUpdated(propName: string) : void {
- this.updateTotal();
- }
-
- build() {
- Column() {
- Button("add to basket").onClick(() => { this.shopBasket.push(Math.round(100 * Math.random())) })
- Text(`${this.totalPurchase}`)
- .fontSize(30)
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-parameterless-configuration.md b/en/application-dev/ui/ts-parameterless-configuration.md
deleted file mode 100644
index 3f5c2cfb0fff19cbaf20e9c2e931c775af6079cd..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-parameterless-configuration.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Configuration Without Parameters
-
-
-If the API definition of a component does not contain mandatory parameters, you do not need to configure any content in the parentheses next to the component. For example, the Divider component does not contain parameters:
-
-
-```ts
-Column() {
- Text('item 1')
- Divider() // No parameter configuration of the divider component
- Text('item 2')
-}
-```
diff --git a/en/application-dev/ui/ts-rending-control-syntax-foreach.md b/en/application-dev/ui/ts-rending-control-syntax-foreach.md
deleted file mode 100644
index fee0758a7e3c9a5f7770dcddd91e6cc9d3a7e96a..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-rending-control-syntax-foreach.md
+++ /dev/null
@@ -1,142 +0,0 @@
-# ForEach
-
-The development framework provides **ForEach** to iterate arrays and create components for each array item. If a large number of elements are involved in **ForEach**, the page loading may become slow. For best possible results, you are advised to use **[LazyForEach](ts-rending-control-syntax-lazyforeach.md)** instead. **ForEach** is defined as follows:
-
-
-```ts
-ForEach(
- arr: any[], // Array to be iterated
- itemGenerator: (item: any, index?: number) => void, // child component generator
- keyGenerator?: (item: any, index?: number) => string // (optional) Unique key generator, which is recommended.
-)
-```
-
-
-## ForEach
-
-
-ForEach(arr: any[],itemGenerator: (item: any, index?: number) => void, keyGenerator?: (item: any, index?: number) => string):void
-
-
-Table 1 Parameters
-
-| Name | Type | Mandatory | Default Value | Description |
-| ------------- | ---------------------------------------- | ---- | ---- | ---------------------------------------- |
-| arr | any[] | Yes | - | Must be an array. An empty array is allowed. If the array is empty, no child component is created. The functions that return array-type values are also allowed, for example, **arr.slice (1, 3)**. The set functions cannot change any state variables including the array itself, such as **Array.splice**, **Array.sort**, and **Array.reverse**.|
-| itemGenerator | (item: any, index?: number) => void | Yes | - | Lambda function used to generate one or more child components for a given array item. A component and its child component list must be enclosed in braces ({...}).|
-| keyGenerator | (item: any, index?: number) => string | No | - | Anonymous parameter used to generate a unique and stable key value for a given array item. When the position of a subitem in the array is changed, the key value of the subitem cannot be changed. When a subitem in the array is replaced with a new item, the key value of the current item must be different from that of the new item. This key-value generator is optional. However, for performance reasons, it is strongly recommended that the key-value generator be provided, so that the development framework can better identify array changes. If the array is reversed while no key-value generator is provided, all nodes in **ForEach** will be rebuilt.|
-
-
-> **NOTE**
-> - **ForEach** must be used in container components.
->
-> - The generated child components are allowed in the parent container component of **ForEach**. The child component generator function can contain the **if/else** conditional statement, and the **if/else** conditional statement can contain **ForEach**.
->
-> - The call sequence of subitem generator functions may be different from that of the data items in the array. During the development, do not assume whether the subitem generator and key value generator functions are executed and the execution sequence. Below is an example of incorrect usage:
-> ```ts
-> ForEach(anArray, item => {Text(`${++counter}. item.label`)})
-> ```
->
-> Below is an example of correct usage:
->
-> ```ts
-> ForEach(anArray.map((item1, index1) => { return { i: index1 + 1, data: item1 }; }),
-> item => Text(`${item.i}. item.data.label`),
-> item => item.data.id.toString())
-> ```
-
-
-## Example
-
-The following is an example of a simple-type array:
-
-```ts
-// xxx.ets
-@Entry
-@Component
-struct MyComponent {
- @State arr: number[] = [10, 20, 30]
- build() {
- Column() {
- Button() {
- Text('Reverse Array')
- }.onClick(() => {
- this.arr.reverse()
- })
-
- ForEach(this.arr, // Parameter 1: array to be iterated
- (item: number) => { // Parameter 2: item generator
- Text(`item value: ${item}`)
- Divider()
- },
- (item: number) => item.toString() // Parameter 3: unique key generator, which is optional but recommended.
- )
- }
- }
-}
-```
-
-The following is an example of a complex-type array:
-```ts
-// xxx.ets
-class Month {
- year: number
- month: number
- days: Array
-
- constructor(year, month, days) {
- this.year = year;
- this.month = month;
- this.days = days;
- }
-}
-
-@Entry
-@Component
-struct Calendar1 {
-// simulate with 6 months
- @State calendar: Month[] = [
- new Month(2020, 1, [...Array(31).keys()]),
- new Month(2020, 2, [...Array(28).keys()]),
- new Month(2020, 3, [...Array(31).keys()]),
- new Month(2020, 4, [...Array(30).keys()]),
- new Month(2020, 5, [...Array(31).keys()]),
- new Month(2020, 6, [...Array(30).keys()]),
- ]
-
- build() {
- Column() {
- Button('next month')
- .onClick(() => {
- this.calendar.shift()
- this.calendar.push({
- year: 2020,
- month: 7,
- days: [...Array(31)
- .keys()]
- })
- })
- ForEach(this.calendar,
- (item: Month) => {
- Text('month:' + item.month)
- .fontSize(30)
- .padding(20)
- Grid() {
- ForEach(item.days,
- (day: number) => {
- GridItem() {
- Text((day + 1).toString())
- .fontSize(30)
- }
- },
- (day: number) => day.toString())
- }
- .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr')
- .rowsGap(20)
- },
- // field is used together with year and month as the unique ID of the month.
- (item: Month) => (item.year * 12 + item.month).toString())
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-rending-control-syntax-if-else.md b/en/application-dev/ui/ts-rending-control-syntax-if-else.md
deleted file mode 100644
index f01ee38f97d84128f8b56841692256d073cdacfa..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-rending-control-syntax-if-else.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# if/else
-
-
-Use if/else for conditional rendering.
-
-
-> **NOTE**
-> - State variables can be used in the if conditional statement.
->
-> - You can use the if conditional statement to implement rendering of child components.
->
-> - The if conditional statement must be used in container components.
->
-> - Some container components limit the type or number of child components. When if is placed in these components, the limitation applies to components created in if and else statements. For example, when if is used in the <Grid> component, whose child components can only be <GridItem>, only the <GridItem> component can be used in the if conditional statement.
-
-
-## Example
-
-Example of using the if conditional statement:
-
-
-```ts
-Column() {
- if (this.count > 0) {
- Text('count is positive')
- }
-}
-```
-
-
-Example of using the if, else if, and else conditional statements:
-
-
-```ts
-Column() {
- if (this.count < 0) {
- Text('count is negative')
- } else if (this.count % 2 === 0) {
- Divider()
- Text('even')
- } else {
- Divider()
- Text('odd')
- }
-}
-```
diff --git a/en/application-dev/ui/ts-rending-control-syntax-lazyforeach.md b/en/application-dev/ui/ts-rending-control-syntax-lazyforeach.md
deleted file mode 100644
index b28f8576f61c73cfcc9b78953749ee29f3781390..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-rending-control-syntax-lazyforeach.md
+++ /dev/null
@@ -1,194 +0,0 @@
-# LazyForEach
-
-
-The development framework provides LazyForEach to iterate data from provided data sources and create corresponding components during each iteration. LazyForEach is defined as follows:
-
-
-```ts
-LazyForEach(
- dataSource: IDataSource, // Data source to be iterated
- itemGenerator: (item: any) => void, // child component generator
- keyGenerator?: (item: any) => string // (optional) Unique key generator, which is recommended.
-): void
-
-interface IDataSource {
- totalCount(): number; // Get total count of data
- getData(index: number): any; // Get single data by index
- registerDataChangeListener(listener: DataChangeListener): void; // Register listener to listening data changes
- unregisterDataChangeListener(listener: DataChangeListener): void; // Unregister listener
-}
-
-interface DataChangeListener {
- onDataReloaded(): void; // Called while data reloaded
- onDataAdd(index: number): void; // Called while single data added
- onDataMove(from: number, to: number): void; // Called while single data moved
- onDataDelete(index: number): void; // Called while single data deleted
- onDataChange(index: number): void; // Called while single data changed
-}
-```
-
-
-## APIs
-
-
-### LazyForEach
-
-LazyForEach(dataSource: IDataSource, itemGenerator: (item: any) => void, keyGenerator?: (item: any) => string):void
-
-Table 1 Parameters
-
-| Name | Type | Mandatory | Default Value | Description |
-| -------- | -------- | -------- | -------- | -------- |
-| dataSource | IDataSource | Yes | - | Object used to implement the IDataSource API. You need to implement related APIs. |
-| itemGenerator | (item: any) => void | Yes | - | Used to generate the lambda function of the child components. It generates one or more child components for a given array item. A single component and its child component list must be contained in the braces ({...}) |
-| keyGenerator | (item: any) => string | No | - | Used as an anonymous parameter for generating a unique and stable key value for a given array item. When the position of a subitem in the array is changed, the key value of the subitem cannot be changed. When a subitem in the array is replaced with a new item, the key value of the current item must be different from that of the new item. This key-value generator is optional. However, for performance reasons, it is strongly recommended that the key-value generator be provided, so that the development framework can better identify array changes. If the array is reversed while no key-value generator is provided, all nodes in LazyForEach will be rebuilt. |
-
-
-Table 2 Description of IDataSource
-
-| Name | Description |
-| -------- | -------- |
-| totalCount(): number | Obtains the total number of data records. |
-| getData(index: number): any | Obtains the data corresponding to the specified index. |
-| registerDataChangeListener(listener: DataChangeListener): void | Registers the data change listener. |
-| unregisterDataChangeListener(listener: DataChangeListener): void | Unregisters the data change listener. |
-
-
-Table 3 Description of DataChangeListener
-
-| Name | Description |
-| -------- | -------- |
-| onDataReloaded(): void | Reloads all data. |
-| onDataAdded(index: number): void | Notifies the component that data is added to the position indicated by the specified index. |
-| onDataMoved(from: number, to: number): void | Notifies the component that data is moved from the **from** position to the **to** position. |
-| onDataDeleted(index: number): void | Notifies the component that data is deleted from the position indicated by the specified index. |
-| onDataChanged(index: number): void | Notifies the component that data in the position indicated by the specified index is changed. |
-| onDataAdd(index: number): void8+ | Notifies the component that data is added to the position indicated by the specified index. |
-| onDataMove(from: number, to: number): void8+ | Notifies the component that data is moved from the **from** position to the **to** position. |
-| onDataDelete(index: number): void8+ | Notifies the component that data is deleted from the position indicated by the specified index. |
-| onDataChange(index: number): void8+ | Notifies the component that data in the position indicated by the specified index is changed. |
-
-
-> **NOTE**
->
-> - LazyForEach must be used in the container component. Only the **\**, **\**, and \**** components support LazyForEach (that is, only the visible part and a small amount of data before and after the visible part are loaded for caching). For other components, all data is loaded at a time.
->
-> - LazyForEach must create one and only one child component in each iteration.
->
-> - The generated child component must be in the parent container component of LazyForEach.
->
-> - LazyForEach can be included in an if/else conditional statement, but cannot contain an if/else conditional statement.
->
-> - For the purpose of high-performance rendering, when the onDataChanged method of the DataChangeListener object is used to update the UI, the component update is triggered only when the state variable is used in the component specified in the UI description of itemGenerator.
->
-> - The calling sequence of the subitem generator function may be different from that of the data items in the data source. During the development, do not assume whether the subitem generator and key value generator functions are executed and the execution sequence. The following is an example of incorrect usage:
-> ```ts
-> LazyForEach(dataSource, item => {Text(`${++counter}. item.label`)})
-> ```
->
-> Below is an example of correct usage:
->
-> ```ts
-> LazyForEach(dataSource,
-> item => Text(`${item.i}. item.data.label`)),
-> item => item.data.id.toString())
-> ```
-
-
-## Example
-
-
-```ts
-// Basic implementation of IDataSource to handle data listener
-class BasicDataSource implements IDataSource {
- private listeners: DataChangeListener[] = []
-
- public totalCount(): number {
- return 0
- }
- public getData(index: number): any {
- return undefined
- }
-
- registerDataChangeListener(listener: DataChangeListener): void {
- if (this.listeners.indexOf(listener) < 0) {
- console.info('add listener')
- this.listeners.push(listener)
- }
- }
- unregisterDataChangeListener(listener: DataChangeListener): void {
- const pos = this.listeners.indexOf(listener);
- if (pos >= 0) {
- console.info('remove listener')
- this.listeners.splice(pos, 1)
- }
- }
-
- notifyDataReload(): void {
- this.listeners.forEach(listener => {
- listener.onDataReloaded()
- })
- }
- notifyDataAdd(index: number): void {
- this.listeners.forEach(listener => {
- listener.onDataAdd(index)
- })
- }
- notifyDataChange(index: number): void {
- this.listeners.forEach(listener => {
- listener.onDataChange(index)
- })
- }
- notifyDataDelete(index: number): void {
- this.listeners.forEach(listener => {
- listener.onDataDelete(index)
- })
- }
- notifyDataMove(from: number, to: number): void {
- this.listeners.forEach(listener => {
- listener.onDataMove(from, to)
- })
- }
-}
-
-class MyDataSource extends BasicDataSource {
- private dataArray: string[] = ['/path/image0', '/path/image1', '/path/image2', '/path/image3']
-
- public totalCount(): number {
- return this.dataArray.length
- }
- public getData(index: number): any {
- return this.dataArray[index]
- }
-
- public addData(index: number, data: string): void {
- this.dataArray.splice(index, 0, data)
- this.notifyDataAdd(index)
- }
- public pushData(data: string): void {
- this.dataArray.push(data)
- this.notifyDataAdd(this.dataArray.length - 1)
- }
-}
-
-@Entry
-@Component
-struct MyComponent {
- private data: MyDataSource = new MyDataSource()
- build() {
- List({space: 3}) {
- LazyForEach(this.data, (item: string) => {
- ListItem() {
- Row() {
- Image(item).width("30%").height(50)
- Text(item).fontSize(20).margin({left:10})
- }.margin({left: 10, right: 10})
- }
- .onClick(()=>{
- this.data.pushData('/path/image' + this.data.totalCount())
- })
- }, item => item)
- }
- }
-}
-```
diff --git a/en/application-dev/ui/ts-syntactic-sugar.md b/en/application-dev/ui/ts-syntactic-sugar.md
deleted file mode 100644
index 0ee439d57782858a93fe874a78e057ef4a11cf34..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-syntactic-sugar.md
+++ /dev/null
@@ -1,196 +0,0 @@
-# About Syntactic Sugar
-
-## Decorators
-
-
-A decorator **@Decorator** can decorate a class, structure, or class attribute. Multiple decorators can be applied to the same target element and defined on a single line or multiple lines. It is recommended that the decorators be defined on multiple lines.
-
-
-In the example below, the elements decorated by **@Component** take on the form of a component, and the variables decorated by **@State** can be used to represent states.
-
-
-```ts
-@Component
-struct MyComponent {
- @State count: number = 0
-}
-```
-
-
-Multiple decorators can be defined on a single line, as shown below:
-
-
-```ts
-@Entry @Component struct MyComponent {
-}
-```
-
-
-However, you are advised to define the decorators on multiple lines, as shown below:
-
-
-```ts
-@Entry
-@Component
-struct MyComponent {
-}
-```
-
-
-### Supported Decorators
-
-| Decorator | Decorates... | Description |
-| ------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
-| @Component | struct | The decorated structure has the component-based capability. The **build** method must be implemented to update the UI.|
-| @Entry | struct | The decorated component is used as the entry of a page. The component is rendered and displayed when the page is loaded. |
-| @Preview | struct | Custom components decorated by **@Preview** can be previewed in DevEco Studio. When the target page is loaded, the custom components decorated by **@Preview** are created and displayed.|
-| @Builder | Methods | In the decorated method, you can use the declarative UI description to quickly generate multiple layouts in a custom component.|
-| @Extend | Methods | This decorator adds attribute functions to a preset component, allowing you to quickly define and reuse the custom style of the component.|
-| @CustomDialog | struct | This decorator is used to decorate custom pop-up dialog boxes. |
-| @State | Primitive data types, classes, and arrays | If the decorated state data is modified, the **build** method of the component will be called to update the UI. |
-| @Prop | Primitive data types | This decorator is used to establish one-way data binding between the parent and child components. When the data associated with the parent component is modified, the UI of the current component is updated.|
-| @Link | Primitive data types, classes, and arrays | This decorator is used to establish two-way data binding between the parent and child components. The internal state data of the parent component is used as the data source. Any changes made to one component will be reflected to the other.|
-| @Observed | Classes | This decorator is used to indicate that the data changes in the class will be managed by the UI page. |
-| @ObjectLink | Objects of **@Observed** decorated classes | When the decorated state variable is modified, the parent and sibling components that have the state variable will be notified for UI re-rendering.|
-| @Consume | Primitive data types, classes, and arrays | When the **@Consume** decorated variable detects the update of the **@Provide** decorated variable, the re-rendering of the current custom component is triggered.|
-| @Provide | Primitive data types, classes, and arrays | As the data provider, **@Provide** can update the data of child nodes and trigger page rendering.|
-| @Watch | Variables decorated by **@State**, **@Prop**, **@Link**, **@ObjectLink**, **@Provide**, **@Consume**, **@StorageProp**, or **@StorageLink** | This decorator is used to listen for the changes of the state variables. The application can register a callback method through **@Watch**. |
-
-
-## Chain Call
-
-You can configure the UI structure and its attributes and events and separate them with a dot(.) to implement chain call.
-
-```ts
-Column() {
- Image('1.jpg')
- .alt('error.jpg')
- .width(100)
- .height(100)
-}.padding(10)
-```
-
-
-## struct
-
-Components can be implemented based on **struct**s. Components cannot inherit from each other. The **struct**s implemented components can be created and destroyed more quickly than **class** implemented components.
-
-```ts
-@Component
-struct MyComponent {
- @State data: string = ''
-
- build() {
- }
-}
-```
-
-
-## Instantiating a struct Without the new Keyword
-
-You can omit the **new** keyword when instantiating a **struct**.
-
-```ts
-// Definition
-@Component
-struct MyComponent {
- build() {
- }
-}
-
-// Usage
-Column() {
- MyComponent()
-}
-
-// Equivalent to
-new Column() {
- new MyComponent()
-}
-```
-
-
-## Restrictions on Using TypeScript in Generators
-
-TypeScript has the following restrictions on generators:
-
-- Expressions can be used only in character strings (${expression}), **if** conditions, **ForEach** parameters, and component parameters.
-
-- No expressions should cause any application state variables (**@State**, **@Link**, and **@Prop**) to change. Otherwise, undefined and potentially unstable framework behavior may occur.
-
-- The generator function cannot contain local variables.
-
-None of the above restrictions apply to anonymous function implementations of event-handling functions (such as **onClick**)
-
-Incorrect:
-
-```ts
-build() {
- let a: number = 1 // invalid: variable declaration not allowed
- Column() {
- Text(`Hello ${this.myName.toUpperCase()}`) // ok.
- ForEach(this.arr.reverse(), ..., ...) // invalid: Array.reverse modifies the @State array variable in place
- }
- buildSpecial() // invalid: no function calls
- Text(this.calcTextValue()) // this function call is ok.
-}
-```
-
-
-## Two-Way Binding of Variables
-
-**$$** supports two-way binding for simple variables and **@State**, **@Link**, and **@Prop** decorated variables.
-
-Currently, **$$** supports only the rendering between the **show** parameter of the **[bindPopup](../reference/arkui-ts/ts-universal-attributes-popup.md)** attribute and the **@State** decorated variable, the **checked** attribute of the **\** component, and the **refreshing** parameter of the **\** component.
-
-
-```ts
-// xxx.ets
-@Entry
-@Component
-struct bindPopup {
- @State customPopup: boolean = false
- build() {
- Column() {
- Button(){
- Text('Popup')
- }
- .onClick(()=>{
- this.customPopup = !this.customPopup
- })
- .bindPopup(
- $$this.customPopup, {
- message: "showPopup"
- }
- )
- }
- }
-}
-```
-
-## Restrictions on Declaring Multiple Data Types of State Variables
-
-If a **@State**, **@Provide**, **@Link**, or **@Consume** decorated state variable supports multiple data types, they must be all simple data types or references at one time.
-
-Example:
-
-```ts
-@Entry
-@Component
-struct Index {
- // Incorrect: @State message: string | Resource = 'Hello World'
- @State message: string = 'Hello World'
-
- build() {
- Row() {
- Column() {
- Text(`${ this.message }`)
- .fontSize(50)
- .fontWeight(FontWeight.Bold)
- }
- .width('100%')
- }
- .height('100%')
- }
-}
-```
diff --git a/en/application-dev/ui/ts-syntax-intro.md b/en/application-dev/ui/ts-syntax-intro.md
deleted file mode 100644
index de2bce20806ecaccf5cece33cdc41a7676f1726a..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-syntax-intro.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Overview
-
-
-This section defines the core mechanism and functions of the TypeScript-based declarative development paradigm. It acquaints you with the declarative UI descriptions, componentization mechanisms, UI state management, rendering control syntax, and syntactic sugar.
-
-
-Follow the provided guidelines for UI development. For details about the components, see components.
-
-
-> **NOTE**
-> - All examples use the TypeScript (TS) language. If you are using another language, comply with the syntax requirements for that language.
->
-> - The components used in the examples are preset in the UI framework and are used only to explain the UI description specifications.
->
-> - Universal attribute and event methods generally apply to all components, and the attribute and event methods within a component apply only to this component.
-
diff --git a/en/application-dev/ui/ts-ui-state-mgmt-concepts.md b/en/application-dev/ui/ts-ui-state-mgmt-concepts.md
deleted file mode 100644
index 86910b42a1fec7986d9fe06a3cd76a185706e747..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ts-ui-state-mgmt-concepts.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Basic Concepts
-
-
-In the declarative UI programming paradigm, the UI is a function in the specific application state, and you update a UI by modifying the current application state. The development framework provides comprehensive application state management capabilities, as shown in the figure below.
-
-
-![en-us_image_0000001222967768](figures/en-us_image_0000001222967768.png)
-
-
-## State Variable Decorators
-
-- @State: state attribute of the component. Each time the @State decorated variable changes, the component re-renders and updates the UI.
-- @Link: allows a component to depend on some state attributes of its parent component. Each time the data in one component is updated, the state of the other component is updated, and the parent and child components are rendered again.
-- @Prop: works in a way similar to that of @Link. The difference is that the changes made by a child component are not synchronized to the parent component.
-> **NOTE**
->
-> The state variable cannot use an ID as its name, as in **@Prop id:number**.
-
-
-## Application State Data
-
-AppStorage is the central store of the application states in the entire UI. The UI framework creates a singleton AppStorage object for the application and provides the corresponding decorators and APIs for the application.
-
-- @StorageLink: works in a way similar to that of @Consume. The difference is that the link object with the specified name is obtained from the AppStorage. It establishes two-way binding between the UI component and AppStorage to synchronize data.
-
-- @StorageProp: synchronizes UI component attributes with the AppStorage unidirectionally. That is, the value change in the AppStorage will trigger an update of the corresponding UI component, but the change of the UI component will not cause an update of the attribute value in the AppStorage.
-
-- Service logic implementation API: adds, reads, modifies, or deletes the state attributes of applications. The changes made by this API will be synchronized to the UI component for UI update.
diff --git a/en/application-dev/ui/ui-ts-local-storage.md b/en/application-dev/ui/ui-ts-local-storage.md
deleted file mode 100644
index 88492c6b05a147d971d25880517501e77633f64d..0000000000000000000000000000000000000000
--- a/en/application-dev/ui/ui-ts-local-storage.md
+++ /dev/null
@@ -1,360 +0,0 @@
-# LocalStorage
-
-> **NOTE**
->
-> This component is supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
-
-**LocalStorage** is a storage unit in an application. Its lifecycle is determined by the ability to which it is bound. **LocalStorage** provides storage for variable and non-variable state attributes within the scope of an application. The variable and non-variable state attributes work together to build an application UI, including the UI of abilities.
-
-Application layer: Multiple **LocalStorage** instances can be created for an application. Each ability of an application corresponds to a **LocalStorage** instance.
-
-Ability: An application can have multiple abilities. Only one **LocalStorage** instance can be allocated to the child components of an ability. Once allocated a **LocalStorage** instance, the child components have access to objects stored in the **LocalStorage**.
-
-A component can access only one **LocalStorage** instance, and a **LocalStorage** instance can be allocated to multiple components.
-
-## @LocalStorageLink Decorator
-
-Two-way data binding can be established between a component and the **LocalStorage** through the component's state variable decorated by **@LocalStorageLink(*key*)**. Wherein, **key** is the attribute key value in the **LocalStorage**. When a component that contains a **@LocalStorageLink** decorated state variable is created, the state variable is initialized with the value predefined in the **LocalStorage**. If no initial value is assigned in the **LocalStorage**, the state variable will use the value defined by **@LocalStorageLink**. Changes made to this variable in the component will be first synchronized to the **LocalStorage**, and then to other components of the bound ability.
-
-## @LocalStorageProp Decorator
-
-One-way data binding can be established between a component and the **LocalStorage** through the component's state variable decorated by **@LocalStorageProp(*key*)**. Wherein, **key** is the attribute key value in the **LocalStorage**. When a component that contains a **@LocalStorageProp** decorated state variable is created, the state variable is initialized with the value predefined in the **LocalStorage**. Changes made to the value in the **LocalStorage** will cause all UI components of the bound ability to update the state.
-
-> **NOTE**
->
-> If a **LocalStorage** instance has initial values assigned when being created, these values will be used for the **@LocalStorageLink** and **@LocalStorageProp** decorated state variables in the component. Otherwise, the initial values assigned for **@LocalStorageLink** and **@LocalStorageProp** will be used instead.
-
-## LocalStorage
-
-### constructor
-
-constructor(initializingProperties?: Object)
-
-Creates and initializes a **LocalStorage** instance.
-
-**Parameters**
-
-| Name | Type | Mandatory | Default Value | Description |
-| ---------------------- | ------ | :--: | ---- | ---------------------------------------- |
-| initializingProperties | Object | No | - | Object attributes and their values returned by **object.keys(obj)**.|
-
-
-
-### GetShared
-
-static GetShared(): LocalStorage
-
-Obtains the current shared **LocalStorage** object.
-
-This API can be used only in the stage model.
-
-**Return value**
-
-| Type | Description |
-| ----------------------------- | ----------------- |
-| [LocalStorage](#localstorage) | **LocalStorage** object.|
-
-
-
-### has
-
-has(propName: string): boolean
-
-Checks whether the **LocalStorage** contains the specified attribute value.
-
-**Parameters**
-
-| Name | Type | Mandatory | Default Value | Description |
-| -------- | ------ | :--: | ---- | ------- |
-| propName | string | Yes | - | Attribute value.|
-
-**Return value**
-
-| Type | Description |
-| ------- | ------------- |
-| boolean | Whether the attribute value is contained.|
-
-
-
-### get
-
-get\(propName: string): T
-
-Obtains the value corresponding to the given key.
-
-**Parameters**
-
-| Name | Type | Mandatory | Default Value | Description |
-| -------- | ------ | :--: | ---- | ----------- |
-| propName | string | Yes | - | Key of the value to obtain.|
-
-**Return value**
-
-| Type | Description |
-| -------------- | ---------------------------------------- |
-| T \| undefined | Returns the value if it is found; returns **undefined** otherwise.|
-
-
-
-### set
-
-set\(propName: string, newValue: T): boolean
-
-Sets the value for the given key.
-
-**Parameters**
-
-| Name | Type | Mandatory | Default Value | Description |
-| -------- | ------ | :--: | ---- | ----------- |
-| propName | string | Yes | - | Key of the value to set. |
-| newValue | T | Yes | - | Value to set.|
-
-**Return value**
-
-| Type | Description |
-| ------- | ----------------------------------- |
-| boolean | Returns **true** if the value is successfully set for the key; returns **false** otherwise.|
-
-
-
-### setOrCreate
-
-setOrCreate\(propName: string, newValue: T): boolean
-
-Creates or updates the value for the given key.
-
-**Parameters**
-
-| Name | Type | Mandatory | Default Value | Description |
-| -------- | ------ | :--: | ---- | -------------- |
-| propName | string | Yes | - | Key of the value to create or update. |
-| newValue | T | Yes | - | Value to create or update.|
-
-**Return value**
-
-| Type | Description |
-| ------- | ---------------------------------------- |
-| boolean | Updates the value of the attribute and returns **true** if an attribute that has the same name as the specified key exists; creates an attribute with the specified value of the T type as its default value and returns **false** otherwise. **true** cannot be returned for **undefined** or **null**.|
-
-
-
-### link
-
-link\(propName: string): T
-
-Establishes two-way data binding between an attribute and this **LocalStorage** instance.
-
-**Parameters**
-
-| Name | Type | Mandatory | Default Value | Description |
-| -------- | ------ | :--: | ---- | ----------- |
-| propName | string | Yes | - | Key of the target attribute.|
-
-**Return value**
-
-| Type | Description |
-| ---- | ---------------------------------------- |
-| T | Returns the two-way data binding if an attribute that has the same name as the specified key exists; returns **undefined** otherwise.|
-
-
-
-### setAndLink
-
-setAndLink\(propName: string, defaultValue: T): T
-
-Establishes two-way data binding between an attribute and this **LocalStorage** instance. This API works in a way similar to the **link** API.
-
-**Parameters**
-
-| Name | Type | Mandatory | Default Value | Description |
-| ------------ | ------ | :--: | ---- | ----------- |
-| propName | string | Yes | - | Key of the target attribute.|
-| defaultValue | T | Yes | - | Default value to set. |
-
-**Return value**
-
-| Type | Description |
-| ------------------------------------ | ------------------------------------------------------------ |
-| [@Link](ts-component-states-link.md) | Returns the value corresponding to the specified key if the key is stored in the **LocalStorage**; creates and returns a **Link** instance with the specified value as its default value otherwise.|
-
-
-
-### prop
-
-prop\(propName: string): T
-
-Establishes one-way data binding with an attribute to update its status.
-
-**Parameters**
-
-| Name | Type | Mandatory | Default Value | Description |
-| -------- | ------ | :--: | ---- | ------------- |
-| propName | string | Yes | - | Key of the target attribute.|
-
-**Return value**
-
-| Type | Description |
-| ------------------------------------ | ---------------------------------------- |
-| [@Prop](ts-component-states-prop.md) | Returns one-way binding to an attribute with a given key if the attribute exists; returns **undefined** otherwise. This means that attribute changes made through the **LocalStorage** will be synchronized to the variable or component, but attribute changes made by the variable or component will not be synchronized to the **LocalStorage**. Note that the variables returned are immutable variables, which are applicable to mutable and immutable state variables. |
-
-
-
-### setAndProp
-
-setAndProp\(propName: string, defaultValue: T): T
-
-Sets up one-way data binding with the **localStorage**. This API works in a way similar to the **Prop** API.
-
-**Parameters**
-
-| Name | Type | Mandatory | Default Value | Description |
-| ------------ | ------ | :--: | ---- | --------------- |
-| propName | string | Yes | - | Key value in the key-value pair to be saved.|
-| defaultValue | T | Yes | - | Default value to set. |
-
-**Return value**
-
-| Type | Description |
-| ------------------------------------ | ---------------------------------------- |
-| [@Prop](ts-component-states-prop.md) | Returns the value corresponding to the specified key if the key is stored in the **LocalStorage**; creates and returns a **Prop** instance with the specified value as its default value otherwise.|
-
-
-
-### delete
-
-delete(propName: string): boolean
-
-Deletes the key-value pair specified by key.
-
-**Parameters**
-
-| Name | Type | Mandatory | Default Value | Description |
-| -------- | ------ | :--: | ---- | ------------ |
-| propName | string | Yes | - | Key value of the attribute to be deleted.|
-
-**Return value**
-
-| Type | Description |
-| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the key-value pair exists and is successfully deleted; returns **false** otherwise.|
-
-
-
-### keys
-
-keys(): IterableIterator\
-
-Searches for all keys.
-
-**Return value**
-
-| Type | Description |
-| -------------- | -------------- |
-| array\ | Returns an array of strings containing all keys.|
-
-
-
-### size
-
-size(): number
-
-Number of existing key-value pairs.
-
-**Return value**
-
-| Type | Description |
-| ------ | --------- |
-| number | Number of key-value pairs.|
-
-
-
-### Clear
-
-clear(): boolean
-
-Deletes all attributes.
-
-**Return value**
-
-| Type | Description |
-| ------- | --------------------------------- |
-| boolean | Returns **true** if all attributes are deleted; returns **false** if any of the attributes is being referenced by a state variable.|
-
-### Example 1 (Creating a LocalStorage in an Ability)
-
-```ts
-import Ability from '@ohos.application.Ability'
-export default class MainAbility extends Ability {
- storage : LocalStorage
- onCreate() {
- this.storage = new LocalStorage();
- this.storage.setOrCreate("storageSimpleProp",121);
- console.log("[Demo MainAbility onCreate]");
- }
- onDestroy() {
- console.log("[Demo MainAbility onDestroy]")
- }
- onWindowStageCreate(windowStage) {
- windowStage.loadContent("pages/index",this.storage)
- }
- onWindowStageDestroy() {
- console.log("[Demo] MainAbility onWindoeStageDestroy")
- }
- onForeground() {
- console.log("[Demo] MainAbility onForeground")
- }
- onBackground() {
- console.log("[Demo] MainAbility onBackground")
- }
-}
-```
-
-The @Component decorated component obtains data.
-
-```ts
-let storage = LocalStorage.GetShared()
-@Entry(storage)
-@Component
-struct LocalStorageComponent {
- @LocalStorageLink("storageSimpleProp") simpleVarName: number = 0
- build() {
- Column(){
- Text(this.simpleVarName.toString())
- .onClick(()=>{
- this.simpleVarName +=1;
- })
- Text(JSON.stringify(this.simpleVarName))
- .fontSize(50)
- }
- .height(500)
- }
-}
-```
-
-### Example 2 (Defining LocalStorage on the Entry Page)
-
-```ts
-let storage = new LocalStorage({"PropA":47});
-@Entry(storage)
-@Component
-struct ComA {
- @LocalStorageLink("PropA") storLink: number = 1;
- build() {
- Column() {
- Text(`Parent from LocalStorage ${ this.storLink }`)
- .onClick(()=>this.storLink+=1)
- Child()
- }
- }
-}
-
-
-@Component
-struct Child{
- @LocalStorageLink("PropA") storLink: number = 1;
- build() {
- Text(`Parent from LocalStorage ${ this.storLink }`)
- .onClick(()=>this.storLink+=1)
- }
-}
-```
diff --git a/en/device-dev/get-code/sourcecode-acquire.md b/en/device-dev/get-code/sourcecode-acquire.md
index 718d3d9f8425b386ef1865d10ab62ece13ed53d1..b244824c3be958bf35bbf78f6d2f689d2e931a6a 100644
--- a/en/device-dev/get-code/sourcecode-acquire.md
+++ b/en/device-dev/get-code/sourcecode-acquire.md
@@ -8,7 +8,7 @@ The open-source code repositories are available at [https://openharmony.gitee.co
## Overview of Source Code Acquisition
-The OpenHarmony source code is open to you as [HPM parts](../hpm-part/Readme-EN.md), which can be obtained in any of the following ways:
+The OpenHarmony source code is open to you as [HPM parts](../hpm-part/hpm-part-about.md), which can be obtained in any of the following ways:
- **Method 1**: Acquire the source code from the Gitee code repository. You can use the **repo** or **git** tool to download the latest code from the code repository.
- **Method 2**: Acquire the source code from [DevEco Marketplace](https://repo.harmonyos.com/#/en/home). Visit [DevEco Marketplace](https://repo.harmonyos.com/#/en/home), search for your desired open-source distribution, and download the bundle list \(or customize bundles and download the bundle list\). Then use the **hpm-cli** tool to download and install the bundles and compilation toolchain on your local PC.
@@ -67,7 +67,11 @@ The OpenHarmony source code is open to you as [HPM parts](../hpm-part/Readme-EN.
>![](../public_sys-resources/icon-note.gif) **NOTE**
>
->Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities.
+>Download the release code, which is more stable, if you want to develop commercial functionalities. Download the master code if you want to get quick access to the latest features for your development.
+
+- **Obtaining OpenHarmony release code**
+
+ For details about how to obtain the source code of an OpenHarmony release, see the [Release Notes](../../release-notes/Readme.md).
- **Obtaining OpenHarmony master code**
@@ -87,10 +91,6 @@ The OpenHarmony source code is open to you as [HPM parts](../hpm-part/Readme-EN.
repo forall -c 'git lfs pull'
```
-- **Obtaining OpenHarmony release code**
-
- For details about how to obtain the source code of an OpenHarmony release, see the [Release Notes]([Release Notes](../../release-notes/Readme.md).
-
## Method 2: Acquiring Source Code from DevEco Marketplace
diff --git a/en/device-dev/security/security.md b/en/device-dev/security/security.md
deleted file mode 100644
index 95d81080547fa0cb91a99a47aa7fdb83c39163b7..0000000000000000000000000000000000000000
--- a/en/device-dev/security/security.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Privacy and Security
-
-- **[Privacy Protection](security-privacy-protection.md)**
-
-- **[Security Guidelines](security-guidelines-overall.md)**
-
-
diff --git a/en/device-dev/subsystems/subsys-tel.md b/en/device-dev/subsystems/subsys-tel.md
deleted file mode 100644
index d2dfe0e890b7281d4b356f231907469586a15f55..0000000000000000000000000000000000000000
--- a/en/device-dev/subsystems/subsys-tel.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Telephony
-
-- **[Telephony Overview](subsys-tel-overview.md)**
-- **[Telephony Development](subsys-tel-guide.md)**
-
diff --git a/en/release-notes/api-change/v3.1-Release/readme.md b/en/release-notes/api-change/v3.1-Release/Readme-EN.md
similarity index 100%
rename from en/release-notes/api-change/v3.1-Release/readme.md
rename to en/release-notes/api-change/v3.1-Release/Readme-EN.md
diff --git a/en/release-notes/api-change/v3.2-beta1/readme.md b/en/release-notes/api-change/v3.2-beta1/Readme-EN.md
similarity index 100%
rename from en/release-notes/api-change/v3.2-beta1/readme.md
rename to en/release-notes/api-change/v3.2-beta1/Readme-EN.md
diff --git a/en/release-notes/api-change/v3.2-beta2/readme.md b/en/release-notes/api-change/v3.2-beta2/Readme-EN.md
similarity index 100%
rename from en/release-notes/api-change/v3.2-beta2/readme.md
rename to en/release-notes/api-change/v3.2-beta2/Readme-EN.md
diff --git a/en/release-notes/api-change/v3.2-beta3/readme.md b/en/release-notes/api-change/v3.2-beta3/Readme-EN.md
similarity index 100%
rename from en/release-notes/api-change/v3.2-beta3/readme.md
rename to en/release-notes/api-change/v3.2-beta3/Readme-EN.md
diff --git a/zh-cn/application-dev/application-test/Readme-CN.md b/zh-cn/application-dev/application-test/Readme-CN.md
new file mode 100644
index 0000000000000000000000000000000000000000..65f819c5af15d5cadea3f17b777a2a471ee2d95a
--- /dev/null
+++ b/zh-cn/application-dev/application-test/Readme-CN.md
@@ -0,0 +1,6 @@
+# 应用测试
+
+- 自动化测试框架
+ - [自动化测试框架使用指导](arkxtest-guidelines.md)
+- SmartPerf性能工具
+ - [SmartPerf性能工具使用指导](smartperf-guidelines.md)
diff --git a/zh-cn/application-dev/application-test/figures/SmartPerfConfig1.png b/zh-cn/application-dev/application-test/figures/SmartPerfConfig1.png
new file mode 100644
index 0000000000000000000000000000000000000000..9d1db45701bf8bc34bcccbc769bf4df4a814e6be
Binary files /dev/null and b/zh-cn/application-dev/application-test/figures/SmartPerfConfig1.png differ
diff --git a/zh-cn/application-dev/application-test/figures/SmartPerfConfig2.png b/zh-cn/application-dev/application-test/figures/SmartPerfConfig2.png
new file mode 100644
index 0000000000000000000000000000000000000000..ca4806b3623be0218e550353f4cfd5b1002396c7
Binary files /dev/null and b/zh-cn/application-dev/application-test/figures/SmartPerfConfig2.png differ
diff --git a/zh-cn/application-dev/application-test/figures/SmartPerfConfig3.png b/zh-cn/application-dev/application-test/figures/SmartPerfConfig3.png
new file mode 100644
index 0000000000000000000000000000000000000000..88389866f85413746e1448a8c3cc284e9909f101
Binary files /dev/null and b/zh-cn/application-dev/application-test/figures/SmartPerfConfig3.png differ
diff --git a/zh-cn/application-dev/application-test/figures/SmartPerfControl1.png b/zh-cn/application-dev/application-test/figures/SmartPerfControl1.png
new file mode 100644
index 0000000000000000000000000000000000000000..c7279107055ca517306a49c619ee01fa6cf70e6a
Binary files /dev/null and b/zh-cn/application-dev/application-test/figures/SmartPerfControl1.png differ
diff --git a/zh-cn/application-dev/application-test/figures/SmartPerfControl2.png b/zh-cn/application-dev/application-test/figures/SmartPerfControl2.png
new file mode 100644
index 0000000000000000000000000000000000000000..e6cacffb7d3864542295ec20ad037079b20fa909
Binary files /dev/null and b/zh-cn/application-dev/application-test/figures/SmartPerfControl2.png differ
diff --git a/zh-cn/application-dev/application-test/figures/SmartPerfReport1.png b/zh-cn/application-dev/application-test/figures/SmartPerfReport1.png
new file mode 100644
index 0000000000000000000000000000000000000000..7f4884e9048fef84707648b5fa6fdcdd70d6106c
Binary files /dev/null and b/zh-cn/application-dev/application-test/figures/SmartPerfReport1.png differ
diff --git a/zh-cn/application-dev/application-test/figures/SmartPerfReport2.png b/zh-cn/application-dev/application-test/figures/SmartPerfReport2.png
new file mode 100644
index 0000000000000000000000000000000000000000..6e26349fef4c11bd03117da591878bc16f2d9534
Binary files /dev/null and b/zh-cn/application-dev/application-test/figures/SmartPerfReport2.png differ
diff --git a/zh-cn/application-dev/application-test/figures/SmartPerfStru.png b/zh-cn/application-dev/application-test/figures/SmartPerfStru.png
new file mode 100644
index 0000000000000000000000000000000000000000..1ddae68adbb452e693258d8e4ae0a52bf43dc247
Binary files /dev/null and b/zh-cn/application-dev/application-test/figures/SmartPerfStru.png differ
diff --git a/zh-cn/application-dev/application-test/smartperf-guidelines.md b/zh-cn/application-dev/application-test/smartperf-guidelines.md
new file mode 100644
index 0000000000000000000000000000000000000000..6614cfde0c2f27f6a42efa4e6d79340f6732849a
--- /dev/null
+++ b/zh-cn/application-dev/application-test/smartperf-guidelines.md
@@ -0,0 +1,85 @@
+# SmartPerf性能工具使用指导
+
+## 概述
+
+为支撑OpenHarmony性能测试,我们向用户提供了符合功能需求并且可靠、易用的性能测试工具。支持开发者针对应用进行相应的性能数据采集以及指标计算功能。
+
+## 简介
+
+SmartPerf端是一款基于OpenHarmony系统开发的性能功耗测试工具,操作简单易用,可提供包括性能、功耗的关键KPI指标,给出具体指标的测试值,包括采集设备的FPS、CPU、GPU、Ftrace等指标数据;
+
+目前SmartPerf工具提供了两种使用方式,分别为hap应用可视化操作方式(SmartPerf-Device)和shell命令行方式(SmartPerf-Daemon),其中SmartPerf-Device支持可视化操作、悬浮窗控制暂停,悬浮窗实时展示数据,SmartPerf-Daemon主要适用于无屏设备、性能较差的设备,对3568等设备同样支持。
+
+## 实现原理
+
+SmartPerf工具主要包括SmartPerf-Device、SmartPerf-Daemon两个部分,其中Device采集的FPS、RAM、Trace等指标需要通过发送消息给Daemon端去采集数据,然后接收Daemon回传的数据展示,同时Daemon端也提供了shell命令的方式单独执行采集,工具的主要功能组成如下图:
+
+![图片说明](figures/SmartPerfStru.png)
+
+## 约束与限制
+
+1.SmartPerf-Device、SmartPerf-Daemon在3.2系统版本后开始预制使用。
+
+2.其中SmartPerf-Device的使用必须是具备屏幕的设备。
+
+## 环境准备
+
+SmartPerf-Daemon执行需要PC连接OpenHarmony设备,如RK3568开发板等。
+
+## 执行性能测试
+
+**SmartPerf-Device应用可视化使用示例**
+
+以下SmartPerf-Device应用内截图以RK3568设备为例。
+
+1.应用采集配置。
+
+启动SmartPerf-Device进入首页,选择测试应用、测试指标项,点击”开始测试“,拉起测试应用。
+![图片说明](figures/SmartPerfConfig1.png)
+![图片说明](figures/SmartPerfConfig2.png)
+![图片说明](figures/SmartPerfConfig3.png)
+
+2.悬浮窗控制采集。
+
+点击悬浮窗”start“开始采集,单击悬浮窗”计时器“暂停采集,再次单击继续采集双击计时器,实时展示采集数据,可拖动悬浮框更改悬浮框位置,长按”计时器“,结束采集。
+
+![图片说明](figures/SmartPerfControl1.png)
+![图片说明](figures/SmartPerfControl2.png)
+
+3.查看报告。
+
+点击“报告”,查看测试报告列表,点击“报告列表”,查看测试指标项详情。
+
+![图片说明](figures/SmartPerfReport1.png)
+![图片说明](figures/SmartPerfReport2.png)
+
+**SmartPerf-Daemon命令行使用示例**
+
+1.进入shell, 执行查看帮助命令。
+```
+:# SP_daemon --help
+```
+2.执行采集命令。
+```
+:# SP_daemon -N 2 -PKG com.ohos.contacts -c -g -t -p -r
+```
+
+**采集命令使用示例解析**
+
+| 命令 | 功能 |是否必选|
+| :-----| :--------------------- |:-----|
+| -N | 设置采集次数 |是|
+| -PKG | 设置包名 | 否|
+| -PID | 设置进程pid(对于ram适用) |否|
+| -c | 是否采集cpu | 否|
+| -g | 是否采集gpu |否|
+| -f | 是否采集fps |否|
+| -t | 是否采集温度 |否|
+| -p | 是否采集电流 |否|
+| -r | 是否采集内存 |否|
+
+**测试结果默认输出路径如下**
+```
+报告存放路径:/data/local/tmp/data.csv
+```
+
diff --git a/zh-cn/application-dev/faqs/Readme-CN.md b/zh-cn/application-dev/faqs/Readme-CN.md
index 37df6ee329a127824a6993221c00d39006851f28..549b7bc2a8f3880a58b91e6e81bb5fa3ced80c50 100644
--- a/zh-cn/application-dev/faqs/Readme-CN.md
+++ b/zh-cn/application-dev/faqs/Readme-CN.md
@@ -2,7 +2,7 @@
- [Ability框架开发常见问题](faqs-ability.md)
- [UI框架(JS)开发常见问题](faqs-ui-js.md)
-- [UI框架(eTS)开发常见问题](faqs-ui-ets.md)
+- [UI框架(ArkTS)开发常见问题](faqs-ui-ets.md)
- [图形图像开发常见问题](faqs-graphics.md)
- [文件管理开发常见问题](faqs-file-management.md)
- [网络与连接开发常见问题](faqs-connectivity.md)
diff --git a/zh-cn/application-dev/faqs/faqs-ui-ets.md b/zh-cn/application-dev/faqs/faqs-ui-ets.md
index 893d9e664c09a44144547dd3adbe99278f2d646b..46cbe5907ec7734d20b6a37719ca49e7bbd014a3 100644
--- a/zh-cn/application-dev/faqs/faqs-ui-ets.md
+++ b/zh-cn/application-dev/faqs/faqs-ui-ets.md
@@ -1,12 +1,12 @@
-# UI框架(eTS)开发常见问题
+# UI框架(ArkTS)开发常见问题
-## TS语言在生成器函数中编译失败,有哪些使用限制?
+## ArkTS语言在生成器函数中编译失败,有哪些使用限制?
适用于:OpenHarmony SDK 3.2.5.3版本,API9 Stage模型
-TS语言的使用在生成器函数中存在以下限制:
+ArkTS语言的使用在生成器函数中存在以下限制:
- 表达式仅允许在字符串(${expression})、if条件、ForEach的参数和组件的参数中使用;
diff --git a/zh-cn/application-dev/media/audio-capturer.md b/zh-cn/application-dev/media/audio-capturer.md
index 6d37e14b6d39f0db6e47c0084e2b060289e99863..60318f711977e7f7001304c74166dd29222ba7e5 100644
--- a/zh-cn/application-dev/media/audio-capturer.md
+++ b/zh-cn/application-dev/media/audio-capturer.md
@@ -8,7 +8,7 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以
## 运作机制
-该模块提供了音频采集模块的状态变化示意图
+该模块提供了音频采集模块的状态变化示意图。
**图1** 音频采集状态变化示意图
diff --git a/zh-cn/application-dev/quick-start/arkts-state-mgmt-application-level.md b/zh-cn/application-dev/quick-start/arkts-state-mgmt-application-level.md
index 922b4715478f37d49ed18a7ed4e4c98d54a3f981..c4e7e7cf211265eb5837f7e2c8967aa6aaaa38ac 100644
--- a/zh-cn/application-dev/quick-start/arkts-state-mgmt-application-level.md
+++ b/zh-cn/application-dev/quick-start/arkts-state-mgmt-application-level.md
@@ -143,12 +143,28 @@ struct LocalStorageComponent {
@LocalStorageLink("storageSimpleProp") simpleVarName: number = 0
build() {
Column(){
- Text(this.simpleVarName.toString())
+ Button(`LocalStorageLink: ${ this.simpleVarName.toString() }`)
.onClick(()=>{
this.simpleVarName +=1;
})
Text(JSON.stringify(this.simpleVarName))
.fontSize(50)
+ LocalStorageComponentProp();
+ }
+ .height(500)
+ }
+}
+@Component
+struct LocalStorageComponentProp {
+ @LocalStorageProp("storageSimpleProp") simpleVarName: number = 0
+ build() {
+ Column() {
+ Button(`LocalStorageProp: ${ this.simpleVarName.toString() }`)
+ .onClick(() => {
+ this.simpleVarName += 1;
+ })
+ Text(JSON.stringify(this.simpleVarName))
+ .fontSize(50)
}
.height(500)
}
diff --git a/zh-cn/application-dev/reference/apis/js-apis-colorSpaceManager.md b/zh-cn/application-dev/reference/apis/js-apis-colorSpaceManager.md
index 0f881ebc86ce35fbf5b026f6714b627580a3afbd..8e1b9222850a83f8e9596a6314fbe1d6903ac51d 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-colorSpaceManager.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-colorSpaceManager.md
@@ -64,6 +64,14 @@ create(colorSpaceName: ColorSpace): ColorSpaceManager
| ------------------ | ------------------------ |
| [ColorSpaceManager](#colorspacemanager) | 返回当前创建的色域对象实例。 |
+**错误码:**
+
+以下错误码的详细介绍请参见[色彩管理错误码](../errorcodes/errorcode-colorspace-manager.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | ----------------------- |
+| 18600001 | Parameter value is abnormal. |
+
**示例:**
```js
@@ -96,6 +104,14 @@ create(primaries: ColorSpacePrimaries, gamma: number): ColorSpaceManager
| ------------------ | ------------------------ |
| [ColorSpaceManager](#colorspacemanager) | 返回当前创建的色域对象实例。 色域类型定义为[ColorSpace](#colorspace)枚举值`CUSTOM`。 |
+**错误码:**
+
+以下错误码的详细介绍请参见[色彩管理错误码](../errorcodes/errorcode-colorspace-manager.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | ----------------------- |
+| 18600001 | Parameter value is abnormal. |
+
**示例:**
```js
@@ -138,6 +154,14 @@ getColorSpaceName(): ColorSpace
| ------------------ | ------------------------ |
| [ColorSpace](#colorspace) | 返回色域类型枚举值。 |
+**错误码:**
+
+以下错误码的详细介绍请参见[色彩管理错误码](../errorcodes/errorcode-colorspace-manager.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | ----------------------- |
+| 18600001 | Parameter value is abnormal. |
+
**示例:**
```js
@@ -162,6 +186,14 @@ getWhitePoint(): Array\
| ------------------ | ------------------------ |
| Array\ | 返回色域白点值[x, y]。 |
+**错误码:**
+
+以下错误码的详细介绍请参见[色彩管理错误码](../errorcodes/errorcode-colorspace-manager.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | ----------------------- |
+| 18600001 | Parameter value is abnormal. |
+
**示例:**
```js
@@ -186,6 +218,14 @@ getGamma(): number
| ------------------ | ------------------------ |
| number | 返回色域gamma值。 |
+**错误码:**
+
+以下错误码的详细介绍请参见[色彩管理错误码](../errorcodes/errorcode-colorspace-manager.md)。
+
+| 错误码ID | 错误信息 |
+| ------- | ----------------------- |
+| 18600001 | Parameter value is abnormal. |
+
**示例:**
```js
diff --git a/zh-cn/application-dev/reference/apis/js-apis-display.md b/zh-cn/application-dev/reference/apis/js-apis-display.md
index 91d9a4e985f3e52912d1ebd31d70bcda83389d7c..16f4b444dfab57746ef9839190eade2c246007c7 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-display.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-display.md
@@ -89,8 +89,9 @@ getDefaultDisplaySync(): Display
**示例:**
```js
+let displayClass = null;
try {
- let displayClass = display.getDefaultDisplaySync();
+ displayClass = display.getDefaultDisplaySync();
} catch (exception) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
};
@@ -208,8 +209,9 @@ try {
return;
};
+let ret = undefined;
try {
- let ret = display.hasPrivateWindow(displayClass.id);
+ ret = display.hasPrivateWindow(displayClass.id);
} catch (exception) {
console.error('Failed to check has privateWindow or not. Code: ' + JSON.stringify(exception));
};
@@ -243,7 +245,7 @@ on(type: 'add'|'remove'|'change', callback: Callback<number>): void
```js
let callback = (data) => {
console.info('Listening enabled. Data: ' + JSON.stringify(data));
-}
+};
try {
display.on("add", callback);
} catch (exception) {
@@ -445,8 +447,9 @@ getCutoutInfo(callback: AsyncCallback<CutoutInfo>): void
**示例:**
```js
+let displayClass = null;
try {
- let displayClass = display.getDefaultDisplaySync();
+ displayClass = display.getDefaultDisplaySync();
} catch (exception) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
};
@@ -483,8 +486,9 @@ getCutoutInfo(): Promise<CutoutInfo>
**示例:**
```js
+let displayClass = null;
try {
- let displayClass = display.getDefaultDisplaySync();
+ displayClass = display.getDefaultDisplaySync();
} catch (exception) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(exception));
};
diff --git a/zh-cn/application-dev/reference/apis/js-apis-hiviewdfx-hiappevent.md b/zh-cn/application-dev/reference/apis/js-apis-hiviewdfx-hiappevent.md
index ed292c7470817d3eabed6dd4715f6cf07a06bd7b..ab79995e38e9bbcada9927895da534b52d0734c8 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-hiviewdfx-hiappevent.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-hiviewdfx-hiappevent.md
@@ -29,7 +29,7 @@ write(info: [AppEventInfo](#appeventinfo), callback: AsyncCallback<void>):
**错误码:**
-以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errcode-hiviewdfx-hiappevent.md)。
+以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errorcode-hiappevent.md)。
| 错误码ID | 错误信息 |
| -------- | --------------------------------------------- |
@@ -83,7 +83,7 @@ write(info: [AppEventInfo](#appeventinfo)): Promise<void>
**错误码:**
-以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errcode-hiviewdfx-hiappevent.md)。
+以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errorcode-hiappevent.md)。
| 错误码ID | 错误信息 |
| -------- | --------------------------------------------- |
@@ -142,7 +142,7 @@ configure(config: [ConfigOption](configoption)): void
**错误码:**
-以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errcode-hiviewdfx-hiappevent.md)。
+以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errorcode-hiappevent.md)。
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
@@ -195,7 +195,7 @@ addWatcher(watcher: [Watcher](#watcher)): [AppEventPackageHolder](#appeventpacka
**错误码:**
-以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errcode-hiviewdfx-hiappevent.md)。
+以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errorcode-hiappevent.md)。
| 错误码ID | 错误信息 |
| -------- | ------------------------------- |
@@ -272,7 +272,7 @@ removeWatcher(watcher: [Watcher](#watcher)): void
**错误码:**
-以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errcode-hiviewdfx-hiappevent.md)。
+以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errorcode-hiappevent.md)。
| 错误码ID | 错误信息 |
| -------- | --------------------- |
@@ -373,7 +373,7 @@ setSize(size: number): void
**错误码:**
-以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errcode-hiviewdfx-hiappevent.md)。
+以下错误码的详细介绍请参见[应用事件打点错误码](../errorcodes/errorcode-hiappevent.md)。
| 错误码ID | 错误信息 |
| -------- | ------------------- |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-request.md b/zh-cn/application-dev/reference/apis/js-apis-request.md
index c379b82a1b868a981002f162727565e9eb3dd773..7a2a4623d5e4aab2f9f49985e87d25e2d00c09ab 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-request.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-request.md
@@ -719,7 +719,7 @@ delete(callback: AsyncCallback<boolean>): void
**需要权限**:ohos.permission.INTERNET
-**系统能力**: 以下各项对应的系统能力均为SystemCapability.MiscServices.Upload。
+**系统能力**: 以下各项对应的系统能力均为SystemCapability.MiscServices.Download。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
@@ -733,7 +733,7 @@ delete(callback: AsyncCallback<boolean>): void
**需要权限**:ohos.permission.INTERNET
-**系统能力**: 以下各项对应的系统能力均为SystemCapability.MiscServices.Upload。
+**系统能力**: 以下各项对应的系统能力均为SystemCapability.MiscServices.Download。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-rpc.md b/zh-cn/application-dev/reference/apis/js-apis-rpc.md
index cb71165bcf0a072b15de827cf9621e30cf336672..e8b88c0404bbe9d0b477551168012e76de16f728 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-rpc.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-rpc.md
@@ -70,7 +70,7 @@ writeRemoteObject(object: [IRemoteObject](#iremoteobject)): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------- |
@@ -126,7 +126,7 @@ readRemoteObject(): IRemoteObject
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -183,7 +183,7 @@ writeInterfaceToken(token: string): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -217,7 +217,7 @@ readInterfaceToken(): string
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ----- |
@@ -328,7 +328,7 @@ setCapacity(size: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------ |
@@ -522,7 +522,7 @@ writeByte(val: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------- |
@@ -556,7 +556,7 @@ readByte(): number
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -597,7 +597,7 @@ writeShort(val: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------ |
@@ -631,7 +631,7 @@ readShort(): number
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -672,7 +672,7 @@ writeInt(val: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------- |
@@ -706,7 +706,7 @@ readInt(): number
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------- |
@@ -747,7 +747,7 @@ writeLong(val: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------- |
@@ -781,7 +781,7 @@ readLong(): number
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -822,7 +822,7 @@ writeFloat(val: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------- |
@@ -856,7 +856,7 @@ readFloat(): number
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -897,7 +897,7 @@ writeDouble(val: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -931,7 +931,7 @@ readDouble(): number
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -972,7 +972,7 @@ writeBoolean(val: boolean): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------- |
@@ -1006,7 +1006,7 @@ readBoolean(): boolean
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------- |
@@ -1047,7 +1047,7 @@ writeChar(val: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1081,7 +1081,7 @@ readChar(): number
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------ | --------- |
@@ -1122,7 +1122,7 @@ writeString(val: string): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1156,7 +1156,7 @@ readString(): string
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1197,7 +1197,7 @@ writeParcelable(val: Parcelable): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1250,7 +1250,7 @@ readParcelable(dataIn: Parcelable) : void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------- |
@@ -1306,7 +1306,7 @@ writeByteArray(byteArray: number[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1341,7 +1341,7 @@ readByteArray(dataIn: number[]) : void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1383,7 +1383,7 @@ readByteArray(): number[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------- |
@@ -1425,7 +1425,7 @@ writeShortArray(shortArray: number[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ----- | ----- |
@@ -1459,7 +1459,7 @@ readShortArray(dataIn: number[]) : void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------ | ------- |
@@ -1500,7 +1500,7 @@ readShortArray(): number[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------- |
@@ -1541,7 +1541,7 @@ writeIntArray(intArray: number[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ----- | --------- |
@@ -1575,7 +1575,7 @@ readIntArray(dataIn: number[]) : void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1616,7 +1616,7 @@ readIntArray(): number[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ----- | ------- |
@@ -1657,7 +1657,7 @@ writeLongArray(longArray: number[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ----- |
@@ -1691,7 +1691,7 @@ readLongArray(dataIn: number[]) : void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------ |
@@ -1732,7 +1732,7 @@ readLongArray(): number[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1773,7 +1773,7 @@ writeFloatArray(floatArray: number[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1807,7 +1807,7 @@ readFloatArray(dataIn: number[]) : void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1848,7 +1848,7 @@ readFloatArray(): number[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1889,7 +1889,7 @@ writeDoubleArray(doubleArray: number[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1923,7 +1923,7 @@ readDoubleArray(dataIn: number[]) : void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -1964,7 +1964,7 @@ readDoubleArray(): number[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2005,7 +2005,7 @@ writeBooleanArray(booleanArray: boolean[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2039,7 +2039,7 @@ readBooleanArray(dataIn: boolean[]) : void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2080,7 +2080,7 @@ readBooleanArray(): boolean[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2121,7 +2121,7 @@ writeCharArray(charArray: number[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------ |
@@ -2155,7 +2155,7 @@ readCharArray(dataIn: number[]) : void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2196,7 +2196,7 @@ readCharArray(): number[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2238,7 +2238,7 @@ writeStringArray(stringArray: string[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2272,7 +2272,7 @@ readStringArray(dataIn: string[]) : void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2313,7 +2313,7 @@ readStringArray(): string[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2348,7 +2348,7 @@ writeNoException(): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2399,7 +2399,7 @@ readException(): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2472,7 +2472,7 @@ writeParcelableArray(parcelableArray: Parcelable[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2528,7 +2528,7 @@ readParcelableArray(parcelableArray: Parcelable[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2588,7 +2588,7 @@ writeRemoteObjectArray(objectArray: IRemoteObject[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------- |
@@ -2644,7 +2644,7 @@ readRemoteObjectArray(objects: IRemoteObject[]): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2701,7 +2701,7 @@ readRemoteObjectArray(): IRemoteObject[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2792,7 +2792,7 @@ static dupFileDescriptor(fd: number) :number
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------- |
@@ -2866,7 +2866,7 @@ writeFileDescriptor(fd: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------ |
@@ -2904,7 +2904,7 @@ readFileDescriptor(): number
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -2948,7 +2948,7 @@ writeAshmem(ashmem: Ashmem): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------- |
@@ -2989,7 +2989,7 @@ readAshmem(): Ashmem
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -3061,7 +3061,7 @@ writeRawData(rawData: number[], size: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------ |
@@ -3103,7 +3103,7 @@ readRawData(size: number): number[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -5985,7 +5985,7 @@ registerDeathRecipient(recipient: DeathRecipient, flags: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -6031,7 +6031,7 @@ removeDeathRecipient(recipient: DeathRecipient, flags: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -6076,7 +6076,7 @@ getDescriptor(): string
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -6576,7 +6576,7 @@ registerDeathRecipient(recipient: DeathRecipient, flags: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -6688,7 +6688,7 @@ removeDeathRecipient(recipient: DeathRecipient, flags: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -6802,7 +6802,7 @@ getInterfaceDescriptor(): string
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------- |
@@ -8185,7 +8185,7 @@ getInterfaceDescriptor(): string
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -8578,7 +8578,7 @@ mapTypedAshmem(mapType: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | ------ |
@@ -8636,7 +8636,7 @@ mapReadAndWriteAshmem(): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -8688,7 +8688,7 @@ mapReadonlyAshmem(): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -8746,7 +8746,7 @@ setProtectionType(protectionType: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | ------- |
@@ -8812,7 +8812,7 @@ writeAshmem(buf: number[], size: number, offset: number): void
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| ------- | -------- |
@@ -8890,7 +8890,7 @@ readAshmem(size: number, offset: number): number[]
**错误码:**
-以下错误码的详细介绍请参见ohos.rpc错误码
+以下错误码的详细介绍请参见[ohos.rpc错误码](../errorcodes/errorcode-rpc.md)
| 错误码ID | 错误信息 |
| -------- | -------- |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-screen.md b/zh-cn/application-dev/reference/apis/js-apis-screen.md
index 52ba0e627bee0c69ed7503c55db4b4b9b569a296..b74622b0c97c213738f0cc25fd9dec2bc07d9baa 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-screen.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-screen.md
@@ -39,7 +39,7 @@ getAllScreens(callback: AsyncCallback<Array<Screen>>): void
**示例:**
```js
-var screenClass = null;
+let screenClass = null;
screen.getAllScreens((err, data) => {
if (err.code) {
console.error('Failed to get all screens . Cause: ' + JSON.stringify(err));
@@ -75,7 +75,7 @@ getAllScreens(): Promise<Array<Screen>>
**示例:**
```js
-var screenClass = null;
+let screenClass = null;
let promise = screen.getAllScreens();
promise.then((data) => {
screenClass = data[0];
diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-parameter.md b/zh-cn/application-dev/reference/apis/js-apis-system-parameter.md
index 6f9afe3b538b7d1e8406ba1bbac773e8ff77093f..8620a1959baeb13a4f132999b9b0668855f30b52 100755
--- a/zh-cn/application-dev/reference/apis/js-apis-system-parameter.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-system-parameter.md
@@ -6,6 +6,7 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> - 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+> - 本模块接口为系统接口。
> - 由于系统参数都是各个系统服务的内部信息和控制参数,每个系统参数都有各自不同的DAC和MAC访问控制权限,三方应用不能使用此类接口。
@@ -248,4 +249,4 @@ try {
}catch(e){
console.log("set unexpected error: " + e);
}
-```
\ No newline at end of file
+```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-parameterV9.md b/zh-cn/application-dev/reference/apis/js-apis-system-parameterV9.md
new file mode 100755
index 0000000000000000000000000000000000000000..ac0af056101318c670581788ca0d479aceaf02ca
--- /dev/null
+++ b/zh-cn/application-dev/reference/apis/js-apis-system-parameterV9.md
@@ -0,0 +1,238 @@
+# 系统参数
+
+系统参数(SystemParameter)是为各系统服务提供的简单易用的键值对访问接口,各个系统服务可以定义系统参数来描述该服务的状态信息,或者通过系统参数来改变系统服务的行为。其基本操作原语为get和set,通过get可以查询系统参数的值,通过set可以修改系统参数的值。
+详细的系统参数设计原理及定义可参考
+[系统参数](../../../device-dev/subsystems/subsys-boot-init-sysparam.md)。
+
+> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
+> - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
+> - 本模块接口为系统接口。
+> - 由于系统参数都是各个系统服务的内部信息和控制参数,每个系统参数都有各自不同的DAC和MAC访问控制权限,三方应用不能使用此类接口。
+
+## 导入模块
+
+```ts
+import systemparameter from '@ohos.systemParameterV9'
+```
+
+## systemparameter.getSync
+
+getSync(key: string, def?: string): string
+
+获取系统参数Key对应的值。
+
+**系统能力:** SystemCapability.Startup.SystemInfo
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| key | string | 是 | 待查询的系统参数Key。 |
+| def | string | 否 | 默认值。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| -------- | -------- |
+| string | 系统参数值,若key不存在,返回默认值。若未指定默认值,返回空字符串。 |
+
+**示例:**
+
+```ts
+try {
+ var info = systemparameter.getSync("const.ohos.apiversion");
+ console.log(JSON.stringify(info));
+}catch(e){
+ console.log("getSync unexpected error: " + e);
+}
+```
+
+## systemparameter.get
+
+get(key: string, callback: AsyncCallback<string>): void
+
+获取系统参数Key对应的值。
+
+**系统能力:** SystemCapability.Startup.SystemInfo
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| key | string | 是 | 待查询的系统参数Key。 |
+| callback | AsyncCallback<string> | 是 | 回调函数。 |
+
+**示例:**
+
+```ts
+try {
+ systemparameter.get("const.ohos.apiversion", function (err, data) {
+ if (err == undefined) {
+ console.log("get test.parameter.key value success:" + data)
+ } else {
+ console.log(" get test.parameter.key value err:" + err.code)
+ }});
+}catch(e){
+ console.log("get unexpected error: " + e);
+}
+```
+
+## systemparameter.get
+
+get(key: string, def: string, callback: AsyncCallback<string>): void
+
+获取系统参数Key对应的值。
+
+**系统能力:** SystemCapability.Startup.SystemInfo
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| key | string | 是 | 待查询的系统参数Key。 |
+| def | string | 是 | 默认值。 |
+| callback | AsyncCallback<string> | 是 | 回调函数。 |
+
+**示例:**
+
+```ts
+try {
+ systemparameter.get("const.ohos.apiversion", "default", function (err, data) {
+ if (err == undefined) {
+ console.log("get test.parameter.key value success:" + data)
+ } else {
+ console.log(" get test.parameter.key value err:" + err.code)
+ }
+ });
+}catch(e){
+ console.log("get unexpected error:" + e)
+}
+```
+
+## systemparameter.get
+
+get(key: string, def?: string): Promise<string>
+
+获取系统参数Key对应的值。
+
+**系统能力:** SystemCapability.Startup.SystemInfo
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| key | string | 是 | 待查询的系统参数Key。 |
+| def | string | 否 | 默认值。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| -------- | -------- |
+| Promise<string> | Promise示例,用于异步获取结果。 |
+
+**示例:**
+
+```ts
+try {
+ var p = systemparameter.get("const.ohos.apiversion");
+ p.then(function (value) {
+ console.log("get test.parameter.key success: " + value);
+ }).catch(function (err) {
+ console.log("get test.parameter.key error: " + err.code);
+ });
+}catch(e){
+ console.log("get unexpected error: " + e);
+}
+```
+
+## systemparameter.setSync
+
+setSync(key: string, value: string): void
+
+设置系统参数Key对应的值。
+
+**系统能力:** SystemCapability.Startup.SystemInfo
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| key | string | 是 | 待设置的系统参数Key。 |
+| value | string | 是 | 待设置的系统参数值。 |
+
+**示例:**
+
+```ts
+try {
+ systemparameter.setSync("test.parameter.key", "default");
+}catch(e){
+ console.log("set unexpected error: " + e);
+}
+```
+
+## systemparameter.set
+
+set(key: string, value: string, callback: AsyncCallback<void>): void
+
+设置系统参数Key对应的值。
+
+**系统能力:** SystemCapability.Startup.SystemInfo
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| key | string | 是 | 待设置的系统参数Key。 |
+| value | string | 是 | 待设置的系统参数值。 |
+| callback | AsyncCallback<void> | 是 | 回调函数。 |
+
+**示例:**
+
+```ts
+try {
+ systemparameter.set("test.parameter.key", "testValue", function (err, data) {
+ if (err == undefined) {
+ console.log("set test.parameter.key value success :" + data)
+ } else {
+ console.log("set test.parameter.key value err:" + err.code)
+ }});
+}catch(e){
+ console.log("set unexpected error: " + e);
+}
+```
+
+## systemparameter.set
+
+set(key: string, value: string): Promise<void>
+
+设置系统参数Key对应的值。
+
+**系统能力:** SystemCapability.Startup.SystemInfo
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| key | string | 是 | 待设置的系统参数Key。 |
+| value| string | 是 | 待设置的系统参数值。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| -------- | -------- |
+| Promise<void> | Promise示例,用于异步获取结果。 |
+
+**示例:**
+
+```ts
+try {
+ var p = systemparameter.set("test.parameter.key", "testValue");
+ p.then(function (value) {
+ console.log("set test.parameter.key success: " + value);
+ }).catch(function (err) {
+ console.log(" set test.parameter.key error: " + err.code);
+ });
+}catch(e){
+ console.log("set unexpected error: " + e);
+}
+```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-webview.md b/zh-cn/application-dev/reference/apis/js-apis-webview.md
index 8ec9190d5a4c6a98f21255d9e36bf9495198c309..fdaaf855c584ebb1d34038f0155893bb32afb27f 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-webview.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-webview.md
@@ -10,12 +10,14 @@
>
> - 示例效果请以真机运行为准,当前IDE预览器不支持。
+## 需要权限
+访问在线网页时需添加网络权限:ohos.permission.INTERNET,具体申请方式请参考[权限申请声明](../../security/accesstoken-guidelines.md)。
+
## 导入模块
```ts
import web_webview from '@ohos.web.webview';
```
-
## WebMessagePort
通过WebMessagePort可以进行消息的发送以及接收。
@@ -26,7 +28,8 @@ close(): void
关闭该信息端口。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**示例:**
@@ -58,7 +61,8 @@ postMessageEvent(message: string): void
发送消息。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -110,7 +114,8 @@ onMessageEvent(callback: (result: string) => void): void
注册回调函数,接收HTML5侧发送过来的消息。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -173,7 +178,8 @@ loadUrl(url: string | Resource, headers?: Array\): void
加载指定的URL。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -225,7 +231,8 @@ loadData(data: string, mimeType: string, encoding: string, baseUrl?: string, his
加载指定的数据。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -248,7 +255,7 @@ loadData(data: string, mimeType: string, encoding: string, baseUrl?: string, his
**示例:**
- ```ts
+```ts
// xxx.ets
import web_webview from '@ohos.web.webview'
@@ -275,7 +282,7 @@ struct WebComponent {
}
}
}
- ```
+```
### accessforward
@@ -283,7 +290,8 @@ accessForward(): boolean
当前页面是否可前进,即当前页面是否有前进历史记录。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**返回值:**
@@ -301,7 +309,7 @@ accessForward(): boolean
**示例:**
- ```ts
+```ts
// xxx.ets
import web_webview from '@ohos.web.webview'
@@ -325,7 +333,52 @@ struct WebComponent {
}
}
}
- ```
+```
+
+### forward
+
+forward(): void
+
+按照历史栈,前进一个页面。一般结合accessForward一起使用。
+
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
+**错误码**:
+
+以下错误码的详细介绍请参见 [webview错误码](../errorcodes/errorcode-webview.md)
+
+| 错误码ID | 错误信息 |
+| -------- | ------------------------------------------------------------ |
+| 17100001 | Init error. The WebviewController must be associated with a Web component. |
+| 17100007 | Invalid back or forward operation. |
+
+**示例:**
+
+```ts
+// xxx.ets
+import web_webview from '@ohos.web.webview'
+
+@Entry
+@Component
+struct WebComponent {
+ controller: web_webview.WebviewController = new web_webview.WebviewController();
+
+ build() {
+ Column() {
+ Button('forward')
+ .onClick(() => {
+ try {
+ this.controller.forward();
+ } catch (error) {
+ console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
+ }
+ })
+ Web({ src: 'www.example.com', controller: this.controller })
+ }
+ }
+}
+```
### accessBackward
@@ -333,9 +386,8 @@ accessBackward(): boolean
当前页面是否可后退,即当前页面是否有返回历史记录。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**返回值:**
@@ -379,15 +431,59 @@ struct WebComponent {
}
```
+### backward
+
+backward(): void
+
+按照历史栈,后退一个页面。一般结合accessBackward一起使用。
+
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
+**错误码**:
+
+以下错误码的详细介绍请参见 [webview错误码](../errorcodes/errorcode-webview.md)
+
+| 错误码ID | 错误信息 |
+| -------- | ------------------------------------------------------------ |
+| 17100001 | Init error. The WebviewController must be associated with a Web component. |
+| 17100007 | Invalid back or forward operation. |
+
+**示例:**
+
+```ts
+// xxx.ets
+import web_webview from '@ohos.web.webview'
+
+@Entry
+@Component
+struct WebComponent {
+ controller: web_webview.WebviewController = new web_webview.WebviewController();
+
+ build() {
+ Column() {
+ Button('backward')
+ .onClick(() => {
+ try {
+ this.controller.backward();
+ } catch (error) {
+ console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
+ }
+ })
+ Web({ src: 'www.example.com', controller: this.controller })
+ }
+ }
+}
+```
+
### onActive
onActive(): void
调用此接口通知Web组件进入前台激活状态。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**错误码:**
@@ -430,9 +526,8 @@ onInactive(): void
调用此接口通知Web组件进入未激活状态。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**错误码:**
@@ -470,13 +565,12 @@ struct WebComponent {
```
### refresh
-refresh()
+refresh(): void
调用此接口通知Web组件刷新网页。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**错误码:**
@@ -519,9 +613,8 @@ accessStep(step: number): boolean
当前页面是否可前进或者后退给定的step步。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -578,9 +671,8 @@ clearHistory(): void
删除所有前进后退记录。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**错误码:**
@@ -623,9 +715,8 @@ getHitTest(): HitTestTypeV9
获取当前被点击区域的元素类型。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**返回值:**
@@ -671,13 +762,12 @@ struct WebComponent {
### registerJavaScriptProxy
-registerJavaScriptProxy(object: object, name: string, methodList: Array\)
+registerJavaScriptProxy(object: object, name: string, methodList: Array\): void
注入JavaScript对象到window对象中,并在window对象中调用该对象的方法。注册后,须调用[refresh](#refresh)接口生效。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -737,9 +827,8 @@ runJavaScript(script: string, callback : AsyncCallback\): void
异步执行JavaScript脚本,并通过回调方式返回脚本执行的结果。runJavaScript需要在loadUrl完成后,比如onPageEnd中调用。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -802,9 +891,8 @@ runJavaScript(script: string): Promise\
异步执行JavaScript脚本,并通过Promise方式返回脚本执行的结果。runJavaScript需要在loadUrl完成后,比如onPageEnd中调用。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -864,13 +952,12 @@ struct WebComponent {
### deleteJavaScriptRegister
-deleteJavaScriptRegister(name: string)
+deleteJavaScriptRegister(name: string): void
删除通过registerJavaScriptProxy注册到window上的指定name的应用侧JavaScript对象。删除后立即生效,无须调用[refresh](#refresh)接口。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -921,9 +1008,8 @@ zoom(factor: number): void
调整当前网页的缩放比例。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -975,9 +1061,8 @@ searchAllAsync(searchString: string): void
异步查找网页中所有匹配关键字'searchString'的内容并高亮,结果通过[onSearchResultReceive](../arkui-ts/ts-basic-components-web.md#onsearchresultreceive9)异步返回。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -1031,9 +1116,8 @@ clearMatches(): void
清除所有通过[searchAllAsync](#searchallasync)匹配到的高亮字符查找结果。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**错误码:**
@@ -1076,9 +1160,8 @@ searchNext(forward: boolean): void
滚动到下一个匹配的查找结果并高亮。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -1127,9 +1210,8 @@ clearSslCache(): void
清除Web组件记录的SSL证书错误事件对应的用户操作行为。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**错误码:**
@@ -1172,9 +1254,8 @@ clearClientAuthenticationCache(): void
清除Web组件记录的客户端证书请求事件对应的用户操作行为。
-**需要权限:**
-
-ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**错误码:**
@@ -1217,7 +1298,8 @@ struct WebComponent {
创建Web信息端口。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**返回值:**
@@ -1268,7 +1350,8 @@ postMessage(name: string, ports: Array\, uri: string): void
发送Web信息端口到HTML5。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -1357,10 +1440,13 @@ function PostWebMsg(data) {
### requestFocus
-requestFocus():void
+requestFocus(): void
使当前web页面获取焦点。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**错误码**:
以下错误码的详细介绍请参见 [webview错误码](../errorcodes/errorcode-webview.md)
@@ -1402,6 +1488,9 @@ zoomIn(): void
调用此接口将当前网页进行放大,比例为20%。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**错误码**:
以下错误码的详细介绍请参见 [webview错误码](../errorcodes/errorcode-webview.md)
@@ -1445,6 +1534,9 @@ zoomOut(): void
调用此接口将当前网页进行缩小,比例为20%。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**错误码**:
以下错误码的详细介绍请参见 [webview错误码](../errorcodes/errorcode-webview.md)
@@ -1488,6 +1580,9 @@ getHitTestValue(): HitTestValue
获取当前被点击区域的元素信息。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**返回值:**
| 类型 | 说明 |
@@ -1537,6 +1632,9 @@ getWebId(): number
获取当前Web组件的索引值,用于多个Web组件的管理。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**返回值:**
| 类型 | 说明 |
@@ -1585,6 +1683,9 @@ getUserAgent(): string
获取当前默认用户代理。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**返回值:**
| 类型 | 说明 |
@@ -1633,6 +1734,9 @@ getTitle(): string
获取文件选择器标题。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**返回值:**
| 类型 | 说明 |
@@ -1681,6 +1785,9 @@ getPageHeight(): number
获取当前网页的页面高度。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**返回值:**
| 类型 | 说明 |
@@ -1729,6 +1836,9 @@ storeWebArchive(baseName: string, autoName: boolean, callback: AsyncCallback\
以Promise方式异步保存当前页面。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
@@ -1850,6 +1963,9 @@ getUrl(): string
获取当前页面的url地址。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**返回值:**
| 类型 | 说明 |
@@ -1894,10 +2010,13 @@ struct WebComponent {
### stop
-stop():void
+stop(): void
停止页面加载。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**错误码**:
以下错误码的详细介绍请参见 [webview错误码](../errorcodes/errorcode-webview.md)
@@ -1939,6 +2058,9 @@ backOrForward(step: number): void
按照历史栈,前进或者后退指定步长的页面,当历史栈中不存在对应步长的页面时,不会进行页面跳转。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
@@ -1992,7 +2114,8 @@ static getCookie(url: string): string
获取指定url对应cookie的值。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2047,7 +2170,8 @@ static setCookie(url: string, value: string): void
为指定url设置单个cookie的值。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2100,17 +2224,18 @@ struct WebComponent {
### saveCookieAsync
-static saveCookieAsync(callback: AsyncCallback\): void
+static saveCookieAsync(callback: AsyncCallback\): void
将当前存在内存中的cookie异步保存到磁盘中。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
| -------- | ---------------------- | ---- | ------ | :------------------------------------------------- |
-| callback | AsyncCallback\ | 是 | - | 返回cookie是否成功保存的布尔值作为回调函数的入参。 |
+| callback | AsyncCallback\ | 是 | - | 返回cookie是否成功保存的布尔值作为回调函数的入参。 |
**示例:**
@@ -2129,9 +2254,11 @@ struct WebComponent {
Button('saveCookieAsync')
.onClick(() => {
try {
- web_webview.WebCookieManager.saveCookieAsync(function (result) {
- console.log("result: " + result);
- });
+ web_webview.WebCookieManager.saveCookieAsync((error) => {
+ if (error) {
+ console.log("error: " + error);
+ }
+ })
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
@@ -2144,17 +2271,18 @@ struct WebComponent {
### saveCookieAsync
-static saveCookieAsync(): Promise\
+static saveCookieAsync(): Promise\
将当前存在内存中的cookie以Promise方法异步保存到磁盘中。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**返回值:**
| 类型 | 说明 |
| ---------------- | ----------------------------------------- |
-| Promise\ | Promise实例,用于获取cookie是否成功保存。 |
+| Promise\ | Promise实例,用于获取cookie是否成功保存。 |
**示例:**
@@ -2173,10 +2301,10 @@ struct WebComponent {
.onClick(() => {
try {
web_webview.WebCookieManager.saveCookieAsync()
- .then(function (result) {
- console.log("result: " + result);
+ .then(() => {
+ console.log("saveCookieAsyncCallback success!");
})
- .catch(function (error) {
+ .catch((error) => {
console.error("error: " + error);
});
} catch (error) {
@@ -2195,7 +2323,8 @@ static putAcceptCookieEnabled(accept: boolean): void
设置WebCookieManager实例是否拥有发送和接收cookie的权限。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2236,7 +2365,8 @@ static isCookieAllowed(): boolean
获取WebCookieManager实例是否拥有发送和接收cookie的权限。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**返回值:**
@@ -2274,7 +2404,8 @@ static putAcceptThirdPartyCookieEnabled(accept: boolean): void
设置WebCookieManager实例是否拥有发送和接收第三方cookie的权限。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2315,7 +2446,8 @@ static isThirdPartyCookieAllowed(): boolean
获取WebCookieManager实例是否拥有发送和接收第三方cookie的权限。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**返回值:**
@@ -2353,7 +2485,8 @@ static existCookie(): boolean
获取是否存在cookie。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**返回值:**
@@ -2391,7 +2524,8 @@ static deleteEntireCookie(): void
清除所有cookie。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**示例:**
@@ -2422,7 +2556,8 @@ static deleteSessionCookie(): void
清除所有会话cookie。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**示例:**
@@ -2457,7 +2592,8 @@ static deleteOrigin(origin : string): void
清除指定源所使用的存储。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2509,7 +2645,8 @@ static getOrigins(callback: AsyncCallback\>) : void
以回调方式异步获取当前使用Web SQL数据库的所有源的信息。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2570,7 +2707,8 @@ static getOrigins() : Promise\>
以Promise方式异步获取当前使用Web SQL数据库的所有源的信息。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**返回值:**
@@ -2631,7 +2769,8 @@ static getOriginQuota(origin : string, callback : AsyncCallback\) : void
使用callback回调异步获取指定源的Web SQL数据库的存储配额,配额以字节为单位。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2690,7 +2829,8 @@ static getOriginQuota(origin : string) : Promise\
以Promise方式异步获取指定源的Web SQL数据库的存储配额,配额以字节为单位。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2754,7 +2894,8 @@ static getOriginUsage(origin : string, callback : AsyncCallback\) : void
以回调方式异步获取指定源的Web SQL数据库的存储量,存储量以字节为单位。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2813,7 +2954,8 @@ static getOriginUsage(origin : string) : Promise\
以Promise方式异步获取指定源的Web SQL数据库的存储量,存储量以字节为单位。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2877,7 +3019,8 @@ static deleteAllData(): void
清除Web SQL数据库当前使用的所有存储。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**示例:**
@@ -2913,11 +3056,12 @@ web组件数据库管理对象。
### getHttpAuthCredentials
-static getHttpAuthCredentials(host: string, realm: string): Array
+static getHttpAuthCredentials(host: string, realm: string): Array\
检索给定主机和域的HTTP身份验证凭据,该方法为同步方法。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -2930,7 +3074,7 @@ static getHttpAuthCredentials(host: string, realm: string): Array
| 类型 | 说明 |
| ----- | -------------------------------------------- |
-| Array | 包含用户名和密码的组数,检索失败返回空数组。 |
+| Array\ | 包含用户名和密码的组数,检索失败返回空数组。 |
**示例:**
@@ -2972,7 +3116,8 @@ static saveHttpAuthCredentials(host: string, realm: string, username: string, pa
保存给定主机和域的HTTP身份验证凭据,该方法为同步方法。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -3018,7 +3163,8 @@ static existHttpAuthCredentials(): boolean
判断是否存在任何已保存的HTTP身份验证凭据,该方法为同步方法。存在返回true,不存在返回false。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**返回值:**
@@ -3059,7 +3205,8 @@ static deleteHttpAuthCredentials(): void
清除所有已保存的HTTP身份验证凭据,该方法为同步方法。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**示例:**
@@ -3098,7 +3245,8 @@ static allowGeolocation(origin: string): void
允许指定来源使用地理位置接口。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -3147,7 +3295,8 @@ static deleteGeolocation(origin: string): void
清除指定来源的地理位置权限状态。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -3197,7 +3346,8 @@ static getAccessibleGeolocation(origin: string, callback: AsyncCallback\
以Promise方式异步获取指定源的地理位置权限状态。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
@@ -3313,7 +3466,8 @@ static getStoredGeolocation(callback: AsyncCallback\>): void
以回调方式异步获取已存储地理位置权限状态的所有源信息。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**参数:**
@@ -3361,6 +3515,9 @@ static getStoredGeolocation(): Promise\>
以Promise方式异步获取已存储地理位置权限状态的所有源信息。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
**返回值:**
| 类型 | 说明 |
@@ -3406,7 +3563,8 @@ static deleteAllGeolocation(): void
清除所有来源的地理位置权限状态。
-**需要权限**:ohos.permission.INTERNET
+**系统能力:**
+SystemCapability.Web.Webview.Core
**示例:**
@@ -3453,6 +3611,7 @@ Web组件返回的请求/响应头对象。
| HttpAnchorImg | 带有超链接的图片,其中超链接的src为http。 |
| Img | HTML::img标签。 |
| Map | 地理地址。 |
+| Phone | 电话号码。 |
| Unknown | 未知内容。 |
## HitTestValue
@@ -3468,6 +3627,9 @@ Web组件返回的请求/响应头对象。
提供Web SQL数据库的使用信息。
+**系统能力:**
+SystemCapability.Web.Webview.Core
+
| 名称 | 类型 | 必填 | 说明 |
| ------ | ------ | :--- | -------------------- |
| origin | string | 是 | 指定源的字符串索引。 |
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 126504770692cb365ca69305bb4cf6896ad3481b..1007f7883d67e91b197f5b674c8c54abbb234402 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-window.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-window.md
@@ -592,6 +592,7 @@ minimizeAll(id: number): Promise<void>
import display from '@ohos.display'
import window from '@ohos.window'
+let displayClass = null;
try {
displayClass = display.getDefaultDisplaySync();
} catch (exception) {
@@ -923,7 +924,7 @@ create(ctx: BaseContext, id: string, type: WindowType, callback: AsyncCallback&l
```js
let windowClass = null;
- window.create(this.context, 'alertWindow', window.WindowType.TYPE_SYSTEM_ALERT, (err, data) => {
+window.create(this.context, 'alertWindow', window.WindowType.TYPE_SYSTEM_ALERT, (err, data) => {
if (err.code) {
console.error('Failed to create the window. Cause: ' + JSON.stringify(err));
return;
@@ -998,13 +999,13 @@ find(id: string, callback: AsyncCallback<Window>): void
```js
let windowClass = null;
- window.find('alertWindow', (err, data) => {
- if (err.code) {
- console.error('Failed to find the Window. Cause: ' + JSON.stringify(err));
- return;
- }
- windowClass = data;
- console.info('Succeeded in finding the window. Data: ' + JSON.stringify(data));
+window.find('alertWindow', (err, data) => {
+ if (err.code) {
+ console.error('Failed to find the Window. Cause: ' + JSON.stringify(err));
+ return;
+ }
+ windowClass = data;
+ console.info('Succeeded in finding the window. Data: ' + JSON.stringify(data));
});
```
@@ -1038,7 +1039,7 @@ find(id: string): Promise<Window>
let windowClass = null;
let promise = window.find('alertWindow');
promise.then((data)=> {
- windowClass = data;
+ windowClass = data;
console.info('Succeeded in finding the window. Data: ' + JSON.stringify(data));
}).catch((err)=>{
console.error('Failed to find the Window. Cause: ' + JSON.stringify(err));
@@ -1105,7 +1106,7 @@ getTopWindow(): Promise<Window>
let windowClass = null;
let promise = window.getTopWindow();
promise.then((data)=> {
- windowClass = data;
+ windowClass = data;
console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data));
}).catch((err)=>{
console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err));
@@ -2348,25 +2349,20 @@ loadContent(path: string, storage: LocalStorage, callback: AsyncCallback<void
**示例:**
```ts
-class myAbility extends Ability {
- storage : LocalStorage
- onWindowStageCreate(windowStage) {
- this.storage = new LocalStorage();
- this.storage.setOrCreate('storageSimpleProp',121);
- console.log('onWindowStageCreate');
- try {
- windowStage.loadContent('pages/page2',this.storage,(err) => {
- if (err.code) {
- console.error('Failed to load the content. Cause:' + JSON.stringify(err));
- return;
- }
- console.info('Succeeded in loading the content.');
- });
- } catch (exception) {
- console.error('Failed to load the content. Cause:' + JSON.stringify(exception));
- };
- }
-}
+let storage = new LocalStorage();
+storage.setOrCreate('storageSimpleProp',121);
+console.log('onWindowStageCreate');
+try {
+ windowClass.loadContent('pages/page2', storage, (err) => {
+ if (err.code) {
+ console.error('Failed to load the content. Cause:' + JSON.stringify(err));
+ return;
+ }
+ console.info('Succeeded in loading the content.');
+ });
+} catch (exception) {
+ console.error('Failed to load the content. Cause:' + JSON.stringify(exception));
+};
```
### loadContent9+
@@ -2404,26 +2400,19 @@ loadContent(path: string, storage: LocalStorage): Promise<void>
**示例:**
```ts
-class myAbility extends Ability {
- storage : LocalStorage
- onWindowStageCreate(windowStage) {
- this.storage = new LocalStorage();
- this.storage.setOrCreate('storageSimpleProp',121);
- console.log('onWindowStageCreate');
- let windowClass = null;
- try {
- let promise = windowStage.loadContent('pages/page2',this.storage);
- promise.then(()=> {
- windowClass = data;
- console.info('Succeeded in loading the content.');
- }).catch((err)=>{
- console.error('Failed to load the content. Cause:' + JSON.stringify(err));
- });
- } catch (exception) {
- console.error('Failed to load the content. Cause:' + JSON.stringify(exception));
- };
- }
-}
+let storage = new LocalStorage();
+storage.setOrCreate('storageSimpleProp',121);
+console.log('onWindowStageCreate');
+try {
+ let promise = windowClass.loadContent('pages/page2', storage);
+ promise.then(() => {
+ console.info('Succeeded in loading the content.');
+ }).catch((err) => {
+ console.error('Failed to load the content. Cause:' + JSON.stringify(err));
+ });
+} catch (exception) {
+ console.error('Failed to load the content. Cause:' + JSON.stringify(exception));
+};
```
### isWindowShowing9+
@@ -2719,7 +2708,7 @@ off(type: 'screenshot', callback?: Callback<void>): void
```js
let callback = ()=>{
console.info('screenshot happened');
-}
+};
try {
windowClass.on('screenshot', callback);
} catch (exception) {
@@ -3745,13 +3734,13 @@ snapshot(callback: AsyncCallback<image.PixelMap>): void
**示例:**
```js
-windowClass.snapshot((err, data) => {
+windowClass.snapshot((err, pixelMap) => {
if (err.code) {
console.error('Failed to snapshot window. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in snapshotting window. Pixel bytes number: ' + pixelMap.getPixelBytesNumber());
- data.release(); // PixelMap使用完后及时释放内存
+ pixelMap.release(); // PixelMap使用完后及时释放内存
});
```
@@ -3855,9 +3844,9 @@ scale(scaleOptions: ScaleOptions): void
let obj : window.ScaleOptions = {
x : 2.0,
y : 1.0,
- pivotX = 0.5;
- pivotY = 0.5;
-}
+ pivotX : 0.5,
+ pivotY : 0.5
+};
try {
windowClass.scale(obj);
} catch (exception) {
@@ -3897,9 +3886,9 @@ let obj : window.RotateOptions = {
x : 1.0,
y : 1.0,
z : 45.0,
- pivotX = 0.5;
- pivotY = 0.5;
-}
+ pivotX : 0.5,
+ pivotY : 0.5
+};
try {
windowClass.rotate(obj);
} catch (exception) {
@@ -3939,7 +3928,7 @@ let obj : window.TranslateOptions = {
x : 100.0,
y : 0.0,
z : 0.0
-}
+};
try {
windowClass.translate(obj);
} catch (exception) {
@@ -3977,7 +3966,7 @@ try {
```js
let controller = windowClass.getTransitionController(); // 获取属性转换控制器
controller.animationForHidden = (context : window.TransitionContext) => {
- let toWindow = context.toWindow
+ let toWindow = context.toWindow;
animateTo({
duration: 1000, // 动画时长
tempo: 0.5, // 播放速率
@@ -3993,7 +3982,7 @@ controller.animationForHidden = (context : window.TransitionContext) => {
x : 100.0,
y : 0.0,
z : 0.0
- }
+ };
toWindow.translate(obj); // 设置动画过程中的属性转换
console.info('toWindow translate end');
}
@@ -4108,7 +4097,7 @@ setBackdropBlurStyle(blurStyle: BlurStyle): void
```js
try {
- windowClass.setBackdropBlurStyle(window.BlurType.THIN);
+ windowClass.setBackdropBlurStyle(window.BlurStyle.THIN);
} catch (exception) {
console.error('Failed to set backdrop blur style. Cause: ' + JSON.stringify(exception));
};
@@ -6525,7 +6514,7 @@ completeTransition(isCompleted: boolean): void
```js
let controller = windowClass.getTransitionController();
controller.animationForShown = (context : window.TransitionContext) => {
- let toWindow = context.toWindow
+ let toWindow = context.toWindow;
animateTo({
duration: 1000, // 动画时长
tempo: 0.5, // 播放速率
@@ -6538,7 +6527,7 @@ controller.animationForShown = (context : window.TransitionContext) => {
x : 100.0,
y : 0.0,
z : 0.0
- }
+ };
toWindow.translate(obj);
console.info('toWindow translate end');
}
@@ -6577,7 +6566,7 @@ animationForShown(context: TransitionContext): void
```js
let controller = windowClass.getTransitionController();
controller.animationForShown = (context : window.TransitionContext) => {
- let toWindow = context.toWindow
+ let toWindow = context.toWindow;
animateTo({
duration: 1000, // 动画时长
tempo: 0.5, // 播放速率
@@ -6593,7 +6582,7 @@ controller.animationForShown = (context : window.TransitionContext) => {
x : 100.0,
y : 0.0,
z : 0.0
- }
+ };
toWindow.translate(obj);
console.info('toWindow translate end');
}
@@ -6623,7 +6612,7 @@ animationForHidden(context: TransitionContext): void
```js
let controller = windowClass.getTransitionController();
controller.animationForHidden = (context : window.TransitionContext) => {
- let toWindow = context.toWindow
+ let toWindow = context.toWindow;
animateTo({
duration: 1000, // 动画时长
tempo: 0.5, // 播放速率
@@ -6639,7 +6628,7 @@ controller.animationForHidden = (context : window.TransitionContext) => {
x : 100.0,
y : 0.0,
z : 0.0
- }
+ };
toWindow.translate(obj);
console.info('toWindow translate end');
}
diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image2_0000001219982725.PNG b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image2_0000001219982725.PNG
new file mode 100644
index 0000000000000000000000000000000000000000..310eae1cbaec0f37b61787a9cfa6ddf032c887d4
Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/zh-cn_image2_0000001219982725.PNG differ
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md
index b0b05888b5a30ad76e80b507449d9f84428586ac..cfc799864db233086458ac6106bc3670b4d4e12b 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md
@@ -16,7 +16,7 @@
## 接口
-Web(options: { src: ResourceStr, controller: WebController })
+Web(options: { src: ResourceStr, controller: WebController | WebviewController})
> **说明:**
>
@@ -27,7 +27,7 @@ Web(options: { src: ResourceStr, controller: WebController })
| 参数名 | 参数类型 | 必填 | 参数描述 |
| ---------- | ------------------------------- | ---- | ------- |
| src | [ResourceStr](ts-types.md) | 是 | 网页资源地址。 |
-| controller | [WebController](#webcontroller) | 否 | 控制器。 |
+| controller | [WebController](#webcontroller) 或 [WebviewController](../apis/js-apis-webview.md#webviewcontroller) |是 | 控制器。 |
**示例:**
@@ -45,6 +45,21 @@ Web(options: { src: ResourceStr, controller: WebController })
}
}
```
+ ```ts
+ // xxx.ets
+ import web_webview from '@ohos.web.webview'
+
+ @Entry
+ @Component
+ struct WebComponent {
+ controller: web_webview.WebviewController = new web_webview.WebviewController();
+ build() {
+ Column() {
+ Web({ src: 'www.example.com', controller: this.controller })
+ }
+ }
+ }
+ ```
加载本地网页
```ts
@@ -193,7 +208,7 @@ imageAccess(imageAccess: boolean)
### javaScriptProxy
javaScriptProxy(javaScriptProxy: { object: object, name: string, methodList: Array\,
- controller: WebController })
+ controller: WebController | WebviewController})
注入JavaScript对象到window对象中,并在window对象中调用该对象的方法。所有参数不支持更新。
@@ -204,7 +219,7 @@ javaScriptProxy(javaScriptProxy: { object: object, name: string, methodList: Arr
| object | object | 是 | - | 参与注册的对象。只能声明方法,不能声明属性。 |
| name | string | 是 | - | 注册对象的名称,与window中调用的对象名一致。 |
| methodList | Array\ | 是 | - | 参与注册的应用侧JavaScript对象的方法。 |
-| controller | [WebController](#webcontroller) | 否 | - | 控制器。 |
+| controller | [WebController](#webcontroller) 或 [WebviewController](../apis/js-apis-webview.md#webviewcontroller) | 是 | - | 控制器。 |
**示例:**
@@ -239,6 +254,39 @@ javaScriptProxy(javaScriptProxy: { object: object, name: string, methodList: Arr
}
}
```
+ ```ts
+ // xxx.ets
+ import web_webview from '@ohos.web.webview'
+
+ @Entry
+ @Component
+ struct WebComponent {
+ controller: web_webview.WebviewController = new web_webview.WebviewController();
+ testObj = {
+ test: (data1, data2, data3) => {
+ console.log("data1:" + data1);
+ console.log("data2:" + data2);
+ console.log("data3:" + data3);
+ return "AceString";
+ },
+ toString: () => {
+ console.log('toString' + "interface instead.");
+ }
+ }
+ build() {
+ Column() {
+ Web({ src: 'www.example.com', controller: this.controller })
+ .javaScriptAccess(true)
+ .javaScriptProxy({
+ object: this.testObj,
+ name: "objName",
+ methodList: ["test", "toString"],
+ controller: this.controller,
+ })
+ }
+ }
+ }
+ ```
### javaScriptAccess
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md
index 0f6a52a9b060be178339cc7c8002606484bccd23..e4a0722bda929988aa717c14e98c8bd5b806917f 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md
@@ -27,8 +27,8 @@ Grid(scroller?: Scroller)
| 名称 | 参数类型 | 描述 |
| -------- | -------- | -------- |
-| columnsTemplate | string | 设置当前网格布局列的数量,不设置时默认1列。 例如, '1fr 1fr 2fr' 是将父组件分3列,将父组件允许的宽分为4等份,第一列占1份,第二列占1份,第三列占2份。 默认值:'1fr' |
-| rowsTemplate | string | 设置当前网格布局行的数量,不设置时默认1行。 例如, '1fr 1fr 2fr'是将父组件分三行,将父组件允许的高分为4等份,第一行占1份,第二行占一份,第三行占2份。 默认值:'1fr' |
+| columnsTemplate | string | 设置当前网格布局列的数量,不设置时默认1列。 例如, '1fr 1fr 2fr' 是将父组件分3列,将父组件允许的宽分为4等份,第一列占1份,第二列占1份,第三列占2份。|
+| rowsTemplate | string | 设置当前网格布局行的数量,不设置时默认1行。 例如, '1fr 1fr 2fr'是将父组件分三行,将父组件允许的高分为4等份,第一行占1份,第二行占一份,第三行占2份。 |
| columnsGap | Length | 设置列与列的间距。 默认值:0 |
| rowsGap | Length | 设置行与行的间距。 默认值:0 |
| scrollBar | [BarState](ts-appendix-enums.md#barstate) | 设置滚动条状态。 默认值:BarState.Off |
@@ -37,12 +37,32 @@ Grid(scroller?: Scroller)
| cachedCount | number | 设置预加载的GridItem的数量。具体使用可参考[减少应用白块说明](../../ui/ts-performance-improvement-recommendation.md#减少应用滑动白块)。 默认值:1 |
| editMode 8+ | boolean | 设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部[GridItem](ts-container-griditem.md)。 默认值:flase |
| layoutDirection8+ | [GridDirection](#griddirection8枚举说明) | 设置布局的主轴方向。 默认值:GridDirection.Row |
-| maxCount8+ | number | 当layoutDirection是Row/RowReverse时,表示可显示的最大行数 当layoutDirection是Column/ColumnReverse时,表示可显示的最大列数。 默认值:1 |
-| minCount8+ | number | 当layoutDirection是Row/RowReverse时,表示可显示的最小行数。 当layoutDirection是Column/ColumnReverse时,表示可显示的最小列数。 默认值:1 |
-| cellLength8+ | number | 当layoutDirection是Row/RowReverse时,表示一行的高度。 当layoutDirection是Column/ColumnReverse时,表示一列的宽度。 默认值:0 |
+| maxCount8+ | number | 当layoutDirection是Row/RowReverse时,表示可显示的最大列数 当layoutDirection是Column/ColumnReverse时,表示可显示的最大行数。 默认值:Infinity |
+| minCount8+ | number | 当layoutDirection是Row/RowReverse时,表示可显示的最小列数。 当layoutDirection是Column/ColumnReverse时,表示可显示的最小行数。 默认值:1 |
+| cellLength8+ | number | 当layoutDirection是Row/RowReverse时,表示一行的高度。 当layoutDirection是Column/ColumnReverse时,表示一列的宽度。 默认值:第一个元素的大小 |
| multiSelectable8+ | boolean | 是否开启鼠标框选。 默认值:false - false:关闭框选。 - true:开启框选。 |
| supportAnimation8+ | boolean | 是否支持动画。 默认值:false |
+Grid组件根据rowsTemplate、columnsTemplate属性的设置情况,可分为以下三种布局模式:
+
+1、rowsTemplate、columnsTemplate同时设置:
+
+Grid只展示固定行列数的元素,其余元素不展示,且Grid不可滚动。例如rowsTemplate、columnsTemplate都设置为"1fr 1fr"时,则仅展示两行两列,共4个元素,其他元素不展示。
+
+此模式下以下属性不生效:layoutDirection、maxCount、minCount、cellLength。
+
+2、rowsTemplate、columnsTemplate仅设置其中的一个:
+
+元素按照设置的方向进行排布,超出的元素可通过滚动的方式展示。例如Grid有十个元素,且设置columnsTemplate为"1fr 1fr 1fr",则Grid有三列,元素先填满一行,再填充下一行。在Grid区域外的元素,可通过竖直方向的滚动,进行展示。
+
+此模式下以下属性不生效:layoutDirection、maxCount、minCount、cellLength。
+
+3、rowsTemplate、columnsTemplate都不设置:
+
+元素在layoutDirection方向上排布,列数由Grid的宽度、首个元素的宽度、minCount、maxCount、columnsGap共同决定;行数由Grid高度、首个元素高度、cellLength、rowsGap共同决定。超出行列容纳范围的元素不显示,也不能通过滚动进行展示。
+
+此模式下仅生效以下属性:layoutDirection、maxCount、minCount、cellLength、editMode、columnsGap、rowsGap。
+
## GridDirection8+ 枚举说明
| 名称 | 描述 |
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md
index 616f06a5994845272abc6f453590222744dabfa2..8c5b3995696b5a85498a5b7f4dd5a49012493832 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-line.md
@@ -138,4 +138,49 @@ struct LineExample1 {
}
```
-![zh-cn_image1_0000001219982725](figures/zh-cn_image1_0000001219982725.png)
\ No newline at end of file
+![zh-cn_image1_0000001219982725](figures/zh-cn_image1_0000001219982725.png)
+
+### 示例3
+
+```ts
+// xxx.ets
+@Entry
+@Component
+struct LineExample {
+ build() {
+ Column() {
+ Line()
+ .startPoint([50, 30])
+ .endPoint([300, 30])
+ .strokeWidth(10)
+ // 设置strokeDashArray的数组间隔为 50
+ Line()
+ .startPoint([50, 20])
+ .endPoint([300, 20])
+ .strokeWidth(10)
+ .strokeDashArray([50])
+ // 设置strokeDashArray的数组间隔为 50, 10
+ Line()
+ .startPoint([50, 20])
+ .endPoint([300, 20])
+ .strokeWidth(10)
+ .strokeDashArray([50, 10])
+ // 设置strokeDashArray的数组间隔为 50, 10, 20
+ Line()
+ .startPoint([50, 20])
+ .endPoint([300, 20])
+ .strokeWidth(10)
+ .strokeDashArray([50, 10, 20])
+ // 设置strokeDashArray的数组间隔为 50, 10, 20, 30
+ Line()
+ .startPoint([50, 20])
+ .endPoint([300, 20])
+ .strokeWidth(10)
+ .strokeDashArray([50, 10, 20, 30])
+
+ }
+ }
+}
+```
+
+![zh-cn_image2_0000001219982725](figures/zh-cn_image2_0000001219982725.PNG)
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-state-management.md b/zh-cn/application-dev/reference/arkui-ts/ts-state-management.md
index 183bf1b8c250b333bf0be5c475bdfb7a2542342d..0defa90f0c7156a21408dc0b4cb6935eeea1f7d7 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-state-management.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-state-management.md
@@ -401,7 +401,7 @@ setOrCreate\(propName: string, newValue: T): boolean
| 类型 | 描述 |
| ------- | ------------------------------------------------------------ |
-| boolean | 如果已存在与给定键名字相同的属性,更新其值且返回true。如果不存在具有给定名称的属性,在LocalStorage中创建具有给定默认值的新属性,默认值必须是T类型。不允许undefined 或 null 返回true。 |
+| boolean | 如果已存在与给定键名字相同的属性,更新其值且返回true。如果不存在具有给定名称的属性,在LocalStorage中创建具有给定默认值的新属性,默认值必须是T类型,不允许undefined 或 null 。 |
```ts
this.storage = new LocalStorage();
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-flex-layout.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-flex-layout.md
index e4414bb93c2b9b19354b873f1e342ad90635d7bf..bd24f2257c7b23e2b6eefb6d9cf6b3b24914ed47 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-flex-layout.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-flex-layout.md
@@ -10,7 +10,7 @@
| 名称 | 参数说明 | 描述 |
| ---------- | ---------------------------------------- | ---------------------------------------- |
-| flexBasis | number \| string | 设置组件在父容器主轴方向上的基准尺寸。 默认值:'auto'(表示组件在主轴方向上的基准尺寸为组件原本的大小) |
+| flexBasis | number \| string | 设置组件在父容器主轴方向上的基准尺寸。 默认值:'auto'(表示组件在主轴方向上的基准尺寸为组件原本的大小)。 不支持百分比设置。 |
| flexGrow | number | 设置父容器的剩余空间分配给此属性所在组件的比例。 默认值:0 |
| flexShrink | number | 设置父容器压缩尺寸分配给此属性所在组件的比例。 父容器为Row、Column时,默认值:0 父容器为flex时,默认值:1 |
| alignSelf | [ItemAlign](ts-appendix-enums.md#itemalign) | 子组件在父容器交叉轴的对齐格式,覆盖Flex布局容器中alignItems默认配置。 默认值:ItemAlign.Auto |
diff --git a/zh-cn/application-dev/reference/errorcodes/errcode-system-parameterV9.md b/zh-cn/application-dev/reference/errorcodes/errcode-system-parameterV9.md
new file mode 100644
index 0000000000000000000000000000000000000000..effa914b588691613a686964e134ec2f400d4cc6
--- /dev/null
+++ b/zh-cn/application-dev/reference/errorcodes/errcode-system-parameterV9.md
@@ -0,0 +1,74 @@
+# 系统参数错误码
+
+## 14700101 系统参数查找失败
+
+**错误信息**
+
+System parameter can not be found.
+
+**错误描述**
+
+workspace中没有相应节点,或者没有设置key值,系统会报此错误码。
+
+**可能原因**
+
+参数没有设置,或设置失败。
+
+**处理步骤**
+
+设置合法的参数。
+
+## 14700102 系统参数值无效
+
+**错误信息**
+
+System parameter value is invalid.
+
+**错误描述**
+
+当系统参数value值为空字符、非法字符或长度超出范围时,系统会报此错误码。
+
+**可能原因**
+
+接口的参数值超出设置范围或者含有特殊字符,比如,"const..param.xxx"。
+
+**处理步骤**
+
+修改value值为合法字符串。
+
+## 14700103 系统权限操作权限被拒绝
+
+**错误信息**
+
+System permission operation permission denied.
+
+**错误描述**
+
+系统参数没有DAC或MAC权限时,系统会报此错误码。
+
+**可能原因**
+
+没有配置DAC或MAC权限。
+
+**处理步骤**
+
+添加相应的DAC或MAC权限。
+
+## 14700104 系统内部错误,包括内存不足,死锁等
+
+**错误信息**
+
+System internal error including out of memory, deadlock etc.
+
+**错误描述**
+
+当试图修改const属性参数、socket连接失败、内存拷贝失败等错误时,系统会报此错误码。
+
+**可能原因**
+
+当socket连接异常,添加节点或获取节点失败。
+
+**处理步骤**
+
+1. 内存不足,需要分析整个进程的内存占用情况,是否有内存泄露的情况。
+2. 死锁,多出现在多线程场景下,需要通过错误堆栈查看是否有死锁的场景。
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/errorcodes/errorcode-colorspace-manager.md b/zh-cn/application-dev/reference/errorcodes/errorcode-colorspace-manager.md
new file mode 100755
index 0000000000000000000000000000000000000000..28fc683cfb07d50038eba50994836a8b2af14b0a
--- /dev/null
+++ b/zh-cn/application-dev/reference/errorcodes/errorcode-colorspace-manager.md
@@ -0,0 +1,18 @@
+# 色彩管理错误码
+
+## 18600001 参数值异常
+**错误信息**
+
+Parameter value is abnormal.
+
+**错误描述**
+
+当参数值不符合接口调用要求时,系统会报此错误码。
+
+**可能原因**
+
+参数值超出接口调用范围会报错,如枚举值超出定义范围。
+
+**处理步骤**
+
+在定义接口参数前,确保参数值符合接口参数要求。
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/errorcodes/errorcode-display.md b/zh-cn/application-dev/reference/errorcodes/errorcode-display.md
index 2d19ab659374a9e87095fcb53c883148a3af0ec0..166bb9d68fb9a51dd22f01281b461fc30a6c8e56 100755
--- a/zh-cn/application-dev/reference/errorcodes/errorcode-display.md
+++ b/zh-cn/application-dev/reference/errorcodes/errorcode-display.md
@@ -1,34 +1,43 @@
# 屏幕错误码
## 1400001 无效虚拟屏
-### 错误信息
+**错误信息**
This is invalid screen.
-### 错误描述
+
+**错误描述**
当操作无效的虚拟屏时,会报此错误码。
-### 可能原因
+
+**可能原因**
1. 虚拟屏未创建。
2. 虚拟屏已销毁。
-### 处理步骤
+
+**处理步骤**
1. 在操作虚拟屏前,检查该虚拟屏是否已经存在,确保已创建该虚拟屏。
2. 在操作虚拟屏前,检查虚拟屏是否已被销毁,确保其未被销毁,再进行相关操作。
## 1400002 无权限操作
-### 错误信息
+**错误信息**
This operation is not access.
-### 错误描述
+
+**错误描述**
当对无操作权限的对象进行操作时,会报此错误码。
-### 可能原因
+
+**可能原因**
操作了其它进程的虚拟屏对象。
-### 处理步骤
+
+**处理步骤**
请检查是否非法操作了别的进程的对象,删除相关非法操作。
## 1400003 系统服务工作异常
-### 错误信息
+**错误信息**
This window manager service work abnormally.
-### 错误描述
+
+**错误描述**
当系统服务工作异常时,会报此错误码。
-### 可能原因
+
+**可能原因**
1. 窗口内部服务没有正常启动。
2. 底层图形图像合成渲染异常。
-### 处理步骤
+
+**处理步骤**
系统服务内部工作异常,请稍候重试,或者重启设备尝试。
diff --git a/zh-cn/application-dev/reference/errorcodes/errcode-hiviewdfx-hiappevent.md b/zh-cn/application-dev/reference/errorcodes/errorcode-hiappevent.md
similarity index 100%
rename from zh-cn/application-dev/reference/errorcodes/errcode-hiviewdfx-hiappevent.md
rename to zh-cn/application-dev/reference/errorcodes/errorcode-hiappevent.md
diff --git a/zh-cn/application-dev/reference/errorcodes/errorcode-pasteboard.md b/zh-cn/application-dev/reference/errorcodes/errorcode-pasteboard.md
index 45da702e55b3f3af0eef50de7593968aedd3adc0..03f37480020359c096ad06cbdf9d16d4df32988e 100644
--- a/zh-cn/application-dev/reference/errorcodes/errorcode-pasteboard.md
+++ b/zh-cn/application-dev/reference/errorcodes/errorcode-pasteboard.md
@@ -2,75 +2,75 @@
## 12900001 索引超过范围
-### 错误信息
+**错误信息**
The index is out of range.
-### 错误描述
+**错误描述**
当调用getRecord等涉及索引的接口时,索引超过范围时,系统会报此错误码。
-### 可能原因
+**可能原因**
接口的参数索引值超出当前PasteData中的记录数,比如,getRecord传入index值过大。
-### 处理步骤
+**处理步骤**
检查参数索引值是否在正确范围,使用恰当的索引值重新进行开发。
## 12900002 Record数量超过最大限制
-### 错误信息
+**错误信息**
The number of record exceeds the maximum limit.
-### 错误描述
+**错误描述**
当添加Record时,若当前PasteData记录数已达到最大值,系统会报此错误码。
-### 可能原因
+**可能原因**
当前PasteData记录数已达到最大值,未进行相关Record的删除或数目检查,直接继续添加Record导致。
-### 处理步骤
+**处理步骤**
1. 检查判断当前PasteData记录数是否已达最大值。
2. 若当前PasteData记录数已达最大值,删除相关Record后,再重新添加Record进行开发。
## 12900003 另外一个复制或粘贴正在进行
-### 错误信息
+**错误信息**
Another copy or paste is in progress.
-### 错误描述
+**错误描述**
上次的复制/粘贴动作还未结束时,再次调用相关接口,系统会报此错误码。
-### 可能原因
+**可能原因**
复制粘贴均为异步接口,当复制/粘贴的数据内容较大,需要时间较长时,在此期间再次执行复制/粘贴则会出错。
-### 处理步骤
+**处理步骤**
1. 再次进行复制/粘贴时,首先判断上次复制/粘贴的状态。
2. 当上次复制/粘贴动作完成后,再进行后续操作。
## 12900004 禁止复制
-### 错误信息
+**错误信息**
Replication is prohibited.
-### 错误描述
+**错误描述**
当对不支持复制的数据内容进行复制操作时,系统会报此错误码。
-### 可能原因
+**可能原因**
数据内容不支持复制,比如只读类型的数据内容。
-### 处理步骤
+**处理步骤**
1. 在对相关数据内容进行复制时,首先判断其数据类型是否支持复制。
2. 若数据内容不支持复制,不对此类数据内容进行复制操作。
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/errorcodes/errorcode-rpc.md b/zh-cn/application-dev/reference/errorcodes/errorcode-rpc.md
index 2c5743f21c4b269dfef62d679d60948adadd767f..533764276a46c24626c94a3af7927b92d290c036 100644
--- a/zh-cn/application-dev/reference/errorcodes/errorcode-rpc.md
+++ b/zh-cn/application-dev/reference/errorcodes/errorcode-rpc.md
@@ -1,264 +1,251 @@
# RPC错误码
- 从API version 9起,IPC支持异常返回功能。错误码对应数值及含义如下。
-
+从API version 9起,IPC支持异常返回功能。错误码对应数值及含义如下。
## 1900001 系统调用mmap失败
-### 错误信息
+**错误信息**
Call mmap function failed.
-### 错误描述
+**错误描述**
执行系统调用mmap失败。
-### 可能原因
+**可能原因**
1. 映射区域过大。
2. 系统内存压力大,没有足够内存可以用来进行映射。
-### 处理步骤
+**处理步骤**
1. 请检查调用Ashmem::create()时是否指定了超大内存;
2. 请检查执行映射时系统是否有足够的内存可用。
-
## 1900002 系统调用ioctl失败
-### 错误信息
+**错误信息**
Call os ioctl function failed.
-### 错误描述
+**错误描述**
在共享内存文件描述符上执行系统调用ioctl失败。
-### 可能原因
+**可能原因**
1. 设置的参数为内核非法参数;
2. 设置的类型超过了共享内存映射时指定的类型。
-### 处理步骤
+**处理步骤**
1. 请检查调用指定的参数是否来自Ashmem类的PROT_EXEC、PROT_READ和PROT_WRITE;
2. 请检查指定的参数是否为映射共享内存时所指类型的子集。
-
## 1900003 共享内存写数据失败
-### 错误信息
+**错误信息**
Write to ashmem failed.
-### 错误描述
+**错误描述**
向共享内存写数据失败。
-### 可能原因
+**可能原因**
1. 单次写或者连续写的总内容超过了映射的共享内存大小;
2. 没有对共享内存设置PROT_WRITE模式。
-### 处理步骤
+**处理步骤**
1. 请检查当前向共享内存所写内容是否已经超过了映射的总大小;
2. 请检查是否设置了PROT_WRITE保护权限。
-
## 1900004 共享内存读数据失败
-### 错误信息
+**错误信息**
Read from ashmem failed.
-### 错误描述
+**错误描述**
从共享内存读数据失败。
-### 可能原因
+**可能原因**
1. 单次写或者连续写的总内容超过了映射的共享内存大小;
2. 没有对共享内存设置PROT_READ模式。
-### 处理步骤
+**处理步骤**
1. 请检查当前向共享内存所写内容是否已经超过了映射的总大小;
2. 请检查是否设置了PROT_READ保护权限。
-
## 1900005 ipc对象权限错误
-### 错误信息
+**错误信息**
Only proxy object permitted.
-### 错误描述
+**错误描述**
只有proxy对象允许该操作。
-### 可能原因
+**可能原因**
在RemoteObject对象上调用了只有RemoteProxy对象支持的方法。
-### 处理步骤
+**处理步骤**
请检查是否在RemoteObject对象上调用了只有RemoteProxy对象支持的方法。
-
## 1900006 ipc对象权限错误
-### 错误信息
+**错误信息**
Only remote object permitted.
-### 错误描述
+**错误描述**
只有remote对象允许该操作。
-### 可能原因
+**可能原因**
在RemoteProxy对象上调用了只有RemoteObject对象支持的方法。
-### 处理步骤
+**处理步骤**
请检查是否在RemoteProxy对象上调用了只有RemoteObject对象支持的方法。
-
## 1900007 远端对象通信失败
-### 错误信息
+**错误信息**
Communication failed.
-### 错误描述
+**错误描述**
和远端对象进行进程间通信失败。
-### 可能原因
+**可能原因**
1. 远端对象已经销毁;
2. 远端对象发生了销毁然后重新创建,本端持有的代理对象已经过期。
-### 处理步骤
+**处理步骤**
1. 请检查远端对象是否已经销毁;
2. 请检查是否注册了死亡监听,并且远端对象发生析构又重新创建。
-
## 1900008 非法的ipc对象
-### 错误信息
+**错误信息**
Proxy or remote object is invalid.
-### 错误描述
+**错误描述**
非法的代理对象或者远端对象。
-### 可能原因
+**可能原因**
1. 代理对象已经失效;
2. 远端对象已经销毁。
-### 处理步骤
+**处理步骤**
1. 请检查proxy对象获取过程是否有异常;
2. 请检查远端对象是否已经析构。
-
## 1900009 向MessageSequence写入数据失败
-### 错误信息
+**错误信息**
Write data to message sequence failed.
-### 错误描述
+**错误描述**
向MessageSequence写数据失败。
-### 可能原因
+**可能原因**
sequence默认空间已满。
-### 处理步骤
+**处理步骤**
请使用MessageSequence提供的获取缓冲区空间相关方法确认是否还有剩余空间。
-
## 1900010 读取MessageSequence数据失败
-### 错误信息
+**错误信息**
Read data from message sequence failed.
-### 错误描述
+**错误描述**
读取MessageSequence数据失败。
-### 可能原因
+**可能原因**
读取和写入顺序不一致。
-### 处理步骤
+**处理步骤**
请检查读取的顺序和写入的顺序保持严格一致。
-
## 1900011 内存分配失败
-### 错误信息
+**错误信息**
Sequence memory alloc failed.
-### 错误描述
+**错误描述**
序列化过程中内存分配失败。
-### 可能原因
+**可能原因**
写入的数据过大。
-### 处理步骤
+**处理步骤**
请检查写入的数据或者设置的参数是否过大。
-
## 1900012 JS方法失败
-### 错误信息
+**错误信息**
Call JS callback function failed.
-### 错误描述
+**错误描述**
执行JS回调方法失败。
-### 可能原因
+**可能原因**
业务的JS方法返回失败。
-### 处理步骤
+**处理步骤**
请检查业务JS方法是否执行成功。
-
## 1900013 系统调用dup失败
-### 错误信息
+**错误信息**
Call os dup function failed.
-### 错误描述
+**错误描述**
执行系统调用dup失败。
-### 可能原因
+**可能原因**
1. 进程的文件句柄资源已经耗尽;
2. 入参fd已经被关闭。
-### 处理步骤
+**处理步骤**
1. 请检查入参fd是否依然有效;
2. 请排查进程是否已经耗尽了fd资源。
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/errorcodes/errorcode-window.md b/zh-cn/application-dev/reference/errorcodes/errorcode-window.md
index f55c63a902daf8e263d1f9fd410fb70791b8bfef..3239f04eb519496c6af4675f64c5f63887f77fb0 100755
--- a/zh-cn/application-dev/reference/errorcodes/errorcode-window.md
+++ b/zh-cn/application-dev/reference/errorcodes/errorcode-window.md
@@ -1,61 +1,79 @@
# 窗口错误码
## 1300001 重复操作
-### 错误信息
+**错误信息**
This is repeat operation.
-### 错误描述
+
+**错误描述**
当进行某些重复操作时,系统会报此错误码。
-### 可能原因
+
+**可能原因**
创建的窗口已经存在时,再次创建该窗口会报错。
-### 处理步骤
+
+**处理步骤**
在创建窗口前,检查该窗口是否已经存在,确保为首次创建该窗口。
## 1300002 窗口状态异常
-### 错误信息
+**错误信息**
This window state is abnormal.
-### 错误描述
+
+**错误描述**
当窗口状态异常,如已被销毁时,操作该窗口,会报此错误码。
-### 可能原因
+
+**可能原因**
操作窗口时,该窗口已被销毁。
-### 处理步骤
+
+**处理步骤**
在对窗口进行操作前,检查该窗口是否存在,确保其未被销毁,再进行相关操作。
## 1300003 系统服务工作异常
-### 错误信息
+**错误信息**
This window manager service work abnormally.
-### 错误描述
+
+**错误描述**
当系统服务工作异常时,会报此错误码。
-### 可能原因
+
+**可能原因**
窗口内部服务没有正常启动。
-### 处理步骤
+
+**处理步骤**
系统服务内部工作异常,请稍候重试,或者重启设备尝试。
## 1300004 无权限操作
-### 错误信息
+**错误信息**
This operation is not access.
-### 错误描述
+
+**错误描述**
当对无操作权限的对象进行操作时,会报此错误码。
-### 可能原因
+
+**可能原因**
操作了其它进程的窗口对象。
-### 处理步骤
+
+**处理步骤**
请检查是否非法操作了别的进程的对象,删除相关操作。
## 1300005 WindowStage异常
-### 错误信息
+**错误信息**
This window stage is abnormal.
-### 错误描述
+
+**错误描述**
当WindowStage异常,如已被销毁时,操作该WindowStage,会报此错误码。
-### 可能原因
+
+**可能原因**
操作WindowStage时,该WindowStage已被销毁。
-### 处理步骤
+
+**处理步骤**
在对WindowStage进行操作前,检查该WindowStage是否存在,若已被销毁,请释放该WindowStage下的窗口。
## 1300006 窗口上下文异常
-### 错误信息
+**错误信息**
This window context is abnormal.
-### 错误描述
+
+**错误描述**
当窗口上下文异常,如已被销毁时,操作该窗口上下文,会报此错误码。
-### 可能原因
+
+**可能原因**
操作窗口上下文时,该窗口上下文已被销毁。
-### 处理步骤
+
+**处理步骤**
在对窗口上下文进行操作前,检查该窗口上下文是否存在,确保其未被销毁,再进行相关操作。
diff --git a/zh-cn/application-dev/reference/errorcodes/errorcodes-request.md b/zh-cn/application-dev/reference/errorcodes/errorcodes-request.md
index 2f7063b797dea8ff1f61361128ef7105252b8172..de898cb9a20669b61219528368bd5b934a00744e 100644
--- a/zh-cn/application-dev/reference/errorcodes/errorcodes-request.md
+++ b/zh-cn/application-dev/reference/errorcodes/errorcodes-request.md
@@ -48,7 +48,7 @@ Task manager service error.
**可能原因**
-该错误码表示服务异常,,可能原因任务创建失败
+该错误码表示服务异常,可能原因任务创建失败
**处理步骤**
diff --git a/zh-cn/application-dev/security/huks-guidelines.md b/zh-cn/application-dev/security/huks-guidelines.md
index be627e670fcd7250d050e319c31179d5830f2b0c..146d718154fc87f7ff98ee50e12f3490a4c011ad 100644
--- a/zh-cn/application-dev/security/huks-guidelines.md
+++ b/zh-cn/application-dev/security/huks-guidelines.md
@@ -56,8 +56,8 @@ RSA512, RSA768, RSA1024, RSA2048, RSA3072, RSA4096, ECC224, ECC256, ECC384, ECC5
import huks from '@ohos.security.huks';
function StringToUint8Array(str) {
- var arr = [];
- for (var i = 0, j = str.length; i < j; ++i) {
+ let arr = [];
+ for (let i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return new Uint8Array(arr);
@@ -190,10 +190,10 @@ function deleteKeyItem(keyAlias:string, huksOptions:huks.HuksOptions) {
});
}
-var srcKeyAlias = 'hukRsaKeyAlias';
-var srcKeyAliasSecond = 'huksRsaKeyAliasSecond';
-var exportKey;
-var inputEccPair = new Uint8Array([
+let srcKeyAlias = 'hukRsaKeyAlias';
+let srcKeyAliasSecond = 'huksRsaKeyAliasSecond';
+let exportKey;
+let inputEccPair = new Uint8Array([
0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0xa5, 0xb8, 0xa3, 0x78, 0x1d, 0x6d, 0x76, 0xe0, 0xb3, 0xf5, 0x6f, 0x43,
0x9d, 0xcf, 0x60, 0xf6, 0x0b, 0x3f, 0x64, 0x45, 0xa8, 0x3f, 0x1a, 0x96, 0xf1, 0xa1, 0xa4, 0x5d,
@@ -205,7 +205,7 @@ var inputEccPair = new Uint8Array([
async function testImportExport() {
/* 集成生成密钥参数集 */
- var exportProperties = new Array();
+ let exportProperties = new Array();
exportProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_RSA,
@@ -232,7 +232,7 @@ async function testImportExport() {
tag: huks.HuksTag.HUKS_TAG_DIGEST,
value: huks.HuksKeyDigest.HUKS_DIGEST_SHA256,
}
- var huksOptions = {
+ let huksOptions = {
properties: exportProperties,
inData: new Uint8Array(new Array())
}
@@ -244,7 +244,7 @@ async function testImportExport() {
await publicExportKeyFunc(srcKeyAlias, huksOptions);
/* 集成导入密钥参数集 */
- var importProperties = new Array();
+ let importProperties = new Array();
importProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_ECC
@@ -265,7 +265,7 @@ async function testImportExport() {
tag: huks.HuksTag.HUKS_TAG_IMPORT_KEY_TYPE,
value: huks.HuksImportKeyType.HUKS_KEY_TYPE_KEY_PAIR,
};
- var importOptions = {
+ let importOptions = {
properties: importProperties,
inData: inputEccPair
};
@@ -466,11 +466,11 @@ function deleteKeyItem(keyAlias:string, huksOptions:huks.HuksOptions) {
});
}
-var importAlias = "importAlias";
-var wrapAlias = "wrappingKeyAlias";
-var exportKey;
+let importAlias = "importAlias";
+let wrapAlias = "wrappingKeyAlias";
+let exportKey;
-var inputEccPair = new Uint8Array([
+let inputEccPair = new Uint8Array([
0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0xa5, 0xb8, 0xa3, 0x78, 0x1d, 0x6d, 0x76, 0xe0, 0xb3, 0xf5, 0x6f, 0x43,
0x9d, 0xcf, 0x60, 0xf6, 0x0b, 0x3f, 0x64, 0x45, 0xa8, 0x3f, 0x1a, 0x96, 0xf1, 0xa1, 0xa4, 0x5d,
@@ -480,7 +480,7 @@ var inputEccPair = new Uint8Array([
0x7c, 0x86, 0xba, 0xca, 0x64, 0x0b, 0x88, 0x96, 0xe2, 0xfa, 0x77, 0xbc, 0x71, 0xe3, 0x0f, 0x0f,
0x9e, 0x3c, 0xe5, 0xf9]);
-var properties = new Array();
+let properties = new Array();
properties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_ECC
@@ -501,12 +501,12 @@ properties[4] = {
tag: huks.HuksTag.HUKS_TAG_IMPORT_KEY_TYPE,
value: huks.HuksImportKeyType.HUKS_KEY_TYPE_KEY_PAIR,
};
-var huksOptions = {
+let huksOptions = {
properties: properties,
inData: inputEccPair
};
-var importProperties = new Array();
+let importProperties = new Array();
importProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_AES
@@ -531,7 +531,7 @@ importProperties[5] = {
tag: huks.HuksTag.HUKS_TAG_UNWRAP_ALGORITHM_SUITE,
value: huks.HuksUnwrapSuite.HUKS_UNWRAP_SUITE_ECDH_AES_256_GCM_NOPADDING
};
-var importOptions = {
+let importOptions = {
properties: importProperties,
inData: new Uint8Array(new Array())
};
@@ -556,7 +556,7 @@ async function importWrappedKeyItemTest() {
* nonce1的长度(4字节) + nonce1的数据 + tag1的长度(4字节) + tag1的数据 +
* keyA长度占用的内存长度(4字节) + keyA的长度 + keyA_enc的长度(4字节) + keyA_enc的数据
*/
- var inputKey = new Uint8Array([
+ let inputKey = new Uint8Array([
0x5b, 0x00, 0x00, 0x00, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xc0,
0xfe, 0x1c, 0x67, 0xde, 0x86, 0x0e, 0xfb, 0xaf, 0xb5, 0x85, 0x52, 0xb4, 0x0e, 0x1f, 0x6c, 0x6c,
@@ -663,16 +663,16 @@ struct Index {
import huks from '@ohos.security.huks';
function StringToUint8Array(str) {
- var arr = [];
- for (var i = 0, j = str.length; i < j; ++i) {
+ let arr = [];
+ for (let i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return new Uint8Array(arr);
}
function Uint8ArrayToString(fileData) {
- var dataString = '';
- for (var i = 0; i < fileData.length; i++) {
+ let dataString = '';
+ for (let i = 0; i < fileData.length; i++) {
dataString += String.fromCharCode(fileData[i]);
}
return dataString;
@@ -820,17 +820,17 @@ function deleteKeyItem(keyAlias:string, huksOptions:huks.HuksOptions) {
});
}
-var IV = '0000000000000000';
-var cipherInData = 'Hks_SM4_Cipher_Test_101010101010101010110_string';
-var srcKeyAlias = 'huksCipherSm4SrcKeyAlias';
-var encryptUpdateResult = new Array();
-var handle;
-var updateResult = new Array();
-var finishOutData;
+let IV = '0000000000000000';
+let cipherInData = 'Hks_SM4_Cipher_Test_101010101010101010110_string';
+let srcKeyAlias = 'huksCipherSm4SrcKeyAlias';
+let encryptUpdateResult = new Array();
+let handle;
+let updateResult = new Array();
+let finishOutData;
async function testSm4Cipher() {
/* 集成生成密钥参数集 & 加密参数集 */
- var properties = new Array();
+ let properties = new Array();
properties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_SM4,
@@ -853,12 +853,12 @@ async function testSm4Cipher() {
tag: huks.HuksTag.HUKS_TAG_PADDING,
value: huks.HuksKeyPadding.HUKS_PADDING_NONE,
}
- var huksOptions = {
+ let huksOptions = {
properties: properties,
inData: new Uint8Array(new Array())
}
- var propertiesEncrypt = new Array();
+ let propertiesEncrypt = new Array();
propertiesEncrypt[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_SM4,
@@ -883,7 +883,7 @@ async function testSm4Cipher() {
tag: huks.HuksTag.HUKS_TAG_IV,
value: StringToUint8Array(IV),
}
- var encryptOptions = {
+ let encryptOptions = {
properties: propertiesEncrypt,
inData: new Uint8Array(new Array())
}
@@ -911,7 +911,7 @@ async function testSm4Cipher() {
tag: huks.HuksTag.HUKS_TAG_PURPOSE,
value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT,
});
- var decryptOptions = {
+ let decryptOptions = {
properties: propertiesEncrypt,
inData: new Uint8Array(new Array())
}
@@ -967,16 +967,16 @@ struct Index {
import huks from '@ohos.security.huks';
function StringToUint8Array(str) {
- var arr = [];
- for (var i = 0, j = str.length; i < j; ++i) {
+ let arr = [];
+ for (let i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return new Uint8Array(arr);
}
function Uint8ArrayToString(fileData) {
- var dataString = '';
- for (var i = 0; i < fileData.length; i++) {
+ let dataString = '';
+ for (let i = 0; i < fileData.length; i++) {
dataString += String.fromCharCode(fileData[i]);
}
return dataString;
@@ -1124,20 +1124,20 @@ function deleteKeyItem(keyAlias:string, huksOptions:huks.HuksOptions) {
});
}
-var AAD = '0000000000000000';
-var NONCE = '000000000000';
-var AEAD = '0000000000000000';
-var cipherInData = 'Hks_AES_Cipher_Test_00000000000000000000000000000000000000000000000000000_string';
-var srcKeyAlias = 'huksCipherSm4SrcKeyAlias';
-var updateResult = new Array();
-var encryptUpdateResult = new Array();
-var decryptUpdateResult = new Array();
-var handle;
-var finishOutData;
+let AAD = '0000000000000000';
+let NONCE = '000000000000';
+let AEAD = '0000000000000000';
+let cipherInData = 'Hks_AES_Cipher_Test_00000000000000000000000000000000000000000000000000000_string';
+let srcKeyAlias = 'huksCipherSm4SrcKeyAlias';
+let updateResult = new Array();
+let encryptUpdateResult = new Array();
+let decryptUpdateResult = new Array();
+let handle;
+let finishOutData;
async function testAesCipher() {
/* 集成生成密钥参数集 & 加密参数集 */
- var properties = new Array();
+ let properties = new Array();
properties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_AES,
@@ -1160,12 +1160,12 @@ async function testAesCipher() {
tag: huks.HuksTag.HUKS_TAG_PADDING,
value: huks.HuksKeyPadding.HUKS_PADDING_NONE,
}
- var huksOptions = {
+ let huksOptions = {
properties: properties,
inData: new Uint8Array(new Array())
}
- var propertiesEncrypt = new Array();
+ let propertiesEncrypt = new Array();
propertiesEncrypt[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_AES,
@@ -1202,7 +1202,7 @@ async function testAesCipher() {
tag: huks.HuksTag.HUKS_TAG_AE_TAG,
value: StringToUint8Array(AEAD),
}
- var encryptOptions = {
+ let encryptOptions = {
properties: propertiesEncrypt,
inData: new Uint8Array(new Array())
}
@@ -1236,7 +1236,7 @@ async function testAesCipher() {
tag: huks.HuksTag.HUKS_TAG_AE_TAG,
value: new Uint8Array(encryptUpdateResult.splice(encryptUpdateResult.length - 16,encryptUpdateResult.length))
});
- var decryptOptions = {
+ let decryptOptions = {
properties: propertiesEncrypt,
inData: new Uint8Array(new Array())
}
@@ -1342,8 +1342,8 @@ Update过程只将inData发送到Core中记录在ctx中,不进行Hash计算,
import huks from '@ohos.security.huks';
function StringToUint8Array(str) {
- var arr = [];
- for (var i = 0, j = str.length; i < j; ++i) {
+ let arr = [];
+ for (let i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return new Uint8Array(arr);
@@ -1569,15 +1569,15 @@ function deleteKeyItem(keyAlias:string, huksOptions:huks.HuksOptions) {
});
}
-var signVerifyInData = 'signVerifyInDataForTest';
-var generateKeyAlias = 'generateKeyAliasForTest';
-var importKeyAlias = 'importKeyAliasForTest';
-var handle;
-var exportKey;
-var finishOutData;
+let signVerifyInData = 'signVerifyInDataForTest';
+let generateKeyAlias = 'generateKeyAliasForTest';
+let importKeyAlias = 'importKeyAliasForTest';
+let handle;
+let exportKey;
+let finishOutData;
/* 集成生成密钥参数集 */
-var generateKeyProperties = new Array();
+let generateKeyProperties = new Array();
generateKeyProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_SM2,
@@ -1596,13 +1596,13 @@ generateKeyProperties[3] = {
tag: huks.HuksTag.HUKS_TAG_DIGEST,
value: huks.HuksKeyDigest.HUKS_DIGEST_SM3,
}
-var genrateKeyOptions = {
+let genrateKeyOptions = {
properties: generateKeyProperties,
inData: new Uint8Array(new Array())
}
/* 集成签名参数集 */
-var signProperties = new Array();
+let signProperties = new Array();
signProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_SM2,
@@ -1620,13 +1620,13 @@ signProperties[3] = {
tag: huks.HuksTag.HUKS_TAG_KEY_SIZE,
value: huks.HuksKeySize.HUKS_SM2_KEY_SIZE_256,
}
-var signOptions = {
+let signOptions = {
properties: signProperties,
inData: new Uint8Array(new Array())
}
/* 集成验签参数集 */
-var verifyProperties = new Array();
+let verifyProperties = new Array();
verifyProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_SM2,
@@ -1643,7 +1643,7 @@ verifyProperties[3] = {
tag: huks.HuksTag.HUKS_TAG_KEY_SIZE,
value: huks.HuksKeySize.HUKS_SM2_KEY_SIZE_256,
}
-var verifyOptions = {
+let verifyOptions = {
properties: verifyProperties,
inData: new Uint8Array(new Array())
}
@@ -1653,8 +1653,8 @@ async function testSm2SignVerify() {
await publicGenKeyFunc(generateKeyAlias, genrateKeyOptions);
/* 签名 */
- var signHandle;
- var signFinishOutData;
+ let signHandle;
+ let signFinishOutData;
await publicInitFunc(generateKeyAlias, signOptions);
signHandle = handle;
@@ -1673,7 +1673,7 @@ async function testSm2SignVerify() {
await publicImportKeyFunc(importKeyAlias, verifyOptions);
/* 验证签名 */
- var verifyHandle;
+ let verifyHandle;
await publicInitFunc(importKeyAlias, verifyOptions);
verifyHandle = handle;
@@ -1773,8 +1773,8 @@ HksFinish对paramSet中参数的要求:
import huks from '@ohos.security.huks';
function StringToUint8Array(str) {
- var arr = [];
- for (var i = 0, j = str.length; i < j; ++i) {
+ let arr = [];
+ for (let i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return new Uint8Array(arr);
@@ -1968,17 +1968,17 @@ function deleteKeyItem(keyAlias:string, huksOptions:huks.HuksOptions) {
});
}
-var srcKeyAliasFirst = "AgreeX25519KeyFirstAlias";
-var srcKeyAliasSecond = "AgreeX25519KeySecondAlias";
-var agreeX25519InData = 'AgreeX25519TestIndata';
-var handle;
-var exportKey;
-var exportKeyFrist;
-var exportKeySecond;
+let srcKeyAliasFirst = "AgreeX25519KeyFirstAlias";
+let srcKeyAliasSecond = "AgreeX25519KeySecondAlias";
+let agreeX25519InData = 'AgreeX25519TestIndata';
+let handle;
+let exportKey;
+let exportKeyFrist;
+let exportKeySecond;
async function testAgree() {
/* 集成生成密钥参数集 */
- var properties = new Array();
+ let properties = new Array();
properties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_X25519,
@@ -2003,7 +2003,7 @@ async function testAgree() {
tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE,
value: huks.HuksCipherMode.HUKS_MODE_CBC,
}
- var HuksOptions = {
+ let HuksOptions = {
properties: properties,
inData: new Uint8Array(new Array())
}
@@ -2018,7 +2018,7 @@ async function testAgree() {
exportKeySecond = exportKey;
/* 集成第一个协商参数集 */
- var finishProperties = new Array();
+ let finishProperties = new Array();
finishProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_KEY_STORAGE_FLAG,
value: huks.HuksKeyStorageType.HUKS_STORAGE_TEMP,
@@ -2057,7 +2057,7 @@ async function testAgree() {
tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE,
value: huks.HuksCipherMode.HUKS_MODE_ECB,
}
- var finishOptionsFrist = {
+ let finishOptionsFrist = {
properties: finishProperties,
inData: StringToUint8Array(agreeX25519InData)
}
@@ -2069,7 +2069,7 @@ async function testAgree() {
await publicFinishFunc(handle, finishOptionsFrist);
/* 集成第二个协商参数集 */
- var finishOptionsSecond = {
+ let finishOptionsSecond = {
properties: finishProperties,
inData: StringToUint8Array(agreeX25519InData)
}
@@ -2171,8 +2171,8 @@ HksFinish对paramSet中参数的要求:
import huks from '@ohos.security.huks';
function StringToUint8Array(str) {
- var arr = [];
- for (var i = 0, j = str.length; i < j; ++i) {
+ let arr = [];
+ for (let i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return new Uint8Array(arr);
@@ -2318,14 +2318,14 @@ function deleteKeyItem(keyAlias:string, huksOptions:huks.HuksOptions) {
});
}
-var deriveHkdfInData = "deriveHkdfTestIndata";
-var srcKeyAlias = "deriveHkdfKeyAlias";
-var handle;
-var HuksKeyDeriveKeySize = 32;
+let deriveHkdfInData = "deriveHkdfTestIndata";
+let srcKeyAlias = "deriveHkdfKeyAlias";
+let handle;
+let HuksKeyDeriveKeySize = 32;
async function testDerive() {
/* 集成生成密钥参数集 */
- var properties = new Array();
+ let properties = new Array();
properties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_AES,
@@ -2342,7 +2342,7 @@ async function testDerive() {
tag: huks.HuksTag.HUKS_TAG_KEY_SIZE,
value: huks.HuksKeySize.HUKS_AES_KEY_SIZE_128,
}
- var huksOptions = {
+ let huksOptions = {
properties: properties,
inData: new Uint8Array(new Array())
}
@@ -2360,7 +2360,7 @@ async function testDerive() {
value: HuksKeyDeriveKeySize,
});
- var finishProperties = new Array();
+ let finishProperties = new Array();
finishProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_KEY_STORAGE_FLAG,
value: huks.HuksKeyStorageType.HUKS_STORAGE_PERSISTENT,
@@ -2399,7 +2399,7 @@ async function testDerive() {
tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE,
value: huks.HuksCipherMode.HUKS_MODE_ECB,
}
- var finishOptions = {
+ let finishOptions = {
properties: finishProperties,
inData: new Uint8Array(new Array())
}
@@ -2488,8 +2488,8 @@ HksInit对paramSet中参数的要求,其他三段式接口对paramSet无要求
import huks from '@ohos.security.huks';
function StringToUint8Array(str) {
- var arr = [];
- for (var i = 0, j = str.length; i < j; ++i) {
+ let arr = [];
+ for (let i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return new Uint8Array(arr);
@@ -2651,13 +2651,13 @@ function deleteKeyItem(keyAlias:string, huksOptions:huks.HuksOptions) {
});
}
-var srcKeyAlias = "sm3KeyAlias";
-var hmacInData = 'sm3TestIndata';
-var handle;
+let srcKeyAlias = "sm3KeyAlias";
+let hmacInData = 'sm3TestIndata';
+let handle;
async function testMac() {
/* 集成生成密钥参数集 */
- var properties = new Array();
+ let properties = new Array();
properties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_SM3,
@@ -2674,7 +2674,7 @@ async function testMac() {
tag: huks.HuksTag.HUKS_TAG_KEY_SIZE,
value: huks.HuksKeySize.HUKS_AES_KEY_SIZE_256,
}
- var huksOptions = {
+ let huksOptions = {
properties:properties,
inData:new Uint8Array(new Array())
}
@@ -2758,8 +2758,8 @@ RSA512, RSA768, RSA1024, RSA2048, RSA3072, RSA4096, ECC224, ECC256, ECC384, ECC5
import huks from '@ohos.security.huks';
function StringToUint8Array(str) {
- var arr = [];
- for (var i = 0, j = str.length; i < j; ++i) {
+ let arr = [];
+ for (let i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return new Uint8Array(arr);
@@ -2858,20 +2858,20 @@ function deleteKeyItem(keyAlias:string, huksOptions:huks.HuksOptions) {
});
}
-var securityLevel = StringToUint8Array('sec_level');
-var challenge = StringToUint8Array('challenge_data');
-var versionInfo = StringToUint8Array('version_info');
-var udid = StringToUint8Array('udid');
-var serial = StringToUint8Array('serial');
-var deviceId = StringToUint8Array('device_id');
-var idAliasString = "id attest";
+let securityLevel = StringToUint8Array('sec_level');
+let challenge = StringToUint8Array('challenge_data');
+let versionInfo = StringToUint8Array('version_info');
+let udid = StringToUint8Array('udid');
+let serial = StringToUint8Array('serial');
+let deviceId = StringToUint8Array('device_id');
+let idAliasString = "id attest";
async function testAttestId() {
- var aliasString = idAliasString;
- var aliasUint8 = StringToUint8Array(aliasString);
+ let aliasString = idAliasString;
+ let aliasUint8 = StringToUint8Array(aliasString);
/* 集成生成密钥参数集 & 生成密钥 */
- var properties = new Array();
+ let properties = new Array();
properties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_RSA
@@ -2904,13 +2904,13 @@ async function testAttestId() {
tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE,
value: huks.HuksCipherMode.HUKS_MODE_ECB
};
- var options = {
+ let options = {
properties: properties
};
await publicGenKeyFunc(aliasString, options);
/* 集成证书参数集 */
- var attestProperties = new Array();
+ let attestProperties = new Array();
attestProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_ATTESTATION_ID_SEC_LEVEL_INFO,
value: securityLevel
@@ -2939,7 +2939,7 @@ async function testAttestId() {
tag: huks.HuksTag.HUKS_TAG_ATTESTATION_ID_DEVICE,
value: deviceId
};
- var huksOptions = {
+ let huksOptions = {
properties: attestProperties
};
@@ -3007,8 +3007,8 @@ RSA512, RSA768, RSA1024, RSA2048, RSA3072, RSA4096, ECC224, ECC256, ECC384, ECC5
import huks from '@ohos.security.huks';
function StringToUint8Array(str) {
- var arr = [];
- for (var i = 0, j = str.length; i < j; ++i) {
+ let arr = [];
+ for (let i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return new Uint8Array(arr);
@@ -3107,16 +3107,16 @@ function deleteKeyItem(keyAlias:string, huksOptions:huks.HuksOptions) {
});
}
-var securityLevel = StringToUint8Array('sec_level');
-var challenge = StringToUint8Array('challenge_data');
-var versionInfo = StringToUint8Array('version_info');
-var keyAliasString = "key attest";
+let securityLevel = StringToUint8Array('sec_level');
+let challenge = StringToUint8Array('challenge_data');
+let versionInfo = StringToUint8Array('version_info');
+let keyAliasString = "key attest";
async function testAttestKey() {
- var aliasString = keyAliasString;
- var aliasUint8 = StringToUint8Array(aliasString);
+ let aliasString = keyAliasString;
+ let aliasUint8 = StringToUint8Array(aliasString);
- var properties = new Array();
+ let properties = new Array();
properties[0] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_RSA
@@ -3149,13 +3149,13 @@ async function testAttestKey() {
tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE,
value: huks.HuksCipherMode.HUKS_MODE_ECB
};
- var options = {
+ let options = {
properties: properties
};
await publicGenKeyFunc(aliasString, options);
/* 集成证书参数集 */
- var attestProperties = new Array();
+ let attestProperties = new Array();
attestProperties[0] = {
tag: huks.HuksTag.HUKS_TAG_ATTESTATION_ID_SEC_LEVEL_INFO,
value: securityLevel
@@ -3172,7 +3172,7 @@ async function testAttestKey() {
tag: huks.HuksTag.HUKS_TAG_ATTESTATION_ID_ALIAS,
value: aliasUint8
};
- var huksOptions = {
+ let huksOptions = {
properties: attestProperties
};
diff --git a/zh-cn/application-dev/website.md b/zh-cn/application-dev/website.md
index 5286e48cbe5fe3c953b8ffab81c0ce6c61374fcf..96e02fdd8648a52265c6357090a4159af16f4ff9 100644
--- a/zh-cn/application-dev/website.md
+++ b/zh-cn/application-dev/website.md
@@ -4,8 +4,8 @@
- 快速开始
- 快速入门
- [开发准备](quick-start/start-overview.md)
- - [使用eTS语言开发(Stage模型)](quick-start/start-with-ets-stage.md)
- - [使用eTS语言开发(FA模型)](quick-start/start-with-ets-fa.md)
+ - [使用ArkTS语言开发(Stage模型)](quick-start/start-with-ets-stage.md)
+ - [使用ArkTS语言开发(FA模型)](quick-start/start-with-ets-fa.md)
- [使用JS语言开发(FA模型)](quick-start/start-with-js-fa.md)
- 开发基础知识
- [应用包结构说明(FA模型)](quick-start/package-structure.md)
@@ -14,7 +14,7 @@
- [HarmonyAppProvision配置文件](quick-start/app-provision-structure.md)
- 学习ArkTS语言
- [初识ArkTS语言](quick-start/arkts-get-started.md)
- - eTS语法(声明式UI)
+ - ArkTS语法(声明式UI)
- [基本UI描述](quick-start/arkts-basic-ui-description.md)
- 状态管理
- [基本概念](quick-start/arkts-state-mgmt-concepts.md)
@@ -994,7 +994,7 @@
- [full-SDK替换指南](quick-start/full-sdk-switch-guide.md)
- [Ability框架开发常见问题](faqs/faqs-ability.md)
- [UI框架(JS)开发常见问题](faqs/faqs-ui-js.md)
- - [UI框架(eTS)开发常见问题](faqs/faqs-ui-ets.md)
+ - [UI框架(ArkTS)开发常见问题](faqs/faqs-ui-ets.md)
- [图形图像开发常见问题](faqs/faqs-graphics.md)
- [文件管理开发常见问题](faqs/faqs-file-management.md)
- [网络与连接开发常见问题](faqs/faqs-connectivity.md)
diff --git a/zh-cn/device-dev/get-code/sourcecode-acquire.md b/zh-cn/device-dev/get-code/sourcecode-acquire.md
index 7fb9f4c4c51323d740ad6cf5d3da5bed2d20fbec..b341943bb88fe552c418b6426e560cb484105869 100644
--- a/zh-cn/device-dev/get-code/sourcecode-acquire.md
+++ b/zh-cn/device-dev/get-code/sourcecode-acquire.md
@@ -12,7 +12,7 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及
## 获取源码概述
-本文档将介绍如何获取OpenHarmony源码并说明OpenHarmony的源码目录结构。OpenHarmony的代码以[组件](../hpm-part/Readme-CN.md)的形式开放,开发者可以通过如下其中一种方式获取:
+本文档将介绍如何获取OpenHarmony源码并说明OpenHarmony的源码目录结构。OpenHarmony的代码以[组件](../hpm-part/hpm-part-about.md)的形式开放,开发者可以通过如下其中一种方式获取:
- **获取方式1**:从码云代码仓库获取。通过repo或git工具从代码仓库中下载,此方式可获取最新代码。
@@ -77,7 +77,12 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
-> Master主干为开发分支,开发者可通过Master主干获取最新特性。发布版本代码相对比较稳定,开发者可基于发布版本代码进行商用功能开发。
+>
+> 发布版本代码相对比较稳定,开发者可基于发布版本代码进行商用功能开发。Master主干为开发分支,开发者可通过Master主干获取最新特性。
+
+- **OpenHarmony发布版本代码获取**
+
+ OpenHarmony发布版本获取源码方式请参考[Release Notes](../../release-notes/Readme.md)。
- **OpenHarmony主干代码获取**
@@ -98,10 +103,6 @@ OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及
repo forall -c 'git lfs pull'
```
-- **OpenHarmony发布版本代码获取**
-
- OpenHarmony发布版本获取源码方式请参考[Release Notes](../../release-notes/Readme.md)。
-
## 获取方式2:从DevEco Marketplace获取
diff --git a/zh-cn/device-dev/security/security-guidelines-overall.md b/zh-cn/device-dev/security/security-guidelines-overall.md
index 948fccd9efb8611098db00444917a9f30a8a1af5..465d5b3117c96acf458c488d491787b30bd64767 100644
--- a/zh-cn/device-dev/security/security-guidelines-overall.md
+++ b/zh-cn/device-dev/security/security-guidelines-overall.md
@@ -9,6 +9,7 @@ OpenHarmony操作系统是一个开放的系统,开发者可以通过OpenHarmo
**图1** 安全保障示意图
+
![zh-cn_image_0000001058270836](figures/zh-cn_image_0000001058270836.png)
@@ -73,7 +74,7 @@ OpenHarmony操作系统是一个开放的系统,开发者可以通过OpenHarmo
下图描述了DAC在文件访问时的鉴权过程,首先匹配进程uid和文件uid属性,其次匹配进程gid和文件gid属性,最后都匹配失败的情况,判断文件other属性是否支持进程的读、写、执行操作。同时支持忽略DAC检测机制(读、写、执行)作为一组系统特权(Capability),支持高权限(如系统服务)对低权限(三方APP)的文件管理。
**图2** DAC流程图
-
+
![zh-cn_image_0000001057233092](figures/zh-cn_image_0000001057233092.png)
- **Capability机制**
@@ -102,6 +103,7 @@ OpenHarmony操作系统是一个开放的系统,开发者可以通过OpenHarmo
HUKS(OpenHarmony Universal Keystore Service),提供了密钥管理、证书管理服务,当前在OpenHarmony上主要提供密钥管理服务,用于支撑HiChain(设备身份认证平台)的基础设备认证。如下是HUKS的功能结构图:
**图3** HUKS功能结构图
+
![zh-cn_image_0000001159520844](figures/zh-cn_image_0000001159520844.png)
支持算法包括:
@@ -144,6 +146,7 @@ HUKS本身不考虑多个应用同时调用的情况,因为HUKS只是一个lib
**图4** 设备间建立可信关系流程图
+
![zh-cn_image_0000001058382954](figures/zh-cn_image_0000001058382954.png)
diff --git a/zh-cn/device-dev/security/security.md b/zh-cn/device-dev/security/security.md
deleted file mode 100644
index 1d9db4c8610e88ab991a455bc8be6fc56db2e36c..0000000000000000000000000000000000000000
--- a/zh-cn/device-dev/security/security.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# 隐私与安全
-
-- **[隐私保护](security-privacy-protection.md)**
-
-- **[安全指南](security-guidelines-overall.md)**
-
-
diff --git a/zh-cn/device-dev/subsystems/subsys-tel.md b/zh-cn/device-dev/subsystems/subsys-tel.md
deleted file mode 100644
index 18fb1c222599057d529dbf0547723e8cc8b270e6..0000000000000000000000000000000000000000
--- a/zh-cn/device-dev/subsystems/subsys-tel.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# 电话服务
-
-
-
-- **[电话服务概述](subsys-tel-overview.md)**
-
-- **[电话服务开发指导](subsys-tel-guide.md)**
\ No newline at end of file
diff --git a/zh-cn/release-notes/api-change/v3.1-Release/readme.md b/zh-cn/release-notes/api-change/v3.1-Release/Readme-ZH.md
similarity index 100%
rename from zh-cn/release-notes/api-change/v3.1-Release/readme.md
rename to zh-cn/release-notes/api-change/v3.1-Release/Readme-ZH.md
diff --git a/zh-cn/release-notes/api-change/v3.2-beta1/readme.md b/zh-cn/release-notes/api-change/v3.2-beta1/Readme-ZH.md
similarity index 100%
rename from zh-cn/release-notes/api-change/v3.2-beta1/readme.md
rename to zh-cn/release-notes/api-change/v3.2-beta1/Readme-ZH.md
diff --git a/zh-cn/release-notes/api-change/v3.2-beta2/readme.md b/zh-cn/release-notes/api-change/v3.2-beta2/Readme-ZH.md
similarity index 100%
rename from zh-cn/release-notes/api-change/v3.2-beta2/readme.md
rename to zh-cn/release-notes/api-change/v3.2-beta2/Readme-ZH.md
diff --git a/zh-cn/release-notes/api-change/v3.2-beta3/readme.md b/zh-cn/release-notes/api-change/v3.2-beta3/Readme-ZH.md
similarity index 100%
rename from zh-cn/release-notes/api-change/v3.2-beta3/readme.md
rename to zh-cn/release-notes/api-change/v3.2-beta3/Readme-ZH.md