1 Star 0 Fork 4K

Feng Lin/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.data.cloudData.d.ts 57.83 KB
一键复制 编辑 原始数据 按行查看 历史
wTong888 提交于 2024-05-07 21:42 +08:00 . fix:fix code description
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ArkData
*/
import { AsyncCallback } from './@ohos.base';
import type relationalStore from './@ohos.data.relationalStore';
import commonType from './@ohos.data.commonType';
/**
* Provides methods for cloud capabilities.
*
* @namespace cloudData
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @since 10
*/
declare namespace cloudData {
/**
* Describes the clear action type.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
enum ClearAction {
/**
* Indicates clearing cloud-related data only, which includes cloud meta data and cloud-related local data.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
CLEAR_CLOUD_INFO,
/**
* Indicates clearing all cloud-related file data,which synchronized with the cloud.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
CLEAR_CLOUD_DATA_AND_INFO
}
/**
* ID of the event, which indicates the change of the data in the cloud.
*
* @constant
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
const DATA_CHANGE_EVENT_ID = 'cloud_data_change';
/**
* Extra data for data change notification.
*
* @interface ExtraData
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
interface ExtraData {
/**
* Event ID.
*
* @type { string }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
eventId: string;
/**
* Extra data, which contains the following fields.
* '{
* "data": "{
* "accountId": "aaa",
* "bundleName": "com.bbb.xxx",
* "containerName": "alias",
* "databaseScopes": ["private", "shared"],
* "recordTypes": ["xxx", "yyy", "zzz"]
* }"
* }'
* All fields are mandatory.
*
* @type { string }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
extraData: string;
}
/**
* Additional data for querying data statistics information.
*
* @interface StatisticInfo
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
interface StatisticInfo {
/**
* Cloud table name.
*
* @type { string }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
table: string;
/**
* Number of records to be inserted to the cloud.
*
* @type { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
inserted: number;
/**
* Number of inconsistent records between the local device and the cloud.
*
* @type { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
updated: number;
/**
* Number of consistent records between the local device and the cloud.
*
* @type { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
normal: number;
}
/**
* Sync information.
*
* @interface SyncInfo
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
interface SyncInfo {
/**
* Sync start time.
*
* @type { Date }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
startTime: Date;
/**
* Sync finish time.
*
* @type { Date }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
finishTime: Date;
/**
* Sync progress.
*
* @type { relationalStore.ProgressCode }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
code: relationalStore.ProgressCode;
}
/**
* Provides methods to set CloudSync config.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
class Config {
/**
* Enables the cloud function.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { object } switches - Indicates switches information of all applications.
* switches will overwrite the saved application switch information.If the specific application switch changes,
* the {@link changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean)} method will notify the data manager service.
* @param { AsyncCallback<void> } callback - the callback of enableCloud.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
/**
* Enables the cloud function.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { Record<string, boolean> } switches - Indicates switches information of all applications.
* switches will overwrite the saved application switch information.If the specific application switch changes,
* the {@link changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean)} method will notify the data manager service.
* @param { AsyncCallback<void> } callback - the callback of enableCloud.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
static enableCloud(
accountId: string,
switches: Record<string, boolean>,
callback: AsyncCallback<void>
): void;
/**
* Enables the cloud function.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { object } switches - Indicates switches information of all applications.
* switches will overwrite the saved application switch information.If the specific application switch changes,
* the {@link changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean)} method will notify the data manager service.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
/**
* Enables the cloud function.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { Record<string, boolean> } switches - Indicates switches information of all applications.
* switches will overwrite the saved application switch information.If the specific application switch changes,
* the {@link changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean)} method will notify the data manager service.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
static enableCloud(accountId: string, switches: Record<string, boolean>): Promise<void>;
/**
* Disables the cloud function.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { AsyncCallback<void> } callback - the callback of disableCloud.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
static disableCloud(accountId: string, callback: AsyncCallback<void>): void;
/**
* Disables the cloud function.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
static disableCloud(accountId: string): Promise<void>;
/**
* Changes the cloud switch of a single application.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { string } bundleName - Indicates the name of application.
* @param { boolean } status - Indicates the condition of cloud sync switch.true means the switch is on,false means switch is off.
* @param { AsyncCallback<void> } callback - the callback of changeAppCloudSwitch.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
static changeAppCloudSwitch(
accountId: string,
bundleName: string,
status: boolean,
callback: AsyncCallback<void>
): void;
/**
* Changes the cloud switch of a single application.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { string } bundleName - Indicates the name of application.
* @param { boolean } status - Indicates the condition of cloud sync switch.true means the switch is on,false means switch is off.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
static changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean): Promise<void>;
/**
* Notifies changes of the cloud records.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { ExtraData } extInfo - Indicates the extra data for
* notification {@link ExtraData}.
* @param { number } [userId] - Indicates the user ID.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 201 - Permission verification failed, which
* is usually returned by <b>VerifyAccessToken</b>.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
static notifyDataChange(extInfo: ExtraData, userId?: number): Promise<void>;
/**
* Notifies changes of the cloud records.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { ExtraData } extInfo - Indicates the extra data for
* notification {@link ExtraData}.
* @param { AsyncCallback<void> } callback - Indicates the callback invoked
* to return the data changes.
* @throws { BusinessError } 201 - Permission verification failed, which
* is usually returned by <b>VerifyAccessToken</b>.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
static notifyDataChange(extInfo: ExtraData, callback: AsyncCallback<void>): void;
/**
* Notifies changes of the cloud records.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { ExtraData } extInfo - Indicates the extra data for
* notification {@link ExtraData}.
* @param { number } userId - Indicates the user ID.
* @param { AsyncCallback<void> } callback - Indicates the callback invoked
* to return the data changes.
* @throws { BusinessError } 201 - Permission verification failed, which
* is usually returned by <b>VerifyAccessToken</b>.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
static notifyDataChange(extInfo: ExtraData, userId: number, callback: AsyncCallback<void>): void;
/**
* notifies changes of the cloud records
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { string } bundleName - Indicates the name of application.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Server
* @systemapi
* @since 10
*/
static notifyDataChange(accountId: string, bundleName: string): Promise<void>;
/**
* notifies changes of the cloud records
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { string } bundleName - Indicates the name of application.
* @param { AsyncCallback<void> } callback - the callback of notifyDataChange.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Server
* @systemapi
* @since 10
*/
static notifyDataChange(accountId: string, bundleName: string, callback: AsyncCallback<void>): void;
/**
* Queries statistics of the cloud records.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { string } bundleName - Indicates the name of application.
* @param { string } [storeId] - Indicates the store ID.
* @returns { Promise<Record<string, Array<StatisticInfo>>> } Promise used to return the result.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
static queryStatistics(
accountId: string,
bundleName: string,
storeId?: string
): Promise<Record<string, Array<StatisticInfo>>>;
/**
* Queries last sync information.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { string } bundleName - Indicates the name of application.
* @param { string } [storeId] - Indicates the store ID.
* @returns { Promise<Record<string, SyncInfo>> } Promise used to return the result.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
static queryLastSyncInfo(
accountId: string,
bundleName: string,
storeId?: string
): Promise<Record<string, SyncInfo>>;
/**
* deletes cloud information from local data.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { object } appActions - Indicates the way in which the application data is to be cleared.
* @param { AsyncCallback<void> } callback - the callback of clear.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
/**
* deletes cloud information from local data.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
* @param { Record<string, ClearAction> } appActions - Indicates the way in which the application data is to be cleared.
* @param { AsyncCallback<void> } callback - the callback of clear.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
static clear(
accountId: string,
appActions: Record<string, ClearAction>,
callback: AsyncCallback<void>
): void;
/**
* deletes cloud information from local data.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing the information of specific opened cloud.
* @param { object } appActions - Indicates the way in which the application data is to be cleared.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 10
*/
/**
* deletes cloud information from local data.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { string } accountId - Indicates the account ID. The account ID is required by hashing the information of specific opened cloud.
* @param { Record<string, ClearAction> } appActions - Indicates the way in which the application data is to be cleared.
* @returns { Promise<void> } the promise returned by the function.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 11
*/
static clear(accountId: string, appActions: Record<string, ClearAction>): Promise<void>;
/**
* Sets global cloud strategy.
*
* @permission ohos.permission.CLOUDDATA_CONFIG
* @param { StrategyType } strategy - Indicates the strategy type of the cloud sync.
* @param { Array<commonType.ValueType> } param - Indicates specific strategy of the cloud sync.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Config
* @systemapi
* @since 12
*/
static setGlobalCloudStrategy(strategy: StrategyType, param?: Array<commonType.ValueType>): Promise<void>;
}
/**
* Enumerates the strategy types of cloud sync.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 12
*/
enum StrategyType {
/**
* Sync via the network.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 12
*/
NETWORK
}
/**
* Enumerates the types of cloud sync via the network.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 12
*/
enum NetWorkStrategy {
/**
* Sync using WiFi.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 12
*/
WIFI = 1,
/**
* Sync using the cellular network.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 12
*/
CELLULAR = 2,
}
/**
* Sets cloud strategy.
*
* @param { StrategyType } strategy - Indicates the strategy type of the cloud sync.
* @param { Array<commonType.ValueType> } param - Indicates specific strategy of the cloud sync.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 12
*/
function setCloudStrategy(strategy: StrategyType, param?: Array<commonType.ValueType>): Promise<void>;
/**
* Provides methods to implement cloud sharing.
*
* @namespace sharing
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
export namespace sharing {
/**
* Enumerates the roles.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
enum Role {
/**
* ROLE_INVITER: means inviter of cloud sharing.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
ROLE_INVITER = 0,
/**
* ROLE_INVITEE: means invitee of cloud sharing.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
ROLE_INVITEE = 1,
}
/**
* Enumerates the states of sharing invitation.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
enum State {
/**
* STATE_UNKNOWN: Unknown state.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
STATE_UNKNOWN = 0,
/**
* STATE_ACCEPTED: Accept the sharing invitation.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
STATE_ACCEPTED = 1,
/**
* STATE_REJECTED: Reject the sharing invitation.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
STATE_REJECTED = 2,
/**
* STATE_SUSPENDED: Suspend the sharing process.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
STATE_SUSPENDED = 3,
/**
* STATE_UNAVAILABLE: The sharing process unavailable.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 12
*/
STATE_UNAVAILABLE = 4,
}
/**
* Enumerates the error code of sharing invitation.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
enum SharingCode {
/**
* SUCCESS: means sharing success.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
SUCCESS = 0,
/**
* REPEATED_REQUEST: means the user has been invited.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
REPEATED_REQUEST = 1,
/**
* NOT_INVITER: means the participant is not inviter.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
NOT_INVITER = 2,
/**
* NOT_INVITER_OR_INVITEE: means the participant is not inviter or invitee.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
NOT_INVITER_OR_INVITEE = 3,
/**
* OVER_QUOTA: means the number of sharing times today of current user has reached maximum.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
OVER_QUOTA = 4,
/**
* TOO_MANY_PARTICIPANTS: means the number of participants reaches the maximum.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
TOO_MANY_PARTICIPANTS = 5,
/**
* INVALID_ARGS: means invalid arguments.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
INVALID_ARGS = 6,
/**
* NETWORK_ERROR: means the network is unavailable.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
NETWORK_ERROR = 7,
/**
* CLOUD_DISABLED: means cloud is disabled.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
CLOUD_DISABLED = 8,
/**
* SERVER_ERROR: means invoke cloud space failed.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
SERVER_ERROR = 9,
/**
* INNER_ERROR: means an unknown error has occurred.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
INNER_ERROR = 10,
/**
* INVALID_INVITATION: means the invitation has expired or does not exist.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
INVALID_INVITATION = 11,
/**
* RATE_LIMIT: means the data transfer is rate-limited.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
RATE_LIMIT = 12,
/**
* CUSTOM_ERROR: means error codes that exceed this enumerated value are custom error codes.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
CUSTOM_ERROR = 1000,
}
/**
* Result interface.
*
* @interface Result
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
interface Result<T> {
/**
* Error code.
*
* @type { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
code: number;
/**
* Error code description.
*
* @type { ?string }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
description?: string;
/**
* The result value.
*
* @type { ?T }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
value?: T;
}
/**
* Privilege for the shared data.
*
* @interface Privilege
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
interface Privilege {
/**
* Whether the participants can write the shared data. The value <b>true</b>
* means the participants can write the shared data; the value <b>false</b>
* means the opposite.
*
* @type { ?boolean }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
writable?: boolean;
/**
* Whether the participants can read the shared data. The value <b>true</b>
* means the participants can read the shared data; the value <b>false</b>
* means the opposite.
*
* @type { ?boolean }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
readable?: boolean;
/**
* Whether the participants can create data. The value <b>true</b>
* means the participants can create data; the value <b>false</b>
* means the opposite.
*
* @type { ?boolean }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
creatable?: boolean;
/**
* Whether the participants can delete the shared data. The value <b>true</b>
* means the participants can delete the shared data; the value <b>false</b>
* means the opposite.
*
* @type { ?boolean }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
deletable?: boolean;
/**
* Whether the participants can share the data. The value <b>true</b>
* means the participants can share the data; the value <b>false</b>
* means the opposite.
*
* @type { ?boolean }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
shareable?: boolean;
}
/**
* Participants in cloud sharing.
*
* @interface Participant
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
interface Participant {
/**
* Identity of participant.
*
* @type { string }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
identity: string;
/**
* Role of the participant, which can be inviter or invitee.
*
* @type { ?Role }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
role?: Role;
/**
* State of the sharing invitation.
*
* @type { ?State }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
state?: State;
/**
* Permissions for the shared data.
*
* @type { ?Privilege }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
privilege?: Privilege;
/**
* Attach information.
*
* @type { ?string }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
attachInfo?: string;
}
/**
* Allocates shared resources based on conditions,
* and shares data with the specified privilege to participants.
*
* @param { string } storeId - Indicates relational store name.
* @param { relationalStore.RdbPredicates } predicates - See {@link relationalStore.RdbPredicates}.
* @param { Array<Participant> } participants - Participants to share.
* @param { Array<string> } [columns] - Columns to be shared.
* @returns { Promise<relationalStore.ResultSet> } - Promise used to return {@link relationalStore.ResultSet}.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function allocResourceAndShare(
storeId: string,
predicates: relationalStore.RdbPredicates,
participants: Array<Participant>,
columns?: Array<string>
): Promise<relationalStore.ResultSet>;
/**
* Allocates shared resources based on conditions,
* and shares data with the specified privilege to participants.
*
* @param { string } storeId - Indicates relational store name.
* @param { relationalStore.RdbPredicates } predicates - See {@link relationalStore.RdbPredicates}.
* @param { Array<Participant> } participants - Participants to share.
* @param { AsyncCallback<relationalStore.ResultSet> } callback - Indicates the
* callback invoked to return the {@link relationalStore.ResultSet}.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function allocResourceAndShare(
storeId: string,
predicates: relationalStore.RdbPredicates,
participants: Array<Participant>,
callback: AsyncCallback<relationalStore.ResultSet>
): void;
/**
* Allocates shared resources based on conditions,
* and shares data with the specified privilege to participants.
*
* @param { string } storeId - Indicates relational store name.
* @param { relationalStore.RdbPredicates } predicates - See {@link relationalStore.RdbPredicates}.
* @param { Array<Participant> } participants - Participants to share.
* @param { Array<string> } columns - Columns to be shared.
* @param { AsyncCallback<relationalStore.ResultSet> } callback - Indicates the
* callback invoked to return the {@link relationalStore.ResultSet}.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function allocResourceAndShare(
storeId: string,
predicates: relationalStore.RdbPredicates,
participants: Array<Participant>,
columns: Array<string>,
callback: AsyncCallback<relationalStore.ResultSet>
): void;
/**
* Shares data with the specified privilege to participants.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @param { Array<Participant> } participants - Indicates the participants
* involved in the data sharing.
* @param { AsyncCallback<Result<Array<Result<Participant>>>> } callback - Indicates the
* callback invoked to return the result.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function share(
sharingResource: string,
participants: Array<Participant>,
callback: AsyncCallback<Result<Array<Result<Participant>>>>
): void;
/**
* Shares data with the specified privilege to participants.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @param { Array<Participant> } participants - Indicates the participants
* involved in the data sharing.
* @returns { Promise<Result<Array<Result<Participant>>>> } - Promise used to return the result.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function share(
sharingResource: string,
participants: Array<Participant>
): Promise<Result<Array<Result<Participant>>>>;
/**
* UnShares data.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @param { Array<Participant> } participants - Indicates the participants
* involved.
* @param { AsyncCallback<Result<Array<Result<Participant>>>> } callback - Indicates the callback invoked
* to return the result.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function unshare(
sharingResource: string,
participants: Array<Participant>,
callback: AsyncCallback<Result<Array<Result<Participant>>>>
): void;
/**
* UnShares data.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @param { Array<Participant> } participants - Indicates the participants
* involved.
* @returns { Promise<Result<Array<Result<Participant>>>> } - Promise used to return the result.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function unshare(
sharingResource: string,
participants: Array<Participant>
): Promise<Result<Array<Result<Participant>>>>;
/**
* Exit sharing.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @param { AsyncCallback<Result<void>> } callback - The callback of exit.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function exit(sharingResource: string, callback: AsyncCallback<Result<void>>): void;
/**
* Exit sharing.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @returns { Promise<Result<void>> } - The promise returned by the function.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function exit(sharingResource: string): Promise<Result<void>>;
/**
* Changes the permissions for the shared data.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @param { Array<Participant> } participants - Indicates the participants
* whose permissions are to be changed.
* @param { AsyncCallback<Result<Array<Result<Participant>>>> } callback - Indicates the
* callback invoked to return the result.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function changePrivilege(
sharingResource: string,
participants: Array<Participant>,
callback: AsyncCallback<Result<Array<Result<Participant>>>>
): void;
/**
* Changes the permissions for the shared data.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @param { Array<Participant> } participants - Indicates the participants
* whose permissions are to be changed.
* @returns { Promise<Result<Array<Result<Participant>>>> } - Promise used to return the result.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function changePrivilege(
sharingResource: string,
participants: Array<Participant>
): Promise<Result<Array<Result<Participant>>>>;
/**
* Queries the participants based on the specified shared data.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @param { AsyncCallback<Result<Array<Participant>>> } callback - Indicates the
* callback invoked to return the participants obtained.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function queryParticipants(sharingResource: string, callback: AsyncCallback<Result<Array<Participant>>>): void;
/**
* Queries the participants based on the specified shared data.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @returns { Promise<Result<Array<Participant>>> } - Promise used to return the result.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function queryParticipants(sharingResource: string): Promise<Result<Array<Participant>>>;
/**
* Queries the participants based on the specified invitation code.
*
* @param { string } invitationCode - Indicates the invitation code.
* @param { AsyncCallback<Result<Array<Participant>>> } callback - Indicates the
* callback invoked to return the participants obtained.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function queryParticipantsByInvitation(
invitationCode: string,
callback: AsyncCallback<Result<Array<Participant>>>
): void;
/**
* Queries the participants based on the specified invitation code.
*
* @param { string } invitationCode - Indicates the invitation code.
* @returns { Promise<Result<Array<Participant>>> } - Promise used to return the result.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function queryParticipantsByInvitation(invitationCode: string): Promise<Result<Array<Participant>>>;
/**
* Confirms the invitation of cloud sharing.
*
* @param { string } invitationCode - Indicates the invitation code.
* @param { State } state - Indicates the state of invitation.
* @param { AsyncCallback<Result<string>> } callback - Indicates the callback
* invoked to return the sharing resource.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function confirmInvitation(invitationCode: string, state: State, callback: AsyncCallback<Result<string>>): void;
/**
* Confirms the invitation of cloud sharing.
*
* @param { string } invitationCode - Indicates the invitation code.
* @param { State } state - Indicates the state of invitation.
* @returns { Promise<Result<string>> } - Promise used to return the sharing resource.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function confirmInvitation(invitationCode: string, state: State): Promise<Result<string>>;
/**
* Changes confirmation of shared record.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @param { State } state - Indicates the state of invitation.
* @param { AsyncCallback<Result<void>> } callback - Indicates the callback.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function changeConfirmation(sharingResource: string, state: State, callback: AsyncCallback<Result<void>>): void;
/**
* Changes confirmation of shared record.
*
* @param { string } sharingResource - Indicates the sharing resource.
* @param { State } state - Indicates the state of invitation.
* @returns { Promise<Result<void>> } - The promise returned by the function.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @systemapi
* @since 11
*/
function changeConfirmation(sharingResource: string, state: State): Promise<Result<void>>;
}
}
export default cloudData;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lffl8796/interface_sdk-js.git
git@gitee.com:lffl8796/interface_sdk-js.git
lffl8796
interface_sdk-js
interface_sdk-js
master

搜索帮助