mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2025-03-02 14:21:40 +00:00
add cloudsync manager api
Signed-off-by: 张文迪 <zhangwendi3@huawei.com>
This commit is contained in:
parent
a8793fa86e
commit
c2ccd13cff
90
api/@ohos.file.cloudSyncManager.d.ts
vendored
Normal file
90
api/@ohos.file.cloudSyncManager.d.ts
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"),
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { AsyncCallback } from './basic';
|
||||
|
||||
/**
|
||||
* This module provides the capabilities to manage the state and data of cloud file synchronization.
|
||||
*
|
||||
* @since 10
|
||||
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
|
||||
*/
|
||||
declare namespace cloudSyncManager {
|
||||
/**
|
||||
* Modify switch state of the application's cloud synchronization capability.
|
||||
*
|
||||
* @since 10
|
||||
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
|
||||
* @systemapi
|
||||
* @param {string} accountId - Current account id
|
||||
* @param {string} bundleName - Name of bundle whose switchStatus is changing
|
||||
* @param {boolean} status - New switch status
|
||||
* @returns {Promise<void>} - Return Promise
|
||||
* @throws { BusinessError } 201 - Permission verification failed.
|
||||
* @throws { BusinessError } 202 - The caller is not a system application.
|
||||
* @throws { BusinessError } 401 - The input parameter is invalid.
|
||||
*/
|
||||
function changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean): Promise<void>;
|
||||
|
||||
/**
|
||||
* Modify switch state of the application's cloud synchronization capability.
|
||||
*
|
||||
* @since 10
|
||||
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
|
||||
* @systemapi
|
||||
* @param {string} accountId - Current account id
|
||||
* @param {string} bundleName - Name of bundle whose switchStatus is changing
|
||||
* @param {boolean} status - New switch status
|
||||
* @param {AsyncCallback<void>} [callback] - Callback function
|
||||
* @returns {void} Return void
|
||||
* @throws { BusinessError } 201 - Permission verification failed.
|
||||
* @throws { BusinessError } 202 - The caller is not a system application.
|
||||
* @throws { BusinessError } 401 - The input parameter is invalid.
|
||||
*/
|
||||
function changeAppCloudSwitch(accountId: string, bundleName: string, status: boolean, callback: AsyncCallback<void>): void;
|
||||
|
||||
/**
|
||||
* Notify the change of data in cloud.
|
||||
*
|
||||
* @since 10
|
||||
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
|
||||
* @systemapi
|
||||
* @param {string} accountId - Current account id
|
||||
* @param {string} bundleName - Name of bundle whose switchStatus is changing
|
||||
* @returns {Promise<void>} Return Promise
|
||||
* @throws { BusinessError } 201 - Permission verification failed.
|
||||
* @throws { BusinessError } 202 - The caller is not a system application.
|
||||
* @throws { BusinessError } 401 - The input parameter is invalid.
|
||||
*/
|
||||
function notifyDataChange(accountId: string, bundleName: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* Notify the change of data in cloud.
|
||||
*
|
||||
* @since 10
|
||||
* @syscap SystemCapability.FileManagement.DistributedFileService.CloudSyncManager
|
||||
* @systemapi
|
||||
* @param {string} accountId - Current account id
|
||||
* @param {string} bundleName - Name of bundle whose switchStatus is changing
|
||||
* @param {AsyncCallback<void>} [callback] - Callback function
|
||||
* @returns {void} Return void
|
||||
* @throws { BusinessError } 201 - Permission verification failed.
|
||||
* @throws { BusinessError } 202 - The caller is not a system application.
|
||||
* @throws { BusinessError } 401 - The input parameter is invalid.
|
||||
*/
|
||||
function notifyDataChange(accountId: string, bundleName: string, callback: AsyncCallback<void>): void;
|
||||
}
|
||||
|
||||
export default cloudSyncManager;
|
@ -109,6 +109,7 @@
|
||||
"SystemCapability.FileManagement.AppFileService",
|
||||
"SystemCapability.FileManagement.UserFileService",
|
||||
"SystemCapability.FileManagement.UserFileManager.Core",
|
||||
"SystemCapability.FileManagement.DistributedFileService.CloudSyncManager",
|
||||
"SystemCapability.USB.USBManager",
|
||||
"SystemCapability.Startup.SystemInfo",
|
||||
"SystemCapability.DistributedDataManager.RelationalStore.Core",
|
||||
|
@ -136,6 +136,7 @@
|
||||
"SystemCapability.FileManagement.AppFileService",
|
||||
"SystemCapability.FileManagement.UserFileService",
|
||||
"SystemCapability.FileManagement.UserFileManager.Core",
|
||||
"SystemCapability.FileManagement.DistributedFileService.CloudSyncManager",
|
||||
"SystemCapability.USB.USBManager",
|
||||
"SystemCapability.Sensors.Sensor",
|
||||
"SystemCapability.Sensors.MiscDevice",
|
||||
|
@ -135,6 +135,7 @@
|
||||
"SystemCapability.FileManagement.AppFileService",
|
||||
"SystemCapability.FileManagement.UserFileService",
|
||||
"SystemCapability.FileManagement.UserFileManager.Core",
|
||||
"SystemCapability.FileManagement.DistributedFileService.CloudSyncManager",
|
||||
"SystemCapability.USB.USBManager",
|
||||
"SystemCapability.Sensors.Sensor",
|
||||
"SystemCapability.Sensors.MiscDevice",
|
||||
|
@ -115,6 +115,7 @@
|
||||
"SystemCapability.FileManagement.AppFileService",
|
||||
"SystemCapability.FileManagement.UserFileService",
|
||||
"SystemCapability.FileManagement.UserFileManager.Core",
|
||||
"SystemCapability.FileManagement.DistributedFileService.CloudSyncManager",
|
||||
"SystemCapability.USB.USBManager",
|
||||
"SystemCapability.Startup.SystemInfo",
|
||||
"SystemCapability.DistributedDataManager.RelationalStore.Core",
|
||||
|
@ -307,7 +307,8 @@
|
||||
"SystemCapability.Cloud.Push",
|
||||
"SystemCapability.XTS.DeviceAttest",
|
||||
"SystemCapability.XTS.DeviceAttestLite",
|
||||
"SystemCapability.Base"
|
||||
"SystemCapability.Base",
|
||||
"SystemCapability.FileManagement.DistributedFileService.CloudSyncManager"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user