diff --git a/en/application-dev/reference/apis/js-apis-distributedKVStore.md b/en/application-dev/reference/apis/js-apis-distributedKVStore.md index 7dbc21ff6db0ac0115bb3f7eee6e6b7596dd744e..11b7053bbd4ed6e0ebcf6c65fc9d7576d8a080f5 100644 --- a/en/application-dev/reference/apis/js-apis-distributedKVStore.md +++ b/en/application-dev/reference/apis/js-apis-distributedKVStore.md @@ -271,10 +271,10 @@ Creates a **KVManager** instance to manage KV stores. Stage model: ```js -import AbilityStage from '@ohos.application.Ability' +import UIAbility from '@ohos.app.ability.UIAbility' let kvManager; -export default class MyAbilityStage extends AbilityStage { +export default class EntryAbility extends UIAbility { onCreate() { console.log("MyAbilityStage onCreate") let context = this.context @@ -722,7 +722,7 @@ Subscribes to service status changes. | Name | Type | Mandatory| Description | | ------------- | -------------------- | ---- | ------------------------------------------------------------ | | event | string | Yes | Event to subscribe to. The value is **distributedDataServiceDie**, which indicates a service status change event.| -| deathCallback | Callback<void> | Yes | Callback invoked to return service status changes. | +| deathCallback | Callback<void> | Yes | Callback invoked to return service status changes. | **Example** @@ -2847,7 +2847,7 @@ try { ### get -get(key: string, callback: AsyncCallback): void +get(key: string, callback: AsyncCallback<boolean | string | number | Uint8Array>): void Obtains the value of the specified key. This API uses an asynchronous callback to return the result. @@ -2898,7 +2898,7 @@ try { ### get -get(key: string): Promise<boolean | string| number | Uint8Array> +get(key: string): Promise<boolean | string | number | Uint8Array> Obtains the value of the specified key. This API uses a promise to return the result. @@ -4849,7 +4849,7 @@ Before calling any method in **DeviceKVStore**, you must use [getKVStore](#getkv ### get -get(key: string, callback: AsyncCallback): void +get(key: string, callback: AsyncCallback<boolean | string | number | Uint8Array>): void Obtains the value of the specified key for this device. This API uses an asynchronous callback to return the result. @@ -4900,7 +4900,7 @@ try { ### get -get(key: string): Promise<boolean | string| number | Uint8Array> +get(key: string): Promise<boolean | string | number | Uint8Array> Obtains the value of the specified key for this device. This API uses a promise to return the result. @@ -4952,7 +4952,7 @@ try { ### get -get(deviceId: string, key: string, callback: AsyncCallback<boolean|string|number|Uint8Array>): void +get(deviceId: string, key: string, callback: AsyncCallback<boolean | string | number | Uint8Array>): void Obtains a string value that matches the specified device ID and key. This API uses an asynchronous callback to return the result. @@ -5004,7 +5004,7 @@ try { ### get -get(deviceId: string, key: string): Promise<boolean|string|number|Uint8Array> +get(deviceId: string, key: string): Promise<boolean | string | number | Uint8Array> Obtains a string value that matches the specified device ID and key. This API uses a promise to return the result. diff --git a/en/application-dev/reference/apis/js-apis-system-storage.md b/en/application-dev/reference/apis/js-apis-system-storage.md index 0549fac53863bd341d1ff0d1aa8d0e95a0a262c8..a4a3bb6b5d885308f6a6a28d994b9f27fda27536 100644 --- a/en/application-dev/reference/apis/js-apis-system-storage.md +++ b/en/application-dev/reference/apis/js-apis-system-storage.md @@ -51,7 +51,7 @@ export default { ## storage.set -get(options: SetStorageOptions): void +set(options: SetStorageOptions): void Sets the value in the cache based on the specified key. @@ -167,8 +167,8 @@ export default { | key | string | Yes | Key of the data to set. | | value | string | Yes | New value to set. The length must be less than 128 bytes. | | success | () => void | No | Called when **storage.set()** is called successfully. | -| fail | (data: string, code: number) => void | No | Called to return the result when **storage.get()** fails to be called. **data** is the error information, and **code** indicates the error code. | -| complete | () => void | No | Called when **storage.get()** is complete. | +| fail | (data: string, code: number) => void | No | Called to return the result when **storage.set()** fails to be called. **data** is the error information, and **code** indicates the error code. | +| complete | () => void | No | Called when **storage.set()** is complete. | ## ClearStorageOptions