提交 f7af39a1 编写于 作者: G Gloria

Update docs against 9682+9404+9515+9285+9556

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 11a50470
......@@ -41,7 +41,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar
"module": {
"abilities": [
{
"continuable": true,
"continuable": true
}
]
}
......@@ -62,7 +62,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar
"module": {
"abilities": [
{
"launchType": "standard",
"launchType": "standard"
}
]
}
......@@ -76,7 +76,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar
"module": {
"abilities": [
{
"launchType": "singleton",
"launchType": "singleton"
}
]
}
......
......@@ -10,6 +10,8 @@ The **LauncherAbilityInfo** module provides information about a launcher ability
**System capability**: SystemCapability.BundleManager.BundleFramework
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Type | Readable| Writable| Description |
| --------------- | ---------------------------------------------------- | ---- | ---- | ------------------------------------ |
| applicationInfo | [ApplicationInfo](js-apis-bundle-ApplicationInfo.md) | Yes | No | Application information of the launcher ability.|
......
......@@ -10,7 +10,9 @@ The **DispatchInfo** module provides dispatch information.
**System capability**: SystemCapability.BundleManager.BundleFramework
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Type | Readable| Writable| Description |
| ----------- | ------ | ---- | ---- | ------------------------ |
| verison | string | Yes | No | Version of the API to dispatch.|
| version | string | Yes | No | Version of the API to dispatch.|
| dispatchAPI | string | Yes | No | API to dispatch. |
......@@ -12,9 +12,9 @@ The **ExtensionRunningInfo** module provides running information and states for
The Extension ability running information is obtained through an **abilityManager** instance.
```js
import abilitymanager from '@ohos.application.abilityManager';
import abilityManager from '@ohos.application.abilityManager';
let upperLimit=1
abilitymanager.getExtensionRunningInfos(upperLimit, (err,data) => {
abilityManager.getExtensionRunningInfos(upperLimit, (err,data) => {
console.log("getExtensionRunningInfos err: " + err + " data: " + JSON.stringify(data));
});
```
......
......@@ -43,7 +43,7 @@ Describes the options for showing the toast.
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| message | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Text to display. |
| message | string\| [Resource](../../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Text to display. |
| duration | number | No | Duration that the toast will remain on the screen. The default value is 1500 ms. The value range is 1500 ms to 10000 ms. If a value less than 1500 ms is set, the default value is used. If the value greater than 10000 ms is set, the upper limit 10000 ms is used.|
| bottom | string\| number | No | Distance between the toast border and the bottom of the screen. |
......@@ -140,8 +140,8 @@ Describes the options for showing the dialog box.
| Name | Type | Mandatory | Description |
| ------- | ---------------------------------------- | ---- | ---------------------------------------- |
| title | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Title of the dialog box. |
| message | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Text body. |
| title | string\| [Resource](../../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Title of the dialog box. |
| message | string\| [Resource](../../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Text body. |
| buttons | Array | No | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. Up to three buttons are supported. The first button is of the **positiveButton** type, the second is of the **negativeButton** type, and the third is of the **neutralButton** type.|
## ShowDialogSuccessResponse
......@@ -246,7 +246,7 @@ Describes the options for showing the action menu.
| Name | Type | Mandatory | Description |
| ------- | ---------------------------------------- | ---- | ---------------------------------------- |
| title | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Title of the text to display. |
| title | string\| [Resource](../../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Title of the text to display. |
| buttons | Array&lt;[Button](#button)&gt; | Yes | Array of menu item buttons. The array structure is **{text:'button', color: '\#666666'}**. Up to six buttons are supported. If there are more than six buttons, extra buttons will not be displayed.|
## ActionMenuSuccessResponse
......@@ -267,5 +267,5 @@ Describes the menu item button in the action menu.
| Name | Type | Mandatory | Description |
| ----- | ---------------------------------------- | ---- | ------- |
| text | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Button text.|
| color | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Text color of the button.|
| text | string\| [Resource](../../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Button text.|
| color | string\| [Resource](../../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Text color of the button.|
......@@ -64,17 +64,18 @@ A constructor used to create a **Worker** instance.
**Example**
```js
import worker from '@ohos.worker';
// Create a worker thread.
// In the FA model, the workers and pages directories are at the same level.
const workerInstance = new worker.Worker("workers/worker.js", {name:"first worker"});
const workerFAModel01 = new worker.Worker("workers/worker.js", {name:"first worker"});
// In the FA model, the workers and pages directories are at different levels.
const workerInstance = new worker.Worker("../workers/worker.js", {name:"first worker"});
const workerFAModel02 = new worker.Worker("../workers/worker.js", {name:"first worker"});
// In the stage model, the workers and pages directories are at the same level.
const workerInstance = new worker.Worker('entry/ets/workers/worker.ts');
const workerStageModel01 = new worker.Worker('entry/ets/workers/worker.ts');
// In the stage model, the workers and pages directories are at different levels.
const workerInstance = new worker.Worker('entry/ets/pages/workers/worker.ts');
const workerStageModel02 = new worker.Worker('entry/ets/pages/workers/worker.ts');
// scriptURL—— Description of "entry/ets/workers/worker.ts".
// entry is the value of the name attribute under module in the module.json5 file.
......@@ -144,8 +145,9 @@ Sends a message to the worker thread. The message data is transferred using the
```js
const workerInstance = new worker.Worker("workers/worker.js");
workerInstance.postMessage("hello world");
const workerInstance= new worker.Worker("workers/worker.js");
var buffer = new ArrayBuffer(8);
workerInstance.postMessage(buffer, [buffer]);
```
......@@ -290,7 +292,7 @@ workerInstance.onerror = function(e) {
### onmessage
onmessage?: (event: MessageEvent) =&gt; void
onmessage?: (event: MessageEvent\<T>) =&gt; void
Defines the event handler to be called when the host thread receives a message sent by the worker thread through **parentPort.postMessage**. The event handler is executed in the host thread.
......@@ -316,7 +318,7 @@ workerInstance.onmessage = function(e) {
### onmessageerror
onmessageerror?: (event: MessageEvent) =&gt; void
onmessageerror?: (event: MessageEvent\<T>) =&gt; void
Defines the event handler to be called when the worker thread receives a message that cannot be serialized. The event handler is executed in the host thread.
......@@ -503,7 +505,7 @@ parentPort.onmessage = function(e) {
### onmessage
onmessage?: (event: MessageEvent) =&gt; void
onmessage?: (event: MessageEvent\<T>) =&gt; void
Defines the event handler to be called when the worker thread receives a message sent by the host thread through **worker.postMessage**. The event handler is executed in the worker thread.
......@@ -535,7 +537,7 @@ parentPort.onmessage = function(e) {
### onmessageerror
onmessageerror?: (event: MessageEvent) =&gt; void
onmessageerror?: (event: MessageEvent\<T>) =&gt; void
Defines the event handler to be called when the worker thread receives a message that cannot be deserialized. The event handler is executed in the worker thread.
......@@ -780,3 +782,7 @@ Configuration of the **build-profile.json5** file:
}
}
```
## Precautions
Currently, a maximum of seven workers can co-exist.
If the number of workers exceeds the upper limit, the error message "Too many workers, the number of workers exceeds the maximum." is displayed.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册