diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index acfd0ce291c4b2a2fc358d38190a333d3dccca1a..7b3453bec659d9c62b8dac2711378a687295ed9b 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -71,6 +71,7 @@ declare namespace distributedKVStore { context: BaseContext; } +/*** if arkts dynamic */ /** * KVStore constants * @@ -139,6 +140,72 @@ declare namespace distributedKVStore { */ readonly MAX_BATCH_SIZE: number; } +/*** endif */ + +/*** if arkts static */ + /** + * KVStore constants + * + * @interface Constants + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + class Constants { + /** + * Max key length is 1024. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + static get MAX_KEY_LENGTH(): int; + + /** + * Max value length is 4194303. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + static get MAX_VALUE_LENGTH(): int; + + /** + * Max device coordinate key length is 896. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + static get MAX_KEY_LENGTH_DEVICE(): int; + + /** + * Max store id length is 128. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + static get MAX_STORE_ID_LENGTH(): int; + + /** + * Max query length is 512000. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + static get MAX_QUERY_LENGTH(): int; + + /** + * Max batch operation size is 128. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + static get MAX_BATCH_SIZE(): int; + } +/*** endif */ /** * Indicates the {@code ValueType}. @@ -147,6 +214,7 @@ declare namespace distributedKVStore { * @enum { number } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ enum ValueType { /** @@ -154,6 +222,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ STRING, @@ -162,6 +231,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ INTEGER, @@ -170,6 +240,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ FLOAT, @@ -178,6 +249,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ BYTE_ARRAY, @@ -186,6 +258,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ BOOLEAN, @@ -194,6 +267,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ DOUBLE } @@ -204,6 +278,7 @@ declare namespace distributedKVStore { * @interface Value * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ interface Value { /** @@ -212,6 +287,7 @@ declare namespace distributedKVStore { * @type { ValueType } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static * @see ValueType */ type: ValueType; @@ -219,11 +295,12 @@ declare namespace distributedKVStore { /** * Indicates the value * - * @type { Uint8Array | string | number | boolean } + * @type { Uint8Array | string | int | float | double | boolean } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - value: Uint8Array | string | number | boolean; + value: Uint8Array | string | int | float | double | boolean; } /** @@ -232,6 +309,7 @@ declare namespace distributedKVStore { * @interface Entry * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ interface Entry { /** @@ -240,6 +318,7 @@ declare namespace distributedKVStore { * @type { string } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ key: string; @@ -249,6 +328,7 @@ declare namespace distributedKVStore { * @type { Value } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ value: Value; } @@ -262,6 +342,7 @@ declare namespace distributedKVStore { * @interface ChangeNotification * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ interface ChangeNotification { /** @@ -270,6 +351,7 @@ declare namespace distributedKVStore { * @type { Entry[] } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ insertEntries: Entry[]; @@ -279,6 +361,7 @@ declare namespace distributedKVStore { * @type { Entry[] } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ updateEntries: Entry[]; @@ -288,6 +371,7 @@ declare namespace distributedKVStore { * @type { Entry[] } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ deleteEntries: Entry[]; @@ -297,6 +381,7 @@ declare namespace distributedKVStore { * @type { string } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ deviceId: string; } @@ -307,6 +392,7 @@ declare namespace distributedKVStore { * @enum { number } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ enum SyncMode { /** @@ -314,6 +400,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ PULL_ONLY, @@ -322,6 +409,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ PUSH_ONLY, @@ -330,6 +418,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ PUSH_PULL } @@ -340,6 +429,7 @@ declare namespace distributedKVStore { * @enum { number } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ enum SubscribeType { /** @@ -347,6 +437,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ SUBSCRIBE_TYPE_LOCAL, @@ -355,6 +446,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ SUBSCRIBE_TYPE_REMOTE, @@ -363,6 +455,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ SUBSCRIBE_TYPE_ALL } @@ -526,13 +619,13 @@ declare namespace distributedKVStore { schema?: Schema; } +/*** if arkts dynamic */ /** * Represents the database schema. * You can set the schema object in options when create or open the database. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic - * @since 20 static */ class Schema { /** @@ -540,7 +633,6 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic - * @since 20 static */ constructor(); @@ -580,6 +672,98 @@ declare namespace distributedKVStore { */ skip: number; } +/*** endif */ + +/*** if arkts static */ + /** + * Represents the database schema. + * You can set the schema object in options when create or open the database. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + class Schema { + /** + * A constructor used to create a Schema instance. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + constructor(); + + /** + * Indicates the root json object. + * + * @type { FieldNode } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + get root(): FieldNode; + + /** + * Indicates the root json object. + * + * @type { FieldNode } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + set root(para: FieldNode); + + /** + * Indicates the string array of json. + * + * @type { Array } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + get indexes(): Array; + + /** + * Indicates the string array of json. + * + * @type { Array } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + set indexes(para: Array); + + /** + * Indicates the mode of schema. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + get mode(): int; + + /** + * Indicates the mode of schema. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + set mode(para: int); + + /** + * Indicates the skip size of schema. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + get skip(): int; + + /** + * Indicates the skip size of schema. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + set skip(para: int); + } +/*** endif */ /** * Represents a node of a {@link Schema} instance. @@ -589,6 +773,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ class FieldNode { /** @@ -600,6 +785,7 @@ declare namespace distributedKVStore { *
2.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ constructor(name: string); @@ -614,9 +800,11 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ appendChild(child: FieldNode): boolean; +/*** if arkts dynamic */ /** * Indicates the default value of field node. * @type { string } @@ -642,6 +830,61 @@ declare namespace distributedKVStore { * @since 9 dynamic */ type: number; +/*** endif */ + +/*** if arkts static */ + /** + * Indicates the default value of field node. + * @type { string } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + get defaultValue(): string; + + /** + * Indicates the default value of field node. + * @type { string } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + set defaultValue(para: string); + + /** + * Indicates the nullable of database field. + * + * @type { boolean } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + get nullable(): boolean; + + /** + * Indicates the nullable of database field. + * + * @type { boolean } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + set nullable(para: boolean); + + /** + * Indicates the type of value. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + get type(): int; + + /** + * Indicates the type of value. + * + * @type { int } + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 20 static + */ + set type(para: int); +/*** endif */ } /** @@ -653,25 +896,28 @@ declare namespace distributedKVStore { * @interface KVStoreResultSet * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ interface KVStoreResultSet { /** * Obtains the number of lines in a result set. * - * @returns { number } Returns the number of lines. + * @returns { int } Returns the number of lines. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - getCount(): number; + getCount(): int; /** * Obtains the current read position in a result set. * - * @returns { number } Returns the current read position. The read position starts with 0. + * @returns { int } Returns the current read position. The read position starts with 0. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - getPosition(): number; + getPosition(): int; /** * Moves the read position to the first line. @@ -680,6 +926,7 @@ declare namespace distributedKVStore { * @returns { boolean } Returns true if the operation succeeds; return false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ moveToFirst(): boolean; @@ -690,6 +937,7 @@ declare namespace distributedKVStore { * @returns { boolean } Returns true if the operation succeeds; return false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ moveToLast(): boolean; @@ -700,6 +948,7 @@ declare namespace distributedKVStore { * @returns { boolean } Returns true if the operation succeeds; return false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ moveToNext(): boolean; @@ -710,13 +959,14 @@ declare namespace distributedKVStore { * @returns { boolean } Returns true if the operation succeeds; return false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ 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. A negative offset indicates + * @param { int } 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 @@ -726,20 +976,22 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - move(offset: number): boolean; + move(offset: int): boolean; /** * Moves the read position from 0 to an absolute position. * - * @param { number } position - Indicates the absolute position. + * @param { int } position - Indicates the absolute position. * @returns { boolean } Returns true if the operation succeeds; return false otherwise. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - moveToPosition(position: number): boolean; + moveToPosition(position: int): boolean; /** * Checks whether the read position is the first line. @@ -747,6 +999,7 @@ declare namespace distributedKVStore { * @returns { boolean } Returns true if the read position is the first line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ isFirst(): boolean; @@ -756,6 +1009,7 @@ declare namespace distributedKVStore { * @returns { boolean } Returns true if the read position is the last line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ isLast(): boolean; @@ -765,6 +1019,7 @@ declare namespace distributedKVStore { * @returns { boolean } Returns true if the read position is before the first line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ isBeforeFirst(): boolean; @@ -774,6 +1029,7 @@ declare namespace distributedKVStore { * @returns { boolean } Returns true if the read position is after the last line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ isAfterLast(): boolean; @@ -783,6 +1039,7 @@ declare namespace distributedKVStore { * @returns { Entry } Returns a key-value pair. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getEntry(): Entry; } @@ -795,6 +1052,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ class Query { /** @@ -802,6 +1060,7 @@ declare namespace distributedKVStore { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ constructor(); @@ -811,6 +1070,7 @@ declare namespace distributedKVStore { * @returns { Query } Returns the reset {@code Query} object. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ reset(): Query; @@ -826,6 +1086,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ equalTo(field: string, value: number | string | boolean): Query; @@ -841,6 +1102,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ notEqualTo(field: string, value: number | string | boolean): Query; @@ -856,6 +1118,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ greaterThan(field: string, value: number | string | boolean): Query; @@ -871,6 +1134,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ lessThan(field: string, value: number | string): Query; @@ -886,6 +1150,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ greaterThanOrEqualTo(field: string, value: number | string): Query; @@ -901,6 +1166,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ lessThanOrEqualTo(field: string, value: number | string): Query; @@ -914,6 +1180,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ isNull(field: string): Query; @@ -922,15 +1189,16 @@ declare namespace distributedKVStore { * int value list. * * @param { string } field - Indicates the field, which cannot contain ^. - * @param { number[] } valueList - Indicates the int value list. + * @param { (int | long | double)[] } valueList - Indicates the int value list. * @returns { Query } Returns the {@coed Query} object. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types; *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - inNumber(field: string, valueList: number[]): Query; + inNumber(field: string, valueList: (int | long | double)[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified @@ -944,6 +1212,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ inString(field: string, valueList: string[]): Query; @@ -952,15 +1221,16 @@ declare namespace distributedKVStore { * specified int value list. * * @param { string } field - Indicates the field, which cannot contain ^. - * @param { number[] } valueList - Indicates the int value list. + * @param { (int | long | double)[] } valueList - Indicates the int value list. * @returns { Query } Returns the {@coed Query} object. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types; *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - notInNumber(field: string, valueList: number[]): Query; + notInNumber(field: string, valueList: (int | long | double)[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the @@ -974,6 +1244,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ notInString(field: string, valueList: string[]): Query; @@ -989,6 +1260,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ like(field: string, value: string): Query; @@ -1004,6 +1276,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ unlike(field: string, value: string): Query; @@ -1014,6 +1287,7 @@ declare namespace distributedKVStore { * @returns { Query } Returns the {@coed Query} object. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ and(): Query; @@ -1024,6 +1298,7 @@ declare namespace distributedKVStore { * @returns { Query } Returns the {@coed Query} object. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ or(): Query; @@ -1037,6 +1312,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ orderByAsc(field: string): Query; @@ -1050,15 +1326,16 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ orderByDesc(field: string): Query; /** * Constructs a {@code Query} object to specify the number of results and the start position. * - * @param { number } total - Maximum number of results to query. The value must be a non-negative integer. + * @param { int } total - Maximum number of results to query. The value must be a non-negative integer. * If the input value is less than 0, the number of results is not limited. - * @param { number } offset - Start position of the query result. By default, + * @param { int } offset - Start position of the query result. By default, * the start position is the beginning of the result set. If **offset** is a negative number, * the start position is the beginning of the result set. If **offset** exceeds the end of the result set, * the query result is empty. @@ -1067,8 +1344,9 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - limit(total: number, offset: number): Query; + limit(total: int, offset: int): Query; /** * Creates a {@code Query} condition with a specified field that is not null. @@ -1079,6 +1357,7 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ isNotNull(field: string): Query; @@ -1090,6 +1369,7 @@ declare namespace distributedKVStore { * @returns { Query } Returns the {@coed Query} object. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ beginGroup(): Query; @@ -1101,6 +1381,7 @@ declare namespace distributedKVStore { * @returns { Query } Returns the {@coed Query} object. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ endGroup(): Query; @@ -1113,6 +1394,7 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ prefixKey(prefix: string): Query; @@ -1125,6 +1407,7 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ setSuggestIndex(index: string): Query; @@ -1138,6 +1421,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ deviceId(deviceId: string): Query; @@ -1149,6 +1433,7 @@ declare namespace distributedKVStore { * @returns { string } String representing this {@code Query}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getSqlLike(): string; } @@ -1192,7 +1477,7 @@ declare namespace distributedKVStore { * * @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 { Uint8Array | string | int | float | double | boolean } value - Indicates the value to be inserted. * @param { AsyncCallback } callback - the callback of put. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types; @@ -1204,7 +1489,7 @@ declare namespace distributedKVStore { * @since 10 dynamic * @since 20 static */ - put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; + put(key: string, value: Uint8Array | string | int | float | double | boolean, callback: AsyncCallback): void; /** * Writes a key-value pair of the string type into the {@code SingleKVStore} database. @@ -1230,7 +1515,7 @@ declare namespace distributedKVStore { * * @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 { Uint8Array | string | int | float | double | boolean } value - Indicates the value to be inserted. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types; @@ -1242,7 +1527,7 @@ declare namespace distributedKVStore { * @since 10 dynamic * @since 20 static */ - put(key: string, value: Uint8Array | string | number | boolean): Promise; + put(key: string, value: Uint8Array | string | int | float | double | boolean): Promise; /** * Inserts key-value pairs into the {@code SingleKVStore} database in batches. @@ -1268,6 +1553,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 14800047 - The WAL file size exceeds the default limit. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ putBatch(entries: Entry[], callback: AsyncCallback): void; @@ -1295,6 +1581,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 14800047 - The WAL file size exceeds the default limit. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ putBatch(entries: Entry[]): Promise; @@ -1330,6 +1617,7 @@ declare namespace distributedKVStore { * @systemapi * @StageModelOnly * @since 10 dynamic + * @since 20 static */ putBatch(value: Array, callback: AsyncCallback): void; @@ -1365,6 +1653,7 @@ declare namespace distributedKVStore { * @systemapi * @StageModelOnly * @since 10 dynamic + * @since 20 static */ putBatch(value: Array): Promise; @@ -1396,6 +1685,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 14800047 - The WAL file size exceeds the default limit. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ delete(key: string, callback: AsyncCallback): void; @@ -1411,7 +1701,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100003 - Database corrupted. * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since 9 dynamic */ /** * Deletes the key-value pair based on a specified key. @@ -1427,6 +1717,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 14800047 - The WAL file size exceeds the default limit. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ delete(key: string): Promise; @@ -1444,7 +1735,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @StageModelOnly - * @since 9 + * @since 9 dynamic */ /** * Deletes the key-value pairs based on the dataSharePredicates. @@ -1462,8 +1753,9 @@ declare namespace distributedKVStore { * @systemapi * @StageModelOnly * @since 10 dynamic + * @since 20 static */ - delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); + delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; /** * Deletes the key-value pairs based on the dataSharePredicates. @@ -1497,6 +1789,7 @@ declare namespace distributedKVStore { * @systemapi * @StageModelOnly * @since 10 dynamic + * @since 20 static */ delete(predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -1526,6 +1819,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 14800047 - The WAL file size exceeds the default limit. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ deleteBatch(keys: string[], callback: AsyncCallback): void; @@ -1555,6 +1849,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 14800047 - The WAL file size exceeds the default limit. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ deleteBatch(keys: string[]): Promise; @@ -1571,6 +1866,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; @@ -1587,6 +1883,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ removeDeviceData(deviceId: string): Promise; @@ -1594,7 +1891,7 @@ declare namespace distributedKVStore { * Obtains the value of a specified key. * * @param { string } key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. - * @param { AsyncCallback } callback - + * @param { AsyncCallback } callback - * {Uint8Array|string|boolean|number}: the returned value specified by the key. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types; @@ -1606,13 +1903,13 @@ declare namespace distributedKVStore { * @since 9 dynamic * @since 20 static */ - get(key: string, callback: AsyncCallback): void; + get(key: string, callback: AsyncCallback): void; /** * Obtains the value of a specified key. * * @param { string } key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. - * @returns { Promise } + * @returns { Promise } * {Uint8Array|string|boolean|number}: the returned value specified by the key. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types; @@ -1624,7 +1921,7 @@ declare namespace distributedKVStore { * @since 9 dynamic * @since 20 static */ - get(key: string): Promise; + get(key: string): Promise; /** * Obtains all key-value pairs that match a specified key prefix. @@ -1638,6 +1935,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getEntries(keyPrefix: string, callback: AsyncCallback): void; @@ -1653,6 +1951,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getEntries(keyPrefix: string): Promise; @@ -1668,6 +1967,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getEntries(query: Query, callback: AsyncCallback): void; @@ -1683,6 +1983,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getEntries(query: Query): Promise; @@ -1722,6 +2023,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; @@ -1761,6 +2063,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ getResultSet(keyPrefix: string): Promise; @@ -1790,6 +2093,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ getResultSet(query: Query, callback: AsyncCallback): void; @@ -1819,6 +2123,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ getResultSet(query: Query): Promise; @@ -1856,6 +2161,7 @@ declare namespace distributedKVStore { * @systemapi * @StageModelOnly * @since 10 dynamic + * @since 20 static */ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; @@ -1893,6 +2199,7 @@ declare namespace distributedKVStore { * @systemapi * @StageModelOnly * @since 10 dynamic + * @since 20 static */ getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -1905,6 +2212,7 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ closeResultSet(resultSet: KVStoreResultSet, callback: AsyncCallback): void; @@ -1917,6 +2225,7 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ closeResultSet(resultSet: KVStoreResultSet): Promise; @@ -1924,7 +2233,7 @@ declare namespace distributedKVStore { * Obtains the number of results matching the specified {@code Query} object. * * @param { Query } query - Indicates the {@code Query} object. - * @param { AsyncCallback } callback - {number}: the number of results matching the + * @param { AsyncCallback } callback - {number}: the number of results matching the * specified {@code Query} object. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. @@ -1932,14 +2241,15 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - getResultSize(query: Query, callback: AsyncCallback): void; + getResultSize(query: Query, callback: AsyncCallback): void; /** * Obtains the number of results matching the specified {@code Query} object. * * @param { Query } query - Indicates the {@code Query} object. - * @returns { Promise } {number}: the number of results matching the specified + * @returns { Promise } {number}: the number of results matching the specified * {@code Query} object. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. @@ -1947,8 +2257,9 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - getResultSize(query: Query): Promise; + getResultSize(query: Query): Promise; /** * Backs up a database in the specified filename. @@ -1991,6 +2302,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ restore(file: string, callback: AsyncCallback): void; @@ -2005,9 +2317,11 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ restore(file: string): Promise; +/*** if arkts dynamic */ /** * Delete database backup files based on the specified filenames. * @@ -2036,6 +2350,38 @@ declare namespace distributedKVStore { * @since 9 dynamic */ deleteBackup(files: Array): Promise>; +/*** endif */ + +/*** if arkts static */ + /** + * Delete database backup files based on the specified filenames. + * + * @param { Array } files - Indicates the backup filenames to be deleted, It can not be empty and + * The length must be less than {@code MAX_KEY_LENGTH}. + * @param { AsyncCallback> } callback - {Record}: + * the list of backup file and it's corresponding delete result which 0 means delete success + * and otherwise failed. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Parameter verification failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + deleteBackup(files: Array, callback: AsyncCallback>): void; + + /** + * Delete database backup files based on the specified filenames. + * + * @param { Array } files - Indicates the backup filenames to be deleted, It can not be empty and + * The length must be less than {@code MAX_KEY_LENGTH}. + * @returns { Promise> } {Record}: the list of backup + * file and it's corresponding delete result which 0 means delete success and otherwise failed. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Parameter verification failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + deleteBackup(files: Array): Promise>; +/*** endif */ /** * Starts a transaction operation in the {@code SingleKVStore} database. @@ -2055,6 +2401,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 14800047 - The WAL file size exceeds the default limit. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ startTransaction(callback: AsyncCallback): void; @@ -2076,6 +2423,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 14800047 - The WAL file size exceeds the default limit. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ startTransaction(): Promise; @@ -2086,6 +2434,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ commit(callback: AsyncCallback): void; @@ -2096,6 +2445,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ commit(): Promise; @@ -2106,6 +2456,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ rollback(callback: AsyncCallback): void; @@ -2116,6 +2467,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ rollback(): Promise; @@ -2129,6 +2481,7 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ enableSync(enabled: boolean, callback: AsyncCallback): void; @@ -2142,6 +2495,7 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ enableSync(enabled: boolean): Promise; @@ -2157,6 +2511,7 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; @@ -2172,34 +2527,37 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; /** * Sets the default delay allowed for database synchronization * - * @param { number } defaultAllowedDelayMs - Indicates the default delay allowed for the + * @param { int } defaultAllowedDelayMs - Indicates the default delay allowed for the * database synchronization, in milliseconds. * @param { AsyncCallback } callback - the callback of setSyncParam. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; + setSyncParam(defaultAllowedDelayMs: int, callback: AsyncCallback): void; /** * Sets the default delay allowed for database synchronization * - * @param { number } defaultAllowedDelayMs - Indicates the default delay allowed for the + * @param { int } defaultAllowedDelayMs - Indicates the default delay allowed for the * database synchronization, in milliseconds. * @returns { Promise } the promise returned by the function. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - setSyncParam(defaultAllowedDelayMs: number): Promise; + setSyncParam(defaultAllowedDelayMs: int): Promise; /** * Synchronize the database to the specified devices with the specified delay allowed. @@ -2208,15 +2566,16 @@ declare namespace distributedKVStore { * @param { string[] } deviceIds - Indicates the list of devices to which to synchronize the database. * @param { SyncMode } mode - Indicates the synchronization mode. The value can be {@code PUSH}, * {@code PULL}, or {@code PUSH_PULL}. - * @param { number } delayMs - Indicates the delay allowed for the synchronization, in milliseconds. + * @param { int } delayMs - Indicates the delay allowed for the synchronization, in milliseconds. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. * @throws { BusinessError } 15100003 - Database corrupted. * @throws { BusinessError } 15100004 - Not found. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; + sync(deviceIds: string[], mode: SyncMode, delayMs?: int): void; /** * Synchronize the database to the specified devices with the specified delay allowed. @@ -2226,15 +2585,16 @@ declare namespace distributedKVStore { * @param { Query } query - Indicates the {@code Query} object. * @param { SyncMode } mode - Indicates the synchronization mode. The value can be {@code PUSH}, * {@code PULL}, or {@code PUSH_PULL}. - * @param { number } delayMs - Indicates the delay allowed for the synchronization, in milliseconds. + * @param { int } delayMs - Indicates the delay allowed for the synchronization, in milliseconds. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. * @throws { BusinessError } 15100003 - Database corrupted. * @throws { BusinessError } 15100004 - Not found. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; + sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: int): void; /** * Register a callback to the database and when data in the distributed database has changed, @@ -2265,9 +2625,11 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; +/*** if arkts dynamic */ /** * Register a databases synchronization callback to the database. *

Sync result is returned through asynchronous callback. @@ -2283,6 +2645,25 @@ declare namespace distributedKVStore { * @since 9 dynamic */ on(event: 'syncComplete', syncCallback: Callback>): void; +/*** endif */ + +/*** if arkts static */ + /** + * Register a databases synchronization callback to the database. + *

Sync result is returned through asynchronous callback. + * + * @param { 'syncComplete' } event - Subscribed event name, fixed as 'syncComplete', indicates the synchronization + * completion event. + * @param { Callback> } syncCallback - {Array<[string, number]>}: the + * deviceId and it's corresponding synchronization result which 0 means synchronization success + * and otherwise failed. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameters types. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + on(event: 'syncComplete', syncCallback: Callback>): void; +/*** endif */ /** * Unsubscribe from the SingleKVStore database based on the specified subscribeType and listener. @@ -2296,9 +2677,11 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ off(event: 'dataChange', listener?: Callback): void; + /*** if arkts dynamic */ /** * Unregister the database synchronization callback. * @@ -2313,6 +2696,24 @@ declare namespace distributedKVStore { * @since 9 dynamic */ off(event: 'syncComplete', syncCallback?: Callback>): void; +/*** endif */ + +/*** if arkts static */ + /** + * Unregister the database synchronization callback. + * + * @param { 'syncComplete' } event - The unsubscribe event name, fixed as 'syncComplete', indicates the + * synchronization completion event. + * @param { Callback> } syncCallback - {Array<[string, number]>}: the + * deviceId and it's corresponding synchronization result which 0 means synchronization success + * and otherwise failed. + * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect parameters types. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 20 static + */ + off(event: 'syncComplete', syncCallback?: Callback>): void; +/*** endif */ /** * Get the security level of the database. @@ -2322,6 +2723,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getSecurityLevel(callback: AsyncCallback): void; @@ -2333,6 +2735,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getSecurityLevel(): Promise; } @@ -2358,7 +2761,7 @@ declare namespace distributedKVStore { * Obtains the value matching the local device ID and specified key. * * @param { string } key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. - * @param { AsyncCallback } callback - + * @param { AsyncCallback } callback - * {Uint8Array|string|boolean|number}: the returned value specified by the local device ID and specified key. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types; @@ -2370,13 +2773,13 @@ declare namespace distributedKVStore { * @since 9 dynamic * @since 20 static */ - get(key: string, callback: AsyncCallback): void; + get(key: string, callback: AsyncCallback): void; /** * Obtains the value matching the local device ID and specified key. * * @param { string } key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. - * @returns { Promise } + * @returns { Promise } * {Uint8Array|string|boolean|number}: the returned value specified by the local device ID and specified key. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types; @@ -2388,7 +2791,7 @@ declare namespace distributedKVStore { * @since 9 dynamic * @since 20 static */ - get(key: string): Promise; + get(key: string): Promise; /** * Obtains the value matching a specified device ID and key. @@ -2396,7 +2799,7 @@ declare namespace distributedKVStore { * @param { string } deviceId - Indicates the device to be queried. * @param { string } key - Indicates the key of the value to be queried. The length must be less than * {@code MAX_KEY_LENGTH}. - * @param { AsyncCallback } callback - + * @param { AsyncCallback } callback - * {boolean | string | number | Uint8Array}: the returned value specified by the deviceId and key. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types; @@ -2408,7 +2811,7 @@ declare namespace distributedKVStore { * @since 9 dynamic * @since 20 static */ - get(deviceId: string, key: string, callback: AsyncCallback): void; + get(deviceId: string, key: string, callback: AsyncCallback): void; /** * Obtains the value matching a specified device ID and key. @@ -2416,7 +2819,7 @@ declare namespace distributedKVStore { * @param { string } deviceId - Indicates the device to be queried. * @param { string } key - Indicates the key of the value to be queried. The length must be less than * {@code MAX_KEY_LENGTH}. - * @returns { Promise } + * @returns { Promise } * {Uint8Array|string|boolean|number}: the returned value specified by the deviceId and key. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types; @@ -2428,7 +2831,7 @@ declare namespace distributedKVStore { * @since 9 dynamic * @since 20 static */ - get(deviceId: string, key: string): Promise; + get(deviceId: string, key: string): Promise; /** * Obtains all key-value pairs that match the local device ID and specified key prefix. @@ -2442,6 +2845,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getEntries(keyPrefix: string, callback: AsyncCallback): void; @@ -2457,6 +2861,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getEntries(keyPrefix: string): Promise; @@ -2473,6 +2878,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; @@ -2489,6 +2895,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ getEntries(deviceId: string, keyPrefix: string): Promise; @@ -2504,6 +2911,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getEntries(query: Query, callback: AsyncCallback): void; @@ -2519,6 +2927,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getEntries(query: Query): Promise; @@ -2535,6 +2944,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; @@ -2551,6 +2961,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ getEntries(deviceId: string, query: Query): Promise; @@ -2590,6 +3001,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; @@ -2629,6 +3041,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ getResultSet(keyPrefix: string): Promise; @@ -2674,6 +3087,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 10 dynamic + * @since 20 static */ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; @@ -2719,6 +3133,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 10 dynamic + * @since 20 static */ getResultSet(deviceId: string, keyPrefix: string): Promise; @@ -2748,6 +3163,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ getResultSet(query: Query, callback: AsyncCallback): void; @@ -2777,6 +3193,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 10 dynamic + * @since 20 static */ getResultSet(query: Query): Promise; @@ -2810,6 +3227,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 10 dynamic + * @since 20 static */ getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; @@ -2843,6 +3261,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 10 dynamic + * @since 20 static */ getResultSet(deviceId: string, query: Query): Promise; @@ -2880,6 +3299,7 @@ declare namespace distributedKVStore { * @systemapi * @StageModelOnly * @since 10 dynamic + * @since 20 static */ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; @@ -2917,6 +3337,7 @@ declare namespace distributedKVStore { * @systemapi * @StageModelOnly * @since 10 dynamic + * @since 20 static */ getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -2956,6 +3377,7 @@ declare namespace distributedKVStore { * @systemapi * @StageModelOnly * @since 10 dynamic + * @since 20 static */ getResultSet( deviceId: string, @@ -2999,6 +3421,7 @@ declare namespace distributedKVStore { * @systemapi * @StageModelOnly * @since 10 dynamic + * @since 20 static */ getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -3006,7 +3429,7 @@ declare namespace distributedKVStore { * Obtains the number of results matching the local device ID and specified {@code Query} object. * * @param { Query } query - Indicates the {@code Query} object. - * @param { AsyncCallback } callback - {number}: the number of results matching the + * @param { AsyncCallback } callback - {number}: the number of results matching the * local device ID and specified {@code Query} object. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. @@ -3014,14 +3437,15 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - getResultSize(query: Query, callback: AsyncCallback): void; + getResultSize(query: Query, callback: AsyncCallback): void; /** * Obtains the number of results matching the local device ID and specified {@code Query} object. * * @param { Query } query - Indicates the {@code Query} object. - * @returns { Promise } {number}: the number of results matching the local device ID and specified + * @returns { Promise } {number}: the number of results matching the local device ID and specified * {@code Query} object. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. @@ -3029,15 +3453,16 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ - getResultSize(query: Query): Promise; + getResultSize(query: Query): Promise; /** * Obtains the number of results matching a specified device ID and {@code Query} object. * * @param { string } deviceId - Indicates the ID of the device to which the results belong. * @param { Query } query - Indicates the {@code Query} object. - * @param { AsyncCallback } callback - {number}: the number of results matching the + * @param { AsyncCallback } callback - {number}: the number of results matching the * specified deviceId and {@code Query} object. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. @@ -3045,15 +3470,16 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ - getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; + getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; /** * Obtains the number of results matching a specified device ID and {@code Query} object. * * @param { string } deviceId - Indicates the ID of the device to which the results belong. * @param { Query } query - Indicates the {@code Query} object. - * @returns { Promise } {number}: the number of results matching the specified + * @returns { Promise } {number}: the number of results matching the specified * deviceId and {@code Query} object. * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameters types. @@ -3061,8 +3487,9 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ - getResultSize(deviceId: string, query: Query): Promise; + getResultSize(deviceId: string, query: Query): Promise; } /** @@ -3149,6 +3576,7 @@ declare namespace distributedKVStore { *
2.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ closeKVStore(appId: string, storeId: string, callback: AsyncCallback): void; @@ -3169,6 +3597,7 @@ declare namespace distributedKVStore { *
2.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ closeKVStore(appId: string, storeId: string): Promise; @@ -3188,6 +3617,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100004 - Not found. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; @@ -3207,6 +3637,7 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100004 - Not found. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ deleteKVStore(appId: string, storeId: string): Promise; @@ -3221,6 +3652,7 @@ declare namespace distributedKVStore { *
2.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; @@ -3235,6 +3667,7 @@ declare namespace distributedKVStore { *
2.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 dynamic + * @since 20 static */ getAllKVStoreId(appId: string): Promise; @@ -3251,6 +3684,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ on(event: 'distributedDataServiceDie', deathCallback: Callback): void; @@ -3268,6 +3702,7 @@ declare namespace distributedKVStore { *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 dynamic + * @since 20 static */ off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; }