diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 30514b2525..cc55042a39 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -19,14 +19,14 @@ import dataSharePredicates from './@ohos.data.dataSharePredicates'; import Context from './application/Context'; /** - * Providers interfaces to create a {@link KVManager} istances. + * Provider interfaces to create a {@link KVManager} istances. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ declare namespace distributedKVStore { /** - * Provides configuration information for {@link KVManager} instances, - * including the caller's package name and distributed network type. + * Provides configuration information to create a {@link KVManager} instance, + * which includes the caller's package name and ability or hap context. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -55,42 +55,42 @@ declare namespace distributedKVStore { */ namespace Constants { /** - * max key length. + * Max key length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ const MAX_KEY_LENGTH = 1024; /** - * max value length. + * Max value length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ const MAX_VALUE_LENGTH = 4194303; /** - * max device coordinate key length. + * Max device coordinate key length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ const MAX_KEY_LENGTH_DEVICE = 896; /** - * max store id length. + * Max store id length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ const MAX_STORE_ID_LENGTH = 128; /** - * max query length. + * Max query length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ const MAX_QUERY_LENGTH = 512000; /** - * max batch operation size. + * Max batch operation size. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -157,16 +157,14 @@ declare namespace distributedKVStore { */ interface Value { /** - * Indicates value type + * Indicates the value type * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @see ValueType - * @type {number} - * @memberof Value * @since 9 */ type: ValueType; /** - * Indicates value + * Indicates the value * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -174,20 +172,20 @@ declare namespace distributedKVStore { } /** - * Provides key-value pairs stored in the distributed database. + * Provides key-value pairs stored in the distributedKVStore. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ interface Entry { /** - * Indicates key + * Indicates the key * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ key: string; /** - * Indicates value + * Indicates the value * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -195,18 +193,18 @@ declare namespace distributedKVStore { } /** - * Receives notifications of all data changes, including data insertion, update, and deletion. + * Receive notifications of all data changes, including data insertion, update, and deletion. * *
If you have subscribed to {@code SingleKVStore} or {@code DeviceKVStore}, you will receive * data change notifications and obtain the changed data from the parameters in callback methods - * upon data insertion, update, or deletion. + * upon data insertion, update or deletion. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ interface ChangeNotification { /** - * Indicates data addition records. + * Indicates data insertion records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -224,7 +222,7 @@ declare namespace distributedKVStore { */ deleteEntries: Entry[]; /** - * Indicates from device id. + * Indicates the device id which brings the data change. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -317,8 +315,8 @@ declare namespace distributedKVStore { */ enum SecurityLevel { /** - * S1: mains the db is low level security - * There are some low impact, when the data is leaked. + * S1: means the db is in the low security level + * There are some low impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -326,8 +324,8 @@ declare namespace distributedKVStore { S1, /** - * S2: mains the db is middle level security - * There are some major impact, when the data is leaked. + * S2: means the db is in the middle security level + * There are some major impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -335,8 +333,8 @@ declare namespace distributedKVStore { S2, /** - * S3: mains the db is high level security - * There are some severity impact, when the data is leaked. + * S3: means the db is in the high security level + * There are some severity impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -344,8 +342,8 @@ declare namespace distributedKVStore { S3, /** - * S4: mains the db is critical level security - * There are some critical impact, when the data is leaked. + * S4: means the db is in the critical security level + * There are some critical impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -354,54 +352,51 @@ declare namespace distributedKVStore { } /** - * Provides configuration options for creating a {@code SingleKVStore} or {@code DeviceKVStore}. - * - *
You can determine whether to create another database if a KVStore database is missing, - * whether to encrypt the database, and the database type. + * Provides configuration options to create a {@code SingleKVStore} or {@code DeviceKVStore}. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ interface Options { /** - * Indicates whether to createa database when the database file does not exist + * Indicates whether to create a database when the database file does not exist * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ createIfMissing?: boolean; /** - * Indicates setting whether database files are encrypted + * Indicates whether database files to be encrypted * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ encrypt?: boolean; /** - * Indicates setting whether to back up database files + * Indicates whether to back up database files * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ backup?: boolean; /** - * Indicates setting whether database files are automatically synchronized + * Indicates whether database files are automatically synchronized * @permission ohos.permission.DISTRIBUTED_DATASYNC * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ autoSync?: boolean; /** - * Indicates setting the databse type + * Indicates the database type * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ kvStoreType?: KVStoreType; /** - * Indicates setting the database security level + * Indicates the database security level * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ securityLevel: SecurityLevel; /** - * Indicates schema object + * Indicates the database schema * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -411,7 +406,7 @@ declare namespace distributedKVStore { /** * Represents the database schema. * - * You can create Schema objects and put them in Options when creating or opening the database. + * You can set the schema object in options when create or open the database. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 @@ -446,7 +441,7 @@ declare namespace distributedKVStore { */ mode: number; /** - * Indicates the skipsize of schema. + * Indicates the skip size of schema. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 @@ -457,7 +452,7 @@ declare namespace distributedKVStore { /** * Represents a node of a {@link Schema} instance. * - *
Through the {@link Schema} instance, you can define the fields contained in the values stored in a database. + *
With a {@link Schema} instance, you can define the value fields which stored in the database. * *
A FieldNode of the {@link Schema} instance is either a leaf or a non-leaf node. * @@ -478,16 +473,16 @@ declare namespace distributedKVStore { /** * Adds a child node to this {@code FieldNode}. * - *
Adding a child node makes this node a non-leaf node. Field value will be ignored if it has child node. + *
Add a child node to makes this node a non-leaf node and field value will be ignored if it has a child node. * * @param {FieldNode} child - The field node to append. - * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. + * @returns Returns true if the child node is successfully added to this {@code FieldNode} and false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ appendChild(child: FieldNode): boolean; /** - * Indicates the default value of fieldnode. + * Indicates the default value of field node. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 @@ -510,10 +505,10 @@ declare namespace distributedKVStore { } /** - * Provide methods to obtain the result set of the {@code SingleKVStore} or {@code DeviceKVStore} database. + * Provides methods to operate the result set of the {@code SingleKVStore} or {@code DeviceKVStore} database. * *
The result set is created by using the {@code getResultSet} method in the {@code SingleKVStore} or - * {@code DeviceKVStore} class. This interface also provides methods for moving the data read + * {@code DeviceKVStore} class. This interface also provides methods to move the data read * position in the result set. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -643,12 +638,12 @@ declare namespace distributedKVStore { } /** - * Represents a database query using a predicate. + * Represents a database query using predicates. * *
This class provides a constructor used to create a {@code Query} instance, which is used to query data * matching specified conditions in the database. * - *
This class also provides methods for adding predicates to the {@code Query} instance. + *
This class also provides methods to add predicates to the {@code Query} instance. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -950,7 +945,6 @@ declare namespace distributedKVStore { * The {@code SingleKVStore} database does not support * synchronous transactions, or data search using snapshots. * - * @version 1 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -960,7 +954,7 @@ declare namespace distributedKVStore { * *
If you do not want to synchronize this key-value pair to other devices, set the write option in the local database.
*
- * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}.
+ * @param {string} key - Indicates the key. Length must be less than {@code MAX_KEY_LENGTH}.
* Spaces before and after the key will be cleared.
* @param {Uint8Array|string|number|boolean} value - Indicates the value to be inserted.
* @param {AsyncCallback If you do not want to synchronize this key-value pair to other devices, set the write option in the local database.
*
- * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}.
+ * @param {string} key - Indicates the key. Length must be less than {@code MAX_KEY_LENGTH}.
* Spaces before and after the key will be cleared.
* @param {Uint8Array|string|number|boolean} value - Indicates the value to be inserted.
* @returns {Promise Sync result is returned through asynchronous callback.
*
* @param {Callback To create a {@code DeviceKVStore} database, you can use the {@link data.distributed.common.KVManager.getKVStore(Options, String)}
* method with {@code KVStoreType} set to {@code DEVICE_COLLABORATION} for the input parameter Options. This database manages distributed
@@ -1965,10 +1959,10 @@ declare namespace distributedKVStore {
* Creates a {@link KVManager} instance based on the configuration information.
*
* You must pass {@link KVManagerConfig} to provide configuration information
- * for creating the {@link KVManager} instance.
+ * to create a {@link KVManager} instance.
*
* @param {KVManagerConfig} config - Indicates the KVStore configuration information,
- * including the user information and package name.
+ * including the package name and context.
* @param {AsyncCallback You must pass {@link KVManagerConfig} to provide configuration information
- * for creating the {@link KVManager} instance.
+ * to create a {@link KVManager} instance.
*
* @param {KVManagerConfig} config - Indicates the KVStore configuration information,
- * including the user information and package name.
+ * including the package name and context.
* @returns {Promise The KVStore database to close must be an object created by using the {@code getKVStore} method. Before using this
* method, release the resources created for the database, for example, {@code KVStoreResultSet} for KVStore, otherwise
- * closing the database will fail. If you are attempting to close a database that is already closed, an error will be returned.
+ * closing the database will fail.
*
* @param {string} appId - Identifies the application that the database belong to.
* @param {string} storeId - Identifies the KVStore database to close.
@@ -2058,7 +2051,7 @@ declare namespace distributedKVStore {
*
* The KVStore database to close must be an object created by using the {@code getKVStore} method. Before using this
* method, release the resources created for the database, for example, {@code KVStoreResultSet} for KVStore, otherwise
- * closing the database will fail. If you are attempting to close a database that is already closed, an error will be returned.
+ * closing the database will fail.
*
* @param {string} appId - Identifies the application that the database belong to.
* @param {string} storeId - Identifies the KVStore database to close.
@@ -2130,7 +2123,7 @@ declare namespace distributedKVStore {
getAllKVStoreId(appId: string): Promise