From 250f55ee198613e70c9561bfccea2046aa0ff181 Mon Sep 17 00:00:00 2001 From: shawn_he Date: Mon, 20 Feb 2023 17:44:34 +0800 Subject: [PATCH] update doc Signed-off-by: shawn_he --- en/application-dev/dfx/apprecovery-guidelines.md | 4 ++-- en/application-dev/reference/apis/js-apis-pointer.md | 8 ++++---- en/application-dev/reference/apis/js-apis-system-fetch.md | 8 +++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/en/application-dev/dfx/apprecovery-guidelines.md b/en/application-dev/dfx/apprecovery-guidelines.md index a415f1150d..67176a77ff 100644 --- a/en/application-dev/dfx/apprecovery-guidelines.md +++ b/en/application-dev/dfx/apprecovery-guidelines.md @@ -39,7 +39,7 @@ Fault management is an important way for applications to deliver a better user e - Fault query indicates that [faultLogger](../reference/apis/js-apis-faultLogger.md) obtains the fault information using its query API. -The figure below does not illustrate the time when [faultLogger](../reference/apis/js-apis-faultLogger.md) is called. You can refer to [LastExitReason](../reference/apis/js-apis-application-abilityConstant.md#abilityconstantlastexitreason) passed during application initialization to determine whether to call [faultLogger](../reference/apis/js-apis-faultLogger.md) to query the information about the last fault. +The figure below does not illustrate the time when [faultLogger](../reference/apis/js-apis-faultLogger.md) is called. You can refer to [LastExitReason](../reference/apis/js-apis-app-ability-abilityConstant.md#abilityconstantlastexitreason) passed during application initialization to determine whether to call [faultLogger](../reference/apis/js-apis-faultLogger.md) to query the information about the last fault. ![Fault rectification process](./figures/fault_rectification.png) It is recommended that you call [errorManager](../reference/apis/js-apis-application-errorManager.md) to process the exception. After the processing is complete, you can call the status saving API and restart the application. @@ -134,7 +134,7 @@ After the callback triggers **appRecovery.saveAppState()**, **onSaveState(state, - Restore data. -After the callback triggers **appRecovery.restartApp()**, the application is restarted. After the restart, **onSaveState(state, wantParams)** of **EntryAbility** is called, and the saved data is in **parameters** of **want**. +After the callback triggers **appRecovery.restartApp()**, the application is restarted. After the restart, **onCreate(want, launchParam)** of **EntryAbility** is called, and the saved data is in **parameters** of **want**. ```ts storage: LocalStorage diff --git a/en/application-dev/reference/apis/js-apis-pointer.md b/en/application-dev/reference/apis/js-apis-pointer.md index fc74447111..8ed463d9a5 100644 --- a/en/application-dev/reference/apis/js-apis-pointer.md +++ b/en/application-dev/reference/apis/js-apis-pointer.md @@ -278,7 +278,7 @@ Obtains the mouse pointer style. This API uses an asynchronous callback to retur import window from '@ohos.window'; window.getTopWindow((error, win) => { - win.getProperties((error, properties) => { + win.getWindowProperties((error, properties) => { let windowId = properties.id; if (windowId < 0) { console.log(`Invalid windowId`); @@ -321,7 +321,7 @@ Obtains the mouse pointer style. This API uses a promise to return the result. import window from '@ohos.window'; window.getTopWindow((error, win) => { - win.getProperties((error, properties) => { + win.getWindowProperties((error, properties) => { let windowId = properties.id; if (windowId < 0) { console.log(`Invalid windowId`); @@ -360,7 +360,7 @@ Sets the mouse pointer style. This API uses an asynchronous callback to return t import window from '@ohos.window'; window.getTopWindow((error, win) => { - win.getProperties((error, properties) => { + win.getWindowProperties((error, properties) => { let windowId = properties.id; if (windowId < 0) { console.log(`Invalid windowId`); @@ -398,7 +398,7 @@ Sets the mouse pointer style. This API uses a promise to return the result. import window from '@ohos.window'; window.getTopWindow((error, win) => { - win.getProperties((error, properties) => { + win.getWindowProperties((error, properties) => { let windowId = properties.id; if (windowId < 0) { console.log(`Invalid windowId`); diff --git a/en/application-dev/reference/apis/js-apis-system-fetch.md b/en/application-dev/reference/apis/js-apis-system-fetch.md index 529dc836e0..6829c569a3 100644 --- a/en/application-dev/reference/apis/js-apis-system-fetch.md +++ b/en/application-dev/reference/apis/js-apis-system-fetch.md @@ -21,8 +21,6 @@ fetch(Object): void Obtains data through a network. -**Required permission**: ohos.permission.INTERNET - **System capability**: SystemCapability.Communication.NetStack **Parameters** @@ -33,8 +31,8 @@ Obtains data through a network. | header | Object | No| Request header.| | method | string | No| Request method. The default value is **GET**. The value can be **OPTIONS**, **GET**, **HEAD**, **POST**, **PUT**, **DELETE **or **TRACE**.| | responseType | string | No| Response type. The return type can be text or JSON. By default, the return type is determined based on **Content-Type** in the header returned by the server. For details, see return values in the **success** callback.| -| success | Function | No| Called when the data is obtained successfully.| -| fail | Function | No| Called when the data failed to be obtained.| +| success | Function | No| Called when data is obtained successfully. The return value is [FetchResponse](#fetchresponse). | +| fail | Function | No| Called when data failed to be obtained.| | complete | Function | No| Called when the execution is complete.| **Table 1** Mapping between data and Content-Type @@ -46,7 +44,7 @@ Obtains data through a network. | Object | Not set| The default value of **Content-Type** is **application/x-www-form-urlencoded**. The **data** value is encoded based on the URL rule and appended in the request body.| | Object | application/x-www-form-urlencoded | The value of data is encoded based on the URL rule and is used as the request body.| -Return values in the **success** callback +## FetchResponse | Name| Type| Description| | -------- | -------- | -------- | -- GitLab