From eb579ade105a20dec3c6c176dc1e8675e09574cf Mon Sep 17 00:00:00 2001 From: xuzhihao Date: Wed, 30 Mar 2022 10:00:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A4=BA=E4=BE=8B=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=9C=AA=E6=94=BE=E5=9C=A8```=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuzhihao --- .../reference/apis/js-apis-particleAbility.md | 8 ++++---- .../reference/apis/js-apis-distributed-data.md | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-particleAbility.md b/en/application-dev/reference/apis/js-apis-particleAbility.md index e4499fb3d2..0ada74de48 100644 --- a/en/application-dev/reference/apis/js-apis-particleAbility.md +++ b/en/application-dev/reference/apis/js-apis-particleAbility.md @@ -26,7 +26,7 @@ Starts a particle ability. This API uses an asynchronous callback to return the | Name | Type | Mandatory| Description | | --------- | ----------------------------------------------- | ---- | ----------------- | -| parameter | [StartAbilityParameter](#startabilityparameter) | Yes | Ability to start.| +| parameter | [StartAbilityParameter](js-apis-featureAbility.md#startabilityparameter) | Yes | Ability to start.| | callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -58,7 +58,7 @@ particleAbility.startAbility( ## particleAbility.startAbility -startAbility(parameter: StartAbilityParameter): Promise; +startAbility(parameter: StartAbilityParameter): Promise\; Starts a particle ability. This API uses a promise to return the result. @@ -69,7 +69,7 @@ Starts a particle ability. This API uses a promise to return the result. | Name | Type | Mandatory| Description | | --------- | ----------------------------------------------- | ---- | ----------------- | -| parameter | [StartAbilityParameter](#startabilityparameter) | Yes | Ability to start.| +| parameter | [StartAbilityParameter](js-apis-featureAbility.md#startabilityparameter) | Yes | Ability to start.| **Return value** @@ -380,7 +380,7 @@ Connects this ability to a specific Service ability. This API uses a callback to | Name | Type | Mandatory| Description | | ------- | -------------- | ---- | ---------------------------- | -| request | [Want](#want) | Yes | Service ability to connect.| +| request | [Want](js-apis-featureAbility.md#want) | Yes | Service ability to connect.| | options | ConnectOptions | Yes | Callback used to return the result. | **Example** diff --git a/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md b/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md index 5bbfb109df..bddc433712 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md +++ b/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md @@ -27,7 +27,7 @@ createKVManager(config: KVManagerConfig, callback: AsyncCallback<KVManager> | callback | AsyncCallback<[KVManager](#kvmanager)> | 是 | KVManager实例创建时调用的回调,返回KVManager对象实例。 | **示例**: - + ``` let kvManager; try { const kvManagerConfig = { @@ -48,6 +48,7 @@ createKVManager(config: KVManagerConfig, callback: AsyncCallback<KVManager> } catch (e) { console.log("An unexpected error occurred. Error:" + e); } + ``` ## distributedData.createKVManager @@ -70,7 +71,7 @@ createKVManager(config: KVManagerConfig): Promise<KVManager> | Promise<[KVManager](#kvmanager)> | 指定的Promise回调方法,返回创建的KVManager对象实例。 | **示例**: - + ``` let kvManager; try { const kvManagerConfig = { @@ -89,7 +90,7 @@ createKVManager(config: KVManagerConfig): Promise<KVManager> } catch (e) { console.log("An unexpected error occurred. Error:" + e); } - + ``` ## KVManagerConfig @@ -2088,7 +2089,7 @@ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncC | ----- | ------ | ---- | ----------------------- | | key | string | 是 |要添加数据的key,不能为空且长度不大于[MAX_KEY_LENGTH](#constants)。 | | value | Uint8Array \| string \| number \| boolean | 是 |要添加数据的value,支持Uint8Array、number 、 string 、boolean,Uint8Array、string 的长度不大于[MAX_VALUE_LENGTH](#constants)。 | -| callback | AsyncCallback<void> | 是 |回调函数。 | +| callback | AsyncCallback<void> | 是 |回调函数。 | **示例** @@ -2984,7 +2985,7 @@ get(key: string, callback: AsyncCallback<Uint8Array | string | boolean | numb ### get -get(key: string): Promise<Uint8Array | string | boolean | number> +get(key: string): Promise<Uint8Array | string | boolean | number> 获取指定键的值,并通过Promise方式返回,此方法为异步方法。 -- GitLab