diff --git a/en/application-dev/application-dev-guide-for-gitee.md b/en/application-dev/application-dev-guide-for-gitee.md index aaefaf25e04f5455ce8081cb38c75ecf62f5a06e..4b3ea45a7f6016a92f8e04b3feaa1fda77b07b76 100644 --- a/en/application-dev/application-dev-guide-for-gitee.md +++ b/en/application-dev/application-dev-guide-for-gitee.md @@ -54,7 +54,7 @@ They are organized as follows: - [Component Reference (JavaScript-based Web-like Development Paradigm)](reference/arkui-js/Readme-EN.md) - [Component Reference (TypeScript-based Declarative Development Paradigm)](reference/arkui-ts/Readme-EN.md) - APIs - - [JS and TS APIs](reference/apis/Readme-CN.md) + - [JS and TS APIs](reference/apis/Readme-EN.md) - Native APIs - [Standard Libraries](reference/native-lib/third_party_libc/musl.md) - [Node_API](reference/native-lib/third_party_napi/napi.md) diff --git a/en/application-dev/reference/apis/js-apis-request.md b/en/application-dev/reference/apis/js-apis-request.md index fec9be3f8e6b9e7cf42f741f357710c99650c2c3..256be1a80f2dce94e12538ad5c5c97876bdac634 100644 --- a/en/application-dev/reference/apis/js-apis-request.md +++ b/en/application-dev/reference/apis/js-apis-request.md @@ -335,10 +335,10 @@ Removes this upload task. This API uses an asynchronous callback to return the r | Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- | | url | string | Yes | Resource URL. | -| header | object | No | HTTP or HTTPS header added to an upload request. | -| method | string | No | Request methods available: **POST** and **PUT**. The default value is **POST**. | +| header | object | Yes | HTTP or HTTPS header added to an upload request. | +| method | string | Yes | Request methods available: **POST** and **PUT**. The default value is **POST**. | | files | Array<[File](#file)> | Yes | List of files to upload, which is submitted through **multipart/form-data**. | -| data | Array<[RequestData](#requestdata)> | No | Form data in the request body. | +| data | Array<[RequestData](#requestdata)> | Yes | Form data in the request body. | ## File @@ -349,7 +349,7 @@ Removes this upload task. This API uses an asynchronous callback to return the r | -------- | -------- | -------- | -------- | | filename | string | No | File name in the header when **multipart** is used. | | name | string | No | Name of a form item when **multipart** is used. The default value is **file**. | -| uri | string | Yes | Local path for storing files.
The **dataability** and **internal** protocol types are supported. However, the **internal** protocol type supports only temporary directories. The following is an example:
dataability:///com.domainname.dataability.persondata/person/10/file.txt
internal://cache/path/to/file.txt | +| uri | string | Yes | Local path for storing files.
The **dataability** and **internal** protocol types are supported. However, the **internal** protocol type supports only temporary directories. Below are examples:
dataability:///com.domainname.dataability.persondata/person/10/file.txt
internal://cache/path/to/file.txt | | type | string | No | Type of the file content. By default, the type is obtained based on the extension of the file name or URI. | diff --git a/en/application-dev/reference/apis/js-apis-timer.md b/en/application-dev/reference/apis/js-apis-timer.md index e85037469d3dd0d931ea7de0a37df77d35880bae..d144a95db8f59ca0605fd228b351380afe6feac8 100644 --- a/en/application-dev/reference/apis/js-apis-timer.md +++ b/en/application-dev/reference/apis/js-apis-timer.md @@ -1,50 +1,45 @@ # Timer -> **NOTE:** The initial APIs of this module are supported since API version 4. Newly added APIs will be marked with a superscript to indicate their earliest API version. -## Module to Import - -None +## setTimeout -## Required Permissions +## Modules to Import -None -## setTimeout +``` +import Time from '@ohos.Time'; +``` -setTimeout(handler[,delay[, ...args]]): number +setTimeout(handler[,delay[,…args]]): number Sets a timer for the system to call a function after the timer goes off. -- Parameters +**Parameters** - +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| handler | Function | Yes| Function to be called after the timer goes off.| +| delay | number | No| Number of milliseconds delayed before the execution. If this parameter is left empty, the default value **0** is used, which means that the execution starts immediately or as soon as possible.| +| ...args | Array<any> | No| Additional parameters to pass to the handler after the timer goes off.| - | Name | Type | Mandatory | Description | - | ------- | ----------- | --------- | ------------------------------------------------------------ | - | handler | Function | Yes | Function to be called after the timer goes off. | - | delay | number | No | Number of milliseconds delayed before the execution. If this parameter is left empty, the default value **0** is used, which means that the execution starts immediately or as soon as possible. | - | ...args | Array\ | No | Additional parameter to pass to the handler after the timer goes off. | +**Return value** -- Return Value +| Type| Description| +| -------- | -------- | +| number | Timer ID.| - +**Example** - | Type | Description | - | ------ | ----------- | - | number | Timer ID. | - -- Example - - ``` - export default { - setTimeOut() { - var timeoutID = setTimeout(function() { - console.log('delay 1s'); - }, 1000); - } +```js +export default { + setTimeOut() { + var timeoutID = setTimeout(function() { + console.log('delay 1s'); + }, 1000); } - ``` +} +``` + ## clearTimeout @@ -52,26 +47,25 @@ clearTimeout(timeoutID: number): void Cancels the timer created via **setTimeout()**. -- Parameter +**Parameters** - +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| timeoutID | number | Yes| ID of the timer to cancel, which is returned by **setTimeout()**| - | Name | Type | Mandatory | Description | - | --------- | ------ | --------- | ------------------------------------------------------------ | - | timeoutID | number | Yes | ID of the timer to cancel, which is returned by **setTimeout()** | +**Example** -- Example - - ``` - export default { - clearTimeOut() { - var timeoutID = setTimeout(function() { - console.log('do after 1s delay.'); - }, 1000); - clearTimeout(timeoutID); - } +```js +export default { + clearTimeOut() { + var timeoutID = setTimeout(function() { + console.log('do after 1s delay.'); + }, 1000); + clearTimeout(timeoutID); } - ``` +} +``` + ## setInterval @@ -79,35 +73,32 @@ setInterval(handler[, delay[, ...args]]): number Sets a repeating timer for the system to repeatedly call a function at a fixed interval. -- Parameters - - +**Parameters** - | Name | Type | Mandatory | Description | - | ------- | ----------- | --------- | ------------------------------------------------------------ | - | handler | Function | Yes | Function to be called repeatedly | - | delay | number | No | Number of milliseconds delayed before the execution | - | ...args | Array\ | No | Additional parameter to pass to the handler after the timer goes off | +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| handler | Function | Yes| Function to be called repeatedly.| +| delay | number | No| Number of milliseconds delayed before the execution.| +| ...args | Array<any> | No| Additional parameters to pass to the handler after the timer goes off.| -- Return Value +**Return value** - +| Type| Description| +| -------- | -------- | +| number | ID of the repeating timer.| - | Type | Description | - | ------ | ------------------------- | - | number | ID of the repeated timer. | +**Example** -- Example - - ``` - export default { - setInterval() { - var intervalID = setInterval(function() { - console.log('do very 1s.'); - }, 1000); - } +```js +export default { + setInterval() { + var intervalID = setInterval(function() { + console.log('do very 1s.'); + }, 1000); } - ``` +} +``` + ## clearInterval @@ -115,23 +106,21 @@ clearInterval(intervalID: number): void Cancels the repeating timer set via **setInterval()**. -- Parameter - - +**Parameters** - | Name | Type | Mandatory | Description | - | ---------- | ------ | --------- | ------------------------------------------------------------ | - | intervalID | number | Yes | ID of the repeating timer to cancel, which is returned by **setInterval()**. | +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| intervalID | number | Yes| ID of the repeating timer to cancel, which is returned by **setInterval()**.| -- Example +**Example** - ``` - export default { - clearInterval() { - var intervalID = setInterval(function() { - console.log('do very 1s.'); - }, 1000); - clearInterval(intervalID); - } +```js +export default { + clearInterval() { + var intervalID = setInterval(function() { + console.log('do very 1s.'); + }, 1000); + clearInterval(intervalID); } - ``` \ No newline at end of file +} +``` \ No newline at end of file diff --git a/en/device-dev/device-dev-guide.md b/en/device-dev/device-dev-guide.md index e61f7bbd41f623358b5fa3832df0235492463d5e..70b8a7ce354890cfa42386a58de9031a949a0c61 100644 --- a/en/device-dev/device-dev-guide.md +++ b/en/device-dev/device-dev-guide.md @@ -27,34 +27,31 @@ In addition, OpenHarmony provides a series of optional system components that ca ## Document Outline -- [Mini and Small System Development Guidelines](#table3762949121211) -- [Standard System Development Guidelines](#table17667535516) - **Table 1** Mini and small system development guidelines \(reference memory < 128 MB\) -| Topic | Development Scenario | Documents | +| Topic | Development Scenario | Documents | | -------- | -------- | -------- | -| About OpenHarmony | Getting familiar with OpenHarmony | - [About OpenHarmony](https://gitee.com/openharmony)
- [Glossary](../glossary.md) | -| Development resources | Preparing for your development | - [Obtaining Source Code](get-code/sourcecode-acquire.md)
- [Tool Acquisition](get-code/gettools-acquire.md) | -| Quick start | Getting started with setup, build, burning, debugging, and running of OpenHarmony | [Mini and Small Systems](quick-start/quickstart-lite-overview.md) | -| Basic capabilities | Using basic capabilities of OpenHarmony | - [Kernel for Mini Systems](kernel/kernel-mini-overview.md)
- [Kernel for Small Systems](kernel/kernel-small-overview.md)
- [Drivers](driver/driver-hdf-overview.md)
- [Subsystems](subsystems/subsys-build-mini-lite.md)
- [Security Guidelines](security/security-guidelines-overall.md)
- [Privacy Protection](security/security-privacy-protection.md) | -| Advanced development | Developing smart devices based on system capabilities | - [WLAN-connected Products](guide/device-wlan-led-control.md)
- [Cameras Without a Screen](guide/device-iotcamera-control-overview.md)
- [Cameras with a Screen](guide/device-camera-control-overview.md) | -| Porting and adaptation | - Porting and adapting the OpenHarmony to an SoC
- Porting and adapting the
 OpenHarmony to a third-party library | - [Mini System SoC Porting Guide](porting/oem_transplant_chip_prepare_knows.md)
- [Small System SoC Porting Guide](porting/porting-smallchip-prepare-needs.md)
- [Third-Party Library Porting Guide for Mini and Small Systems](porting/porting-thirdparty-overview.md) | -| Contribution | Contributing components to OpenHarmony | - [HPM Part Overview](hpm-part/hpm-part-about.md)
- [HPM Part Development](hpm-part/hpm-part-development.md)
- [HPM Part Reference](hpm-part/hpm-part-reference.md) | -| Reference | Referring to development specifications | [FAQs](faqs/faqs-overview.md) | +| About OpenHarmony | Getting familiar with OpenHarmony | - [About OpenHarmony](https://gitee.com/openharmony)
- [Glossary](../glossary.md) | +| Development resources | Preparing for your development | - [Obtaining Source Code](get-code/sourcecode-acquire.md)
- [Tool Acquisition](get-code/gettools-acquire.md) | +| Quick start | Getting started with setup, build, burning, debugging, and running of OpenHarmony | [Mini and Small Systems](quick-start/quickstart-lite-overview.md) | +| Basic capabilities | Using basic capabilities of OpenHarmony | - [Kernel for Mini Systems](kernel/kernel-mini-overview.md)
- [Kernel for Small Systems](kernel/kernel-small-overview.md)
- [Drivers](driver/driver-hdf-overview.md)
- [Subsystems](subsystems/subsys-build-mini-lite.md)
- [Security Guidelines](security/security-guidelines-overall.md)
- [Privacy Protection](security/security-privacy-protection.md) | +| Advanced development | Developing smart devices based on system capabilities | - [WLAN-connected Products](guide/device-wlan-led-control.md)
- [Cameras Without a Screen](guide/device-iotcamera-control-overview.md)
- [Cameras with a Screen](guide/device-camera-control-overview.md) | +| Porting and adaptation | - Porting and adapting the OpenHarmony to an SoC
- Porting and adapting the
OpenHarmony to a third-party library | - [Mini System SoC Porting Guide](porting/oem_transplant_chip_prepare_knows.md)
- [Small System SoC Porting Guide](porting/porting-smallchip-prepare-needs.md)
- [Third-Party Library Porting Guide for Mini and Small Systems](porting/porting-thirdparty-overview.md) | +| Contribution | Contributing components to OpenHarmony | - [HPM Part Overview](hpm-part/hpm-part-about.md)
- [HPM Part Development](hpm-part/hpm-part-development.md)
- [HPM Part Reference](hpm-part/hpm-part-reference.md) | +| Reference | Referring to development specifications | [FAQs](faqs/faqs-overview.md) | **Table 2** Standard system development guidelines \(reference memory ≥ 128 MB\) -| Topic | Development Scenario | Documents | +| Topic | Development Scenario | Documents | | -------- | -------- | -------- | -| About OpenHarmony | Getting familiar with OpenHarmony | - [About OpenHarmony](https://gitee.com/openharmony/docs/blob/master/en/OpenHarmony-Overview.md)
- [Glossary](../glossary.md) | -| Development resources | Preparing for your development | - [Obtaining Source Code](get-code/sourcecode-acquire.md)
- [Tool Acquisition](get-code/gettools-acquire.md) | -| Quick start | Getting started with setup, build, burning, debugging, and running of OpenHarmony | [Standard System](quick-start/quickstart-standard-overview.md) | -| Basic capabilities | Using basic capabilities of OpenHarmony | - [Kernel for Standard Systems](kernel/kernel-standard-overview.md)
- [Drivers](driver/driver-hdf-overview.md)
- [Subsystems](subsystems/subsys-build-standard-large.md)
- [Security Guidelines](security/security-guidelines-overall.md)
- [Privacy Protection](security/security-privacy-protection.md) | -| Advanced development | Developing smart devices based on system capabilities | - [Development Guidelines on Clock Apps](guide/device-clock-guide.md)
- [Development Example for Platform Drivers](guide/device-driver-demo.md)
- [Development Example for Peripheral Drivers](guide/device-outerdriver-demo.md) | -| Porting and adaptation | Porting and adapting the OpenHarmony to a third-party library | - [Standard System Porting Guide](porting/standard-system-porting-guide.md)
- [A Method for Rapidly Porting the OpenHarmony Linux Kernel](porting/porting-linux-kernel.md) | -| Contribution | Contributing components to OpenHarmony | - [HPM Part Overview](hpm-part/hpm-part-about.md)
- [HPM Part Development](hpm-part/hpm-part-development.md)
- [HPM Part Reference](hpm-part/hpm-part-reference.md) | -| Reference | Referring to development specifications | [FAQs](faqs/faqs-overview.md) | +| About OpenHarmony | Getting familiar with OpenHarmony | - [About OpenHarmony](https://gitee.com/openharmony/docs/blob/master/en/OpenHarmony-Overview.md)
- [Glossary](../glossary.md) | +| Development resources | Preparing for your development | - [Obtaining Source Code](get-code/sourcecode-acquire.md)
- [Tool Acquisition](get-code/gettools-acquire.md) | +| Quick start | Getting started with setup, build, burning, debugging, and running of OpenHarmony | [Standard System](quick-start/quickstart-standard-overview.md) | +| Basic capabilities | Using basic capabilities of OpenHarmony | - [Kernel for Standard Systems](kernel/kernel-standard-overview.md)
- [Drivers](driver/driver-hdf-overview.md)
- [Subsystems](subsystems/subsys-build-standard-large.md)
- [Security Guidelines](security/security-guidelines-overall.md)
- [Privacy Protection](security/security-privacy-protection.md) | +| Advanced development | Developing smart devices based on system capabilities | - [Development Guidelines on Clock Apps](guide/device-clock-guide.md)
- [Development Example for Platform Drivers](guide/device-driver-demo.md)
- [Development Example for Peripheral Drivers](guide/device-outerdriver-demo.md) | +| Porting and adaptation | Porting and adapting the OpenHarmony to a third-party library | - [Standard System Porting Guide](porting/standard-system-porting-guide.md)
- [A Method for Rapidly Porting the OpenHarmony Linux Kernel](porting/porting-linux-kernel.md) | +| Contribution | Contributing components to OpenHarmony | - [HPM Part Overview](hpm-part/hpm-part-about.md)
- [HPM Part Development](hpm-part/hpm-part-development.md)
- [HPM Part Reference](hpm-part/hpm-part-reference.md) | +| Reference | Referring to development specifications | [FAQs](faqs/faqs-overview.md) |