161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit ArkData
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base';
2261847f8eSopenharmony_ciimport type relationalStore from './@ohos.data.relationalStore';
2361847f8eSopenharmony_ciimport commonType from './@ohos.data.commonType';
2461847f8eSopenharmony_ci
2561847f8eSopenharmony_ci/**
2661847f8eSopenharmony_ci * Provides methods for cloud capabilities.
2761847f8eSopenharmony_ci *
2861847f8eSopenharmony_ci * @namespace cloudData
2961847f8eSopenharmony_ci * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
3061847f8eSopenharmony_ci * @since 10
3161847f8eSopenharmony_ci */
3261847f8eSopenharmony_cideclare namespace cloudData {
3361847f8eSopenharmony_ci  /**
3461847f8eSopenharmony_ci   * Describes the clear action type.
3561847f8eSopenharmony_ci   *
3661847f8eSopenharmony_ci   * @enum { number }
3761847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
3861847f8eSopenharmony_ci   * @systemapi
3961847f8eSopenharmony_ci   * @since 10
4061847f8eSopenharmony_ci   */
4161847f8eSopenharmony_ci  enum ClearAction {
4261847f8eSopenharmony_ci    /**
4361847f8eSopenharmony_ci     * Indicates clearing cloud-related data only, which includes cloud meta data and cloud-related local data.
4461847f8eSopenharmony_ci     *
4561847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
4661847f8eSopenharmony_ci     * @systemapi
4761847f8eSopenharmony_ci     * @since 10
4861847f8eSopenharmony_ci     */
4961847f8eSopenharmony_ci    CLEAR_CLOUD_INFO,
5061847f8eSopenharmony_ci
5161847f8eSopenharmony_ci    /**
5261847f8eSopenharmony_ci     * Indicates clearing all cloud-related file data,which synchronized with the cloud.
5361847f8eSopenharmony_ci     *
5461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
5561847f8eSopenharmony_ci     * @systemapi
5661847f8eSopenharmony_ci     * @since 10
5761847f8eSopenharmony_ci     */
5861847f8eSopenharmony_ci    CLEAR_CLOUD_DATA_AND_INFO
5961847f8eSopenharmony_ci  }
6061847f8eSopenharmony_ci
6161847f8eSopenharmony_ci  /**
6261847f8eSopenharmony_ci   * ID of the event, which indicates the change of the data in the cloud.
6361847f8eSopenharmony_ci   *
6461847f8eSopenharmony_ci   * @constant
6561847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
6661847f8eSopenharmony_ci   * @systemapi
6761847f8eSopenharmony_ci   * @since 11
6861847f8eSopenharmony_ci   */
6961847f8eSopenharmony_ci  const DATA_CHANGE_EVENT_ID = 'cloud_data_change';
7061847f8eSopenharmony_ci
7161847f8eSopenharmony_ci  /**
7261847f8eSopenharmony_ci   * Extra data for data change notification.
7361847f8eSopenharmony_ci   *
7461847f8eSopenharmony_ci   * @interface ExtraData
7561847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
7661847f8eSopenharmony_ci   * @systemapi
7761847f8eSopenharmony_ci   * @since 11
7861847f8eSopenharmony_ci   */
7961847f8eSopenharmony_ci  interface ExtraData {
8061847f8eSopenharmony_ci    /**
8161847f8eSopenharmony_ci     * Event ID.
8261847f8eSopenharmony_ci     *
8361847f8eSopenharmony_ci     * @type { string }
8461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
8561847f8eSopenharmony_ci     * @systemapi
8661847f8eSopenharmony_ci     * @since 11
8761847f8eSopenharmony_ci     */
8861847f8eSopenharmony_ci    eventId: string;
8961847f8eSopenharmony_ci
9061847f8eSopenharmony_ci    /**
9161847f8eSopenharmony_ci     * Extra data, which contains the following fields.
9261847f8eSopenharmony_ci     * '{
9361847f8eSopenharmony_ci     *   "data": "{
9461847f8eSopenharmony_ci     *     "accountId": "aaa",
9561847f8eSopenharmony_ci     *     "bundleName": "com.bbb.xxx",
9661847f8eSopenharmony_ci     *     "containerName": "alias",
9761847f8eSopenharmony_ci     *     "databaseScopes": ["private", "shared"],
9861847f8eSopenharmony_ci     *     "recordTypes": ["xxx", "yyy", "zzz"]
9961847f8eSopenharmony_ci     *   }"
10061847f8eSopenharmony_ci     * }'
10161847f8eSopenharmony_ci     * All fields are mandatory.
10261847f8eSopenharmony_ci     *
10361847f8eSopenharmony_ci     * @type { string }
10461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
10561847f8eSopenharmony_ci     * @systemapi
10661847f8eSopenharmony_ci     * @since 11
10761847f8eSopenharmony_ci     */
10861847f8eSopenharmony_ci    extraData: string;
10961847f8eSopenharmony_ci  }
11061847f8eSopenharmony_ci
11161847f8eSopenharmony_ci  /**
11261847f8eSopenharmony_ci   * Additional data for querying data statistics information.
11361847f8eSopenharmony_ci   *
11461847f8eSopenharmony_ci   * @interface StatisticInfo
11561847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
11661847f8eSopenharmony_ci   * @systemapi
11761847f8eSopenharmony_ci   * @since 12
11861847f8eSopenharmony_ci   */
11961847f8eSopenharmony_ci  interface StatisticInfo {
12061847f8eSopenharmony_ci    /**
12161847f8eSopenharmony_ci     * Cloud table name.
12261847f8eSopenharmony_ci     *
12361847f8eSopenharmony_ci     * @type { string }
12461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
12561847f8eSopenharmony_ci     * @systemapi
12661847f8eSopenharmony_ci     * @since 12
12761847f8eSopenharmony_ci     */
12861847f8eSopenharmony_ci    table: string;
12961847f8eSopenharmony_ci
13061847f8eSopenharmony_ci    /**
13161847f8eSopenharmony_ci     * Number of records to be inserted to the cloud.
13261847f8eSopenharmony_ci     *
13361847f8eSopenharmony_ci     * @type { number }
13461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
13561847f8eSopenharmony_ci     * @systemapi
13661847f8eSopenharmony_ci     * @since 12
13761847f8eSopenharmony_ci     */
13861847f8eSopenharmony_ci    inserted: number;
13961847f8eSopenharmony_ci
14061847f8eSopenharmony_ci    /**
14161847f8eSopenharmony_ci     * Number of inconsistent records between the local device and the cloud.
14261847f8eSopenharmony_ci     *
14361847f8eSopenharmony_ci     * @type { number }
14461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
14561847f8eSopenharmony_ci     * @systemapi
14661847f8eSopenharmony_ci     * @since 12
14761847f8eSopenharmony_ci     */
14861847f8eSopenharmony_ci    updated: number;
14961847f8eSopenharmony_ci
15061847f8eSopenharmony_ci    /**
15161847f8eSopenharmony_ci     * Number of consistent records between the local device and the cloud.
15261847f8eSopenharmony_ci     *
15361847f8eSopenharmony_ci     * @type { number }
15461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
15561847f8eSopenharmony_ci     * @systemapi
15661847f8eSopenharmony_ci     * @since 12
15761847f8eSopenharmony_ci     */
15861847f8eSopenharmony_ci    normal: number;
15961847f8eSopenharmony_ci  }
16061847f8eSopenharmony_ci
16161847f8eSopenharmony_ci  /**
16261847f8eSopenharmony_ci   * Sync information.
16361847f8eSopenharmony_ci   *
16461847f8eSopenharmony_ci   * @interface SyncInfo
16561847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
16661847f8eSopenharmony_ci   * @systemapi
16761847f8eSopenharmony_ci   * @since 12
16861847f8eSopenharmony_ci   */
16961847f8eSopenharmony_ci  interface SyncInfo {
17061847f8eSopenharmony_ci    /**
17161847f8eSopenharmony_ci     * Sync start time.
17261847f8eSopenharmony_ci     *
17361847f8eSopenharmony_ci     * @type { Date }
17461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
17561847f8eSopenharmony_ci     * @systemapi
17661847f8eSopenharmony_ci     * @since 12
17761847f8eSopenharmony_ci     */
17861847f8eSopenharmony_ci    startTime: Date;
17961847f8eSopenharmony_ci
18061847f8eSopenharmony_ci    /**
18161847f8eSopenharmony_ci     * Sync finish time.
18261847f8eSopenharmony_ci     *
18361847f8eSopenharmony_ci     * @type { Date }
18461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
18561847f8eSopenharmony_ci     * @systemapi
18661847f8eSopenharmony_ci     * @since 12
18761847f8eSopenharmony_ci     */
18861847f8eSopenharmony_ci    finishTime: Date;
18961847f8eSopenharmony_ci
19061847f8eSopenharmony_ci    /**
19161847f8eSopenharmony_ci     * Sync progress.
19261847f8eSopenharmony_ci     *
19361847f8eSopenharmony_ci     * @type { relationalStore.ProgressCode }
19461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
19561847f8eSopenharmony_ci     * @systemapi
19661847f8eSopenharmony_ci     * @since 12
19761847f8eSopenharmony_ci     */
19861847f8eSopenharmony_ci    code: relationalStore.ProgressCode;
19961847f8eSopenharmony_ci  }
20061847f8eSopenharmony_ci
20161847f8eSopenharmony_ci  /**
20261847f8eSopenharmony_ci   * Provides methods to set CloudSync config.
20361847f8eSopenharmony_ci   *
20461847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
20561847f8eSopenharmony_ci   * @systemapi
20661847f8eSopenharmony_ci   * @since 10
20761847f8eSopenharmony_ci   */
20861847f8eSopenharmony_ci  class Config {
20961847f8eSopenharmony_ci    /**
21061847f8eSopenharmony_ci     * Enables the cloud function.
21161847f8eSopenharmony_ci     *
21261847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
21361847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
21461847f8eSopenharmony_ci     * @param { object } switches - Indicates switches information of all applications.
21561847f8eSopenharmony_ci     * switches will overwrite the saved application switch information.If the specific application switch changes,
21661847f8eSopenharmony_ci     * the {@link changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean)} method will notify the data manager service.
21761847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of enableCloud.
21861847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
21961847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
22061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
22161847f8eSopenharmony_ci     * 3. Parameter verification failed.
22261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
22361847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
22461847f8eSopenharmony_ci     * @systemapi
22561847f8eSopenharmony_ci     * @since 10
22661847f8eSopenharmony_ci     */
22761847f8eSopenharmony_ci    /**
22861847f8eSopenharmony_ci     * Enables the cloud function.
22961847f8eSopenharmony_ci     *
23061847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
23161847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
23261847f8eSopenharmony_ci     * @param { Record<string, boolean> } switches - Indicates switches information of all applications.
23361847f8eSopenharmony_ci     * switches will overwrite the saved application switch information.If the specific application switch changes,
23461847f8eSopenharmony_ci     * the {@link changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean)} method will notify the data manager service.
23561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of enableCloud.
23661847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
23761847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
23861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
23961847f8eSopenharmony_ci     * 3. Parameter verification failed.
24061847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
24161847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
24261847f8eSopenharmony_ci     * @systemapi
24361847f8eSopenharmony_ci     * @since 11
24461847f8eSopenharmony_ci     */
24561847f8eSopenharmony_ci    static enableCloud(
24661847f8eSopenharmony_ci      accountId: string,
24761847f8eSopenharmony_ci      switches: Record<string, boolean>,
24861847f8eSopenharmony_ci      callback: AsyncCallback<void>
24961847f8eSopenharmony_ci    ): void;
25061847f8eSopenharmony_ci
25161847f8eSopenharmony_ci    /**
25261847f8eSopenharmony_ci     * Enables the cloud function.
25361847f8eSopenharmony_ci     *
25461847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
25561847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
25661847f8eSopenharmony_ci     * @param { object } switches - Indicates switches information of all applications.
25761847f8eSopenharmony_ci     * switches will overwrite the saved application switch information.If the specific application switch changes,
25861847f8eSopenharmony_ci     * the {@link changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean)} method will notify the data manager service.
25961847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
26061847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
26161847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
26261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
26361847f8eSopenharmony_ci     * 3. Parameter verification failed.
26461847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
26561847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
26661847f8eSopenharmony_ci     * @systemapi
26761847f8eSopenharmony_ci     * @since 10
26861847f8eSopenharmony_ci     */
26961847f8eSopenharmony_ci    /**
27061847f8eSopenharmony_ci     * Enables the cloud function.
27161847f8eSopenharmony_ci     *
27261847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
27361847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
27461847f8eSopenharmony_ci     * @param { Record<string, boolean> } switches - Indicates switches information of all applications.
27561847f8eSopenharmony_ci     * switches will overwrite the saved application switch information.If the specific application switch changes,
27661847f8eSopenharmony_ci     * the {@link changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean)} method will notify the data manager service.
27761847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
27861847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
27961847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
28061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
28161847f8eSopenharmony_ci     * 3. Parameter verification failed.
28261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
28361847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
28461847f8eSopenharmony_ci     * @systemapi
28561847f8eSopenharmony_ci     * @since 11
28661847f8eSopenharmony_ci     */
28761847f8eSopenharmony_ci    static enableCloud(accountId: string, switches: Record<string, boolean>): Promise<void>;
28861847f8eSopenharmony_ci
28961847f8eSopenharmony_ci    /**
29061847f8eSopenharmony_ci     * Disables the cloud function.
29161847f8eSopenharmony_ci     *
29261847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
29361847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
29461847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of disableCloud.
29561847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
29661847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
29761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
29861847f8eSopenharmony_ci     * 3. Parameter verification failed.
29961847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
30061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
30161847f8eSopenharmony_ci     * @systemapi
30261847f8eSopenharmony_ci     * @since 10
30361847f8eSopenharmony_ci     */
30461847f8eSopenharmony_ci    static disableCloud(accountId: string, callback: AsyncCallback<void>): void;
30561847f8eSopenharmony_ci
30661847f8eSopenharmony_ci    /**
30761847f8eSopenharmony_ci     * Disables the cloud function.
30861847f8eSopenharmony_ci     *
30961847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
31061847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
31161847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
31261847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
31361847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
31461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
31561847f8eSopenharmony_ci     * 3. Parameter verification failed.
31661847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
31761847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
31861847f8eSopenharmony_ci     * @systemapi
31961847f8eSopenharmony_ci     * @since 10
32061847f8eSopenharmony_ci     */
32161847f8eSopenharmony_ci    static disableCloud(accountId: string): Promise<void>;
32261847f8eSopenharmony_ci
32361847f8eSopenharmony_ci    /**
32461847f8eSopenharmony_ci     * Changes the cloud switch of a single application.
32561847f8eSopenharmony_ci     *
32661847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
32761847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
32861847f8eSopenharmony_ci     * @param { string } bundleName -  Indicates the name of application.
32961847f8eSopenharmony_ci     * @param { boolean } status - Indicates the condition of cloud sync switch.true means the switch is on,false means switch is off.
33061847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of changeAppCloudSwitch.
33161847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
33261847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
33361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
33461847f8eSopenharmony_ci     * 3. Parameter verification failed.
33561847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
33661847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
33761847f8eSopenharmony_ci     * @systemapi
33861847f8eSopenharmony_ci     * @since 10
33961847f8eSopenharmony_ci     */
34061847f8eSopenharmony_ci    static changeAppCloudSwitch(
34161847f8eSopenharmony_ci      accountId: string,
34261847f8eSopenharmony_ci      bundleName: string,
34361847f8eSopenharmony_ci      status: boolean,
34461847f8eSopenharmony_ci      callback: AsyncCallback<void>
34561847f8eSopenharmony_ci    ): void;
34661847f8eSopenharmony_ci
34761847f8eSopenharmony_ci    /**
34861847f8eSopenharmony_ci     * Changes the cloud switch of a single application.
34961847f8eSopenharmony_ci     *
35061847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
35161847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
35261847f8eSopenharmony_ci     * @param { string } bundleName -  Indicates the name of application.
35361847f8eSopenharmony_ci     * @param { boolean } status - Indicates the condition of cloud sync switch.true means the switch is on,false means switch is off.
35461847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
35561847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
35661847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
35761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
35861847f8eSopenharmony_ci     * 3. Parameter verification failed.
35961847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
36061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
36161847f8eSopenharmony_ci     * @systemapi
36261847f8eSopenharmony_ci     * @since 10
36361847f8eSopenharmony_ci     */
36461847f8eSopenharmony_ci    static changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean): Promise<void>;
36561847f8eSopenharmony_ci
36661847f8eSopenharmony_ci    /**
36761847f8eSopenharmony_ci     * Notifies changes of the cloud records.
36861847f8eSopenharmony_ci     *
36961847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
37061847f8eSopenharmony_ci     * @param { ExtraData } extInfo - Indicates the extra data for
37161847f8eSopenharmony_ci     * notification {@link ExtraData}.
37261847f8eSopenharmony_ci     * @param { number } [userId] - Indicates the user ID.
37361847f8eSopenharmony_ci     * @returns { Promise<void> } Promise used to return the result.
37461847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, which
37561847f8eSopenharmony_ci     * is usually returned by <b>VerifyAccessToken</b>.
37661847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
37761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
37861847f8eSopenharmony_ci     * 3. Parameter verification failed.
37961847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
38061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
38161847f8eSopenharmony_ci     * @systemapi
38261847f8eSopenharmony_ci     * @since 11
38361847f8eSopenharmony_ci     */
38461847f8eSopenharmony_ci    static notifyDataChange(extInfo: ExtraData, userId?: number): Promise<void>;
38561847f8eSopenharmony_ci
38661847f8eSopenharmony_ci    /**
38761847f8eSopenharmony_ci     * Notifies changes of the cloud records.
38861847f8eSopenharmony_ci     *
38961847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
39061847f8eSopenharmony_ci     * @param { ExtraData } extInfo - Indicates the extra data for
39161847f8eSopenharmony_ci     * notification {@link ExtraData}.
39261847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - Indicates the callback invoked
39361847f8eSopenharmony_ci     * to return the data changes.
39461847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, which
39561847f8eSopenharmony_ci     * is usually returned by <b>VerifyAccessToken</b>.
39661847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
39761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
39861847f8eSopenharmony_ci     * 3. Parameter verification failed.
39961847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
40061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
40161847f8eSopenharmony_ci     * @systemapi
40261847f8eSopenharmony_ci     * @since 11
40361847f8eSopenharmony_ci     */
40461847f8eSopenharmony_ci    static notifyDataChange(extInfo: ExtraData, callback: AsyncCallback<void>): void;
40561847f8eSopenharmony_ci
40661847f8eSopenharmony_ci    /**
40761847f8eSopenharmony_ci     * Notifies changes of the cloud records.
40861847f8eSopenharmony_ci     *
40961847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
41061847f8eSopenharmony_ci     * @param { ExtraData } extInfo - Indicates the extra data for
41161847f8eSopenharmony_ci     * notification {@link ExtraData}.
41261847f8eSopenharmony_ci     * @param { number } userId - Indicates the user ID.
41361847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - Indicates the callback invoked
41461847f8eSopenharmony_ci     * to return the data changes.
41561847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, which
41661847f8eSopenharmony_ci     * is usually returned by <b>VerifyAccessToken</b>.
41761847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
41861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
41961847f8eSopenharmony_ci     * 3. Parameter verification failed.
42061847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
42161847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
42261847f8eSopenharmony_ci     * @systemapi
42361847f8eSopenharmony_ci     * @since 11
42461847f8eSopenharmony_ci     */
42561847f8eSopenharmony_ci    static notifyDataChange(extInfo: ExtraData, userId: number, callback: AsyncCallback<void>): void;
42661847f8eSopenharmony_ci
42761847f8eSopenharmony_ci    /**
42861847f8eSopenharmony_ci     * notifies changes of the cloud records
42961847f8eSopenharmony_ci     *
43061847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
43161847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
43261847f8eSopenharmony_ci     * @param { string } bundleName - Indicates the name of application.
43361847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
43461847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
43561847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
43661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
43761847f8eSopenharmony_ci     * 3. Parameter verification failed.
43861847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
43961847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Server
44061847f8eSopenharmony_ci     * @systemapi
44161847f8eSopenharmony_ci     * @since 10
44261847f8eSopenharmony_ci     */
44361847f8eSopenharmony_ci    static notifyDataChange(accountId: string, bundleName: string): Promise<void>;
44461847f8eSopenharmony_ci
44561847f8eSopenharmony_ci    /**
44661847f8eSopenharmony_ci     * notifies changes of the cloud records
44761847f8eSopenharmony_ci     *
44861847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
44961847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
45061847f8eSopenharmony_ci     * @param { string } bundleName - Indicates the name of application.
45161847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of notifyDataChange.
45261847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
45361847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
45461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
45561847f8eSopenharmony_ci     * 3. Parameter verification failed.
45661847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
45761847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Server
45861847f8eSopenharmony_ci     * @systemapi
45961847f8eSopenharmony_ci     * @since 10
46061847f8eSopenharmony_ci     */
46161847f8eSopenharmony_ci    static notifyDataChange(accountId: string, bundleName: string, callback: AsyncCallback<void>): void;
46261847f8eSopenharmony_ci
46361847f8eSopenharmony_ci    /**
46461847f8eSopenharmony_ci     * Queries statistics of the cloud records.
46561847f8eSopenharmony_ci     *
46661847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
46761847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
46861847f8eSopenharmony_ci     * @param { string } bundleName - Indicates the name of application.
46961847f8eSopenharmony_ci     * @param { string } [storeId] - Indicates the store ID.
47061847f8eSopenharmony_ci     * @returns { Promise<Record<string, Array<StatisticInfo>>> } Promise used to return the result.
47161847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
47261847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
47361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
47461847f8eSopenharmony_ci     * 3. Parameter verification failed.
47561847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
47661847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
47761847f8eSopenharmony_ci     * @systemapi
47861847f8eSopenharmony_ci     * @since 12
47961847f8eSopenharmony_ci     */
48061847f8eSopenharmony_ci    static queryStatistics(
48161847f8eSopenharmony_ci        accountId: string,
48261847f8eSopenharmony_ci        bundleName: string,
48361847f8eSopenharmony_ci        storeId?: string
48461847f8eSopenharmony_ci    ): Promise<Record<string, Array<StatisticInfo>>>;
48561847f8eSopenharmony_ci
48661847f8eSopenharmony_ci    /**
48761847f8eSopenharmony_ci     * Queries last sync information.
48861847f8eSopenharmony_ci     *
48961847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
49061847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
49161847f8eSopenharmony_ci     * @param { string } bundleName - Indicates the name of application.
49261847f8eSopenharmony_ci     * @param { string } [storeId] - Indicates the store ID.
49361847f8eSopenharmony_ci     * @returns { Promise<Record<string, SyncInfo>> } Promise used to return the result.
49461847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
49561847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
49661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
49761847f8eSopenharmony_ci     * 3. Parameter verification failed.
49861847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
49961847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
50061847f8eSopenharmony_ci     * @systemapi
50161847f8eSopenharmony_ci     * @since 12
50261847f8eSopenharmony_ci     */
50361847f8eSopenharmony_ci    static queryLastSyncInfo(
50461847f8eSopenharmony_ci        accountId: string,
50561847f8eSopenharmony_ci        bundleName: string,
50661847f8eSopenharmony_ci        storeId?: string
50761847f8eSopenharmony_ci    ): Promise<Record<string, SyncInfo>>;
50861847f8eSopenharmony_ci
50961847f8eSopenharmony_ci    /**
51061847f8eSopenharmony_ci     * deletes cloud information from local data.
51161847f8eSopenharmony_ci     *
51261847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
51361847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
51461847f8eSopenharmony_ci     * @param { object } appActions - Indicates the way in which the application data is to be cleared.
51561847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of clear.
51661847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
51761847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
51861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
51961847f8eSopenharmony_ci     * 3. Parameter verification failed.
52061847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
52161847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
52261847f8eSopenharmony_ci     * @systemapi
52361847f8eSopenharmony_ci     * @since 10
52461847f8eSopenharmony_ci     */
52561847f8eSopenharmony_ci    /**
52661847f8eSopenharmony_ci     * deletes cloud information from local data.
52761847f8eSopenharmony_ci     *
52861847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
52961847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing cloud account.
53061847f8eSopenharmony_ci     * @param { Record<string, ClearAction> } appActions - Indicates the way in which the application data is to be cleared.
53161847f8eSopenharmony_ci     * @param { AsyncCallback<void> } callback - the callback of clear.
53261847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
53361847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
53461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
53561847f8eSopenharmony_ci     * 3. Parameter verification failed.
53661847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
53761847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
53861847f8eSopenharmony_ci     * @systemapi
53961847f8eSopenharmony_ci     * @since 11
54061847f8eSopenharmony_ci     */
54161847f8eSopenharmony_ci    static clear(
54261847f8eSopenharmony_ci      accountId: string,
54361847f8eSopenharmony_ci      appActions: Record<string, ClearAction>,
54461847f8eSopenharmony_ci      callback: AsyncCallback<void>
54561847f8eSopenharmony_ci    ): void;
54661847f8eSopenharmony_ci
54761847f8eSopenharmony_ci    /**
54861847f8eSopenharmony_ci     * deletes cloud information from local data.
54961847f8eSopenharmony_ci     *
55061847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
55161847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing the information of specific opened cloud.
55261847f8eSopenharmony_ci     * @param { object } appActions - Indicates the way in which the application data is to be cleared.
55361847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
55461847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
55561847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
55661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
55761847f8eSopenharmony_ci     * 3. Parameter verification failed.
55861847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
55961847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
56061847f8eSopenharmony_ci     * @systemapi
56161847f8eSopenharmony_ci     * @since 10
56261847f8eSopenharmony_ci     */
56361847f8eSopenharmony_ci    /**
56461847f8eSopenharmony_ci     * deletes cloud information from local data.
56561847f8eSopenharmony_ci     *
56661847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
56761847f8eSopenharmony_ci     * @param { string } accountId - Indicates the account ID. The account ID is required by hashing the information of specific opened cloud.
56861847f8eSopenharmony_ci     * @param { Record<string, ClearAction> } appActions - Indicates the way in which the application data is to be cleared.
56961847f8eSopenharmony_ci     * @returns { Promise<void> } the promise returned by the function.
57061847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
57161847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
57261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
57361847f8eSopenharmony_ci     * 3. Parameter verification failed.
57461847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
57561847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
57661847f8eSopenharmony_ci     * @systemapi
57761847f8eSopenharmony_ci     * @since 11
57861847f8eSopenharmony_ci     */
57961847f8eSopenharmony_ci    static clear(accountId: string, appActions: Record<string, ClearAction>): Promise<void>;
58061847f8eSopenharmony_ci
58161847f8eSopenharmony_ci    /**
58261847f8eSopenharmony_ci     * Sets global cloud strategy.
58361847f8eSopenharmony_ci     *
58461847f8eSopenharmony_ci     * @permission ohos.permission.CLOUDDATA_CONFIG
58561847f8eSopenharmony_ci     * @param { StrategyType } strategy - Indicates the strategy type of the cloud sync.
58661847f8eSopenharmony_ci     * @param { Array<commonType.ValueType> } param - Indicates specific strategy of the cloud sync.
58761847f8eSopenharmony_ci     * @returns { Promise<void> } Promise used to return the result.
58861847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
58961847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
59061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
59161847f8eSopenharmony_ci     * 3. Parameter verification failed.
59261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
59361847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Config
59461847f8eSopenharmony_ci     * @systemapi
59561847f8eSopenharmony_ci     * @since 12
59661847f8eSopenharmony_ci     */
59761847f8eSopenharmony_ci    static setGlobalCloudStrategy(strategy: StrategyType, param?: Array<commonType.ValueType>): Promise<void>;
59861847f8eSopenharmony_ci  }
59961847f8eSopenharmony_ci
60061847f8eSopenharmony_ci  /**
60161847f8eSopenharmony_ci   * Enumerates the strategy types of cloud sync.
60261847f8eSopenharmony_ci   *
60361847f8eSopenharmony_ci   * @enum { number }
60461847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
60561847f8eSopenharmony_ci   * @since 12
60661847f8eSopenharmony_ci   */
60761847f8eSopenharmony_ci  enum StrategyType {
60861847f8eSopenharmony_ci
60961847f8eSopenharmony_ci    /**
61061847f8eSopenharmony_ci     * Sync via the network.
61161847f8eSopenharmony_ci     *
61261847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
61361847f8eSopenharmony_ci     * @since 12
61461847f8eSopenharmony_ci     */
61561847f8eSopenharmony_ci    NETWORK
61661847f8eSopenharmony_ci  }
61761847f8eSopenharmony_ci
61861847f8eSopenharmony_ci  /**
61961847f8eSopenharmony_ci   * Enumerates the types of cloud sync via the network.
62061847f8eSopenharmony_ci   *
62161847f8eSopenharmony_ci   * @enum { number }
62261847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
62361847f8eSopenharmony_ci   * @since 12
62461847f8eSopenharmony_ci   */
62561847f8eSopenharmony_ci  enum NetWorkStrategy {
62661847f8eSopenharmony_ci
62761847f8eSopenharmony_ci    /**
62861847f8eSopenharmony_ci     * Sync using WiFi.
62961847f8eSopenharmony_ci     *
63061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
63161847f8eSopenharmony_ci     * @since 12
63261847f8eSopenharmony_ci     */
63361847f8eSopenharmony_ci    WIFI = 1,
63461847f8eSopenharmony_ci
63561847f8eSopenharmony_ci    /**
63661847f8eSopenharmony_ci     * Sync using the cellular network.
63761847f8eSopenharmony_ci     *
63861847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
63961847f8eSopenharmony_ci     * @since 12
64061847f8eSopenharmony_ci     */
64161847f8eSopenharmony_ci    CELLULAR = 2,
64261847f8eSopenharmony_ci  }
64361847f8eSopenharmony_ci
64461847f8eSopenharmony_ci  /**
64561847f8eSopenharmony_ci   * Sets cloud strategy.
64661847f8eSopenharmony_ci   *
64761847f8eSopenharmony_ci   * @param { StrategyType } strategy - Indicates the strategy type of the cloud sync.
64861847f8eSopenharmony_ci   * @param { Array<commonType.ValueType> } param - Indicates specific strategy of the cloud sync.
64961847f8eSopenharmony_ci   * @returns { Promise<void> } Promise used to return the result.
65061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
65161847f8eSopenharmony_ci     * 3. Parameter verification failed.
65261847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
65361847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
65461847f8eSopenharmony_ci   * @since 12
65561847f8eSopenharmony_ci   */
65661847f8eSopenharmony_ci  function setCloudStrategy(strategy: StrategyType, param?: Array<commonType.ValueType>): Promise<void>;
65761847f8eSopenharmony_ci
65861847f8eSopenharmony_ci  /**
65961847f8eSopenharmony_ci   * Provides methods to implement cloud sharing.
66061847f8eSopenharmony_ci   *
66161847f8eSopenharmony_ci   * @namespace sharing
66261847f8eSopenharmony_ci   * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
66361847f8eSopenharmony_ci   * @systemapi
66461847f8eSopenharmony_ci   * @since 11
66561847f8eSopenharmony_ci   */
66661847f8eSopenharmony_ci  export namespace sharing {
66761847f8eSopenharmony_ci    /**
66861847f8eSopenharmony_ci     * Enumerates the roles.
66961847f8eSopenharmony_ci     *
67061847f8eSopenharmony_ci     * @enum { number }
67161847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
67261847f8eSopenharmony_ci     * @systemapi
67361847f8eSopenharmony_ci     * @since 11
67461847f8eSopenharmony_ci     */
67561847f8eSopenharmony_ci    enum Role {
67661847f8eSopenharmony_ci      /**
67761847f8eSopenharmony_ci       * ROLE_INVITER: means inviter of cloud sharing.
67861847f8eSopenharmony_ci       *
67961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
68061847f8eSopenharmony_ci       * @systemapi
68161847f8eSopenharmony_ci       * @since 11
68261847f8eSopenharmony_ci       */
68361847f8eSopenharmony_ci      ROLE_INVITER = 0,
68461847f8eSopenharmony_ci
68561847f8eSopenharmony_ci      /**
68661847f8eSopenharmony_ci       * ROLE_INVITEE: means invitee of cloud sharing.
68761847f8eSopenharmony_ci       *
68861847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
68961847f8eSopenharmony_ci       * @systemapi
69061847f8eSopenharmony_ci       * @since 11
69161847f8eSopenharmony_ci       */
69261847f8eSopenharmony_ci      ROLE_INVITEE = 1,
69361847f8eSopenharmony_ci    }
69461847f8eSopenharmony_ci
69561847f8eSopenharmony_ci    /**
69661847f8eSopenharmony_ci     * Enumerates the states of sharing invitation.
69761847f8eSopenharmony_ci     *
69861847f8eSopenharmony_ci     * @enum { number }
69961847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
70061847f8eSopenharmony_ci     * @systemapi
70161847f8eSopenharmony_ci     * @since 11
70261847f8eSopenharmony_ci     */
70361847f8eSopenharmony_ci    enum State {
70461847f8eSopenharmony_ci      /**
70561847f8eSopenharmony_ci       * STATE_UNKNOWN: Unknown state.
70661847f8eSopenharmony_ci       *
70761847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
70861847f8eSopenharmony_ci       * @systemapi
70961847f8eSopenharmony_ci       * @since 11
71061847f8eSopenharmony_ci       */
71161847f8eSopenharmony_ci      STATE_UNKNOWN = 0,
71261847f8eSopenharmony_ci
71361847f8eSopenharmony_ci      /**
71461847f8eSopenharmony_ci       * STATE_ACCEPTED: Accept the sharing invitation.
71561847f8eSopenharmony_ci       *
71661847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
71761847f8eSopenharmony_ci       * @systemapi
71861847f8eSopenharmony_ci       * @since 11
71961847f8eSopenharmony_ci       */
72061847f8eSopenharmony_ci      STATE_ACCEPTED = 1,
72161847f8eSopenharmony_ci
72261847f8eSopenharmony_ci      /**
72361847f8eSopenharmony_ci       * STATE_REJECTED: Reject the sharing invitation.
72461847f8eSopenharmony_ci       *
72561847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
72661847f8eSopenharmony_ci       * @systemapi
72761847f8eSopenharmony_ci       * @since 11
72861847f8eSopenharmony_ci       */
72961847f8eSopenharmony_ci      STATE_REJECTED = 2,
73061847f8eSopenharmony_ci
73161847f8eSopenharmony_ci      /**
73261847f8eSopenharmony_ci       * STATE_SUSPENDED: Suspend the sharing process.
73361847f8eSopenharmony_ci       *
73461847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
73561847f8eSopenharmony_ci       * @systemapi
73661847f8eSopenharmony_ci       * @since 11
73761847f8eSopenharmony_ci       */
73861847f8eSopenharmony_ci      STATE_SUSPENDED = 3,
73961847f8eSopenharmony_ci
74061847f8eSopenharmony_ci      /**
74161847f8eSopenharmony_ci       * STATE_UNAVAILABLE: The sharing process unavailable.
74261847f8eSopenharmony_ci       *
74361847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
74461847f8eSopenharmony_ci       * @systemapi
74561847f8eSopenharmony_ci       * @since 12
74661847f8eSopenharmony_ci       */
74761847f8eSopenharmony_ci      STATE_UNAVAILABLE = 4,
74861847f8eSopenharmony_ci    }
74961847f8eSopenharmony_ci
75061847f8eSopenharmony_ci    /**
75161847f8eSopenharmony_ci     * Enumerates the error code of sharing invitation.
75261847f8eSopenharmony_ci     *
75361847f8eSopenharmony_ci     * @enum { number }
75461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
75561847f8eSopenharmony_ci     * @systemapi
75661847f8eSopenharmony_ci     * @since 11
75761847f8eSopenharmony_ci     */
75861847f8eSopenharmony_ci    enum SharingCode {
75961847f8eSopenharmony_ci      /**
76061847f8eSopenharmony_ci       * SUCCESS: means sharing success.
76161847f8eSopenharmony_ci       *
76261847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
76361847f8eSopenharmony_ci       * @systemapi
76461847f8eSopenharmony_ci       * @since 11
76561847f8eSopenharmony_ci       */
76661847f8eSopenharmony_ci      SUCCESS = 0,
76761847f8eSopenharmony_ci
76861847f8eSopenharmony_ci      /**
76961847f8eSopenharmony_ci       * REPEATED_REQUEST: means the user has been invited.
77061847f8eSopenharmony_ci       *
77161847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
77261847f8eSopenharmony_ci       * @systemapi
77361847f8eSopenharmony_ci       * @since 11
77461847f8eSopenharmony_ci       */
77561847f8eSopenharmony_ci      REPEATED_REQUEST = 1,
77661847f8eSopenharmony_ci
77761847f8eSopenharmony_ci      /**
77861847f8eSopenharmony_ci       * NOT_INVITER: means the participant is not inviter.
77961847f8eSopenharmony_ci       *
78061847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
78161847f8eSopenharmony_ci       * @systemapi
78261847f8eSopenharmony_ci       * @since 11
78361847f8eSopenharmony_ci       */
78461847f8eSopenharmony_ci      NOT_INVITER = 2,
78561847f8eSopenharmony_ci
78661847f8eSopenharmony_ci      /**
78761847f8eSopenharmony_ci       * NOT_INVITER_OR_INVITEE: means the participant is not inviter or invitee.
78861847f8eSopenharmony_ci       *
78961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
79061847f8eSopenharmony_ci       * @systemapi
79161847f8eSopenharmony_ci       * @since 11
79261847f8eSopenharmony_ci       */
79361847f8eSopenharmony_ci      NOT_INVITER_OR_INVITEE = 3,
79461847f8eSopenharmony_ci
79561847f8eSopenharmony_ci      /**
79661847f8eSopenharmony_ci       * OVER_QUOTA: means the number of sharing times today of current user has reached maximum.
79761847f8eSopenharmony_ci       *
79861847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
79961847f8eSopenharmony_ci       * @systemapi
80061847f8eSopenharmony_ci       * @since 11
80161847f8eSopenharmony_ci       */
80261847f8eSopenharmony_ci      OVER_QUOTA = 4,
80361847f8eSopenharmony_ci
80461847f8eSopenharmony_ci      /**
80561847f8eSopenharmony_ci       * TOO_MANY_PARTICIPANTS: means the number of participants reaches the maximum.
80661847f8eSopenharmony_ci       *
80761847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
80861847f8eSopenharmony_ci       * @systemapi
80961847f8eSopenharmony_ci       * @since 11
81061847f8eSopenharmony_ci       */
81161847f8eSopenharmony_ci      TOO_MANY_PARTICIPANTS = 5,
81261847f8eSopenharmony_ci
81361847f8eSopenharmony_ci      /**
81461847f8eSopenharmony_ci       * INVALID_ARGS: means invalid arguments.
81561847f8eSopenharmony_ci       *
81661847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
81761847f8eSopenharmony_ci       * @systemapi
81861847f8eSopenharmony_ci       * @since 11
81961847f8eSopenharmony_ci       */
82061847f8eSopenharmony_ci      INVALID_ARGS = 6,
82161847f8eSopenharmony_ci
82261847f8eSopenharmony_ci      /**
82361847f8eSopenharmony_ci       * NETWORK_ERROR: means the network is unavailable.
82461847f8eSopenharmony_ci       *
82561847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
82661847f8eSopenharmony_ci       * @systemapi
82761847f8eSopenharmony_ci       * @since 11
82861847f8eSopenharmony_ci       */
82961847f8eSopenharmony_ci      NETWORK_ERROR = 7,
83061847f8eSopenharmony_ci
83161847f8eSopenharmony_ci      /**
83261847f8eSopenharmony_ci       * CLOUD_DISABLED: means cloud is disabled.
83361847f8eSopenharmony_ci       *
83461847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
83561847f8eSopenharmony_ci       * @systemapi
83661847f8eSopenharmony_ci       * @since 11
83761847f8eSopenharmony_ci       */
83861847f8eSopenharmony_ci      CLOUD_DISABLED = 8,
83961847f8eSopenharmony_ci
84061847f8eSopenharmony_ci      /**
84161847f8eSopenharmony_ci       * SERVER_ERROR: means invoke cloud space failed.
84261847f8eSopenharmony_ci       *
84361847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
84461847f8eSopenharmony_ci       * @systemapi
84561847f8eSopenharmony_ci       * @since 11
84661847f8eSopenharmony_ci       */
84761847f8eSopenharmony_ci      SERVER_ERROR = 9,
84861847f8eSopenharmony_ci
84961847f8eSopenharmony_ci      /**
85061847f8eSopenharmony_ci       * INNER_ERROR: means an unknown error has occurred.
85161847f8eSopenharmony_ci       *
85261847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
85361847f8eSopenharmony_ci       * @systemapi
85461847f8eSopenharmony_ci       * @since 11
85561847f8eSopenharmony_ci       */
85661847f8eSopenharmony_ci      INNER_ERROR = 10,
85761847f8eSopenharmony_ci
85861847f8eSopenharmony_ci      /**
85961847f8eSopenharmony_ci       * INVALID_INVITATION: means the invitation has expired or does not exist.
86061847f8eSopenharmony_ci       *
86161847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
86261847f8eSopenharmony_ci       * @systemapi
86361847f8eSopenharmony_ci       * @since 11
86461847f8eSopenharmony_ci       */
86561847f8eSopenharmony_ci      INVALID_INVITATION = 11,
86661847f8eSopenharmony_ci
86761847f8eSopenharmony_ci      /**
86861847f8eSopenharmony_ci       * RATE_LIMIT: means the data transfer is rate-limited.
86961847f8eSopenharmony_ci       *
87061847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
87161847f8eSopenharmony_ci       * @systemapi
87261847f8eSopenharmony_ci       * @since 11
87361847f8eSopenharmony_ci       */
87461847f8eSopenharmony_ci      RATE_LIMIT = 12,
87561847f8eSopenharmony_ci
87661847f8eSopenharmony_ci      /**
87761847f8eSopenharmony_ci       * CUSTOM_ERROR: means error codes that exceed this enumerated value are custom error codes.
87861847f8eSopenharmony_ci       *
87961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
88061847f8eSopenharmony_ci       * @systemapi
88161847f8eSopenharmony_ci       * @since 11
88261847f8eSopenharmony_ci       */
88361847f8eSopenharmony_ci      CUSTOM_ERROR = 1000,
88461847f8eSopenharmony_ci    }
88561847f8eSopenharmony_ci
88661847f8eSopenharmony_ci    /**
88761847f8eSopenharmony_ci     * Result interface.
88861847f8eSopenharmony_ci     *
88961847f8eSopenharmony_ci     * @interface Result
89061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
89161847f8eSopenharmony_ci     * @systemapi
89261847f8eSopenharmony_ci     * @since 11
89361847f8eSopenharmony_ci     */
89461847f8eSopenharmony_ci    interface Result<T> {
89561847f8eSopenharmony_ci      /**
89661847f8eSopenharmony_ci       * Error code.
89761847f8eSopenharmony_ci       *
89861847f8eSopenharmony_ci       * @type { number }
89961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
90061847f8eSopenharmony_ci       * @systemapi
90161847f8eSopenharmony_ci       * @since 11
90261847f8eSopenharmony_ci       */
90361847f8eSopenharmony_ci      code: number;
90461847f8eSopenharmony_ci
90561847f8eSopenharmony_ci      /**
90661847f8eSopenharmony_ci       * Error code description.
90761847f8eSopenharmony_ci       *
90861847f8eSopenharmony_ci       * @type { ?string }
90961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
91061847f8eSopenharmony_ci       * @systemapi
91161847f8eSopenharmony_ci       * @since 11
91261847f8eSopenharmony_ci       */
91361847f8eSopenharmony_ci      description?: string;
91461847f8eSopenharmony_ci
91561847f8eSopenharmony_ci      /**
91661847f8eSopenharmony_ci       * The result value.
91761847f8eSopenharmony_ci       *
91861847f8eSopenharmony_ci       * @type { ?T }
91961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
92061847f8eSopenharmony_ci       * @systemapi
92161847f8eSopenharmony_ci       * @since 11
92261847f8eSopenharmony_ci       */
92361847f8eSopenharmony_ci      value?: T;
92461847f8eSopenharmony_ci    }
92561847f8eSopenharmony_ci
92661847f8eSopenharmony_ci    /**
92761847f8eSopenharmony_ci     * Privilege for the shared data.
92861847f8eSopenharmony_ci     *
92961847f8eSopenharmony_ci     * @interface Privilege
93061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
93161847f8eSopenharmony_ci     * @systemapi
93261847f8eSopenharmony_ci     * @since 11
93361847f8eSopenharmony_ci     */
93461847f8eSopenharmony_ci    interface Privilege {
93561847f8eSopenharmony_ci      /**
93661847f8eSopenharmony_ci       * Whether the participants can write the shared data. The value <b>true</b>
93761847f8eSopenharmony_ci       * means the participants can write the shared data; the value <b>false</b>
93861847f8eSopenharmony_ci       * means the opposite.
93961847f8eSopenharmony_ci       *
94061847f8eSopenharmony_ci       * @type { ?boolean }
94161847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
94261847f8eSopenharmony_ci       * @systemapi
94361847f8eSopenharmony_ci       * @since 11
94461847f8eSopenharmony_ci       */
94561847f8eSopenharmony_ci      writable?: boolean;
94661847f8eSopenharmony_ci
94761847f8eSopenharmony_ci      /**
94861847f8eSopenharmony_ci       * Whether the participants can read the shared data. The value <b>true</b>
94961847f8eSopenharmony_ci       * means the participants can read the shared data; the value <b>false</b>
95061847f8eSopenharmony_ci       * means the opposite.
95161847f8eSopenharmony_ci       *
95261847f8eSopenharmony_ci       * @type { ?boolean }
95361847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
95461847f8eSopenharmony_ci       * @systemapi
95561847f8eSopenharmony_ci       * @since 11
95661847f8eSopenharmony_ci       */
95761847f8eSopenharmony_ci      readable?: boolean;
95861847f8eSopenharmony_ci
95961847f8eSopenharmony_ci      /**
96061847f8eSopenharmony_ci       * Whether the participants can create data. The value <b>true</b>
96161847f8eSopenharmony_ci       * means the participants can create data; the value <b>false</b>
96261847f8eSopenharmony_ci       * means the opposite.
96361847f8eSopenharmony_ci       *
96461847f8eSopenharmony_ci       * @type { ?boolean }
96561847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
96661847f8eSopenharmony_ci       * @systemapi
96761847f8eSopenharmony_ci       * @since 11
96861847f8eSopenharmony_ci       */
96961847f8eSopenharmony_ci      creatable?: boolean;
97061847f8eSopenharmony_ci
97161847f8eSopenharmony_ci      /**
97261847f8eSopenharmony_ci       * Whether the participants can delete the shared data. The value <b>true</b>
97361847f8eSopenharmony_ci       * means the participants can delete the shared data; the value <b>false</b>
97461847f8eSopenharmony_ci       * means the opposite.
97561847f8eSopenharmony_ci       *
97661847f8eSopenharmony_ci       * @type { ?boolean }
97761847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
97861847f8eSopenharmony_ci       * @systemapi
97961847f8eSopenharmony_ci       * @since 11
98061847f8eSopenharmony_ci       */
98161847f8eSopenharmony_ci      deletable?: boolean;
98261847f8eSopenharmony_ci
98361847f8eSopenharmony_ci      /**
98461847f8eSopenharmony_ci       * Whether the participants can share the data. The value <b>true</b>
98561847f8eSopenharmony_ci       * means the participants can share the data; the value <b>false</b>
98661847f8eSopenharmony_ci       * means the opposite.
98761847f8eSopenharmony_ci       *
98861847f8eSopenharmony_ci       * @type { ?boolean }
98961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
99061847f8eSopenharmony_ci       * @systemapi
99161847f8eSopenharmony_ci       * @since 11
99261847f8eSopenharmony_ci       */
99361847f8eSopenharmony_ci      shareable?: boolean;
99461847f8eSopenharmony_ci    }
99561847f8eSopenharmony_ci
99661847f8eSopenharmony_ci    /**
99761847f8eSopenharmony_ci     * Participants in cloud sharing.
99861847f8eSopenharmony_ci     *
99961847f8eSopenharmony_ci     * @interface Participant
100061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
100161847f8eSopenharmony_ci     * @systemapi
100261847f8eSopenharmony_ci     * @since 11
100361847f8eSopenharmony_ci     */
100461847f8eSopenharmony_ci    interface Participant {
100561847f8eSopenharmony_ci      /**
100661847f8eSopenharmony_ci       * Identity of participant.
100761847f8eSopenharmony_ci       *
100861847f8eSopenharmony_ci       * @type { string }
100961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
101061847f8eSopenharmony_ci       * @systemapi
101161847f8eSopenharmony_ci       * @since 11
101261847f8eSopenharmony_ci       */
101361847f8eSopenharmony_ci      identity: string;
101461847f8eSopenharmony_ci
101561847f8eSopenharmony_ci      /**
101661847f8eSopenharmony_ci       * Role of the participant, which can be inviter or invitee.
101761847f8eSopenharmony_ci       *
101861847f8eSopenharmony_ci       * @type { ?Role }
101961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
102061847f8eSopenharmony_ci       * @systemapi
102161847f8eSopenharmony_ci       * @since 11
102261847f8eSopenharmony_ci       */
102361847f8eSopenharmony_ci      role?: Role;
102461847f8eSopenharmony_ci
102561847f8eSopenharmony_ci      /**
102661847f8eSopenharmony_ci       * State of the sharing invitation.
102761847f8eSopenharmony_ci       *
102861847f8eSopenharmony_ci       * @type { ?State }
102961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
103061847f8eSopenharmony_ci       * @systemapi
103161847f8eSopenharmony_ci       * @since 11
103261847f8eSopenharmony_ci       */
103361847f8eSopenharmony_ci      state?: State;
103461847f8eSopenharmony_ci
103561847f8eSopenharmony_ci      /**
103661847f8eSopenharmony_ci       * Permissions for the shared data.
103761847f8eSopenharmony_ci       *
103861847f8eSopenharmony_ci       * @type { ?Privilege }
103961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
104061847f8eSopenharmony_ci       * @systemapi
104161847f8eSopenharmony_ci       * @since 11
104261847f8eSopenharmony_ci       */
104361847f8eSopenharmony_ci      privilege?: Privilege;
104461847f8eSopenharmony_ci
104561847f8eSopenharmony_ci      /**
104661847f8eSopenharmony_ci       * Attach information.
104761847f8eSopenharmony_ci       *
104861847f8eSopenharmony_ci       * @type { ?string }
104961847f8eSopenharmony_ci       * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
105061847f8eSopenharmony_ci       * @systemapi
105161847f8eSopenharmony_ci       * @since 11
105261847f8eSopenharmony_ci       */
105361847f8eSopenharmony_ci      attachInfo?: string;
105461847f8eSopenharmony_ci    }
105561847f8eSopenharmony_ci
105661847f8eSopenharmony_ci    /**
105761847f8eSopenharmony_ci     * Allocates shared resources based on conditions,
105861847f8eSopenharmony_ci     * and shares data with the specified privilege to participants.
105961847f8eSopenharmony_ci     *
106061847f8eSopenharmony_ci     * @param { string } storeId - Indicates relational store name.
106161847f8eSopenharmony_ci     * @param { relationalStore.RdbPredicates } predicates - See {@link relationalStore.RdbPredicates}.
106261847f8eSopenharmony_ci     * @param { Array<Participant> } participants - Participants to share.
106361847f8eSopenharmony_ci     * @param { Array<string> } [columns] - Columns to be shared.
106461847f8eSopenharmony_ci     * @returns { Promise<relationalStore.ResultSet> } - Promise used to return {@link relationalStore.ResultSet}.
106561847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
106661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
106761847f8eSopenharmony_ci     * 3. Parameter verification failed.
106861847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
106961847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
107061847f8eSopenharmony_ci     * @systemapi
107161847f8eSopenharmony_ci     * @since 11
107261847f8eSopenharmony_ci     */
107361847f8eSopenharmony_ci    function allocResourceAndShare(
107461847f8eSopenharmony_ci      storeId: string,
107561847f8eSopenharmony_ci      predicates: relationalStore.RdbPredicates,
107661847f8eSopenharmony_ci      participants: Array<Participant>,
107761847f8eSopenharmony_ci      columns?: Array<string>
107861847f8eSopenharmony_ci    ): Promise<relationalStore.ResultSet>;
107961847f8eSopenharmony_ci
108061847f8eSopenharmony_ci    /**
108161847f8eSopenharmony_ci     * Allocates shared resources based on conditions,
108261847f8eSopenharmony_ci     * and shares data with the specified privilege to participants.
108361847f8eSopenharmony_ci     *
108461847f8eSopenharmony_ci     * @param { string } storeId - Indicates relational store name.
108561847f8eSopenharmony_ci     * @param { relationalStore.RdbPredicates } predicates - See {@link relationalStore.RdbPredicates}.
108661847f8eSopenharmony_ci     * @param { Array<Participant> } participants - Participants to share.
108761847f8eSopenharmony_ci     * @param { AsyncCallback<relationalStore.ResultSet> } callback - Indicates the
108861847f8eSopenharmony_ci     * callback invoked to return the {@link relationalStore.ResultSet}.
108961847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
109061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
109161847f8eSopenharmony_ci     * 3. Parameter verification failed.
109261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
109361847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
109461847f8eSopenharmony_ci     * @systemapi
109561847f8eSopenharmony_ci     * @since 11
109661847f8eSopenharmony_ci     */
109761847f8eSopenharmony_ci    function allocResourceAndShare(
109861847f8eSopenharmony_ci      storeId: string,
109961847f8eSopenharmony_ci      predicates: relationalStore.RdbPredicates,
110061847f8eSopenharmony_ci      participants: Array<Participant>,
110161847f8eSopenharmony_ci      callback: AsyncCallback<relationalStore.ResultSet>
110261847f8eSopenharmony_ci    ): void;
110361847f8eSopenharmony_ci
110461847f8eSopenharmony_ci    /**
110561847f8eSopenharmony_ci     * Allocates shared resources based on conditions,
110661847f8eSopenharmony_ci     * and shares data with the specified privilege to participants.
110761847f8eSopenharmony_ci     *
110861847f8eSopenharmony_ci     * @param { string } storeId - Indicates relational store name.
110961847f8eSopenharmony_ci     * @param { relationalStore.RdbPredicates } predicates - See {@link relationalStore.RdbPredicates}.
111061847f8eSopenharmony_ci     * @param { Array<Participant> } participants - Participants to share.
111161847f8eSopenharmony_ci     * @param { Array<string> } columns - Columns to be shared.
111261847f8eSopenharmony_ci     * @param { AsyncCallback<relationalStore.ResultSet> } callback - Indicates the
111361847f8eSopenharmony_ci     * callback invoked to return the {@link relationalStore.ResultSet}.
111461847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
111561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
111661847f8eSopenharmony_ci     * 3. Parameter verification failed.
111761847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
111861847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
111961847f8eSopenharmony_ci     * @systemapi
112061847f8eSopenharmony_ci     * @since 11
112161847f8eSopenharmony_ci     */
112261847f8eSopenharmony_ci    function allocResourceAndShare(
112361847f8eSopenharmony_ci      storeId: string,
112461847f8eSopenharmony_ci      predicates: relationalStore.RdbPredicates,
112561847f8eSopenharmony_ci      participants: Array<Participant>,
112661847f8eSopenharmony_ci      columns: Array<string>,
112761847f8eSopenharmony_ci      callback: AsyncCallback<relationalStore.ResultSet>
112861847f8eSopenharmony_ci    ): void;
112961847f8eSopenharmony_ci
113061847f8eSopenharmony_ci    /**
113161847f8eSopenharmony_ci     * Shares data with the specified privilege to participants.
113261847f8eSopenharmony_ci     *
113361847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
113461847f8eSopenharmony_ci     * @param { Array<Participant> } participants - Indicates the participants
113561847f8eSopenharmony_ci     * involved in the data sharing.
113661847f8eSopenharmony_ci     * @param { AsyncCallback<Result<Array<Result<Participant>>>> } callback - Indicates the
113761847f8eSopenharmony_ci     * callback invoked to return the result.
113861847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
113961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
114061847f8eSopenharmony_ci     * 3. Parameter verification failed.
114161847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
114261847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
114361847f8eSopenharmony_ci     * @systemapi
114461847f8eSopenharmony_ci     * @since 11
114561847f8eSopenharmony_ci     */
114661847f8eSopenharmony_ci    function share(
114761847f8eSopenharmony_ci      sharingResource: string,
114861847f8eSopenharmony_ci      participants: Array<Participant>,
114961847f8eSopenharmony_ci      callback: AsyncCallback<Result<Array<Result<Participant>>>>
115061847f8eSopenharmony_ci    ): void;
115161847f8eSopenharmony_ci
115261847f8eSopenharmony_ci    /**
115361847f8eSopenharmony_ci     * Shares data with the specified privilege to participants.
115461847f8eSopenharmony_ci     *
115561847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
115661847f8eSopenharmony_ci     * @param { Array<Participant> } participants - Indicates the participants
115761847f8eSopenharmony_ci     * involved in the data sharing.
115861847f8eSopenharmony_ci     * @returns { Promise<Result<Array<Result<Participant>>>> } - Promise used to return the result.
115961847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
116061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
116161847f8eSopenharmony_ci     * 3. Parameter verification failed.
116261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
116361847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
116461847f8eSopenharmony_ci     * @systemapi
116561847f8eSopenharmony_ci     * @since 11
116661847f8eSopenharmony_ci     */
116761847f8eSopenharmony_ci    function share(
116861847f8eSopenharmony_ci      sharingResource: string,
116961847f8eSopenharmony_ci      participants: Array<Participant>
117061847f8eSopenharmony_ci    ): Promise<Result<Array<Result<Participant>>>>;
117161847f8eSopenharmony_ci
117261847f8eSopenharmony_ci    /**
117361847f8eSopenharmony_ci     * UnShares data.
117461847f8eSopenharmony_ci     *
117561847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
117661847f8eSopenharmony_ci     * @param { Array<Participant> } participants - Indicates the participants
117761847f8eSopenharmony_ci     * involved.
117861847f8eSopenharmony_ci     * @param { AsyncCallback<Result<Array<Result<Participant>>>> } callback - Indicates the callback invoked
117961847f8eSopenharmony_ci     * to return the result.
118061847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
118161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
118261847f8eSopenharmony_ci     * 3. Parameter verification failed.
118361847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
118461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
118561847f8eSopenharmony_ci     * @systemapi
118661847f8eSopenharmony_ci     * @since 11
118761847f8eSopenharmony_ci     */
118861847f8eSopenharmony_ci    function unshare(
118961847f8eSopenharmony_ci      sharingResource: string,
119061847f8eSopenharmony_ci      participants: Array<Participant>,
119161847f8eSopenharmony_ci      callback: AsyncCallback<Result<Array<Result<Participant>>>>
119261847f8eSopenharmony_ci    ): void;
119361847f8eSopenharmony_ci
119461847f8eSopenharmony_ci    /**
119561847f8eSopenharmony_ci     * UnShares data.
119661847f8eSopenharmony_ci     *
119761847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
119861847f8eSopenharmony_ci     * @param { Array<Participant> } participants - Indicates the participants
119961847f8eSopenharmony_ci     * involved.
120061847f8eSopenharmony_ci     * @returns { Promise<Result<Array<Result<Participant>>>> } - Promise used to return the result.
120161847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
120261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
120361847f8eSopenharmony_ci     * 3. Parameter verification failed.
120461847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
120561847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
120661847f8eSopenharmony_ci     * @systemapi
120761847f8eSopenharmony_ci     * @since 11
120861847f8eSopenharmony_ci     */
120961847f8eSopenharmony_ci    function unshare(
121061847f8eSopenharmony_ci      sharingResource: string,
121161847f8eSopenharmony_ci      participants: Array<Participant>
121261847f8eSopenharmony_ci    ): Promise<Result<Array<Result<Participant>>>>;
121361847f8eSopenharmony_ci
121461847f8eSopenharmony_ci    /**
121561847f8eSopenharmony_ci     * Exit sharing.
121661847f8eSopenharmony_ci     *
121761847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
121861847f8eSopenharmony_ci     * @param { AsyncCallback<Result<void>> } callback - The callback of exit.
121961847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
122061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
122161847f8eSopenharmony_ci     * 3. Parameter verification failed.
122261847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
122361847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
122461847f8eSopenharmony_ci     * @systemapi
122561847f8eSopenharmony_ci     * @since 11
122661847f8eSopenharmony_ci     */
122761847f8eSopenharmony_ci    function exit(sharingResource: string, callback: AsyncCallback<Result<void>>): void;
122861847f8eSopenharmony_ci
122961847f8eSopenharmony_ci    /**
123061847f8eSopenharmony_ci     * Exit sharing.
123161847f8eSopenharmony_ci     *
123261847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
123361847f8eSopenharmony_ci     * @returns { Promise<Result<void>> } - The promise returned by the function.
123461847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
123561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
123661847f8eSopenharmony_ci     * 3. Parameter verification failed.
123761847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
123861847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
123961847f8eSopenharmony_ci     * @systemapi
124061847f8eSopenharmony_ci     * @since 11
124161847f8eSopenharmony_ci     */
124261847f8eSopenharmony_ci    function exit(sharingResource: string): Promise<Result<void>>;
124361847f8eSopenharmony_ci
124461847f8eSopenharmony_ci    /**
124561847f8eSopenharmony_ci     * Changes the permissions for the shared data.
124661847f8eSopenharmony_ci     *
124761847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
124861847f8eSopenharmony_ci     * @param { Array<Participant> } participants - Indicates the participants
124961847f8eSopenharmony_ci     * whose permissions are to be changed.
125061847f8eSopenharmony_ci     * @param { AsyncCallback<Result<Array<Result<Participant>>>> } callback - Indicates the
125161847f8eSopenharmony_ci     * callback invoked to return the result.
125261847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
125361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
125461847f8eSopenharmony_ci     * 3. Parameter verification failed.
125561847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
125661847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
125761847f8eSopenharmony_ci     * @systemapi
125861847f8eSopenharmony_ci     * @since 11
125961847f8eSopenharmony_ci     */
126061847f8eSopenharmony_ci    function changePrivilege(
126161847f8eSopenharmony_ci      sharingResource: string,
126261847f8eSopenharmony_ci      participants: Array<Participant>,
126361847f8eSopenharmony_ci      callback: AsyncCallback<Result<Array<Result<Participant>>>>
126461847f8eSopenharmony_ci    ): void;
126561847f8eSopenharmony_ci
126661847f8eSopenharmony_ci    /**
126761847f8eSopenharmony_ci     * Changes the permissions for the shared data.
126861847f8eSopenharmony_ci     *
126961847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
127061847f8eSopenharmony_ci     * @param { Array<Participant> } participants - Indicates the participants
127161847f8eSopenharmony_ci     * whose permissions are to be changed.
127261847f8eSopenharmony_ci     * @returns { Promise<Result<Array<Result<Participant>>>> } - Promise used to return the result.
127361847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
127461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
127561847f8eSopenharmony_ci     * 3. Parameter verification failed.
127661847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
127761847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
127861847f8eSopenharmony_ci     * @systemapi
127961847f8eSopenharmony_ci     * @since 11
128061847f8eSopenharmony_ci     */
128161847f8eSopenharmony_ci    function changePrivilege(
128261847f8eSopenharmony_ci      sharingResource: string,
128361847f8eSopenharmony_ci      participants: Array<Participant>
128461847f8eSopenharmony_ci    ): Promise<Result<Array<Result<Participant>>>>;
128561847f8eSopenharmony_ci
128661847f8eSopenharmony_ci    /**
128761847f8eSopenharmony_ci     * Queries the participants based on the specified shared data.
128861847f8eSopenharmony_ci     *
128961847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
129061847f8eSopenharmony_ci     * @param { AsyncCallback<Result<Array<Participant>>> } callback - Indicates the
129161847f8eSopenharmony_ci     * callback invoked to return the participants obtained.
129261847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
129361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
129461847f8eSopenharmony_ci     * 3. Parameter verification failed.
129561847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
129661847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
129761847f8eSopenharmony_ci     * @systemapi
129861847f8eSopenharmony_ci     * @since 11
129961847f8eSopenharmony_ci     */
130061847f8eSopenharmony_ci    function queryParticipants(sharingResource: string, callback: AsyncCallback<Result<Array<Participant>>>): void;
130161847f8eSopenharmony_ci
130261847f8eSopenharmony_ci    /**
130361847f8eSopenharmony_ci     * Queries the participants based on the specified shared data.
130461847f8eSopenharmony_ci     *
130561847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
130661847f8eSopenharmony_ci     * @returns { Promise<Result<Array<Participant>>> } - Promise used to return the result.
130761847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
130861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
130961847f8eSopenharmony_ci     * 3. Parameter verification failed.
131061847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
131161847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
131261847f8eSopenharmony_ci     * @systemapi
131361847f8eSopenharmony_ci     * @since 11
131461847f8eSopenharmony_ci     */
131561847f8eSopenharmony_ci    function queryParticipants(sharingResource: string): Promise<Result<Array<Participant>>>;
131661847f8eSopenharmony_ci
131761847f8eSopenharmony_ci    /**
131861847f8eSopenharmony_ci     * Queries the participants based on the specified invitation code.
131961847f8eSopenharmony_ci     *
132061847f8eSopenharmony_ci     * @param { string } invitationCode - Indicates the invitation code.
132161847f8eSopenharmony_ci     * @param { AsyncCallback<Result<Array<Participant>>> } callback - Indicates the
132261847f8eSopenharmony_ci     * callback invoked to return the participants obtained.
132361847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
132461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
132561847f8eSopenharmony_ci     * 3. Parameter verification failed.
132661847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
132761847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
132861847f8eSopenharmony_ci     * @systemapi
132961847f8eSopenharmony_ci     * @since 11
133061847f8eSopenharmony_ci     */
133161847f8eSopenharmony_ci    function queryParticipantsByInvitation(
133261847f8eSopenharmony_ci      invitationCode: string,
133361847f8eSopenharmony_ci      callback: AsyncCallback<Result<Array<Participant>>>
133461847f8eSopenharmony_ci    ): void;
133561847f8eSopenharmony_ci
133661847f8eSopenharmony_ci    /**
133761847f8eSopenharmony_ci     * Queries the participants based on the specified invitation code.
133861847f8eSopenharmony_ci     *
133961847f8eSopenharmony_ci     * @param { string } invitationCode - Indicates the invitation code.
134061847f8eSopenharmony_ci     * @returns { Promise<Result<Array<Participant>>> } - Promise used to return the result.
134161847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
134261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
134361847f8eSopenharmony_ci     * 3. Parameter verification failed.
134461847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
134561847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
134661847f8eSopenharmony_ci     * @systemapi
134761847f8eSopenharmony_ci     * @since 11
134861847f8eSopenharmony_ci     */
134961847f8eSopenharmony_ci    function queryParticipantsByInvitation(invitationCode: string): Promise<Result<Array<Participant>>>;
135061847f8eSopenharmony_ci
135161847f8eSopenharmony_ci    /**
135261847f8eSopenharmony_ci     * Confirms the invitation of cloud sharing.
135361847f8eSopenharmony_ci     *
135461847f8eSopenharmony_ci     * @param { string } invitationCode - Indicates the invitation code.
135561847f8eSopenharmony_ci     * @param { State } state - Indicates the state of invitation.
135661847f8eSopenharmony_ci     * @param { AsyncCallback<Result<string>> } callback - Indicates the callback
135761847f8eSopenharmony_ci     * invoked to return the sharing resource.
135861847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
135961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
136061847f8eSopenharmony_ci     * 3. Parameter verification failed.
136161847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
136261847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
136361847f8eSopenharmony_ci     * @systemapi
136461847f8eSopenharmony_ci     * @since 11
136561847f8eSopenharmony_ci     */
136661847f8eSopenharmony_ci    function confirmInvitation(invitationCode: string, state: State, callback: AsyncCallback<Result<string>>): void;
136761847f8eSopenharmony_ci
136861847f8eSopenharmony_ci    /**
136961847f8eSopenharmony_ci     * Confirms the invitation of cloud sharing.
137061847f8eSopenharmony_ci     *
137161847f8eSopenharmony_ci     * @param { string } invitationCode - Indicates the invitation code.
137261847f8eSopenharmony_ci     * @param { State } state - Indicates the state of invitation.
137361847f8eSopenharmony_ci     * @returns { Promise<Result<string>> } - Promise used to return the sharing resource.
137461847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
137561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
137661847f8eSopenharmony_ci     * 3. Parameter verification failed.
137761847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
137861847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
137961847f8eSopenharmony_ci     * @systemapi
138061847f8eSopenharmony_ci     * @since 11
138161847f8eSopenharmony_ci     */
138261847f8eSopenharmony_ci    function confirmInvitation(invitationCode: string, state: State): Promise<Result<string>>;
138361847f8eSopenharmony_ci
138461847f8eSopenharmony_ci    /**
138561847f8eSopenharmony_ci     * Changes confirmation of shared record.
138661847f8eSopenharmony_ci     *
138761847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
138861847f8eSopenharmony_ci     * @param { State } state - Indicates the state of invitation.
138961847f8eSopenharmony_ci     * @param { AsyncCallback<Result<void>> } callback - Indicates the callback.
139061847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
139161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
139261847f8eSopenharmony_ci     * 3. Parameter verification failed.
139361847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
139461847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
139561847f8eSopenharmony_ci     * @systemapi
139661847f8eSopenharmony_ci     * @since 11
139761847f8eSopenharmony_ci     */
139861847f8eSopenharmony_ci    function changeConfirmation(sharingResource: string, state: State, callback: AsyncCallback<Result<void>>): void;
139961847f8eSopenharmony_ci
140061847f8eSopenharmony_ci    /**
140161847f8eSopenharmony_ci     * Changes confirmation of shared record.
140261847f8eSopenharmony_ci     *
140361847f8eSopenharmony_ci     * @param { string } sharingResource - Indicates the sharing resource.
140461847f8eSopenharmony_ci     * @param { State } state - Indicates the state of invitation.
140561847f8eSopenharmony_ci     * @returns { Promise<Result<void>> } - The promise returned by the function.
140661847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
140761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
140861847f8eSopenharmony_ci     * 3. Parameter verification failed.
140961847f8eSopenharmony_ci     * @throws { BusinessError } 801 - Capability not supported.
141061847f8eSopenharmony_ci     * @syscap SystemCapability.DistributedDataManager.CloudSync.Client
141161847f8eSopenharmony_ci     * @systemapi
141261847f8eSopenharmony_ci     * @since 11
141361847f8eSopenharmony_ci     */
141461847f8eSopenharmony_ci    function changeConfirmation(sharingResource: string, state: State): Promise<Result<void>>;
141561847f8eSopenharmony_ci  }
141661847f8eSopenharmony_ci}
141761847f8eSopenharmony_ci
141861847f8eSopenharmony_ciexport default cloudData;
1419