From 825b34d9c06b027279e9b472c84cde660fbe5e9d Mon Sep 17 00:00:00 2001 From: shawn_he Date: Mon, 27 Jun 2022 17:21:26 +0800 Subject: [PATCH] update docs Signed-off-by: shawn_he --- .../reference/apis/js-apis-hiappevent.md | 2 ++ .../reference/apis/js-apis-hitracechain.md | 2 ++ .../reference/apis/js-apis-hitracemeter.md | 2 ++ .../reference/apis/js-apis-update.md | 36 +++++++++---------- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-hiappevent.md b/en/application-dev/reference/apis/js-apis-hiappevent.md index f75b45946a..c684f0ea4f 100644 --- a/en/application-dev/reference/apis/js-apis-hiappevent.md +++ b/en/application-dev/reference/apis/js-apis-hiappevent.md @@ -1,5 +1,7 @@ # HiAppEvent +This module provides the application event logging functions, such as writing application events to the event file and managing the event logging configuration. + > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. diff --git a/en/application-dev/reference/apis/js-apis-hitracechain.md b/en/application-dev/reference/apis/js-apis-hitracechain.md index 485eddc0fb..cbaf898f75 100644 --- a/en/application-dev/reference/apis/js-apis-hitracechain.md +++ b/en/application-dev/reference/apis/js-apis-hitracechain.md @@ -1,5 +1,7 @@ # Distributed Call Chain Tracing +This module implements call chain tracing throughout a service process. It provides functions such as starting and stopping call chain tracing and configuring trace points. + > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. diff --git a/en/application-dev/reference/apis/js-apis-hitracemeter.md b/en/application-dev/reference/apis/js-apis-hitracemeter.md index 656063edf9..e856ee20a4 100644 --- a/en/application-dev/reference/apis/js-apis-hitracemeter.md +++ b/en/application-dev/reference/apis/js-apis-hitracemeter.md @@ -1,5 +1,7 @@ # Performance Tracing +This module provides the functions of tracing service processes and monitoring the system performance. It provides the data needed for hiTraceMeter to carry out performance analysis. + > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. diff --git a/en/application-dev/reference/apis/js-apis-update.md b/en/application-dev/reference/apis/js-apis-update.md index 251c1d59b6..cba0c8a1ce 100644 --- a/en/application-dev/reference/apis/js-apis-update.md +++ b/en/application-dev/reference/apis/js-apis-update.md @@ -134,11 +134,11 @@ Obtains the new version information. This function uses an asynchronous callback **Example** ``` -updater.getNewVersionInfo(info => { +updater.getNewVersionInfo((err, info) => { console.log("getNewVersionInfo success " + info.status); - console.log(`info versionName = ` + info.checkResult[0].versionName); - console.log(`info versionCode = ` + info.checkResult[0].versionCode); - console.log(`info verifyInfo = ` + info.checkResult[0].verifyInfo); + console.log(`info versionName = ` + info.checkResults[0].versionName); + console.log(`info versionCode = ` + info.checkResults[0].versionCode); + console.log(`info verifyInfo = ` + info.checkResults[0].verifyInfo); }); ``` @@ -160,9 +160,9 @@ Obtains the new version information. This function uses a promise to return the ``` updater.getNewVersionInfo().then(value => { - console.log(`info versionName = ` + value.checkResult[0].versionName); - console.log(`info versionCode = ` + value.checkResult[0].versionCode); - console.log(`info verifyInfo = ` + value.checkResult[0].verifyInfo); + console.log(`info versionName = ` + value.checkResults[0].versionName); + console.log(`info versionCode = ` + value.checkResults[0].versionCode); + console.log(`info verifyInfo = ` + value.checkResults[0].verifyInfo); }).catch(err => { console.log("getNewVersionInfo promise error: " + err.code); }); @@ -185,11 +185,11 @@ Checks whether the current version is the latest. This function uses an asynchro **Example** ``` -updater.checkNewVersion(info => { +updater.checkNewVersion((err, info) => { console.log("checkNewVersion success " + info.status); - console.log(`info versionName = ` + info.checkResult[0].versionName); - console.log(`info versionCode = ` + info.checkResult[0].versionCode); - console.log(`info verifyInfo = ` + info.checkResult[0].verifyInfo); + console.log(`info versionName = ` + info.checkResults[0].versionName); + console.log(`info versionCode = ` + info.checkResults[0].versionCode); + console.log(`info verifyInfo = ` + info.checkResults[0].verifyInfo); }); ``` @@ -211,9 +211,9 @@ Checks whether the current version is the latest. This function uses a promise t ``` updater.checkNewVersion().then(value => { - console.log(`info versionName = ` + value.checkResult[0].versionName); - console.log(`info versionCode = ` + value.checkResult[0].versionCode); - console.log(`info verifyInfo = ` + value.checkResult[0].verifyInfo); + console.log(`info versionName = ` + value.checkResults[0].versionName); + console.log(`info versionCode = ` + value.checkResults[0].versionCode); + console.log(`info verifyInfo = ` + value.checkResults[0].verifyInfo); }).catch(err => { console.log("checkNewVersion promise error: " + err.code); }); @@ -284,7 +284,7 @@ Reboots the device and clears the user partition data. This function uses a prom **Example** ``` -updater.rebootAndCleanUserData(result => { +updater.rebootAndCleanUserData((err, result) => { console.log("rebootAndCleanUserData ", result) }); ``` @@ -330,7 +330,7 @@ Installs the update package. This function uses a promise to return the result. **Example** ``` -updater.applyNewVersion(result => { +updater.applyNewVersion((err, result) => { console.log("applyNewVersion ", result) }); ``` @@ -399,7 +399,7 @@ let policy = { autoUpgradeInterval: [ 2, 3 ], autoUpgradeCondition: 2 } -updater.setUpdatePolicy(policy, result => { +updater.setUpdatePolicy(policy, (err, result) => { console.log("setUpdatePolicy ", result) }); ``` @@ -458,7 +458,7 @@ Obtains the update policy. This function uses an asynchronous callback to return **Example** ``` -updater.getUpdatePolicy(policy => { +updater.getUpdatePolicy((err, policy) => { console.log("getUpdatePolicy success"); console.log(`policy autoDownload = ` + policy.autoDownload); console.log(`policy autoDownloadNet = ` + policy.autoDownloadNet); -- GitLab