diff --git a/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md b/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md
index 13cfb0005a19959b23f14334296a9398a0308d0a..9e0d3e602e74c621b139bdc45857f2ce3d395490 100644
--- a/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md
+++ b/en/application-dev/reference/apis/js-apis-application-abilityDelegator.md
@@ -1,6 +1,6 @@
# AbilityDelegator
-> **Note**
+> **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -423,7 +423,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------ |
-| want | [Want](js-apis-featureAbility.md#Want) | Yes | **Want** parameter for starting the ability. |
+| want | [Want](js-apis-application-Want.md) | Yes | **Want** parameter for starting the ability. |
| callback | AsyncCallback\ | Yes | Callback used to return the result.|
**Example**
@@ -455,7 +455,7 @@ Starts an ability. This API uses a promise to return the result.
| Name| Type | Mandatory| Description |
| ------ | -------------------------------------- | ---- | --------------- |
-| want | [Want](js-apis-featureAbility.md#Want) | Yes | **Want** parameter for starting the ability.|
+| want | [Want](js-apis-application-Want.md) | Yes | **Want** parameter for starting the ability.|
**Return value**
diff --git a/en/application-dev/reference/apis/js-apis-formextension.md b/en/application-dev/reference/apis/js-apis-formextension.md
index f7302bbc65e031f06b732d519c8320172278ab83..dea964de0b45fdeca88defea6cb06cd70d8eb43a 100644
--- a/en/application-dev/reference/apis/js-apis-formextension.md
+++ b/en/application-dev/reference/apis/js-apis-formextension.md
@@ -1,6 +1,6 @@
# FormExtension
-> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Provides **FormExtension** APIs.
@@ -35,7 +35,7 @@ Called to notify the widget provider that a **Form** instance (widget) has been
| Name| Type | Mandatory| Description |
| ------ | -------------------------------------- | ---- | ------------------------------------------------------------ |
- | want | [Want](js-apis-featureAbility.md#want) | Yes | Information related to the extension, including the widget ID, name, and style. The information must be managed as persistent data to facilitate subsequent widget update and deletion.|
+ | want | [Want](js-apis-application-Want.md) | Yes | Information related to the extension, including the widget ID, name, and style. The information must be managed as persistent data to facilitate subsequent widget update and deletion.|
**Return value**
diff --git a/en/application-dev/reference/apis/js-apis-formhost.md b/en/application-dev/reference/apis/js-apis-formhost.md
index 0cf54af57b8aacb91bb487e49bf8a74074ecc8da..0c01c3bcbca95cfd5fd9b2b5c42f06faa1b83fbb 100644
--- a/en/application-dev/reference/apis/js-apis-formhost.md
+++ b/en/application-dev/reference/apis/js-apis-formhost.md
@@ -1,6 +1,6 @@
# FormHost
-> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Provides APIs related to the widget host.
@@ -23,24 +23,24 @@ deleteForm(formId: string, callback: AsyncCallback<void>): void;
Deletes a widget. This API uses an asynchronous callback to return the result. After this API is called, the application can no longer use the widget, and the Widget Manager will not retain the widget information.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formId | string | Yes | ID of a widget.|
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formId = "12400633174999288";
formHost.deleteForm(formId, (error, data) => {
- if (error) {
- console.log('formHost deleteForm, error:' + error.code);
+ if (error.code) {
+ console.log('formHost deleteForm, error:' + JSON.stringify(error));
}
});
```
@@ -51,7 +51,7 @@ deleteForm(formId: string): Promise<void>;
Deletes a widget. This API uses a promise to return the result. After this API is called, the application can no longer use the widget, and the Widget Manager will not retain the widget information.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -71,8 +71,10 @@ SystemCapability.Ability.Form
```js
var formId = "12400633174999288";
- formHost.deleteForm(formId).catch((error) => {
- console.log('formProvider deleteForm, error:' + JSON.stringify(error));
+ formHost.deleteForm(formId).then(() => {
+ console.log('formHost deleteForm success');
+ }).catch((error) => {
+ console.log('formHost deleteForm, error:' + JSON.stringify(error));
});
```
@@ -82,24 +84,24 @@ releaseForm(formId: string, callback: AsyncCallback<void>): void;
Releases a widget. This API uses an asynchronous callback to return the result. After this API is called, the application can no longer use the widget, but the Widget Manager still retains the widget cache and storage information.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formId | string | Yes | ID of a widget.|
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formId = "12400633174999288";
formHost.releaseForm(formId, (error, data) => {
- if (error) {
- console.log('formHost releaseForm, error:' + error.code);
+ if (error.code) {
+ console.log('formHost releaseForm, error:' + JSON.stringify(error));
}
});
```
@@ -108,27 +110,27 @@ SystemCapability.Ability.Form
releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback<void>): void;
-Releases a widget. This API uses an asynchronous callback to return the result. After this API is called, the application can no longer use the widget, but the Widget Manager retains the storage information about the widget and determines whether to retain the cache information based on the setting.
+Releases a widget. This API uses an asynchronous callback to return the result. After this API is called, the application can no longer use the widget, but the Widget Manager retains the storage information about the widget and retains or releases the cache information based on the setting.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name | Type | Mandatory| Description |
- | -------------- | ------ | ---- | ----------- |
- | formId | string | Yes | ID of a widget. |
- | isReleaseCache | boolean | Yes | Whether to release the cache.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name | Type | Mandatory| Description |
+| -------------- | ------ | ---- | ----------- |
+| formId | string | Yes | ID of a widget. |
+| isReleaseCache | boolean | Yes | Whether to release the cache.|
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formId = "12400633174999288";
formHost.releaseForm(formId, true, (error, data) => {
- if (error) {
- console.log('formHost releaseForm, error:' + error.code);
+ if (error.code) {
+ console.log('formHost releaseForm, error:' + JSON.stringify(error));
}
});
```
@@ -137,9 +139,9 @@ SystemCapability.Ability.Form
releaseForm(formId: string, isReleaseCache?: boolean): Promise<void>;
-Releases a widget. This API uses a promise to return the result. After this API is called, the application can no longer use the widget, but the Widget Manager retains the storage information about the widget and determines whether to retain the cache information based on the setting.
+Releases a widget. This API uses a promise to return the result. After this API is called, the application can no longer use the widget, but the Widget Manager retains the storage information about the widget and retains or releases the cache information based on the setting.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -160,8 +162,10 @@ SystemCapability.Ability.Form
```js
var formId = "12400633174999288";
- formHost.releaseForm(formId, true).catch((error) => {
- console.log('formProvider releaseForm, error:' + JSON.stringify(error));
+ formHost.releaseForm(formId, true).then(() => {
+ console.log('formHost releaseForm success');
+ }).catch((error) => {
+ console.log('formHost releaseForm, error:' + JSON.stringify(error));
});
```
@@ -177,18 +181,18 @@ SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formId | string | Yes | ID of a widget.|
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formId = "12400633174999288";
formHost.requestForm(formId, (error, data) => {
- if (error) {
- console.log('formHost requestForm, error:' + error.code);
+ if (error.code) {
+ console.log('formHost requestForm, error:' + JSON.stringify(error));
}
});
```
@@ -219,8 +223,10 @@ SystemCapability.Ability.Form
```js
var formId = "12400633174999288";
- formHost.requestForm(formId).catch((error) => {
- console.log('formProvider requestForm, error:' + JSON.stringify(error));
+ formHost.requestForm(formId).then(() => {
+ console.log('formHost requestForm success');
+ }).catch((error) => {
+ console.log('formHost requestForm, error:' + JSON.stringify(error));
});
```
@@ -230,24 +236,24 @@ castTempForm(formId: string, callback: AsyncCallback<void>): void;
Converts a temporary widget to a normal one. This API uses an asynchronous callback to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formId | string | Yes | ID of a widget.|
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formId = "12400633174999288";
formHost.castTempForm(formId, (error, data) => {
- if (error) {
- console.log('formHost castTempForm, error:' + error.code);
+ if (error.code) {
+ console.log('formHost castTempForm, error:' + JSON.stringify(error));
}
});
```
@@ -258,7 +264,7 @@ castTempForm(formId: string): Promise<void>;
Converts a temporary widget to a normal one. This API uses a promise to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -278,54 +284,56 @@ SystemCapability.Ability.Form
```js
var formId = "12400633174999288";
- formHost.castTempForm(formId).catch((error) => {
- console.log('formProvider castTempForm, error:' + JSON.stringify(error));
+ formHost.castTempForm(formId).then(() => {
+ console.log('formHost castTempForm success');
+ }).catch((error) => {
+ console.log('formHost castTempForm, error:' + JSON.stringify(error));
});
```
## notifyVisibleForms
-notifyVisibleForms(formId: string, callback: AsyncCallback<void>): void;
+notifyVisibleForms(formIds: Array<string>, callback: AsyncCallback<void>): void;
Instructs the widget framework to make a widget visible. This API uses an asynchronous callback to return the result. After this API is called, **onVisibilityChange** is invoked to notify the widget provider.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of widget IDs. |
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formId = "12400633174999288";
formHost.notifyVisibleForms(formId, (error, data) => {
- if (error) {
- console.log('formHost notifyVisibleForms, error:' + error.code);
+ if (error.code) {
+ console.log('formHost notifyVisibleForms, error:' + JSON.stringify(error));
}
});
```
## notifyVisibleForms
-notifyVisibleForms(formId: string): Promise<void>;
+notifyVisibleForms(formIds: Array<string>): Promise<void>;
Instructs the widget framework to make a widget visible. This API uses a promise to return the result. After this API is called, **onVisibilityChange** is invoked to notify the widget provider.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of widget IDs.|
**Return value**
@@ -337,54 +345,56 @@ SystemCapability.Ability.Form
```js
var formId = "12400633174999288";
- formHost.notifyVisibleForms(formId).catch((error) => {
- console.log('formProvider notifyVisibleForms, error:' + JSON.stringify(error));
+ formHost.notifyVisibleForms(formId).then(() => {
+ console.log('formHost notifyVisibleForms success');
+ }).catch((error) => {
+ console.log('formHost notifyVisibleForms, error:' + JSON.stringify(error));
});
```
## notifyInvisibleForms
-notifyInvisibleForms(formId: string, callback: AsyncCallback<void>): void;
+notifyInvisibleForms(formIds: Array<string>, callback: AsyncCallback<void>): void;
Instructs the widget framework to make a widget invisible. This API uses an asynchronous callback to return the result. After this API is called, **onVisibilityChange** is invoked to notify the widget provider.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of widget IDs. |
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formId = "12400633174999288";
formHost.notifyInvisibleForms(formId, (error, data) => {
- if (error) {
- console.log('formHost notifyInvisibleForms, error:' + error.code);
+ if (error.code) {
+ console.log('formHost notifyInvisibleForms, error:' + JSON.stringify(error));
}
});
```
## notifyInvisibleForms
-notifyInvisibleForms(formId: string): Promise<void>;
+notifyInvisibleForms(formIds: Array<string>): Promise<void>;
Instructs the widget framework to make a widget invisible. This API uses a promise to return the result. After this API is called, **onVisibilityChange** is invoked to notify the widget provider.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of widget IDs.|
**Return value**
@@ -396,54 +406,56 @@ SystemCapability.Ability.Form
```js
var formId = "12400633174999288";
- formHost.notifyInvisibleForms(formId).catch((error) => {
- console.log('formProvider notifyInvisibleForms, error:' + JSON.stringify(error));
+ formHost.notifyInvisibleForms(formId).then(() => {
+ console.log('formHost notifyInvisibleForms success');
+ }).catch((error) => {
+ console.log('formHost notifyInvisibleForms, error:' + JSON.stringify(error));
});
```
## enableFormsUpdate
-enableFormsUpdate(formId: string, callback: AsyncCallback<void>): void;
+enableFormsUpdate(formIds: Array<string>, callback: AsyncCallback<void>): void;
-Instructs the widget framework to make a widget to be updatable. This API uses an asynchronous callback to return the result. After this API is called, the widget is in the enabled state and can receive updates from the widget provider.
+Instructs the widget framework to make a widget updatable. This API uses an asynchronous callback to return the result. After this API is called, the widget is in the enabled state and can receive updates from the widget provider.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of widget IDs. |
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formId = "12400633174999288";
formHost.enableFormsUpdate(formId, (error, data) => {
- if (error) {
- console.log('formHost enableFormsUpdate, error:' + error.code);
+ if (error.code) {
+ console.log('formHost enableFormsUpdate, error:' + JSON.stringify(error));
}
});
```
## enableFormsUpdate
-enableFormsUpdate(formId: string): Promise<void>;
+enableFormsUpdate(formIds: Array<string>): Promise<void>;
-Instructs the widget framework to make a widget to be updatable. This API uses a promise to return the result. After this API is called, the widget is in the enabled state and can receive updates from the widget provider.
+Instructs the widget framework to make a widget updatable. This API uses a promise to return the result. After this API is called, the widget is in the enabled state and can receive updates from the widget provider.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of widget IDs.|
**Return value**
@@ -455,54 +467,56 @@ SystemCapability.Ability.Form
```js
var formId = "12400633174999288";
- formHost.enableFormsUpdate(formId).catch((error) => {
- console.log('formProvider enableFormsUpdate, error:' + JSON.stringify(error));
+ formHost.enableFormsUpdate(formId).then(() => {
+ console.log('formHost enableFormsUpdate success');
+ }).catch((error) => {
+ console.log('formHost enableFormsUpdate, error:' + JSON.stringify(error));
});
```
## disableFormsUpdate
-disableFormsUpdate(formId: string, callback: AsyncCallback<void>): void;
+disableFormsUpdate(formIds: Array<string>, callback: AsyncCallback<void>): void;
-Instructs the widget framework to make a widget not to be updatable. This API uses an asynchronous callback to return the result. After this API is called, the widget is in the disabled state and cannot receive updates from the widget provider.
+Instructs the widget framework to make a widget not updatable. This API uses an asynchronous callback to return the result. After this API is called, the widget cannot receive updates from the widget provider.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of widget IDs. |
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formId = "12400633174999288";
formHost.disableFormsUpdate(formId, (error, data) => {
- if (error) {
- console.log('formHost disableFormsUpdate, error:' + error.code);
+ if (error.code) {
+ console.log('formHost disableFormsUpdate, error:' + JSON.stringify(error));
}
});
```
## disableFormsUpdate
-disableFormsUpdate(formId: string): Promise<void>;
+disableFormsUpdate(formIds: Array<string>): Promise<void>;
-Instructs the widget framework to make a widget not to be updatable. This API uses a promise to return the result. After this API is called, the widget is in the disabled state and cannot receive updates from the widget provider.
+Instructs the widget framework to make a widget not updatable. This API uses a promise to return the result. After this API is called, the widget cannot receive updates from the widget provider.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formId | string | Yes | ID of a widget.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of widget IDs.|
**Return value**
@@ -514,8 +528,10 @@ SystemCapability.Ability.Form
```js
var formId = "12400633174999288";
- formHost.disableFormsUpdate(formId).catch((error) => {
- console.log('formProvider disableFormsUpdate, error:' + JSON.stringify(error));
+ formHost.disableFormsUpdate(formId).then(() => {
+ console.log('formHost disableFormsUpdate success');
+ }).catch((error) => {
+ console.log('formHost disableFormsUpdate, error:' + JSON.stringify(error));
});
```
@@ -525,23 +541,23 @@ isSystemReady(callback: AsyncCallback<void>): void;
Checks whether the system is ready. This API uses an asynchronous callback to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formId = "12400633174999288";
formHost.isSystemReady((error, data) => {
- if (error) {
- console.log('formHost isSystemReady, error:' + error.code);
+ if (error.code) {
+ console.log('formHost isSystemReady, error:' + JSON.stringify(error));
}
});
```
@@ -552,7 +568,7 @@ isSystemReady(): Promise<void>;
Checks whether the system is ready. This API uses a promise to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -566,8 +582,10 @@ SystemCapability.Ability.Form
```js
var formId = "12400633174999288";
- formHost.isSystemReady().catch((error) => {
- console.log('formProvider isSystemReady, error:' + JSON.stringify(error));
+ formHost.isSystemReady().then(() => {
+ console.log('formHost isSystemReady success');
+ }).catch((error) => {
+ console.log('formHost isSystemReady, error:' + JSON.stringify(error));
});
```
@@ -577,7 +595,7 @@ getAllFormsInfo(callback: AsyncCallback<Array<FormInfo>>): void;
Obtains the widget information provided by all applications on the device. This API uses an asynchronous callback to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -591,8 +609,10 @@ SystemCapability.Ability.Form
```js
formHost.getAllFormsInfo((error, data) => {
- if (error) {
- console.log('formHost getAllFormsInfo, error:' + error.code);
+ if (error.code) {
+ console.log('formHost getAllFormsInfo, error:' + JSON.stringify(error));
+ } else {
+ console.log('formHost getAllFormsInfo, data:' + JSON.stringify(data));
}
});
```
@@ -603,7 +623,7 @@ getAllFormsInfo(): Promise<Array<FormInfo>>;
Obtains the widget information provided by all applications on the device. This API uses a promise to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -616,8 +636,10 @@ SystemCapability.Ability.Form
**Example**
```js
- formHost.getAllFormsInfo().catch((error) => {
- console.log('formProvider getAllFormsInfo, error:' + JSON.stringify(error));
+ formHost.getAllFormsInfo().then((data) => {
+ console.log('formHost getAllFormsInfo data:' + JSON.stringify(data));
+ }).catch((error) => {
+ console.log('formHost getAllFormsInfo, error:' + JSON.stringify(error));
});
```
@@ -627,7 +649,7 @@ getFormsInfo(bundleName: string, callback: AsyncCallback<Array<FormInfo>
Obtains the widget information provided by a given application on the device. This API uses an asynchronous callback to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -641,9 +663,11 @@ SystemCapability.Ability.Form
**Example**
```js
- formHost.getFormsInfo("com.example.ohos.accountjsdemo", (error, data) => {
- if (error) {
- console.log('formHost getFormsInfo, error:' + error.code);
+ formHost.getFormsInfo("com.example.ohos.formjsdemo", (error, data) => {
+ if (error.code) {
+ console.log('formHost getFormsInfo, error:' + JSON.stringify(error));
+ } else {
+ console.log('formHost getFormsInfo, data:' + JSON.stringify(data));
}
});
```
@@ -654,7 +678,7 @@ getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback<
Obtains the widget information provided by a given application on the device. This API uses an asynchronous callback to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -669,9 +693,11 @@ SystemCapability.Ability.Form
**Example**
```js
- formHost.getFormsInfo("com.example.ohos.accountjsdemo", (error, data) => {
- if (error) {
- console.log('formHost getFormsInfo, error:' + error.code);
+ formHost.getFormsInfo("com.example.ohos.formjsdemo", "entry", (error, data) => {
+ if (error.code) {
+ console.log('formHost getFormsInfo, error:' + JSON.stringify(error));
+ } else {
+ console.log('formHost getFormsInfo, data:' + JSON.stringify(data));
}
});
```
@@ -682,7 +708,7 @@ getFormsInfo(bundleName: string, moduleName?: string): Promise<Array<FormI
Obtains the widget information provided by a given application on the device. This API uses a promise to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -702,8 +728,10 @@ SystemCapability.Ability.Form
**Example**
```js
- formHost.getAllFormsInfo().catch((error) => {
- console.log('formProvider getAllFormsInfo, error:' + JSON.stringify(error));
+ formHost.getFormsInfo("com.example.ohos.formjsdemo", "entry").then((data) => {
+ console.log('formHost getFormsInfo, data:' + JSON.stringify(data));
+ }).catch((error) => {
+ console.log('formHost getFormsInfo, error:' + JSON.stringify(error));
});
```
@@ -713,43 +741,45 @@ deleteInvalidForms(formIds: Array<string>, callback: AsyncCallback<numb
Deletes invalid widgets from the list. This API uses an asynchronous callback to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formIds | Array<string> | Yes | List of widget IDs.|
- | callback | AsyncCallback<number> | Yes| Callback used to return the number of widgets deleted.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of valid widget IDs.|
+| callback | AsyncCallback<number> | Yes| Callback used to return the number of widgets deleted.|
**Example**
```js
var formIds = new Array("12400633174999288", "12400633174999289");
formHost.deleteInvalidForms(formIds, (error, data) => {
- if (error) {
- console.log('formHost deleteInvalidForms, error:' + error.code);
+ if (error.code) {
+ console.log('formHost deleteInvalidForms, error:' + JSON.stringify(error));
+ } else {
+ console.log('formHost deleteInvalidForms, data:' + JSON.stringify(data));
}
});
```
## deleteInvalidForms
-function deleteInvalidForms(formIds: Array<string>): Promise<number>;
+function deleteInvalidForms(formIds: Array<string>): Promise<number>;
Deletes invalid widgets from the list. This API uses a promise to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formIds | Array<string> | Yes | List of widget IDs.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of valid widget IDs.|
**Return value**
@@ -761,8 +791,10 @@ SystemCapability.Ability.Form
```js
var formIds = new Array("12400633174999288", "12400633174999289");
- formHost.deleteInvalidForms(formIds).catch((error) => {
- console.log('formProvider deleteInvalidForms, error:' + JSON.stringify(error));
+ formHost.deleteInvalidForms(formIds).then((data) => {
+ console.log('formHost deleteInvalidForms, data:' + JSON.stringify(data));
+ }).catch((error) => {
+ console.log('formHost deleteInvalidForms, error:' + JSON.stringify(error));
});
```
@@ -772,7 +804,7 @@ acquireFormState(want: Want, callback: AsyncCallback<FormStateInfo>): void
Obtains the widget state. This API uses an asynchronous callback to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -780,7 +812,7 @@ SystemCapability.Ability.Form
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------- |
-| want | [Want](js-apis-featureAbility.md#want) | Yes | **Want** information carried to query the widget state.|
+| want | [Want](js-apis-application-Want.md) | Yes | **Want** information carried to query the widget state.|
| callback | AsyncCallback<[FormStateInfo](js-apis-formInfo.md#formstateinfo)> | Yes| Callback used to return the widget state.|
**Example**
@@ -792,8 +824,10 @@ SystemCapability.Ability.Form
"abilityName": "com.extreme.test.MainAbility"
};
formHost.acquireFormState(want, (error, data) => {
- if (error) {
- console.log('formHost acquireFormState, error:' + error.code);
+ if (error.code) {
+ console.log('formHost acquireFormState, error:' + JSON.stringify(error));
+ } else {
+ console.log('formHost acquireFormState, data:' + JSON.stringify(data));
}
});
```
@@ -806,9 +840,9 @@ Obtains the widget state. This API uses a promise to return the result.
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formIds | Array<string> | Yes | List of widget IDs.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| want | [Want](js-apis-application-Want.md) | Yes | **Want** information carried to query the widget state.|
**Return value**
@@ -816,7 +850,7 @@ Obtains the widget state. This API uses a promise to return the result.
| :------------ | :---------------------------------- |
| Promise<[FormStateInfo](js-apis-formInfo.md#formstateinfo)> | Promise used to return the widget state.|
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -828,8 +862,10 @@ SystemCapability.Ability.Form
"bundleName": "com.extreme.test",
"abilityName": "com.extreme.test.MainAbility"
};
- formHost.acquireFormState(want).catch((error) => {
- console.log('formProvider acquireFormState, error:' + JSON.stringify(error));
+ formHost.acquireFormState(want).then((data) => {
+ console.log('formHost acquireFormState, data:' + JSON.stringify(data));
+ }).catch((error) => {
+ console.log('formHost acquireFormState, error:' + JSON.stringify(error));
});
```
@@ -839,52 +875,50 @@ on(type: "formUninstall", callback: Callback<string>): void;
Subscribes to widget uninstall events.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | type | string | Yes | Type of event to subscribe to. The value **formUninstall** indicates a widget uninstallation event.|
- | callback | Callback<string> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| type | string | Yes | Type of event to subscribe to. The value **formUninstall** indicates a widget uninstallation event.|
+| callback | Callback<string> | Yes| Callback used for event subscription.|
**Example**
```js
- formHost.on("formUninstall", (error, data) => {
- if (error) {
- console.log('formHost on formUninstall, error:' + error.code);
- }
- });
+ let callback = function(formId) {
+ console.log('formHost on formUninstall, formId:' + formId);
+ }
+ formHost.on("formUninstall", callback);
```
## off("formUninstall")
-off(type: "formUninstall", callback: Callback<string>): void;
+off(type: "formUninstall", callback?: Callback<string>): void;
Unsubscribes from widget uninstall events.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | type | string | Yes | Type of event to unsubscribe from. The value **formUninstall** indicates a widget uninstallation event.|
- | callback | Callback<string> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| type | string | Yes | Type of event to subscribe to. The value **formUninstall** indicates a widget uninstallation event.|
+| callback | Callback<string> | No| Callback used for event unsubscription. If it is left unspecified, it indicates the callback for all the events that have been subscribed.|
**Example**
```js
- formHost.off("formUninstall", (error, data) => {
- if (error) {
- console.log('formHost off formUninstall, error:' + error.code);
- }
- });
+ let callback = function(formId) {
+ console.log('formHost on formUninstall, formId:' + formId);
+ }
+ formHost.off("formUninstall", callback);
```
## notifyFormsVisible
@@ -893,25 +927,25 @@ notifyFormsVisible(formIds: Array<string>, isVisible: boolean, callback: A
Instructs the widgets to make themselves visible. This API uses an asynchronous callback to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formIds | Array<string> | Yes | List of widget IDs.|
- | isVisible | boolean | Yes | Whether to be visible.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of widget IDs.|
+| isVisible | boolean | Yes | Whether to be visible.|
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formIds = new Array("12400633174999288", "12400633174999289");
formHost.notifyFormsVisible(formIds, true, (error, data) => {
- if (error) {
- console.log('formHost notifyFormsVisible, error:' + error.code);
+ if (error.code) {
+ console.log('formHost notifyFormsVisible, error:' + JSON.stringify(error));
}
});
```
@@ -922,7 +956,7 @@ notifyFormsVisible(formIds: Array<string>, isVisible: boolean): Promise<
Instructs the widgets to make themselves visible. This API uses a promise to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -943,8 +977,10 @@ SystemCapability.Ability.Form
```js
var formIds = new Array("12400633174999288", "12400633174999289");
- formHost.notifyFormsVisible(formIds, true).catch((error) => {
- console.log('formProvider notifyFormsVisible, error:' + JSON.stringify(error));
+ formHost.notifyFormsVisible(formIds, true).then(() => {
+ console.log('formHost notifyFormsVisible success');
+ }).catch((error) => {
+ console.log('formHost notifyFormsVisible, error:' + JSON.stringify(error));
});
```
@@ -952,27 +988,27 @@ SystemCapability.Ability.Form
notifyFormsEnableUpdate(formIds: Array<string>, isEnableUpdate: boolean, callback: AsyncCallback<void>): void;
-Instructs the widgets to enable or disable update. This API uses an asynchronous callback to return the result.
+Instructs the widgets to enable or disable updates. This API uses an asynchronous callback to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
**Parameters**
- | Name| Type | Mandatory| Description |
- | ------ | ------ | ---- | ------- |
- | formIds | Array<string> | Yes | List of widget IDs.|
- | isEnableUpdate | boolean | Yes | Whether to enable update.|
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+| Name| Type | Mandatory| Description |
+| ------ | ------ | ---- | ------- |
+| formIds | Array<string> | Yes | List of widget IDs.|
+| isEnableUpdate | boolean | Yes | Whether to enable update.|
+| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
```js
var formIds = new Array("12400633174999288", "12400633174999289");
formHost.notifyFormsEnableUpdate(formIds, true, (error, data) => {
- if (error) {
- console.log('formHost notifyFormsEnableUpdate, error:' + error.code);
+ if (error.code) {
+ console.log('formHost notifyFormsEnableUpdate, error:' + JSON.stringify(error));
}
});
```
@@ -981,9 +1017,9 @@ SystemCapability.Ability.Form
notifyFormsEnableUpdate(formIds: Array<string>, isEnableUpdate: boolean): Promise<void>;
-Instructs the widgets to enable or disable update. This API uses a promise to return the result.
+Instructs the widgets to enable or disable updates. This API uses a promise to return the result.
-**System capability**:
+**System capability**
SystemCapability.Ability.Form
@@ -1004,7 +1040,9 @@ SystemCapability.Ability.Form
```js
var formIds = new Array("12400633174999288", "12400633174999289");
- formHost.notifyFormsEnableUpdate(formIds, true).catch((error) => {
- console.log('formProvider notifyFormsEnableUpdate, error:' + JSON.stringify(error));
+ formHost.notifyFormsEnableUpdate(formIds, true).then(() => {
+ console.log('formHost notifyFormsEnableUpdate success');
+ }).catch((error) => {
+ console.log('formHost notifyFormsEnableUpdate, error:' + JSON.stringify(error));
});
```
diff --git a/en/application-dev/reference/apis/js-apis-missionManager.md b/en/application-dev/reference/apis/js-apis-missionManager.md
index a36fc053da29747df95dcab84468288cd7421acc..a9c0c75becf3397a933fe15dc57429029759624b 100644
--- a/en/application-dev/reference/apis/js-apis-missionManager.md
+++ b/en/application-dev/reference/apis/js-apis-missionManager.md
@@ -1,11 +1,11 @@
# missionManager
-> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
-Provides mission management. You can use the APIs to lock, unlock, and clear missions, and switch a mission to the foreground.
+missionManager provides APIs to lock, unlock, and clear missions, and switch a mission to the foreground.
## Modules to Import
@@ -34,7 +34,7 @@ Registers a listener to observe the mission status.
| Type| Description|
| -------- | -------- |
- | number | Returns the index of the listener, which is created by the system and allocated when the mission status listener is registered. Each listener has a unique index.|
+ | number | Returns the unique index of the mission status listener, which is created by the system and allocated when the listener is registered.|
**Example**
@@ -55,7 +55,7 @@ Registers a listener to observe the mission status.
unregisterMissionListener(listenerId: number, callback: AsyncCallback<void>): void;
-Unregisters a mission status listener. This API uses an asynchronous callback to return the result.
+Deregisters a mission status listener. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
@@ -63,7 +63,7 @@ Unregisters a mission status listener. This API uses an asynchronous callback to
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
- | listenerId | number | Yes| Index of the mission status listener to unregister. Each listener has a unique index, which is returned by **registerMissionListener**.|
+ | listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.|
| callback | AsyncCallback<void> | Yes| Callback used to return the result.|
**Example**
@@ -88,7 +88,7 @@ Unregisters a mission status listener. This API uses an asynchronous callback to
unregisterMissionListener(listenerId: number): Promise<void>;
-Unregisters a mission status listener. This API uses a promise to return the result.
+Deregisters a mission status listener. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
@@ -96,7 +96,7 @@ Unregisters a mission status listener. This API uses a promise to return the res
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
- | listenerId | number | Yes| Index of the mission status listener to unregister. Each listener has a unique index, which is returned by **registerMissionListener**.|
+ | listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.|
**Return value**
@@ -126,7 +126,7 @@ Unregisters a mission status listener. This API uses a promise to return the res
getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback<MissionInfo>): void;
-Obtains the information of a given mission. This API uses an asynchronous callback to return the result.
+Obtains the information about a given mission. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
@@ -159,7 +159,7 @@ Obtains the information of a given mission. This API uses an asynchronous callba
getMissionInfo(deviceId: string, missionId: number): Promise<MissionInfo>;
-Obtains the information of a given mission. This API uses a promise to return the result.
+Obtains the information about a given mission. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
@@ -191,7 +191,7 @@ Obtains the information of a given mission. This API uses a promise to return th
getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback<Array<MissionInfo>>): void;
-Obtains information of all missions. This API uses an asynchronous callback to return the result.
+Obtains information about all missions. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
@@ -220,7 +220,7 @@ Obtains information of all missions. This API uses an asynchronous callback to r
getMissionInfos(deviceId: string, numMax: number): Promise<Array<MissionInfo>>;
-Obtains information of all missions. This API uses a promise to return the result.
+Obtains information about all missions. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
@@ -617,7 +617,7 @@ Switches a given mission to the foreground. This API uses an asynchronous callba
moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback<void>): void;
-Switches a given mission to the foreground, with the startup parameters for the switch specified, such as the window mode and device ID. This API uses an asynchronous callback to return the result.
+Switches a given mission to the foreground, with the startup parameters for the switching specified. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
@@ -651,7 +651,7 @@ Switches a given mission to the foreground, with the startup parameters for the
moveMissionToFront(missionId: number, options?: StartOptions): Promise<void>;
-Switches a given mission to the foreground, with the startup parameters for the switch specified, such as the window mode and device ID. This API uses a promise to return the result.
+Switches a given mission to the foreground, with the startup parameters for the switching specified. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
@@ -697,7 +697,7 @@ Describes the mission information.
| runningState | number | Yes| Yes| Running state of the mission.|
| lockedState | boolean | Yes| Yes| Locked state of the mission.|
| timestamp | string | Yes| Yes| Latest time when the mission was created or updated.|
-| want | [Want](js-apis-featureAbility.md#want) | Yes| Yes| **Want** information of the mission.|
+| want | [Want](js-apis-application-Want.md) | Yes| Yes| **Want** information of the mission.|
| label | string | Yes| Yes| Label of the mission.|
| iconPath | string | Yes| Yes| Path of the mission icon.|
| continuable | boolean | Yes| Yes| Whether the mission is continuable.|
diff --git a/en/application-dev/reference/apis/js-apis-particleAbility.md b/en/application-dev/reference/apis/js-apis-particleAbility.md
index 7955a810d33f3b6e9cfe23d6c939c1a83bae92c4..a5a215f95741a7467179df5e59fef4115012d5c3 100644
--- a/en/application-dev/reference/apis/js-apis-particleAbility.md
+++ b/en/application-dev/reference/apis/js-apis-particleAbility.md
@@ -1,6 +1,6 @@
# ParticleAbility Module
-> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Constraints
@@ -260,16 +260,16 @@ Requests a continuous task from the system. This API uses a promise to return th
**Parameters**
-| Name| Type| Mandatory| Description|
+| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
-| id | number | Yes| Notification ID of a continuous task.|
-| request | NotificationRequest | Yes| Notification parameter, which is used to display information in the notification bar.|
+| id | number | Yes | Notification ID of a continuous task. |
+| request | NotificationRequest | Yes | Notification parameter, which is used to display information in the notification bar. |
**Return value**
-| Type | Description |
+| Type | Description |
| -------------- | ------------------------- |
-| Promise\ | Promise used to return the result.|
+| Promise\ | Promise used to return the result. |
**Example**
@@ -323,9 +323,9 @@ Requests to cancel a continuous task from the system. This API uses an asynchron
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+ | callback | AsyncCallback<void> | Yes | Callback used to return the result. |
**Example**
@@ -354,9 +354,9 @@ Requests a continuous task from the system. This API uses a promise to return th
**Return value**
-| Type | Description |
+| Type | Description |
| -------------- | ------------------------- |
-| Promise\ | Promise used to return the result.|
+| Promise\ | Promise used to return the result. |
**Example**
@@ -382,21 +382,21 @@ Connects this ability to a specific Service ability. This API uses a callback to
**Parameters**
-| Name | Type | Mandatory| Description |
+| Name | Type | Mandatory | Description |
| ------- | -------------- | ---- | ---------------------------- |
-| request | [Want](js-apis-featureAbility.md#want) | Yes | Service ability to connect.|
-| options | ConnectOptions | Yes | Callback used to return the result. |
+| request | [Want](js-apis-application-Want.md) | Yes | Service ability to connect. |
+| options | ConnectOptions | Yes | Callback used to return the result. |
-ConnectOptions
+**ConnectOptions**
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
-| Name | Readable/Writable| Type | Mandatory | Description |
+| Name | Readable/Writable | Type | Mandatory | Description |
| ------------ | ---- | -------- | ---- | ------------------------- |
-| onConnect | Read only | function | Yes | Callback invoked when the connection is successful. |
-| onDisconnect | Read only | function | Yes | Callback invoked when the connection fails. |
-| onFailed | Read only | function | Yes | Callback invoked when **connectAbility** fails to be called.|
+| onConnect | Read only | function | Yes | Callback invoked when the connection is successful. |
+| onDisconnect | Read only | function | Yes | Callback invoked when the connection fails. |
+| onFailed | Read only | function | Yes | Callback invoked when **connectAbility** fails to be called. |
**Example**
@@ -440,9 +440,9 @@ Disconnects this ability from the Service ability. This API uses a callback to r
**Parameters**
- | Name| Type| Mandatory| Description|
+ | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<void> | Yes| Callback used to return the result.|
+ | callback | AsyncCallback<void> | Yes | Callback used to return the result. |
**Example**
@@ -486,9 +486,9 @@ Disconnects this ability from the Service ability. This API uses a promise to re
**Return value**
-| Type | Description |
+| Type | Description |
| -------------- | ------------------------- |
-| Promise\ | Promise used to return the result.|
+| Promise\ | Promise used to return the result. |
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-pasteboard.md b/en/application-dev/reference/apis/js-apis-pasteboard.md
index b12ac722319812d2682821495dffe35ebde1000c..c5ca90fd33c1de4b2eb4f4fff33eee5e2d899a79 100644
--- a/en/application-dev/reference/apis/js-apis-pasteboard.md
+++ b/en/application-dev/reference/apis/js-apis-pasteboard.md
@@ -279,7 +279,7 @@ A data record is an abstract definition of the content on the pasteboard. The pa
| Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- |
| htmlText7+ | string | Yes | No | HTML text. |
-| want7+ | [Want](js-apis-featureAbility.md#want) | Yes | No | Want text. |
+| want7+ | [Want](js-apis-application-Want.md) | Yes | No | Want text. |
| mimeType7+ | string | Yes | No | Data type. |
| plainText7+ | string | Yes | No | Plain text. |
| uri7+ | string | Yes | No | URI text. |
@@ -506,7 +506,7 @@ The pasteboard supports a maximum number of 128 data records.
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
-| want | [Want](js-apis-featureAbility.md#want) | Yes | Want object. |
+| want | [Want](js-apis-application-Want.md) | Yes | Want object. |
**Example**