From 9dac2271d56d9b17e56836aef47a941ce70f77aa Mon Sep 17 00:00:00 2001 From: Jeam_wang Date: Tue, 15 Jul 2025 17:43:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?number=E8=BD=ACint/long/double?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jeam_wang --- api/@ohos.data.cloudData.d.ts | 38 ++++---- api/@ohos.data.cloudExtension.d.ts | 114 +++++++++++----------- api/@ohos.data.distributedDataObject.d.ts | 8 +- 3 files changed, 80 insertions(+), 80 deletions(-) diff --git a/api/@ohos.data.cloudData.d.ts b/api/@ohos.data.cloudData.d.ts index f068180d4d..f1790cbb71 100644 --- a/api/@ohos.data.cloudData.d.ts +++ b/api/@ohos.data.cloudData.d.ts @@ -33,7 +33,7 @@ declare namespace cloudData { /** * Describes the clear action type. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Config * @systemapi * @since 10 @@ -130,38 +130,38 @@ declare namespace cloudData { /** * Number of records to be inserted to the cloud. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Config * @systemapi * @since 12 */ - inserted: number; + inserted: int; /** * Number of inconsistent records between the local device and the cloud. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Config * @systemapi * @since 12 */ - updated: number; + updated: int; /** * Number of consistent records between the local device and the cloud. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Config * @systemapi * @since 12 */ - normal: number; + normal: int; } /** * Describes sync status. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Config * @systemapi * @since 18 @@ -407,7 +407,7 @@ declare namespace cloudData { * @permission ohos.permission.CLOUDDATA_CONFIG * @param { ExtraData } extInfo - Indicates the extra data for * notification {@link ExtraData}. - * @param { number } [userId] - Indicates the user ID. + * @param { int } [userId] - Indicates the user ID. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 201 - Permission verification failed, which * is usually returned by VerifyAccessToken. @@ -419,7 +419,7 @@ declare namespace cloudData { * @systemapi * @since 11 */ - static notifyDataChange(extInfo: ExtraData, userId?: number): Promise; + static notifyDataChange(extInfo: ExtraData, userId?: int): Promise; /** * Notifies changes of the cloud records. @@ -447,7 +447,7 @@ declare namespace cloudData { * @permission ohos.permission.CLOUDDATA_CONFIG * @param { ExtraData } extInfo - Indicates the extra data for * notification {@link ExtraData}. - * @param { number } userId - Indicates the user ID. + * @param { int } userId - Indicates the user ID. * @param { AsyncCallback } callback - Indicates the callback invoked * to return the data changes. * @throws { BusinessError } 201 - Permission verification failed, which @@ -460,7 +460,7 @@ declare namespace cloudData { * @systemapi * @since 11 */ - static notifyDataChange(extInfo: ExtraData, userId: number, callback: AsyncCallback): void; + static notifyDataChange(extInfo: ExtraData, userId: int, callback: AsyncCallback): void; /** * notifies changes of the cloud records @@ -668,7 +668,7 @@ declare namespace cloudData { /** * Enumerates the strategy types of cloud sync. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Client * @since 12 */ @@ -686,7 +686,7 @@ declare namespace cloudData { /** * Enumerates the types of cloud sync via the network. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Client * @since 12 */ @@ -735,7 +735,7 @@ declare namespace cloudData { /** * Enumerates the roles. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Client * @systemapi * @since 11 @@ -763,7 +763,7 @@ declare namespace cloudData { /** * Enumerates the states of sharing invitation. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Client * @systemapi * @since 11 @@ -818,7 +818,7 @@ declare namespace cloudData { /** * Enumerates the error code of sharing invitation. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Client * @systemapi * @since 11 @@ -963,12 +963,12 @@ declare namespace cloudData { /** * Error code. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Client * @systemapi * @since 11 */ - code: number; + code: int; /** * Error code description. diff --git a/api/@ohos.data.cloudExtension.d.ts b/api/@ohos.data.cloudExtension.d.ts index e00e9d93b4..eaf631e30b 100644 --- a/api/@ohos.data.cloudExtension.d.ts +++ b/api/@ohos.data.cloudExtension.d.ts @@ -74,12 +74,12 @@ declare namespace cloudExtension { /** * Indicates possible cloud types. * - * @typedef { null | number | string | boolean | Uint8Array | CloudAsset | CloudAssets } CloudType + * @typedef { null | long | double | string | boolean | Uint8Array | CloudAsset | CloudAssets } CloudType * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - type CloudType = null | number | string | boolean | Uint8Array | CloudAsset | CloudAssets; + type CloudType = null | long | double | string | boolean | Uint8Array | CloudAsset | CloudAssets; /** * Defines cloud information. @@ -144,32 +144,32 @@ declare namespace cloudExtension { /** * Total space (in KB) of the account on the server. * - * @type { number } + * @type { long } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - totalSpace: number; + totalSpace: long; /** * Available space (in KB) of the account on the server. * - * @type { number } + * @type { long } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - remainingSpace: number; + remainingSpace: long; /** * Current user of the device. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - user: number; + user: int; } /** @@ -216,18 +216,18 @@ declare namespace cloudExtension { /** * Application instance ID. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - instanceId: number; + instanceId: int; } /** * Enumerates the field types. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 @@ -469,12 +469,12 @@ declare namespace cloudExtension { /** * Schema version. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - version: number; + version: int; /** * Databases {@link Database} of the application. @@ -540,12 +540,12 @@ declare namespace cloudExtension { /** * Subscription expiration time, in milliseconds. * - * @type { number } + * @type { long } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - expirationTime: number; + expirationTime: long; /** * Data to be observed. @@ -591,7 +591,7 @@ declare namespace cloudExtension { /** * Enumerates the operations that can be performed on the database. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 @@ -650,24 +650,24 @@ declare namespace cloudExtension { /** * Time when the row data was created. * - * @type { number } + * @type { long } * @readonly * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - readonly createTime: number; + readonly createTime: long; /** * Time when the row data was last modified. * - * @type { number } + * @type { long } * @readonly * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - readonly modifyTime: number; + readonly modifyTime: long /** * Database operation. @@ -693,28 +693,28 @@ declare namespace cloudExtension { /** * Duration for which the cloud database is locked, in seconds. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - interval: number; + interval: int; /** * Lock ID for locking the cloud database. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - lockId: number; + lockId: int; } /** * Enumerates the error codes. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 @@ -796,12 +796,12 @@ declare namespace cloudExtension { /** * Error code. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - code: number; + code: int; /** * Error code description. @@ -881,13 +881,13 @@ declare namespace cloudExtension { * Generates the IDs of the rows of data to be inserted to the cloud. * The IDs must be unique for each table. * - * @param { number } count - Indicates the number of IDs to generate. + * @param { int } count - Indicates the number of IDs to generate. * @returns { Promise>> } Returns the IDs generated. * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - generateId(count: number): Promise>>; + generateId(count: int): Promise>>; /** * Inserts data to the cloud. @@ -946,7 +946,7 @@ declare namespace cloudExtension { * * @param { string } table - Indicates the table name. * @param { Array } fields - Indicates the columns to query. - * @param { number } queryCount - Indicates the number of data records + * @param { int } queryCount - Indicates the number of data records * to query. * @param { string } queryCursor - Indicates the cursor. * @returns { Promise> } Returns the query result. @@ -954,7 +954,7 @@ declare namespace cloudExtension { * @systemapi * @since 11 */ - query(table: string, fields: Array, queryCount: number, queryCursor: string): Promise>; + query(table: string, fields: Array, queryCount: int, queryCursor: string): Promise>; /** * Locks the cloud database. @@ -972,24 +972,24 @@ declare namespace cloudExtension { /** * Uses the heartbeat to extend the lock interval if it is not enough. * - * @param { number } lockId - Indicates the lock ID of the heartbeat. + * @param { int } lockId - Indicates the lock ID of the heartbeat. * @returns { Promise> } Returns the time. * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - heartbeat(lockId: number): Promise>; + heartbeat(lockId: int): Promise>; /** * Unlocks the cloud database. * - * @param { number } lockId - Indicates the lock ID. + * @param { int } lockId - Indicates the lock ID. * @returns { Promise> } Returns the unlock result. * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - unlock(lockId: number): Promise>; + unlock(lockId: int): Promise>; } /** @@ -1041,7 +1041,7 @@ declare namespace cloudExtension { /** * Shares data with specific participants. * - * @param { number } userId - Indicates the user ID. + * @param { int } userId - Indicates the user ID. * @param { string } bundleName - Indicates the bundle name. * @param { string } sharingResource - Indicates the sharing resource. * @param { Array } participants - Indicates the participant. @@ -1051,7 +1051,7 @@ declare namespace cloudExtension { * @since 11 */ share( - userId: number, + userId: int, bundleName: string, sharingResource: string, participants: Array @@ -1060,7 +1060,7 @@ declare namespace cloudExtension { /** * UnShares data with specific participants. * - * @param { number } userId - Indicates the user ID. + * @param { int } userId - Indicates the user ID. * @param { string } bundleName - Indicates the bundle name. * @param { string } sharingResource - Indicates the sharing resource. * @param { Array } participants - Indicates the participant. @@ -1070,7 +1070,7 @@ declare namespace cloudExtension { * @since 11 */ unshare( - userId: number, + userId: int, bundleName: string, sharingResource: string, participants: Array @@ -1079,7 +1079,7 @@ declare namespace cloudExtension { /** * Exits the sharing. * - * @param { number } userId - Indicates the user ID. + * @param { int } userId - Indicates the user ID. * @param { string } bundleName - Indicates the bundle name. * @param { string } sharingResource - Indicates the sharing resource. * @returns { Promise> } Returns the exit result. @@ -1087,12 +1087,12 @@ declare namespace cloudExtension { * @systemapi * @since 11 */ - exit(userId: number, bundleName: string, sharingResource: string): Promise>; + exit(userId: int, bundleName: string, sharingResource: string): Promise>; /** * Changes privilege of the specific participants. * - * @param { number } userId - Indicates the user ID. + * @param { int } userId - Indicates the user ID. * @param { string } bundleName - Indicates the bundle name. * @param { string } sharingResource - Indicates the sharing resource. * @param { Array } participants - Indicates the participant. @@ -1102,7 +1102,7 @@ declare namespace cloudExtension { * @since 11 */ changePrivilege( - userId: number, + userId: int, bundleName: string, sharingResource: string, participants: Array @@ -1111,7 +1111,7 @@ declare namespace cloudExtension { /** * Queries participants of the specific sharing resource. * - * @param { number } userId - Indicates the user ID. + * @param { int } userId - Indicates the user ID. * @param { string } bundleName - Indicates the bundle name. * @param { string } sharingResource - Indicates the sharing resource. * @returns { Promise>> } Returns the query result. @@ -1120,7 +1120,7 @@ declare namespace cloudExtension { * @since 11 */ queryParticipants( - userId: number, + userId: int, bundleName: string, sharingResource: string ): Promise>>; @@ -1128,7 +1128,7 @@ declare namespace cloudExtension { /** * Queries participants based on the specified invitation code. * - * @param { number } userId - Indicates the user ID. + * @param { int } userId - Indicates the user ID. * @param { string } bundleName - Indicates the bundle name. * @param { string } invitationCode - Indicates the invitation code. * @returns { Promise>> } Returns the query result. @@ -1137,7 +1137,7 @@ declare namespace cloudExtension { * @since 11 */ queryParticipantsByInvitation( - userId: number, + userId: int, bundleName: string, invitationCode: string ): Promise>>; @@ -1145,7 +1145,7 @@ declare namespace cloudExtension { /** * Confirms invitation. * - * @param { number } userId - Indicates the user ID. + * @param { int } userId - Indicates the user ID. * @param { string } bundleName - Indicates the bundle name. * @param { string } invitationCode - Indicates the invitation code. * @param { cloudData.sharing.State } state - Indicates the state. @@ -1155,7 +1155,7 @@ declare namespace cloudExtension { * @since 11 */ confirmInvitation( - userId: number, + userId: int, bundleName: string, invitationCode: string, state: cloudData.sharing.State @@ -1164,7 +1164,7 @@ declare namespace cloudExtension { /** * Changes confirmation. * - * @param { number } userId - Indicates the user ID. + * @param { int } userId - Indicates the user ID. * @param { string } bundleName - Indicates the bundle name. * @param { string } sharingResource - Indicates the sharing resource. * @param { cloudData.sharing.State } state - Indicates the state. @@ -1174,7 +1174,7 @@ declare namespace cloudExtension { * @since 11 */ changeConfirmation( - userId: number, + userId: int, bundleName: string, sharingResource: string, state: cloudData.sharing.State @@ -1231,7 +1231,7 @@ declare namespace cloudExtension { * @param { Record> } subInfo - Indicates * the data to be subscribed to, that is, the key-value pairs corresponding * to an array of bundle names and databases. - * @param { number } expirationTime - Indicates the subscription expiration + * @param { long } expirationTime - Indicates the subscription expiration * time. * @returns { Promise> } Returns SubscribeInfo. * @syscap SystemCapability.DistributedDataManager.CloudSync.Server @@ -1240,7 +1240,7 @@ declare namespace cloudExtension { */ subscribe( subInfo: Record>, - expirationTime: number + expirationTime: long ): Promise>; /** @@ -1249,12 +1249,12 @@ declare namespace cloudExtension { * @param { Record> } unsubscribeInfo - Indicates * the data to be unsubscribe from, that is, the key-value pairs * corresponding to an array of bundle names and databases. - * @returns { Promise } Returns unsubscribeInfo result. + * @returns { Promise } Returns unsubscribeInfo result. * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - unsubscribe(unsubscribeInfo: Record>): Promise; + unsubscribe(unsubscribeInfo: Record>): Promise; /** * Connects to a database. @@ -1283,14 +1283,14 @@ declare namespace cloudExtension { /** * Connects to a share center. * - * @param { number } userId - Indicates the user ID. + * @param { int } userId - Indicates the user ID. * @param { string } bundleName - Indicates the bundle name. * @returns { Promise } Returns shareCenter RemoteObject. * @syscap SystemCapability.DistributedDataManager.CloudSync.Server * @systemapi * @since 11 */ - connectShareCenter(userId: number, bundleName: string): Promise; + connectShareCenter(userId: int, bundleName: string): Promise; } } diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index e11cc4ae83..3c68be1465 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -140,11 +140,11 @@ declare namespace distributedDataObject { /** * version of saved object, can compare with DistributedObject.__version * - * @type { number } + * @type { double } * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ - version: number; + version: double; /** * deviceid that data saved @@ -207,12 +207,12 @@ declare namespace distributedDataObject { * * @typedef { function } ProcessObserver * @param { string } sessionId - Session ID of the observed object. - * @param { number } progress - Asset sync progress. The value range is -1 to 100, where + * @param { int } progress - Asset sync progress. The value range is -1 to 100, where *
100 indicates that the asset sync is complete and -1 indicates that the asset sync failed. * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 20 */ - type ProgressObserver = (sessionId: string, progress: number) => void; + type ProgressObserver = (sessionId: string, progress: int) => void; /** * Object create by {@link createDistributedObject}. -- Gitee From 9e0b849dda3f5234c7ac0275c8fa86e452e5262f Mon Sep 17 00:00:00 2001 From: "Jeam.wang" Date: Wed, 16 Jul 2025 08:33:10 +0000 Subject: [PATCH 2/2] update api/@ohos.data.distributedDataObject.d.ts. Signed-off-by: Jeam.wang --- api/@ohos.data.distributedDataObject.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index 3c68be1465..c48a877931 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -140,11 +140,11 @@ declare namespace distributedDataObject { /** * version of saved object, can compare with DistributedObject.__version * - * @type { double } + * @type { int } * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ - version: double; + version: int; /** * deviceid that data saved -- Gitee