161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (C) 2022-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 CoreFileKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback, Callback } from './@ohos.base'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * Provides volumemanager statistics APIs 2561847f8eSopenharmony_ci * 2661847f8eSopenharmony_ci * @namespace volumeManager 2761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 2861847f8eSopenharmony_ci * @systemapi 2961847f8eSopenharmony_ci * @since 9 3061847f8eSopenharmony_ci */ 3161847f8eSopenharmony_cideclare namespace volumeManager { 3261847f8eSopenharmony_ci /** 3361847f8eSopenharmony_ci * Get All Volumes 3461847f8eSopenharmony_ci * 3561847f8eSopenharmony_ci * @interface Volume 3661847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 3761847f8eSopenharmony_ci * @systemapi 3861847f8eSopenharmony_ci * @since 9 3961847f8eSopenharmony_ci */ 4061847f8eSopenharmony_ci export interface Volume { 4161847f8eSopenharmony_ci /** 4261847f8eSopenharmony_ci * Volume ID. 4361847f8eSopenharmony_ci * 4461847f8eSopenharmony_ci * @type { string } 4561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 4661847f8eSopenharmony_ci * @systemapi 4761847f8eSopenharmony_ci * @since 9 4861847f8eSopenharmony_ci */ 4961847f8eSopenharmony_ci id: string; 5061847f8eSopenharmony_ci 5161847f8eSopenharmony_ci /** 5261847f8eSopenharmony_ci * Universally unique identifier of volume. 5361847f8eSopenharmony_ci * 5461847f8eSopenharmony_ci * @type { string } 5561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 5661847f8eSopenharmony_ci * @systemapi 5761847f8eSopenharmony_ci * @since 9 5861847f8eSopenharmony_ci */ 5961847f8eSopenharmony_ci uuid: string; 6061847f8eSopenharmony_ci 6161847f8eSopenharmony_ci /** 6261847f8eSopenharmony_ci * The ID of disk that volume belongs to. 6361847f8eSopenharmony_ci * 6461847f8eSopenharmony_ci * @type { string } 6561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 6661847f8eSopenharmony_ci * @systemapi 6761847f8eSopenharmony_ci * @since 9 6861847f8eSopenharmony_ci */ 6961847f8eSopenharmony_ci diskId: string; 7061847f8eSopenharmony_ci 7161847f8eSopenharmony_ci /** 7261847f8eSopenharmony_ci * The label of the volume. 7361847f8eSopenharmony_ci * 7461847f8eSopenharmony_ci * @type { string } 7561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 7661847f8eSopenharmony_ci * @systemapi 7761847f8eSopenharmony_ci * @since 9 7861847f8eSopenharmony_ci */ 7961847f8eSopenharmony_ci description: string; 8061847f8eSopenharmony_ci 8161847f8eSopenharmony_ci /** 8261847f8eSopenharmony_ci * The volume is removable or not. 8361847f8eSopenharmony_ci * 8461847f8eSopenharmony_ci * @type { boolean } 8561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 8661847f8eSopenharmony_ci * @systemapi 8761847f8eSopenharmony_ci * @since 9 8861847f8eSopenharmony_ci */ 8961847f8eSopenharmony_ci removable: boolean; 9061847f8eSopenharmony_ci 9161847f8eSopenharmony_ci /** 9261847f8eSopenharmony_ci * The mount state of the volume. 9361847f8eSopenharmony_ci * 9461847f8eSopenharmony_ci * @type { number } 9561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 9661847f8eSopenharmony_ci * @systemapi 9761847f8eSopenharmony_ci * @since 9 9861847f8eSopenharmony_ci */ 9961847f8eSopenharmony_ci state: number; 10061847f8eSopenharmony_ci 10161847f8eSopenharmony_ci /** 10261847f8eSopenharmony_ci * The mount path of the volume. 10361847f8eSopenharmony_ci * 10461847f8eSopenharmony_ci * @type { string } 10561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 10661847f8eSopenharmony_ci * @systemapi 10761847f8eSopenharmony_ci * @since 9 10861847f8eSopenharmony_ci */ 10961847f8eSopenharmony_ci path: string; 11061847f8eSopenharmony_ci 11161847f8eSopenharmony_ci /** 11261847f8eSopenharmony_ci * The file system type of the volume. 11361847f8eSopenharmony_ci * 11461847f8eSopenharmony_ci * @type { string } 11561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 11661847f8eSopenharmony_ci * @systemapi 11761847f8eSopenharmony_ci * @since 12 11861847f8eSopenharmony_ci */ 11961847f8eSopenharmony_ci fsType: string; 12061847f8eSopenharmony_ci } 12161847f8eSopenharmony_ci /** 12261847f8eSopenharmony_ci * Get All Volumes 12361847f8eSopenharmony_ci * 12461847f8eSopenharmony_ci * @permission ohos.permission.STORAGE_MANAGER 12561847f8eSopenharmony_ci * @param { AsyncCallback<Array<Volume>> } callback - callback 12661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 12761847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 12861847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:Mandatory 12961847f8eSopenharmony_ciparameters are left unspecified; 13061847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 13161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 13261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 13361847f8eSopenharmony_ci * @systemapi 13461847f8eSopenharmony_ci * @since 9 13561847f8eSopenharmony_ci */ 13661847f8eSopenharmony_ci function getAllVolumes(callback: AsyncCallback<Array<Volume>>): void; 13761847f8eSopenharmony_ci 13861847f8eSopenharmony_ci /** 13961847f8eSopenharmony_ci * Get All Volumes 14061847f8eSopenharmony_ci * 14161847f8eSopenharmony_ci * @permission ohos.permission.STORAGE_MANAGER 14261847f8eSopenharmony_ci * @returns { Promise<Array<Volume>> } return Promise 14361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 14461847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 14561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:Mandatory 14661847f8eSopenharmony_ciparameters are left unspecified; 14761847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 14861847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 14961847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 15061847f8eSopenharmony_ci * @systemapi 15161847f8eSopenharmony_ci * @since 9 15261847f8eSopenharmony_ci */ 15361847f8eSopenharmony_ci function getAllVolumes(): Promise<Array<Volume>>; 15461847f8eSopenharmony_ci 15561847f8eSopenharmony_ci /** 15661847f8eSopenharmony_ci * Mount 15761847f8eSopenharmony_ci * 15861847f8eSopenharmony_ci * @permission ohos.permission.MOUNT_UNMOUNT_MANAGER 15961847f8eSopenharmony_ci * @param { string } volumeId - The id of the volume 16061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback 16161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 16261847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 16361847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 16461847f8eSopenharmony_ciparameters are left unspecified; 16561847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 16661847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 16761847f8eSopenharmony_ci * @throws { BusinessError } 13600002 - Not supported filesystem. 16861847f8eSopenharmony_ci * @throws { BusinessError } 13600003 - Failed to mount. 16961847f8eSopenharmony_ci * @throws { BusinessError } 13600005 - Incorrect volume state. 17061847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 17161847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 17261847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 17361847f8eSopenharmony_ci * @systemapi 17461847f8eSopenharmony_ci * @since 9 17561847f8eSopenharmony_ci */ 17661847f8eSopenharmony_ci function mount(volumeId: string, callback: AsyncCallback<void>): void; 17761847f8eSopenharmony_ci 17861847f8eSopenharmony_ci /** 17961847f8eSopenharmony_ci * Mount 18061847f8eSopenharmony_ci * 18161847f8eSopenharmony_ci * @permission ohos.permission.MOUNT_UNMOUNT_MANAGER 18261847f8eSopenharmony_ci * @param { string } volumeId - The id of the volume 18361847f8eSopenharmony_ci * @returns { Promise<void> } return Promise 18461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 18561847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 18661847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 18761847f8eSopenharmony_ciparameters are left unspecified; 18861847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 18961847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 19061847f8eSopenharmony_ci * @throws { BusinessError } 13600002 - Not supported filesystem. 19161847f8eSopenharmony_ci * @throws { BusinessError } 13600003 - Failed to mount. 19261847f8eSopenharmony_ci * @throws { BusinessError } 13600005 - Incorrect volume state. 19361847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 19461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 19561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 19661847f8eSopenharmony_ci * @systemapi 19761847f8eSopenharmony_ci * @since 9 19861847f8eSopenharmony_ci */ 19961847f8eSopenharmony_ci function mount(volumeId: string): Promise<void>; 20061847f8eSopenharmony_ci 20161847f8eSopenharmony_ci /** 20261847f8eSopenharmony_ci * UnMount 20361847f8eSopenharmony_ci * 20461847f8eSopenharmony_ci * @permission ohos.permission.MOUNT_UNMOUNT_MANAGER 20561847f8eSopenharmony_ci * @param { string } volumeId - The id of the volume 20661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback 20761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 20861847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 20961847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 21061847f8eSopenharmony_ciparameters are left unspecified; 21161847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 21261847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 21361847f8eSopenharmony_ci * @throws { BusinessError } 13600002 - Not supported filesystem. 21461847f8eSopenharmony_ci * @throws { BusinessError } 13600004 - Failed to unmount. 21561847f8eSopenharmony_ci * @throws { BusinessError } 13600005 - Incorrect volume state. 21661847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 21761847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 21861847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 21961847f8eSopenharmony_ci * @systemapi 22061847f8eSopenharmony_ci * @since 9 22161847f8eSopenharmony_ci */ 22261847f8eSopenharmony_ci function unmount(volumeId: string, callback: AsyncCallback<void>): void; 22361847f8eSopenharmony_ci 22461847f8eSopenharmony_ci /** 22561847f8eSopenharmony_ci * UnMount 22661847f8eSopenharmony_ci * 22761847f8eSopenharmony_ci * @permission ohos.permission.MOUNT_UNMOUNT_MANAGER 22861847f8eSopenharmony_ci * @param { string } volumeId - The id of the volume 22961847f8eSopenharmony_ci * @returns { Promise<void> } return Promise 23061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 23161847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 23261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 23361847f8eSopenharmony_ciparameters are left unspecified; 23461847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 23561847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 23661847f8eSopenharmony_ci * @throws { BusinessError } 13600002 - Not supported filesystem. 23761847f8eSopenharmony_ci * @throws { BusinessError } 13600004 - Failed to unmount. 23861847f8eSopenharmony_ci * @throws { BusinessError } 13600005 - Incorrect volume state. 23961847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 24061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 24161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 24261847f8eSopenharmony_ci * @systemapi 24361847f8eSopenharmony_ci * @since 9 24461847f8eSopenharmony_ci */ 24561847f8eSopenharmony_ci function unmount(volumeId: string): Promise<void>; 24661847f8eSopenharmony_ci 24761847f8eSopenharmony_ci /** 24861847f8eSopenharmony_ci * Get the volume by uuid. 24961847f8eSopenharmony_ci * 25061847f8eSopenharmony_ci * @permission ohos.permission.STORAGE_MANAGER 25161847f8eSopenharmony_ci * @param { string } uuid - The uuid of volume 25261847f8eSopenharmony_ci * @param { AsyncCallback<Volume> } callback - callback 25361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 25461847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 25561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 25661847f8eSopenharmony_ciparameters are left unspecified; 25761847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 25861847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 25961847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 26061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 26161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 26261847f8eSopenharmony_ci * @systemapi 26361847f8eSopenharmony_ci * @since 9 26461847f8eSopenharmony_ci */ 26561847f8eSopenharmony_ci function getVolumeByUuid(uuid: string, callback: AsyncCallback<Volume>): void; 26661847f8eSopenharmony_ci 26761847f8eSopenharmony_ci /** 26861847f8eSopenharmony_ci * Get the volume by uuid. 26961847f8eSopenharmony_ci * 27061847f8eSopenharmony_ci * @permission ohos.permission.STORAGE_MANAGER 27161847f8eSopenharmony_ci * @param { string } uuid - The uuid of volume 27261847f8eSopenharmony_ci * @returns { Promise<Volume> } return Promise 27361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 27461847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 27561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 27661847f8eSopenharmony_ciparameters are left unspecified; 27761847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 27861847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 27961847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 28061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 28161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 28261847f8eSopenharmony_ci * @systemapi 28361847f8eSopenharmony_ci * @since 9 28461847f8eSopenharmony_ci */ 28561847f8eSopenharmony_ci function getVolumeByUuid(uuid: string): Promise<Volume>; 28661847f8eSopenharmony_ci 28761847f8eSopenharmony_ci /** 28861847f8eSopenharmony_ci * Get the volume by id. 28961847f8eSopenharmony_ci * 29061847f8eSopenharmony_ci * @permission ohos.permission.STORAGE_MANAGER 29161847f8eSopenharmony_ci * @param { string } volumeId - The id of volume 29261847f8eSopenharmony_ci * @param { AsyncCallback<Volume> } callback - callback 29361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 29461847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 29561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 29661847f8eSopenharmony_ciparameters are left unspecified; 29761847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 29861847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 29961847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 30061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 30161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 30261847f8eSopenharmony_ci * @systemapi 30361847f8eSopenharmony_ci * @since 9 30461847f8eSopenharmony_ci */ 30561847f8eSopenharmony_ci function getVolumeById(volumeId: string, callback: AsyncCallback<Volume>): void; 30661847f8eSopenharmony_ci 30761847f8eSopenharmony_ci /** 30861847f8eSopenharmony_ci * Get the volume by id. 30961847f8eSopenharmony_ci * 31061847f8eSopenharmony_ci * @permission ohos.permission.STORAGE_MANAGER 31161847f8eSopenharmony_ci * @param { string } volumeId - The id of volume 31261847f8eSopenharmony_ci * @returns { Promise<Volume> } return Promise 31361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 31461847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 31561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 31661847f8eSopenharmony_ciparameters are left unspecified; 31761847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 31861847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 31961847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 32061847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 32161847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 32261847f8eSopenharmony_ci * @systemapi 32361847f8eSopenharmony_ci * @since 9 32461847f8eSopenharmony_ci */ 32561847f8eSopenharmony_ci function getVolumeById(volumeId: string): Promise<Volume>; 32661847f8eSopenharmony_ci 32761847f8eSopenharmony_ci /** 32861847f8eSopenharmony_ci * Set the description of volume. 32961847f8eSopenharmony_ci * 33061847f8eSopenharmony_ci * @permission ohos.permission.MOUNT_UNMOUNT_MANAGER 33161847f8eSopenharmony_ci * @param { string } uuid - The uuid of volume 33261847f8eSopenharmony_ci * @param { string } description - New description of volume 33361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback 33461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 33561847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 33661847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 33761847f8eSopenharmony_ciparameters are left unspecified; 33861847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 33961847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 34061847f8eSopenharmony_ci * @throws { BusinessError } 13600002 - Not supported filesystem. 34161847f8eSopenharmony_ci * @throws { BusinessError } 13600005 - Incorrect volume state. 34261847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 34361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 34461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 34561847f8eSopenharmony_ci * @systemapi 34661847f8eSopenharmony_ci * @since 9 34761847f8eSopenharmony_ci */ 34861847f8eSopenharmony_ci function setVolumeDescription(uuid: string, description: string, callback: AsyncCallback<void>): void; 34961847f8eSopenharmony_ci 35061847f8eSopenharmony_ci /** 35161847f8eSopenharmony_ci * Set the description of volume. 35261847f8eSopenharmony_ci * 35361847f8eSopenharmony_ci * @permission ohos.permission.MOUNT_UNMOUNT_MANAGER 35461847f8eSopenharmony_ci * @param { string } uuid - The uuid of volume 35561847f8eSopenharmony_ci * @param { string } description - New description of volume 35661847f8eSopenharmony_ci * @returns { Promise<void> } return Promise 35761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 35861847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 35961847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 36061847f8eSopenharmony_ciparameters are left unspecified; 36161847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 36261847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 36361847f8eSopenharmony_ci * @throws { BusinessError } 13600002 - Not supported filesystem. 36461847f8eSopenharmony_ci * @throws { BusinessError } 13600005 - Incorrect volume state. 36561847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 36661847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 36761847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 36861847f8eSopenharmony_ci * @systemapi 36961847f8eSopenharmony_ci * @since 9 37061847f8eSopenharmony_ci */ 37161847f8eSopenharmony_ci function setVolumeDescription(uuid: string, description: string): Promise<void>; 37261847f8eSopenharmony_ci 37361847f8eSopenharmony_ci /** 37461847f8eSopenharmony_ci * Format. 37561847f8eSopenharmony_ci * 37661847f8eSopenharmony_ci * @permission ohos.permission.MOUNT_FORMAT_MANAGER 37761847f8eSopenharmony_ci * @param { string } volumeId - The id of the volume 37861847f8eSopenharmony_ci * @param { string } fsType - The file system type after formatting 37961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback 38061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 38161847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 38261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 38361847f8eSopenharmony_ciparameters are left unspecified; 38461847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 38561847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 38661847f8eSopenharmony_ci * @throws { BusinessError } 13600002 - Not supported filesystem. 38761847f8eSopenharmony_ci * @throws { BusinessError } 13600005 - Incorrect volume state. 38861847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 38961847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 39061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 39161847f8eSopenharmony_ci * @systemapi 39261847f8eSopenharmony_ci * @since 9 39361847f8eSopenharmony_ci */ 39461847f8eSopenharmony_ci function format(volumeId: string, fsType: string, callback: AsyncCallback<void>): void; 39561847f8eSopenharmony_ci 39661847f8eSopenharmony_ci /** 39761847f8eSopenharmony_ci * Format. 39861847f8eSopenharmony_ci * 39961847f8eSopenharmony_ci * @permission ohos.permission.MOUNT_FORMAT_MANAGER 40061847f8eSopenharmony_ci * @param { string } volumeId - The id of the volume 40161847f8eSopenharmony_ci * @param { string } fsType - The file system type after formatting 40261847f8eSopenharmony_ci * @returns { Promise<void> } return Promise 40361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 40461847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 40561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 40661847f8eSopenharmony_ciparameters are left unspecified; 40761847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 40861847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 40961847f8eSopenharmony_ci * @throws { BusinessError } 13600002 - Not supported filesystem. 41061847f8eSopenharmony_ci * @throws { BusinessError } 13600005 - Incorrect volume state. 41161847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 41261847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 41361847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 41461847f8eSopenharmony_ci * @systemapi 41561847f8eSopenharmony_ci * @since 9 41661847f8eSopenharmony_ci */ 41761847f8eSopenharmony_ci function format(volumeId: string, fsType: string): Promise<void>; 41861847f8eSopenharmony_ci 41961847f8eSopenharmony_ci /** 42061847f8eSopenharmony_ci * Partition. 42161847f8eSopenharmony_ci * 42261847f8eSopenharmony_ci * @permission ohos.permission.MOUNT_FORMAT_MANAGER 42361847f8eSopenharmony_ci * @param { string } diskId - The id of the disk 42461847f8eSopenharmony_ci * @param { number } type - Type of partition such as private partition or public partition 42561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback 42661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 42761847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 42861847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 42961847f8eSopenharmony_ciparameters are left unspecified; 43061847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 43161847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 43261847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 43361847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 43461847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 43561847f8eSopenharmony_ci * @systemapi 43661847f8eSopenharmony_ci * @since 9 43761847f8eSopenharmony_ci */ 43861847f8eSopenharmony_ci function partition(diskId: string, type: number, callback: AsyncCallback<void>): void; 43961847f8eSopenharmony_ci 44061847f8eSopenharmony_ci /** 44161847f8eSopenharmony_ci * Partition. 44261847f8eSopenharmony_ci * 44361847f8eSopenharmony_ci * @permission ohos.permission.MOUNT_FORMAT_MANAGER 44461847f8eSopenharmony_ci * @param { string } diskId - The id of the disk 44561847f8eSopenharmony_ci * @param { number } type - Type of partition such as private partition or public partition 44661847f8eSopenharmony_ci * @returns { Promise<void> } return Promise 44761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission verification failed. 44861847f8eSopenharmony_ci * @throws { BusinessError } 202 - The caller is not a system application. 44961847f8eSopenharmony_ci * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory 45061847f8eSopenharmony_ciparameters are left unspecified; 45161847f8eSopenharmony_ci * <br>2.Incorrect parameter types. 45261847f8eSopenharmony_ci * @throws { BusinessError } 13600001 - IPC error. 45361847f8eSopenharmony_ci * @throws { BusinessError } 13600008 - No such object. 45461847f8eSopenharmony_ci * @throws { BusinessError } 13900042 - Unknown error. 45561847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.StorageService.Volume 45661847f8eSopenharmony_ci * @systemapi 45761847f8eSopenharmony_ci * @since 9 45861847f8eSopenharmony_ci */ 45961847f8eSopenharmony_ci function partition(diskId: string, type: number): Promise<void>; 46061847f8eSopenharmony_ci} 46161847f8eSopenharmony_ci 46261847f8eSopenharmony_ciexport default volumeManager; 463