提交 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 ...@@ -41,7 +41,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar
"module": { "module": {
"abilities": [ "abilities": [
{ {
"continuable": true, "continuable": true
} }
] ]
} }
...@@ -62,7 +62,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar ...@@ -62,7 +62,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar
"module": { "module": {
"abilities": [ "abilities": [
{ {
"launchType": "standard", "launchType": "standard"
} }
] ]
} }
...@@ -76,7 +76,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar ...@@ -76,7 +76,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar
"module": { "module": {
"abilities": [ "abilities": [
{ {
"launchType": "singleton", "launchType": "singleton"
} }
] ]
} }
......
...@@ -10,6 +10,8 @@ The **LauncherAbilityInfo** module provides information about a launcher ability ...@@ -10,6 +10,8 @@ The **LauncherAbilityInfo** module provides information about a launcher ability
**System capability**: SystemCapability.BundleManager.BundleFramework **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 | | Name | Type | Readable| Writable| Description |
| --------------- | ---------------------------------------------------- | ---- | ---- | ------------------------------------ | | --------------- | ---------------------------------------------------- | ---- | ---- | ------------------------------------ |
| applicationInfo | [ApplicationInfo](js-apis-bundle-ApplicationInfo.md) | Yes | No | Application information of the launcher ability.| | 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. ...@@ -10,7 +10,9 @@ The **DispatchInfo** module provides dispatch information.
**System capability**: SystemCapability.BundleManager.BundleFramework **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 | | 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. | | dispatchAPI | string | Yes | No | API to dispatch. |
...@@ -12,9 +12,9 @@ The **ExtensionRunningInfo** module provides running information and states for ...@@ -12,9 +12,9 @@ The **ExtensionRunningInfo** module provides running information and states for
The Extension ability running information is obtained through an **abilityManager** instance. The Extension ability running information is obtained through an **abilityManager** instance.
```js ```js
import abilitymanager from '@ohos.application.abilityManager'; import abilityManager from '@ohos.application.abilityManager';
let upperLimit=1 let upperLimit=1
abilitymanager.getExtensionRunningInfos(upperLimit, (err,data) => { abilityManager.getExtensionRunningInfos(upperLimit, (err,data) => {
console.log("getExtensionRunningInfos err: " + err + " data: " + JSON.stringify(data)); console.log("getExtensionRunningInfos err: " + err + " data: " + JSON.stringify(data));
}); });
``` ```
......
...@@ -43,7 +43,7 @@ Describes the options for showing the toast. ...@@ -43,7 +43,7 @@ Describes the options for showing the toast.
| Name | Type | Mandatory | Description | | 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.| | 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. | | 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. ...@@ -140,8 +140,8 @@ Describes the options for showing the dialog box.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | ---------------------------------------- | ---- | ---------------------------------------- | | ------- | ---------------------------------------- | ---- | ---------------------------------------- |
| title | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Title of the dialog box. | | 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. | | 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.| | 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 ## ShowDialogSuccessResponse
...@@ -246,7 +246,7 @@ Describes the options for showing the action menu. ...@@ -246,7 +246,7 @@ Describes the options for showing the action menu.
| Name | Type | Mandatory | Description | | 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.| | 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 ## ActionMenuSuccessResponse
...@@ -267,5 +267,5 @@ Describes the menu item button in the action menu. ...@@ -267,5 +267,5 @@ Describes the menu item button in the action menu.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ---------------------------------------- | ---- | ------- | | ----- | ---------------------------------------- | ---- | ------- |
| text | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Button text.| | 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.| | 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. ...@@ -64,17 +64,18 @@ A constructor used to create a **Worker** instance.
**Example** **Example**
```js ```js
import worker from '@ohos.worker';
// Create a worker thread. // Create a worker thread.
// In the FA model, the workers and pages directories are at the same level. // 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. // 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. // 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. // 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". // scriptURL—— Description of "entry/ets/workers/worker.ts".
// entry is the value of the name attribute under module in the module.json5 file. // 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 ...@@ -144,8 +145,9 @@ Sends a message to the worker thread. The message data is transferred using the
```js ```js
const workerInstance = new worker.Worker("workers/worker.js"); const workerInstance = new worker.Worker("workers/worker.js");
workerInstance.postMessage("hello world"); workerInstance.postMessage("hello world");
const workerInstance= new worker.Worker("workers/worker.js");
var buffer = new ArrayBuffer(8); var buffer = new ArrayBuffer(8);
workerInstance.postMessage(buffer, [buffer]); workerInstance.postMessage(buffer, [buffer]);
``` ```
...@@ -290,7 +292,7 @@ workerInstance.onerror = function(e) { ...@@ -290,7 +292,7 @@ workerInstance.onerror = function(e) {
### onmessage ### 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. 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) { ...@@ -316,7 +318,7 @@ workerInstance.onmessage = function(e) {
### onmessageerror ### 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. 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) { ...@@ -503,7 +505,7 @@ parentPort.onmessage = function(e) {
### onmessage ### 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. 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) { ...@@ -535,7 +537,7 @@ parentPort.onmessage = function(e) {
### onmessageerror ### 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. 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: ...@@ -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.
先完成此消息的编辑!
想要评论请 注册