From 138edbbbe147ebd8529f341c39b89c7e210ce0ba Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Thu, 9 Jun 2022 19:21:26 +0800 Subject: [PATCH] update docs Signed-off-by: ester.zhou --- .../reference/apis/js-apis-workScheduler.md | 24 ++++++----- .../reference/arkui-js/Readme-EN.md | 1 + .../arkui-js/js-components-custom-style.md | 43 +++++++++++++++++++ .../work-scheduler-dev-guide.md | 12 +++--- en/readme/common-event-notification.md | 6 +-- 5 files changed, 66 insertions(+), 20 deletions(-) create mode 100644 en/application-dev/reference/arkui-js/js-components-custom-style.md diff --git a/en/application-dev/reference/apis/js-apis-workScheduler.md b/en/application-dev/reference/apis/js-apis-workScheduler.md index bd8e95ec9e..964b63aa2e 100644 --- a/en/application-dev/reference/apis/js-apis-workScheduler.md +++ b/en/application-dev/reference/apis/js-apis-workScheduler.md @@ -1,6 +1,6 @@ # Work Scheduler -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. API version 9 is a canary version for trial use. The APIs of this version may be unstable. @@ -100,7 +100,7 @@ Obtains the latest task status. This API uses an asynchronous callback to return ``` workScheduler.getWorkStatus(50, (err, res) => { if (err) { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); } else { for (let item in res) { console.info('workschedulerLog getWorkStatus success,' + item + ' is:' + res[item]); @@ -136,7 +136,7 @@ Obtains the latest task status. This API uses a promise to return the result. console.info('workschedulerLog getWorkStatus success,' + item + ' is:' + res[item]); } }).catch((err) => { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); }) ``` @@ -151,7 +151,7 @@ Obtains all tasks associated with this application. This API uses an asynchronou | Name | Type | Mandatory | Description | | -------- | -------------------- | ---- | ------------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return all tasks associated with the current application.| +| callback | AsyncCallback\ | Yes | Callback used to return all tasks associated with the current application. | **Return value** @@ -164,7 +164,7 @@ Obtains all tasks associated with this application. This API uses an asynchronou ``` workScheduler.obtainAllWorks((err, res) =>{ if (err) { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); } else { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); } @@ -182,7 +182,7 @@ Obtains all tasks associated with this application. This API uses a promise to r | Type | Description | | -------------------------------------- | ------------------------------ | -| Promise> | Promise used to return all tasks associated with the current application.| +| Promise> | Promise used to return all tasks associated with the current application. | **Example** @@ -190,7 +190,7 @@ Obtains all tasks associated with this application. This API uses a promise to r workScheduler.obtainAllWorks().then((res) => { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); }).catch((err) => { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); }) ``` @@ -233,7 +233,7 @@ Checks whether the last execution of the specified task timed out. This API uses ``` workScheduler.isLastWorkTimeOut(500, (err, res) =>{ if (err) { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); } else { console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); } @@ -267,7 +267,7 @@ Checks whether the last execution of the specified task timed out. This API uses console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); }) .catch(err => { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); }); ``` @@ -291,6 +291,8 @@ Provides detailed information about the task. | repeatCycleTime | number | No | Repeat interval. | | repeatCount | number | No | Number of repeat times. | | isPersisted | boolean | No | Whether to enable persistent storage for the task. | +| isDeepIdle | boolean | No | Whether the device needs to enter the idle state. | +| idleWaitTime | number | No | Time to wait in the idle state. | ## NetworkType Enumerates the network types that can trigger the task. @@ -319,7 +321,7 @@ Enumerates the charging types that can trigger the task. | CHARGING_PLUGGED_WIRELESS | 3 | Wireless charging. | ## BatteryStatus -Enumerates the battery status that can trigger the task. +Enumerates the battery states that can trigger the task. **System capability**: SystemCapability.ResourceSchedule.WorkScheduler @@ -330,7 +332,7 @@ Enumerates the battery status that can trigger the task. | BATTERY_STATUS_LOW_OR_OKAY | 2 | The battery level is restored from low to normal, or a low battery alert is displayed.| ## StorageRequest -Enumerates the storage status that can trigger the task. +Enumerates the storage states that can trigger the task. **System capability**: SystemCapability.ResourceSchedule.WorkScheduler diff --git a/en/application-dev/reference/arkui-js/Readme-EN.md b/en/application-dev/reference/arkui-js/Readme-EN.md index fd00b650bc..e5cbbdb935 100644 --- a/en/application-dev/reference/arkui-js/Readme-EN.md +++ b/en/application-dev/reference/arkui-js/Readme-EN.md @@ -101,6 +101,7 @@ - Custom Components - [Basic Usage](js-components-custom-basic-usage.md) + - [Style Inheritance](js-components-custom-style.md) - [Custom Events](js-components-custom-events.md) - [props](js-components-custom-props.md) - [Event Parameter](js-components-custom-event-parameter.md) diff --git a/en/application-dev/reference/arkui-js/js-components-custom-style.md b/en/application-dev/reference/arkui-js/js-components-custom-style.md new file mode 100644 index 0000000000..37e0770cde --- /dev/null +++ b/en/application-dev/reference/arkui-js/js-components-custom-style.md @@ -0,0 +1,43 @@ +# Style Inheritance +> **NOTE**
+> The APIs of this module are supported since API 9. Updates will be marked with a superscript to indicate their earliest API version. + +A custom component has the **inherit-class** attribute, which is defined in the following table. + +| Name | Type | Default Value| Mandatory| Description | +| ------------ | ------ | ------ | ---- | ------------------------------------------------------ | +| inherit-class | string | - | No | Class styles inherited from the parent component, seperated by spaces.| + +To enable a custom component to inherit the styles of its parent component, set the **inherit-calss** attribute for the custom component. + +The example below is a code snippet in the HML file of the parent page that references a custom component named **comp**. This component uses the **inherit-class** attribute to inherit the styles of its parent component: **parent-class1** and **parent-class2**. +```html + + + +
+ +
+``` + +Code snippet in the CSS file of the parent page: +```html +// xxx.css +.parent-class1 { + background-color:red; + border:2px; +} +.parent-class2 { + background-color:green; + border:2px; +} +``` + +Code snippet in the HML file of the custom component, where **parent-class1** and **parent-class2** are styles inherited from the parent component: +```html + +
+ Style 1 inherited from the parent component + Style 2 inherited from the parent component +
+``` diff --git a/en/application-dev/work-scheduler/work-scheduler-dev-guide.md b/en/application-dev/work-scheduler/work-scheduler-dev-guide.md index 5892d2dfe2..dfa30e4a5d 100644 --- a/en/application-dev/work-scheduler/work-scheduler-dev-guide.md +++ b/en/application-dev/work-scheduler/work-scheduler-dev-guide.md @@ -115,7 +115,7 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t workScheduler.getWorkStatus(50, (err, res) => { if (err) { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); } else { for (let item in res) { console.info('workschedulerLog getWorkStatuscallback success,' + item + ' is:' + res[item]); @@ -131,7 +131,7 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t console.info('workschedulerLog getWorkStatus success,' + item + ' is:' + res[item]); } }).catch((err) => { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); }) @@ -141,7 +141,7 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t workScheduler.obtainAllWorks((err, res) =>{ if (err) { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); } else { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); } @@ -152,7 +152,7 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t workScheduler.obtainAllWorks().then((res) => { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); }).catch((err) => { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); }) **Stopping and Clearing Work Scheduler Tasks** @@ -166,7 +166,7 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t workScheduler.isLastWorkTimeOut(500, (err, res) =>{ if (err) { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); } else { console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); } @@ -179,6 +179,6 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); }) .catch(err => { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); }); }) diff --git a/en/readme/common-event-notification.md b/en/readme/common-event-notification.md index cd92d60394..a4daa54864 100644 --- a/en/readme/common-event-notification.md +++ b/en/readme/common-event-notification.md @@ -14,7 +14,7 @@ Each application can subscribe to common events as required. After your applicat ### Architecture -![](figures/cesfwk_architecture_diagram.png "CES Architecture") +![]( figures/cesfwk_architecture_diagram.png "CES Architecture") ## Directory Structure @@ -36,10 +36,10 @@ Each application can subscribe to common events as required. After your applicat ## How to Use -For details, see *CommonEvent Development Guidelines*. +For details, see [Common Event Development](../application-dev/notification/common-event.md). ## Repositories Involved Common Event and Notification -[**notification_ces_standard**](https://gitee.com/openharmony/notification_ces_standard) +[**notification_ces_standard**](https://gitee.com/openharmony/notification_ces_standard) \ No newline at end of file -- GitLab