提交 769d4fc1 编写于 作者: E ester.zhou

update docs

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 ab99fe36
......@@ -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)
......
......@@ -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&lt;[File](#file)&gt; | Yes | List of files to upload, which is submitted through **multipart/form-data**. |
| data | Array&lt;[RequestData](#requestdata)&gt; | No | Form data in the request body. |
| data | Array&lt;[RequestData](#requestdata)&gt; | 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.<br/>The **dataability** and **internal** protocol types are supported. However, the **internal** protocol type supports only temporary directories. The following is an example:<br/>dataability:///com.domainname.dataability.persondata/person/10/file.txt<br/>internal://cache/path/to/file.txt |
| uri | string | Yes | Local path for storing files.<br/>The **dataability** and **internal** protocol types are supported. However, the **internal** protocol type supports only temporary directories. Below are examples:<br>dataability:///com.domainname.dataability.persondata/person/10/file.txt<br>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. |
......
# 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&lt;any&gt; | 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\<any> | 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\<any> | 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&lt;any&gt; | 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
......@@ -27,34 +27,31 @@ In addition, OpenHarmony provides a series of optional system components that ca
## Document Outline<a name="section19810171681218"></a>
- [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&nbsp;Scenario | Documents |
| Topic | Development Scenario | Documents |
| -------- | -------- | -------- |
| About&nbsp;OpenHarmony | Getting&nbsp;familiar&nbsp;with&nbsp;OpenHarmony | -&nbsp;[About&nbsp;OpenHarmony](https://gitee.com/openharmony)<br/>-&nbsp;[Glossary](../glossary.md) |
| Development&nbsp;resources | Preparing&nbsp;for&nbsp;your&nbsp;development | -&nbsp;[Obtaining&nbsp;Source&nbsp;Code](get-code/sourcecode-acquire.md)<br/>-&nbsp;[Tool&nbsp;Acquisition](get-code/gettools-acquire.md) |
| Quick&nbsp;start | Getting&nbsp;started&nbsp;with&nbsp;setup,&nbsp;build, burning,&nbsp;debugging,&nbsp;and running&nbsp;of&nbsp;OpenHarmony | [Mini&nbsp;and&nbsp;Small&nbsp;Systems](quick-start/quickstart-lite-overview.md) |
| Basic&nbsp;capabilities | Using&nbsp;basic&nbsp;capabilities&nbsp;of OpenHarmony | -&nbsp;[Kernel&nbsp;for&nbsp;Mini&nbsp;Systems](kernel/kernel-mini-overview.md)<br/>-&nbsp;[Kernel&nbsp;for&nbsp;Small&nbsp;Systems](kernel/kernel-small-overview.md)<br/>-&nbsp;[Drivers](driver/driver-hdf-overview.md)<br/>-&nbsp;[Subsystems](subsystems/subsys-build-mini-lite.md)<br/>-&nbsp;[Security&nbsp;Guidelines](security/security-guidelines-overall.md)<br/>-&nbsp;[Privacy&nbsp;Protection](security/security-privacy-protection.md) |
| Advanced&nbsp;development | Developing&nbsp;smart&nbsp;devices&nbsp;based on&nbsp;system&nbsp;capabilities | -&nbsp;[WLAN-connected&nbsp;Products](guide/device-wlan-led-control.md)<br/>-&nbsp;[Cameras&nbsp;Without&nbsp;a&nbsp;Screen](guide/device-iotcamera-control-overview.md)<br/>-&nbsp;[Cameras&nbsp;with&nbsp;a&nbsp;Screen](guide/device-camera-control-overview.md) |
| Porting&nbsp;and&nbsp;adaptation | -&nbsp;Porting&nbsp;and&nbsp;adapting&nbsp;the OpenHarmony&nbsp;to&nbsp;an&nbsp;SoC<br/>-&nbsp;Porting&nbsp;and&nbsp;adapting&nbsp;the<br/>&nbsp;OpenHarmony&nbsp;to&nbsp;a third-party&nbsp;library | -&nbsp;[Mini&nbsp;System&nbsp;SoC&nbsp;Porting&nbsp;Guide](porting/oem_transplant_chip_prepare_knows.md)<br/>-&nbsp;[Small&nbsp;System&nbsp;SoC&nbsp;Porting&nbsp;Guide](porting/porting-smallchip-prepare-needs.md)<br/>-&nbsp;[Third-Party&nbsp;Library&nbsp;Porting&nbsp;Guide&nbsp;for&nbsp;Mini&nbsp;and&nbsp;Small&nbsp;Systems](porting/porting-thirdparty-overview.md) |
| Contribution | Contributing&nbsp;components to&nbsp;OpenHarmony | -&nbsp;[HPM Part Overview](hpm-part/hpm-part-about.md)<br/>-&nbsp;[HPM Part Development](hpm-part/hpm-part-development.md)<br/>-&nbsp;[HPM Part Reference](hpm-part/hpm-part-reference.md) |
| Reference | Referring&nbsp;to&nbsp;development&nbsp;specifications | [FAQs](faqs/faqs-overview.md) |
| About OpenHarmony | Getting familiar with OpenHarmony | - [About OpenHarmony](https://gitee.com/openharmony)<br/>- [Glossary](../glossary.md) |
| Development resources | Preparing for your development | - [Obtaining Source Code](get-code/sourcecode-acquire.md)<br/>- [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)<br/>- [Kernel for Small Systems](kernel/kernel-small-overview.md)<br/>- [Drivers](driver/driver-hdf-overview.md)<br/>- [Subsystems](subsystems/subsys-build-mini-lite.md)<br/>- [Security Guidelines](security/security-guidelines-overall.md)<br/>- [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)<br/>- [Cameras Without a Screen](guide/device-iotcamera-control-overview.md)<br/>- [Cameras with a Screen](guide/device-camera-control-overview.md) |
| Porting and adaptation | - Porting and adapting the OpenHarmony to an SoC<br/>- Porting and adapting the<br/> OpenHarmony to a third-party library | - [Mini System SoC Porting Guide](porting/oem_transplant_chip_prepare_knows.md)<br/>- [Small System SoC Porting Guide](porting/porting-smallchip-prepare-needs.md)<br/>- [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)<br/>- [HPM Part Development](hpm-part/hpm-part-development.md)<br/>- [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&nbsp;Scenario | Documents |
| Topic | Development Scenario | Documents |
| -------- | -------- | -------- |
| About&nbsp;OpenHarmony | Getting&nbsp;familiar&nbsp;with&nbsp;OpenHarmony | -&nbsp;[About&nbsp;OpenHarmony](https://gitee.com/openharmony/docs/blob/master/en/OpenHarmony-Overview.md)<br/>-&nbsp;[Glossary](../glossary.md) |
| Development&nbsp;resources | Preparing&nbsp;for&nbsp;your&nbsp;development | -&nbsp;[Obtaining&nbsp;Source&nbsp;Code](get-code/sourcecode-acquire.md)<br/>-&nbsp;[Tool&nbsp;Acquisition](get-code/gettools-acquire.md) |
| Quick&nbsp;start | Getting&nbsp;started&nbsp;with&nbsp;setup,&nbsp;build, burning,&nbsp;debugging,&nbsp;and running&nbsp;of&nbsp;OpenHarmony | [Standard&nbsp;System](quick-start/quickstart-standard-overview.md) |
| Basic&nbsp;capabilities | Using&nbsp;basic&nbsp;capabilities&nbsp;of&nbsp;OpenHarmony | -&nbsp;[Kernel&nbsp;for&nbsp;Standard&nbsp;Systems](kernel/kernel-standard-overview.md)<br/>-&nbsp;[Drivers](driver/driver-hdf-overview.md)<br/>-&nbsp;[Subsystems](subsystems/subsys-build-standard-large.md)<br/>-&nbsp;[Security&nbsp;Guidelines](security/security-guidelines-overall.md)<br/>-&nbsp;[Privacy&nbsp;Protection](security/security-privacy-protection.md) |
| Advanced&nbsp;development | Developing&nbsp;smart&nbsp;devices based&nbsp;on&nbsp;system&nbsp;capabilities | -&nbsp;[Development&nbsp;Guidelines&nbsp;on&nbsp;Clock&nbsp;Apps](guide/device-clock-guide.md)<br/>-&nbsp;[Development&nbsp;Example&nbsp;for&nbsp;Platform&nbsp;Drivers](guide/device-driver-demo.md)<br/>-&nbsp;[Development&nbsp;Example&nbsp;for&nbsp;Peripheral&nbsp;Drivers](guide/device-outerdriver-demo.md) |
| Porting&nbsp;and&nbsp;adaptation | Porting&nbsp;and&nbsp;adapting&nbsp;the OpenHarmony&nbsp;to&nbsp;a&nbsp;third-party&nbsp;library | -&nbsp;[Standard&nbsp;System&nbsp;Porting&nbsp;Guide](porting/standard-system-porting-guide.md)<br/>-&nbsp;[A&nbsp;Method&nbsp;for&nbsp;Rapidly&nbsp;Porting&nbsp;the&nbsp;OpenHarmony&nbsp;Linux&nbsp;Kernel](porting/porting-linux-kernel.md) |
| Contribution | Contributing components to OpenHarmony | -&nbsp;[HPM Part Overview](hpm-part/hpm-part-about.md)<br/>-&nbsp;[HPM Part Development](hpm-part/hpm-part-development.md)<br/>-&nbsp;[HPM Part Reference](hpm-part/hpm-part-reference.md) |
| Reference | Referring&nbsp;to&nbsp;development&nbsp;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)<br/>- [Glossary](../glossary.md) |
| Development resources | Preparing for your development | - [Obtaining Source Code](get-code/sourcecode-acquire.md)<br/>- [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)<br/>- [Drivers](driver/driver-hdf-overview.md)<br/>- [Subsystems](subsystems/subsys-build-standard-large.md)<br/>- [Security Guidelines](security/security-guidelines-overall.md)<br/>- [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)<br/>- [Development Example for Platform Drivers](guide/device-driver-demo.md)<br/>- [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)<br/>- [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)<br/>- [HPM Part Development](hpm-part/hpm-part-development.md)<br/>- [HPM Part Reference](hpm-part/hpm-part-reference.md) |
| Reference | Referring to development specifications | [FAQs](faqs/faqs-overview.md) |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册