From 0ae6844854176a6b18607addb6ef1feb03fa4099 Mon Sep 17 00:00:00 2001 From: z30053452 Date: Thu, 4 Sep 2025 18:51:36 +0800 Subject: [PATCH 1/2] ets fix Signed-off-by: z30053452 --- kits/@kit.ArkData.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kits/@kit.ArkData.d.ts b/kits/@kit.ArkData.d.ts index 8d7709051a..03f0a46872 100644 --- a/kits/@kit.ArkData.d.ts +++ b/kits/@kit.ArkData.d.ts @@ -52,7 +52,9 @@ import unifiedDataChannel from '@ohos.data.unifiedDataChannel'; import uniformTypeDescriptor from '@ohos.data.uniformTypeDescriptor'; import preferences from '@ohos.data.preferences'; import { ValueType, ValuesBucket } from '@ohos.data.ValuesBucket'; +import distributedKVStore from '@ohos.data.distributedKVStore'; + export { - ValueType, ValuesBucket, relationalStore, unifiedDataChannel, uniformTypeDescriptor, preferences + ValueType, ValuesBucket, relationalStore, unifiedDataChannel, uniformTypeDescriptor, preferences, distributedKVStore }; /*** endif */ \ No newline at end of file -- Gitee From e88f9165e266008ec2738d9a109ad576f86404ac Mon Sep 17 00:00:00 2001 From: z30053452 Date: Thu, 11 Sep 2025 14:19:10 +0800 Subject: [PATCH 2/2] code fix Signed-off-by: z30053452 --- api/@ohos.data.distributedKVStore.d.ts | 115 ++++++++++++++++--------- 1 file changed, 76 insertions(+), 39 deletions(-) diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 7c1b0573d5..b308d4f4ec 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -28,7 +28,8 @@ import BaseContext from './application/BaseContext'; * * @namespace distributedKVStore * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace distributedKVStore { /** @@ -37,7 +38,8 @@ declare namespace distributedKVStore { * * @interface KVManagerConfig * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ interface KVManagerConfig { /** @@ -45,7 +47,8 @@ declare namespace distributedKVStore { * * @type { string } * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ bundleName: string; @@ -62,7 +65,8 @@ declare namespace distributedKVStore { * @type { BaseContext } * @syscap SystemCapability.DistributedDataManager.KVStore.Core * if swap the area, you should close all the KV store and use the new BaseContext to create the KVManager - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ context: BaseContext; } @@ -368,14 +372,16 @@ declare namespace distributedKVStore { * * @enum { number } * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ enum KVStoreType { /** * Device-collaboration database, as specified by {@code DeviceKVStore} * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ DEVICE_COLLABORATION, @@ -383,7 +389,8 @@ declare namespace distributedKVStore { * Single-version database, as specified by {@code SingleKVStore} * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ SINGLE_VERSION } @@ -393,7 +400,8 @@ declare namespace distributedKVStore { * * @enum { number } * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ enum SecurityLevel { /** @@ -401,7 +409,8 @@ declare namespace distributedKVStore { * There are some low impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ S1, @@ -410,7 +419,8 @@ declare namespace distributedKVStore { * There are some major impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ S2, @@ -419,7 +429,8 @@ declare namespace distributedKVStore { * There are some severity impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ S3, @@ -428,7 +439,8 @@ declare namespace distributedKVStore { * There are some critical impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ S4 } @@ -438,7 +450,8 @@ declare namespace distributedKVStore { * * @interface Options * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ interface Options { /** @@ -446,7 +459,8 @@ declare namespace distributedKVStore { * * @type { ?boolean } * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ createIfMissing?: boolean; @@ -455,7 +469,8 @@ declare namespace distributedKVStore { * * @type { ?boolean } * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ encrypt?: boolean; @@ -464,7 +479,8 @@ declare namespace distributedKVStore { * * @type { ?boolean } * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ backup?: boolean; @@ -474,7 +490,8 @@ declare namespace distributedKVStore { * @permission ohos.permission.DISTRIBUTED_DATASYNC * @type { ?boolean } * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ autoSync?: boolean; @@ -483,7 +500,8 @@ declare namespace distributedKVStore { * * @type { ?KVStoreType } * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ kvStoreType?: KVStoreType; @@ -492,7 +510,8 @@ declare namespace distributedKVStore { * * @type { SecurityLevel } * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ securityLevel: SecurityLevel; @@ -501,7 +520,8 @@ declare namespace distributedKVStore { * * @type { ?Schema } * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ schema?: Schema; } @@ -511,14 +531,16 @@ declare namespace distributedKVStore { * You can set the schema object in options when create or open the database. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ class Schema { /** * A constructor used to create a Schema instance. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ constructor(); @@ -597,7 +619,6 @@ declare namespace distributedKVStore { /** * Indicates the default value of field node. - * * @type { string } * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 @@ -1143,7 +1164,8 @@ declare namespace distributedKVStore { * * @interface SingleKVStore * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ interface SingleKVStore { /** @@ -1179,7 +1201,8 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @throws { BusinessError } 14800047 - The WAL file size exceeds the default limit. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; @@ -1216,7 +1239,8 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100005 - Database or result set already closed. * @throws { BusinessError } 14800047 - The WAL file size exceeds the default limit. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 10 + * @since arkts {'1.1':'10','1.2':'20'} + * @arkts 1.1&1.2 */ put(key: string, value: Uint8Array | string | number | boolean): Promise; @@ -1579,7 +1603,8 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100004 - Not found. * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ get(key: string, callback: AsyncCallback): void; @@ -1596,7 +1621,8 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100004 - Not found. * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ get(key: string): Promise; @@ -1934,7 +1960,8 @@ declare namespace distributedKVStore { *
2.Parameter verification failed. * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ backup(file: string, callback: AsyncCallback): void; @@ -1948,7 +1975,8 @@ declare namespace distributedKVStore { *
2.Parameter verification failed. * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ backup(file: string): Promise; @@ -2322,7 +2350,8 @@ declare namespace distributedKVStore { * @extends SingleKVStore * @typedef DeviceKVStore * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ interface DeviceKVStore extends SingleKVStore { /** @@ -2338,7 +2367,8 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100004 - Not found. * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ get(key: string, callback: AsyncCallback): void; @@ -2355,7 +2385,8 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100004 - Not found. * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ get(key: string): Promise; @@ -2374,7 +2405,8 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100004 - Not found. * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ get(deviceId: string, key: string, callback: AsyncCallback): void; @@ -2393,7 +2425,8 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100004 - Not found. * @throws { BusinessError } 15100005 - Database or result set already closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ get(deviceId: string, key: string): Promise; @@ -3044,7 +3077,8 @@ declare namespace distributedKVStore { *
2.Incorrect parameters types; *
3.Parameter verification failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ function createKVManager(config: KVManagerConfig): KVManager; @@ -3054,7 +3088,8 @@ declare namespace distributedKVStore { * * @interface KVManager * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ interface KVManager { /** @@ -3072,7 +3107,8 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100002 - Open existed database with changed options. * @throws { BusinessError } 15100003 - Database corrupted. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; @@ -3091,7 +3127,8 @@ declare namespace distributedKVStore { * @throws { BusinessError } 15100002 - Open existed database with changed options. * @throws { BusinessError } 15100003 - Database corrupted. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ getKVStore(storeId: string, options: Options): Promise; -- Gitee