diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 9231cbc643dcd839ff67ccdbdc9a9f4e8ed299ec..7c303b80c7719a3e95c59e5ecef09720200b7c16 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -13,10 +13,10 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import {AsyncCallback, Callback} from './basic'; /** - * Providers interfaces to creat a {@link KVManager} istances. + * Providers interfaces to creat a {@link KVManager} instance. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 7 * @deprecated since 9 @@ -61,16 +61,16 @@ declare namespace distributedData { * @deprecated since 9 */ interface UserInfo { - /** - * Indicates the user ID to set + /** + * Indicates the user ID to set * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 */ userId?: string; - /** - * Indicates the user type to set + /** + * Indicates the user type to set * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -86,8 +86,8 @@ declare namespace distributedData { * @deprecated since 9 */ enum UserType { - /** - * Indicates a user that logs in to different devices using the same account. + /** + * Indicates a user that logs in to different devices using the same account. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -170,8 +170,8 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.ValueType */ enum ValueType { - /** - * Indicates that the value type is string. + /** + * Indicates that the value type is string. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -180,7 +180,7 @@ declare namespace distributedData { STRING = 0, /** - * Indicates that the value type is int. + * Indicates that the value type is int. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -188,8 +188,8 @@ declare namespace distributedData { */ INTEGER = 1, - /** - * Indicates that the value type is float. + /** + * Indicates that the value type is float. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -197,17 +197,17 @@ declare namespace distributedData { */ FLOAT = 2, - /** - * Indicates that the value type is byte array. + /** + * Indicates that the value type is byte array. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ValueTypeB#YTE_ARRAY + * @useinstead ohos.data.distributedKVStore.ValueType#BYTE_ARRAY * */ BYTE_ARRAY = 3, - /** - * Indicates that the value type is boolean. + /** + * Indicates that the value type is boolean. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -215,8 +215,8 @@ declare namespace distributedData { * */ BOOLEAN = 4, - /** - * Indicates that the value type is double. + /** + * Indicates that the value type is double. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -294,15 +294,15 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.ChangeNotification */ interface ChangeNotification { - /** - * Indicates data addition records. + /** + * Indicates data addition records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ChangeNotification#insertEntries */ insertEntries: Entry[]; - /** + /** * Indicates data update records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 @@ -310,8 +310,8 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.ChangeNotification#updateEntries */ updateEntries: Entry[]; - /** - * Indicates data deletion records. + /** + * Indicates data deletion records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -337,7 +337,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SyncMode */ enum SyncMode { - /** + /** * Indicates that data is only pulled from the remote end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 @@ -345,16 +345,16 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SyncMode#PULL_ONLY */ PULL_ONLY = 0, - /** - * Indicates that data is only pushed from the local end. + /** + * Indicates that data is only pushed from the local end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SyncMode#PUSH_ONLY */ PUSH_ONLY = 1, - /** - * Indicates that data is pushed from the local end, and then pulled from the remote end. + /** + * Indicates that data is pushed from the local end, and then pulled from the remote end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -372,26 +372,26 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SubscribeType */ enum SubscribeType { - /** - * Subscription to local data changes + /** + * Subscription to local data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SubscribeType#SUBSCRIBE_TYPE_LOCAL - */ + */ SUBSCRIBE_TYPE_LOCAL = 0, - /** - * Subscription to remote data changes + /** + * Subscription to remote data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SubscribeType#SUBSCRIBE_TYPE_REMOTE - */ + */ SUBSCRIBE_TYPE_REMOTE = 1, - /** - * Subscription to both local and remote data changes + /** + * Subscription to both local and remote data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -409,8 +409,8 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreType */ enum KVStoreType { - /** - * Device-collaborated database, as specified by {@code DeviceKVStore} + /** + * Device-collaboration database, as specified by {@code DeviceKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 7 * @deprecated since 9 @@ -418,8 +418,8 @@ declare namespace distributedData { */ DEVICE_COLLABORATION = 0, - /** - * Single-version database, as specified by {@code SingleKVStore} + /** + * Single-version database, as specified by {@code SingleKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -427,8 +427,8 @@ declare namespace distributedData { */ SINGLE_VERSION = 1, - /** - * Multi-version database, as specified by {@code MultiKVStore} + /** + * Multi-version database, as specified by {@code MultiKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 7 * @deprecated since 9 @@ -522,7 +522,7 @@ declare namespace distributedData { */ 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 7 * @deprecated since 9 @@ -555,7 +555,7 @@ declare namespace distributedData { */ autoSync?: boolean; /** - * Indicates setting the databse type + * Indicates setting the database type * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -571,7 +571,7 @@ declare namespace distributedData { */ securityLevel?: SecurityLevel; /** - * Indicates schema object + * Indicates schema object * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -582,9 +582,9 @@ declare namespace distributedData { /** * Represents the database schema. - * + * * You can create Schema objects and put them in Options when creating or opening the database. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -593,34 +593,35 @@ declare namespace distributedData { class Schema { /** * A constructor used to create a Schema instance. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Schema#constructor */ constructor() + /** * Indicates the root json object. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Schema#root */ - root: FieldNode; + root: FieldNode; /** * Indicates the string array of json. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Schema#indexes */ - indexes: Array; + indexes: Array; /** * Indicates the mode of schema. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -628,8 +629,8 @@ declare namespace distributedData { */ mode: number; /** - * Indicates the skipsize of schema. - * + * Indicates the skip size of schema. + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -640,13 +641,13 @@ declare namespace distributedData { /** * 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. - * + * *

A FieldNode of the {@link Schema} instance is either a leaf or a non-leaf node. - * + * *

The leaf node must have a value; the non-leaf node must have a child {@code FieldNode}. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -656,18 +657,19 @@ declare namespace distributedData { /** * A constructor used to create a FieldNode instance with the specified field. * name Indicates the field node name. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.FieldNode#constructor */ constructor(name: string) + /** * 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. - * + * * @param child The field node to append. * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore @@ -676,41 +678,42 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.FieldNode#appendChild */ appendChild(child: FieldNode): boolean; + /** - * Indicates the default value of fieldnode. + * Indicates the default value of field node. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.FieldNode#default */ - default: string; - /** - * Indicates the nullable of database field. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.FieldNode#nullable - */ - nullable: boolean; - /** - * Indicates the type of value. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.FieldNode#type - */ - type: number; + default: string; + /** + * Indicates the nullable of database field. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.FieldNode#nullable + */ + nullable: boolean; + /** + * Indicates the type of value. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.FieldNode#type + */ + type: number; } /** * Provide methods to obtain the result set of the {@code KvStore} database. - * + * *

The result set is created by using the {@code getResultSet} method in the {@code DeviceKVStore} class. This interface also provides * methods for moving the data read position in the result set. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -719,7 +722,7 @@ declare namespace distributedData { interface KvStoreResultSet { /** * Obtains the number of lines in a result set. - * + * * @returns Returns the number of lines. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -727,9 +730,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#getCount */ getCount(): number; + /** * Obtains the current read position in a result set. - * + * * @returns Returns the current read position. The read position starts with 0. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -737,9 +741,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#getPosition */ getPosition(): number; + /** * Moves the read position to the first line. - * + * *

If the result set is empty, false is returned. * * @returns Returns true if the operation succeeds; return false otherwise. @@ -749,9 +754,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToFirst */ moveToFirst(): boolean; + /** * Moves the read position to the last line. - * + * *

If the result set is empty, false is returned. * * @returns Returns true if the operation succeeds; return false otherwise. @@ -761,9 +767,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToLast */ moveToLast(): boolean; + /** * Moves the read position to the next line. - * + * *

If the result set is empty or the data in the last line is being read, false is returned. * * @returns Returns true if the operation succeeds; return false otherwise. @@ -773,9 +780,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToNext */ moveToNext(): boolean; + /** * Moves the read position to the previous line. - * + * *

If the result set is empty or the data in the first line is being read, false is returned. * * @returns Returns true if the operation succeeds; return false otherwise. @@ -785,12 +793,13 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToPrevious */ moveToPrevious(): boolean; + /** * Moves the read position by a relative offset to the current position. - * - * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a - * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, - * the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, + * + * @param offset Indicates the relative offset to the current position. A negative offset indicates moving backwards, and a + * positive offset indicates moving forwards. For example, if the current position is entry 1 and this offset is 2, + * the destination position will be entry 3; if the current position is entry 3 and this offset is -2, * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the * final position is invalid, false will be returned. * @returns Returns true if the operation succeeds; return false otherwise. @@ -800,9 +809,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#move */ move(offset: number): boolean; + /** * Moves the read position from 0 to an absolute position. - * + * * @param position Indicates the absolute position. * @returns Returns true if the operation succeeds; return false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -811,9 +821,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToPosition */ moveToPosition(position: number): boolean; + /** * Checks whether the read position is the first line. - * + * * @returns Returns true if the read position is the first line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -821,9 +832,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isFirst */ isFirst(): boolean; + /** * Checks whether the read position is the last line. - * + * * @returns Returns true if the read position is the last line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -831,9 +843,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isLast */ isLast(): boolean; + /** * Checks whether the read position is before the last line. - * + * * @returns Returns true if the read position is before the first line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -841,9 +854,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isBeforeFirst */ isBeforeFirst(): boolean; + /** * Checks whether the read position is after the last line. - * + * * @returns Returns true if the read position is after the last line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -851,9 +865,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isAfterLast */ isAfterLast(): boolean; + /** * Obtains a key-value pair. - * + * * @returns Returns a key-value pair. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -886,6 +901,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#constructor */ constructor() + /** * Resets this {@code Query} object. * @@ -896,6 +912,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#reset */ reset(): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is equal to the specified long value. * @@ -908,7 +925,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#equalTo */ - equalTo(field: string, value: number|string|boolean): Query; + equalTo(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not equal to the specified int value. * @@ -921,7 +939,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#notEqualTo */ - notEqualTo(field: string, value: number|string|boolean): Query; + notEqualTo(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. @@ -935,7 +954,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#greaterThan */ - greaterThan(field: string, value: number|string|boolean): Query; + greaterThan(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than the specified int value. * @@ -948,7 +968,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#lessThan */ - lessThan(field: string, value: number|string): Query; + lessThan(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. @@ -962,7 +983,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#greaterThanOrEqualTo */ - greaterThanOrEqualTo(field: string, value: number|string): Query; + greaterThanOrEqualTo(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than or equal to the * specified int value. @@ -976,7 +998,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#lessThanOrEqualTo */ - lessThanOrEqualTo(field: string, value: number|string): Query; + lessThanOrEqualTo(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is null. * @@ -989,6 +1012,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#isNull */ isNull(field: string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified int value list. * @@ -1002,6 +1026,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#inNumber */ inNumber(field: string, valueList: number[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified string value list. * @@ -1015,6 +1040,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#inString */ inString(field: string, valueList: string[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified int value list. * @@ -1028,6 +1054,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#notInNumber */ notInNumber(field: string, valueList: number[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified string value list. * @@ -1041,6 +1068,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#notInString */ notInString(field: string, valueList: string[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is similar to the specified string value. * @@ -1054,6 +1082,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#like */ like(field: string, value: string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not similar to the specified string value. * @@ -1067,6 +1096,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#unlike */ unlike(field: string, value: string): Query; + /** * Constructs a {@code Query} object with the and condition. * @@ -1079,6 +1109,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#and */ and(): Query; + /** * Constructs a {@code Query} object with the or condition. * @@ -1091,6 +1122,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#or */ or(): Query; + /** * Constructs a {@code Query} object to sort the query results in ascending order. * @@ -1103,6 +1135,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#orderByAsc */ orderByAsc(field: string): Query; + /** * Constructs a {@code Query} object to sort the query results in descending order. * @@ -1115,6 +1148,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#orderByDesc */ orderByDesc(field: string): Query; + /** * Constructs a {@code Query} object to specify the number of results and the start position. * @@ -1127,6 +1161,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#limit */ limit(total: number, offset: number): Query; + /** * Creates a {@code query} condition with a specified field that is not null. * @@ -1139,6 +1174,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#isNotNull */ isNotNull(field: string): Query; + /** * Creates a query condition group with a left bracket. * @@ -1152,6 +1188,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#beginGroup */ beginGroup(): Query; + /** * Creates a query condition group with a right bracket. * @@ -1165,6 +1202,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#endGroup */ endGroup(): Query; + /** * Creates a query condition with a specified key prefix. * @@ -1177,6 +1215,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#prefixKey */ prefixKey(prefix: string): Query; + /** * Sets a specified index that will be preferentially used for query. * @@ -1189,31 +1228,33 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#setSuggestIndex */ setSuggestIndex(index: string): Query; - /** - * Add device ID key prefix.Used by {@code DeviceKVStore}. - * - * @param deviceId Specify device id to query from. - * @return Returns the {@code Query} object with device ID prefix added. - * @throw Throws this exception if input is invalid. + + /** + * Add device ID key prefix.Used by {@code DeviceKVStore}. + * + * @param deviceId Specify device id to query from. + * @returns Returns the {@code Query} object with device ID prefix added. + * @throws Throws this exception if input is invalid. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#deviceId - */ - deviceId(deviceId:string):Query; - /** - * Get a String that repreaents this {@code Query}. - * - *

The String would be parsed to DB query format. - * The String length should be no longer than 500kb. - * - * @return String representing this {@code Query}. + */ + deviceId(deviceId: string): Query; + + /** + * Get a String that represents this {@code Query}. + * + *

The String would be parsed to DB query format. + * The String length should be no longer than 500kb. + * + * @returns String representing this {@code Query}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#getSqlLike - */ - getSqlLike():string; + */ + getSqlLike(): string; } /** @@ -1248,6 +1289,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#put */ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; + put(key: string, value: Uint8Array | string | number | boolean): Promise; /** @@ -1264,6 +1306,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#delete */ delete(key: string, callback: AsyncCallback): void; + delete(key: string): Promise; /** @@ -1283,7 +1326,7 @@ declare namespace distributedData { on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** - * Subscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. + * Subscribe the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. * * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, @@ -1296,7 +1339,7 @@ declare namespace distributedData { on(event: 'syncComplete', syncCallback: Callback>): void; /** - * Unsubscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. + * Unsubscribe the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. * * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws Throws this exception if any of the following errors @@ -1320,6 +1363,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#putBatch */ putBatch(entries: Entry[], callback: AsyncCallback): void; + putBatch(entries: Entry[]): Promise; /** @@ -1333,6 +1377,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#deleteBatch */ deleteBatch(keys: string[], callback: AsyncCallback): void; + deleteBatch(keys: string[]): Promise; /** @@ -1347,6 +1392,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#startTransaction */ startTransaction(callback: AsyncCallback): void; + startTransaction(): Promise; /** @@ -1360,6 +1406,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#commit */ commit(callback: AsyncCallback): void; + commit(): Promise; /** @@ -1372,6 +1419,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#rollback */ rollback(callback: AsyncCallback): void; + rollback(): Promise; /** @@ -1386,6 +1434,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#enableSync */ enableSync(enabled: boolean, callback: AsyncCallback): void; + enableSync(enabled: boolean): Promise; /** @@ -1402,6 +1451,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#setSyncRange */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; + setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; } @@ -1434,6 +1484,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#get */ get(key: string, callback: AsyncCallback): void; + get(key: string): Promise; /** @@ -1449,6 +1500,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getEntries */ getEntries(keyPrefix: string, callback: AsyncCallback): void; + getEntries(keyPrefix: string): Promise; /** @@ -1464,6 +1516,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getEntries */ getEntries(query: Query, callback: AsyncCallback): void; + getEntries(query: Query): Promise; /** @@ -1482,6 +1535,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSet */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; + getResultSet(keyPrefix: string): Promise; /** @@ -1496,6 +1550,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSet */ getResultSet(query: Query, callback: AsyncCallback): void; + getResultSet(query: Query): Promise; /** @@ -1510,6 +1565,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#closeResultSet */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; + closeResultSet(resultSet: KvStoreResultSet): Promise; /** @@ -1525,6 +1581,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSize */ getResultSize(query: Query, callback: AsyncCallback): void; + getResultSize(query: Query): Promise; /** @@ -1536,10 +1593,11 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#removeDeviceData */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; + removeDeviceData(deviceId: string): Promise; /** - * Synchronizes the database to the specified devices with the specified delay allowed. + * Synchronize the database to the specified devices with the specified delay allowed. * * @param deviceIds Indicates the list of devices to which to synchronize the database. * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. @@ -1553,10 +1611,10 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SingleKVStore#sync */ - sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; + sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; /** - * Register Synchronizes SingleKvStore databases callback. + * Register a SingleKvStore database synchronization callback. *

Sync result is returned through asynchronous callback. * * @param syncCallback Indicates the callback used to send the synchronization result to the caller. @@ -1566,10 +1624,10 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SingleKVStore#on */ - on(event: 'syncComplete', syncCallback: Callback>): void; + on(event: 'syncComplete', syncCallback: Callback>): void; /** - * UnRegister Synchronizes SingleKvStore databases callback. + * UnRegister the SingleKvStore database synchronization callback. * * @throws Throws this exception if no {@code SingleKvStore} database is available. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1577,35 +1635,37 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SingleKVStore#off */ - off(event: 'syncComplete', syncCallback?: Callback>): void; - - /** - * Sets the default delay allowed for database synchronization - * - * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. - * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SingleKVStore#setSyncParam - */ - setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; - setSyncParam(defaultAllowedDelayMs: number): Promise; - - /** - * Get the security level of the database. - * - * @returns SecurityLevel {@code SecurityLevel} the security level of the database. - * @throws Throws this exception if any of the following errors occurs:{@code SERVER_UNAVAILABLE}, - * {@code IPC_ERROR}, and {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SingleKVStore#getSecurityLevel - */ - getSecurityLevel(callback: AsyncCallback): void; - getSecurityLevel(): Promise; + off(event: 'syncComplete', syncCallback?: Callback>): void; + + /** + * Sets the default delay allowed for database synchronization + * + * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. + * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#setSyncParam + */ + setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; + + setSyncParam(defaultAllowedDelayMs: number): Promise; + + /** + * Get the security level of the database. + * + * @returns SecurityLevel {@code SecurityLevel} the security level of the database. + * @throws Throws this exception if any of the following errors occurs:{@code SERVER_UNAVAILABLE}, + * {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#getSecurityLevel + */ + getSecurityLevel(callback: AsyncCallback): void; + + getSecurityLevel(): Promise; } /** @@ -1627,7 +1687,7 @@ declare namespace distributedData { * * @param deviceId Indicates the device to be queried. * @param key Indicates the key of the value to be queried. - * @return Returns the value matching the given criteria. + * @returns Returns the value matching the given criteria. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore @@ -1635,165 +1695,176 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.DeviceKVStore#get */ - get(deviceId: string, key: string, callback: AsyncCallback): void; - get(deviceId: string, key: string): Promise; - - /** - * Obtains all key-value pairs matching a specified device ID and key prefix. - * - * @param deviceId Identifies the device whose data is to be queried. - * @param keyPrefix Indicates the key prefix to match. - * @returns Returns the list of all key-value pairs meeting the given criteria. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries - */ - getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; - getEntries(deviceId: string, keyPrefix: string): Promise; - - /** - * Obtains the list of key-value pairs matching the specified {@code Query} object. - * - * @param query Indicates the {@code Query} object. - * @returns Returns the list of key-value pairs matching the specified {@code Query} object. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries - */ - getEntries(query: Query, callback: AsyncCallback): void; - getEntries(query: Query): Promise; - - /** - * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. - * - * @param deviceId Indicates the ID of the device to which the key-value pairs belong. - * @param query Indicates the {@code Query} object. - * @returns Returns the list of key-value pairs matching the specified {@code Query} object. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries - */ - getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; - getEntries(deviceId: string, query: Query): Promise; - - /** - * Obtains the {@code KvStoreResultSet} object matching the specified device ID and key prefix. - * - *

The {@code KvStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStore} - * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created four objects, - * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary - * {@code KvStoreResultSet} objects in a timely manner. - * - * @param deviceId Identifies the device whose data is to be queried. - * @param keyPrefix Indicates the key prefix to match. - * @returns Returns the {@code KvStoreResultSet} objects. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet - */ - getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; - getResultSet(deviceId: string, keyPrefix: string): Promise; - - /** - * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * - * @param query Indicates the {@code Query} object. - * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet - */ - getResultSet(query: Query, callback: AsyncCallback): void; - getResultSet(query: Query): Promise; - - /** - * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code Query} object. - * - * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. - * @param query Indicates the {@code Query} object. - * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet - */ - getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; - getResultSet(deviceId: string, query: Query): Promise; - - /** - * Closes a {@code KvStoreResultSet} object returned by getResultSet. - * - * @param resultSet Indicates the {@code KvStoreResultSet} object to close. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#closeResultSet - */ - closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; - closeResultSet(resultSet: KvStoreResultSet): Promise; - - /** - * Obtains the number of results matching the specified {@code Query} object. - * - * @param query Indicates the {@code Query} object. - * @returns Returns the number of results matching the specified {@code Query} object. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize - */ - getResultSize(query: Query, callback: AsyncCallback): void; - getResultSize(query: Query): Promise; - - /** - * Obtains the number of results matching a specified device ID and {@code Query} object. - * - * @param deviceId Indicates the ID of the device to which the results belong. - * @param query Indicates the {@code Query} object. - * @returns Returns the number of results matching the specified {@code Query} object. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize - */ - getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; - getResultSize(deviceId: string, query: Query): Promise; - - /** - * Removes data of a specified device from the current database. This method is used to remove only the data - * synchronized from remote devices. This operation does not synchronize data to other databases or affect - * subsequent data synchronization. - * - * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#removeDeviceData - */ - removeDeviceData(deviceId: string, callback: AsyncCallback): void; - removeDeviceData(deviceId: string): Promise; - - /** - * Synchronizes {@code DeviceKVStore} databases. + get(deviceId: string, key: string, callback: AsyncCallback): void; + + get(deviceId: string, key: string): Promise; + + /** + * Obtains all key-value pairs matching a specified device ID and key prefix. + * + * @param deviceId Identifies the device whose data is to be queried. + * @param keyPrefix Indicates the key prefix to match. + * @returns Returns the list of all key-value pairs meeting the given criteria. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries + */ + getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; + + getEntries(deviceId: string, keyPrefix: string): Promise; + + /** + * Obtains the list of key-value pairs matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries + */ + getEntries(query: Query, callback: AsyncCallback): void; + + getEntries(query: Query): Promise; + + /** + * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. + * + * @param deviceId Indicates the ID of the device to which the key-value pairs belong. + * @param query Indicates the {@code Query} object. + * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries + */ + getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; + + getEntries(deviceId: string, query: Query): Promise; + + /** + * Obtains the {@code KvStoreResultSet} object matching the specified device ID and key prefix. + * + *

The {@code KvStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStore} + * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created four objects, + * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary + * {@code KvStoreResultSet} objects in a timely manner. + * + * @param deviceId Identifies the device whose data is to be queried. + * @param keyPrefix Indicates the key prefix to match. + * @returns Returns the {@code KvStoreResultSet} objects. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet + */ + getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; + + getResultSet(deviceId: string, keyPrefix: string): Promise; + + /** + * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet + */ + getResultSet(query: Query, callback: AsyncCallback): void; + + getResultSet(query: Query): Promise; + + /** + * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code Query} object. + * + * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. + * @param query Indicates the {@code Query} object. + * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet + */ + getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; + + getResultSet(deviceId: string, query: Query): Promise; + + /** + * Closes a {@code KvStoreResultSet} object returned by getResultSet. + * + * @param resultSet Indicates the {@code KvStoreResultSet} object to close. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#closeResultSet + */ + closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; + + closeResultSet(resultSet: KvStoreResultSet): Promise; + + /** + * Obtains the number of results matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the number of results matching the specified {@code Query} object. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize + */ + getResultSize(query: Query, callback: AsyncCallback): void; + + getResultSize(query: Query): Promise; + + /** + * Obtains the number of results matching a specified device ID and {@code Query} object. + * + * @param deviceId Indicates the ID of the device to which the results belong. + * @param query Indicates the {@code Query} object. + * @returns Returns the number of results matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize + */ + getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; + + getResultSize(deviceId: string, query: Query): Promise; + + /** + * Removes data of a specified device from the current database. This method is used to remove only the data + * synchronized from remote devices. This operation does not synchronize data to other databases or affect + * subsequent data synchronization. + * + * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#removeDeviceData + */ + removeDeviceData(deviceId: string, callback: AsyncCallback): void; + + removeDeviceData(deviceId: string): Promise; + + /** + * Synchronize the {@code DeviceKVStore} databases. * *

This method returns immediately and sync result will be returned through asynchronous callback. * @@ -1812,7 +1883,7 @@ declare namespace distributedData { sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; /** - * Register Synchronizes DeviceKVStore databases callback. + * Register a DeviceKVStore database synchronization callback. * *

Sync result is returned through asynchronous callback. * @@ -1826,7 +1897,7 @@ declare namespace distributedData { on(event: 'syncComplete', syncCallback: Callback>): void; /** - * UnRegister Synchronizes DeviceKVStore databases callback. + * UnRegister the DeviceKVStore database synchronization callback. * * @throws Throws this exception if no DeviceKVStore database is available. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1845,7 +1916,7 @@ declare namespace distributedData { * * @param config Indicates the {@link KVStore} configuration information, * including the user information and package name. - * @return Returns the {@code KVManager} instance. + * @returns Returns the {@code KVManager} instance. * @throws Throws exception if input is invalid. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 @@ -1873,29 +1944,30 @@ declare namespace distributedData { * @param storeId Identifies the {@code KVStore} database. * The value of this parameter must be unique for the same application, * and different applications can share the same value. - * @return Returns a {@code KVStore}, or {@code SingleKVStore}. + * @returns Returns a {@code KVStore}, or {@code SingleKVStore}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.KVManager#getKVStore */ getKVStore(storeId: string, options: Options): Promise; + getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; /** * Closes the {@code KvStore} database. - * + * *

Warning: This method is not thread-safe. If you call this method to stop a KvStore database that is running, your * thread may crash. - * - *

The {@code KvStore} database to close must be an object created by using the {@code getKvStore} method. Before using this + * + *

The {@code 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 {@code SingleKvStore}, * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error * will be returned. * * @param kvStore Indicates the {@code KvStore} database to close. * @throws Throws this exception if any of the following errors - * occurs:{@code INVALID_ARGUMENT}, {@code ERVER_UNAVAILABLE}, + * occurs:{@code INVALID_ARGUMENT}, {@code SERVER_UNAVAILABLE}, * {@code STORE_NOT_OPEN}, {@code STORE_NOT_FOUND}, {@code DB_ERROR}, * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1904,18 +1976,19 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#closeKVStore */ closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback): void; + closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise; /** * Deletes the {@code KvStore} database identified by storeId. - * + * *

Before using this method, close all {@code KvStore} instances in use that are identified by the same storeId. - * + * *

You can use this method to delete a {@code KvStore} database not in use. After the database is deleted, all its data will be * lost. * * @param storeId Identifies the {@code KvStore} database to delete. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors * occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code STORE_NOT_FOUND}, * {@code DB_ERROR}, {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. @@ -1925,14 +1998,15 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#deleteKVStore */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; + deleteKVStore(appId: string, storeId: string): Promise; /** * Obtains the storeId of all {@code KvStore} databases that are created by using the {@code getKvStore} method and not deleted by * calling the {@code deleteKvStore} method. - * + * * @returns Returns the storeId of all created {@code KvStore} databases. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code DB_ERROR}, * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1941,13 +2015,14 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#getAllKVStoreId */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; + getAllKVStoreId(appId: string): Promise; /** * register DeviceChangeCallback to get notification when device's status changed - * + * * @param deathCallback device change callback {@code DeviceChangeCallback} - * @throws exception maybe occurs. + * @throws exception maybe occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -1957,7 +2032,7 @@ declare namespace distributedData { /** * unRegister DeviceChangeCallback and can not receive notification - * + * * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. * @throws exception maybe occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 7eb043446415cfdd5d39aaa72dd15cab7a3e32e7..2ee6c9b9e551f3325c0e59887a1d95f6829ad9a8 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -13,13 +13,13 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; -import { ValuesBucket } from './@ohos.data.ValuesBucket'; +import {AsyncCallback, Callback} from './basic'; +import {ValuesBucket} from './@ohos.data.ValuesBucket'; import dataSharePredicates from './@ohos.data.dataSharePredicates'; import Context from './application/Context'; /** - * Provider interfaces to create a {@link KVManager} istances. + * Provider interfaces to create a {@link KVManager} instance. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -41,7 +41,7 @@ declare namespace distributedKVStore { /** * Indicates the ability or hap context * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @Note: if swap the area, you should close all the KV store and use the new Context to create the KVManager + * if swap the area, you should close all the KV store and use the new Context to create the KVManager * @since 9 */ context: Context; @@ -106,43 +106,43 @@ declare namespace distributedKVStore { * @since 9 */ enum ValueType { - /** - * Indicates that the value type is string. + /** + * Indicates that the value type is string. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ STRING, /** - * Indicates that the value type is int. + * Indicates that the value type is int. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ INTEGER, - /** - * Indicates that the value type is float. + /** + * Indicates that the value type is float. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ FLOAT, - /** - * Indicates that the value type is byte array. + /** + * Indicates that the value type is byte array. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 * */ BYTE_ARRAY, - /** - * Indicates that the value type is boolean. + /** + * Indicates that the value type is boolean. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 * */ BOOLEAN, - /** - * Indicates that the value type is double. + /** + * Indicates that the value type is double. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -267,14 +267,14 @@ declare namespace distributedKVStore { * Subscription to local data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 - */ + */ SUBSCRIBE_TYPE_LOCAL, /** * Subscription to remote data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 - */ + */ SUBSCRIBE_TYPE_REMOTE, /** @@ -293,7 +293,7 @@ declare namespace distributedKVStore { */ enum KVStoreType { /** - * Device-collaborated database, as specified by {@code DeviceKVStore} + * Device-collaboration database, as specified by {@code DeviceKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -419,13 +419,14 @@ declare namespace distributedKVStore { * @since 9 */ constructor() + /** * Indicates the root json object. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ - root: FieldNode; + root: FieldNode; /** * Indicates the string array of json. * @@ -471,6 +472,7 @@ declare namespace distributedKVStore { * @since 9 */ constructor(name: string) + /** * Adds a child node to this {@code FieldNode}. * @@ -483,27 +485,28 @@ declare namespace distributedKVStore { * @since 9 */ appendChild(child: FieldNode): boolean; + /** * Indicates the default value of field node. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ - default: string; - /** - * Indicates the nullable of database field. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - nullable: boolean; - /** - * Indicates the type of value. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - type: number; + default: string; + /** + * Indicates the nullable of database field. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + nullable: boolean; + /** + * Indicates the type of value. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + type: number; } /** @@ -525,6 +528,7 @@ declare namespace distributedKVStore { * @since 9 */ getCount(): number; + /** * Obtains the current read position in a result set. * @@ -533,6 +537,7 @@ declare namespace distributedKVStore { * @since 9 */ getPosition(): number; + /** * Moves the read position to the first line. * @@ -543,6 +548,7 @@ declare namespace distributedKVStore { * @since 9 */ moveToFirst(): boolean; + /** * Moves the read position to the last line. * @@ -553,6 +559,7 @@ declare namespace distributedKVStore { * @since 9 */ moveToLast(): boolean; + /** * Moves the read position to the next line. * @@ -563,6 +570,7 @@ declare namespace distributedKVStore { * @since 9 */ moveToNext(): boolean; + /** * Moves the read position to the previous line. * @@ -573,12 +581,13 @@ declare namespace distributedKVStore { * @since 9 */ moveToPrevious(): boolean; + /** * Moves the read position by a relative offset to the current position. * - * @param {number} offset - Indicates the relative offset to the current position. Anegative offset indicates moving - * backwards, and a positive offset indicates moving forewards. Forexample, if the current position is entry 1 and - * thisoffset is 2, the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, + * @param {number} offset - Indicates the relative offset to the current position. A negative offset indicates moving + * backwards, and a positive offset indicates moving forwards. For example, if the current position is entry 1 and + * this offset is 2, the destination position will be entry 3; if the current position is entry 3 and this offset is -2, * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the * final position is invalid, false will be returned. * @returns Returns true if the operation succeeds; return false otherwise. @@ -587,6 +596,7 @@ declare namespace distributedKVStore { * @since 9 */ move(offset: number): boolean; + /** * Moves the read position from 0 to an absolute position. * @@ -597,6 +607,7 @@ declare namespace distributedKVStore { * @since 9 */ moveToPosition(position: number): boolean; + /** * Checks whether the read position is the first line. * @@ -605,6 +616,7 @@ declare namespace distributedKVStore { * @since 9 */ isFirst(): boolean; + /** * Checks whether the read position is the last line. * @@ -613,6 +625,7 @@ declare namespace distributedKVStore { * @since 9 */ isLast(): boolean; + /** * Checks whether the read position is before the last line. * @@ -621,6 +634,7 @@ declare namespace distributedKVStore { * @since 9 */ isBeforeFirst(): boolean; + /** * Checks whether the read position is after the last line. * @@ -629,6 +643,7 @@ declare namespace distributedKVStore { * @since 9 */ isAfterLast(): boolean; + /** * Obtains a key-value pair. * @@ -658,6 +673,7 @@ declare namespace distributedKVStore { * @since 9 */ constructor() + /** * Resets this {@code Query} object. * @@ -666,6 +682,7 @@ declare namespace distributedKVStore { * @since 9 */ reset(): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is equal to the specified long value. * @@ -677,6 +694,7 @@ declare namespace distributedKVStore { * @since 9 */ equalTo(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not equal to the specified int value. * @@ -688,6 +706,7 @@ declare namespace distributedKVStore { * @since 9 */ notEqualTo(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. @@ -700,6 +719,7 @@ declare namespace distributedKVStore { * @since 9 */ greaterThan(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than the specified int value. * @@ -711,6 +731,7 @@ declare namespace distributedKVStore { * @since 9 */ lessThan(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or * equal to the specified int value. @@ -723,6 +744,7 @@ declare namespace distributedKVStore { * @since 9 */ greaterThanOrEqualTo(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than or equal to the * specified int value. @@ -735,6 +757,7 @@ declare namespace distributedKVStore { * @since 9 */ lessThanOrEqualTo(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is null. * @@ -745,6 +768,7 @@ declare namespace distributedKVStore { * @since 9 */ isNull(field: string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified int value list. * @@ -756,6 +780,7 @@ declare namespace distributedKVStore { * @since 9 */ inNumber(field: string, valueList: number[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified string value list. * @@ -767,6 +792,7 @@ declare namespace distributedKVStore { * @since 9 */ inString(field: string, valueList: string[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified int value list. * @@ -778,6 +804,7 @@ declare namespace distributedKVStore { * @since 9 */ notInNumber(field: string, valueList: number[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified string value list. * @@ -789,6 +816,7 @@ declare namespace distributedKVStore { * @since 9 */ notInString(field: string, valueList: string[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is similar to the specified string value. * @@ -800,6 +828,7 @@ declare namespace distributedKVStore { * @since 9 */ like(field: string, value: string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not similar to the specified string value. * @@ -811,6 +840,7 @@ declare namespace distributedKVStore { * @since 9 */ unlike(field: string, value: string): Query; + /** * Constructs a {@code Query} object with the and condition. * @@ -821,6 +851,7 @@ declare namespace distributedKVStore { * @since 9 */ and(): Query; + /** * Constructs a {@code Query} object with the or condition. * @@ -831,6 +862,7 @@ declare namespace distributedKVStore { * @since 9 */ or(): Query; + /** * Constructs a {@code Query} object to sort the query results in ascending order. * @@ -841,6 +873,7 @@ declare namespace distributedKVStore { * @since 9 */ orderByAsc(field: string): Query; + /** * Constructs a {@code Query} object to sort the query results in descending order. * @@ -851,6 +884,7 @@ declare namespace distributedKVStore { * @since 9 */ orderByDesc(field: string): Query; + /** * Constructs a {@code Query} object to specify the number of results and the start position. * @@ -862,6 +896,7 @@ declare namespace distributedKVStore { * @since 9 */ limit(total: number, offset: number): Query; + /** * Creates a {@code Query} condition with a specified field that is not null. * @@ -872,6 +907,7 @@ declare namespace distributedKVStore { * @since 9 */ isNotNull(field: string): Query; + /** * Creates a query condition group with a left bracket. * @@ -883,6 +919,7 @@ declare namespace distributedKVStore { * @since 9 */ beginGroup(): Query; + /** * Creates a query condition group with a right bracket. * @@ -894,6 +931,7 @@ declare namespace distributedKVStore { * @since 9 */ endGroup(): Query; + /** * Creates a query condition with a specified key prefix. * @@ -904,6 +942,7 @@ declare namespace distributedKVStore { * @since 9 */ prefixKey(prefix: string): Query; + /** * Sets a specified index that will be preferentially used for query. * @@ -914,27 +953,29 @@ declare namespace distributedKVStore { * @since 9 */ setSuggestIndex(index: string): Query; + /** * Add device ID key prefix.Used by {@code DeviceKVStore}. * * @param {string} deviceId - Specify device id to query from. - * @return Returns the {@code Query} object with device ID prefix added. + * @returns Returns the {@code Query} object with device ID prefix added. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - deviceId(deviceId:string):Query; + deviceId(deviceId: string): Query; + /** - * Get a String that repreaents this {@code Query}. + * Get a String that represents this {@code Query}. * *

The String would be parsed to DB query format. * The String length should be no longer than 500kb. * - * @return String representing this {@code Query}. + * @returns String representing this {@code Query}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - getSqlLike():string; + getSqlLike(): string; } /** @@ -1398,7 +1439,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - backup(file:string, callback: AsyncCallback):void; + backup(file: string, callback: AsyncCallback): void; /** * Backs up a database in the specified filename. @@ -1411,7 +1452,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - backup(file:string): Promise; + backup(file: string): Promise; /** * Restores a database from a specified database file. @@ -1424,7 +1465,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - restore(file:string, callback: AsyncCallback):void; + restore(file: string, callback: AsyncCallback): void; /** * Restores a database from a specified database file. @@ -1437,7 +1478,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - restore(file:string): Promise; + restore(file: string): Promise; /** * Delete database backup files based on the specified filenames. @@ -1450,7 +1491,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - deleteBackup(files:Array, callback: AsyncCallback>):void; + deleteBackup(files: Array, callback: AsyncCallback>): void; /** * Delete database backup files based on the specified filenames. @@ -1462,7 +1503,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - deleteBackup(files:Array): Promise>; + deleteBackup(files: Array): Promise>; /** * Starts a transaction operation in the {@code SingleKVStore} database. @@ -1607,7 +1648,7 @@ declare namespace distributedKVStore { setSyncParam(defaultAllowedDelayMs: number): Promise; /** - * Synchronizes the database to the specified devices with the specified delay allowed. + * Synchronize the database to the specified devices with the specified delay allowed. * * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param {string[]} deviceIds - Indicates the list of devices to which to synchronize the database. @@ -1623,7 +1664,7 @@ declare namespace distributedKVStore { sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void /** - * Synchronizes the database to the specified devices with the specified delay allowed. + * Synchronize the database to the specified devices with the specified delay allowed. * * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param {string[]} deviceIds - Indicates the list of devices to which to synchronize the database. @@ -1677,7 +1718,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - off(event:'dataChange', listener?: Callback): void; + off(event: 'dataChange', listener?: Callback): void; /** * Unregister the database synchronization callback. @@ -1733,7 +1774,7 @@ declare namespace distributedKVStore { * @param {string} key - Indicates the key of the value to be queried. * @param {AsyncCallback} callback - * {boolean|string|number|Uint8Array}: the returned value specified by the deviceId and key. - * @return Returns the value matching the given criteria. + * @returns Returns the value matching the given criteria. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data. @@ -1750,7 +1791,7 @@ declare namespace distributedKVStore { * @param {string} key - Indicates the key of the value to be queried. * @returns {Promise} * {Uint8Array|string|boolean|number}: the returned value specified by the deviceId and key. - * @return Returns the value matching the given criteria. + * @returns Returns the value matching the given criteria. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data.