From 44a2081dfd363db990550045ad59329f8dfbf21a Mon Sep 17 00:00:00 2001 From: zhangwendi Date: Fri, 24 Jun 2022 15:38:00 +0800 Subject: [PATCH] add diskId in volume and change return type Signed-off-by: zhangwendi --- api/@ohos.volumeManager.d.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/api/@ohos.volumeManager.d.ts b/api/@ohos.volumeManager.d.ts index 42a714605f..416ed23c03 100644 --- a/api/@ohos.volumeManager.d.ts +++ b/api/@ohos.volumeManager.d.ts @@ -34,6 +34,7 @@ declare namespace volumeManager { export interface Volume { id: string; uuid: string; + diskId: string; description: string; removable: boolean; state: number; @@ -43,6 +44,7 @@ declare namespace volumeManager { * Get All Volumes * * @since 9 + * @return Returns the information of all volumes * @syscap SystemCapability.FileManagement.StorageService.Volume * @permission ohos.permission.STORAGE_MANAGER * @systemapi @@ -55,6 +57,7 @@ function getAllVolumes(): Promise>; * Mount * * @since 9 + * @param volumeId that indicates the volume * @syscap SystemCapability.FileManagement.StorageService.Volume * @permission ohos.permission.MOUNT_UNMOUNT_MANAGER * @systemapi @@ -66,6 +69,7 @@ function mount(volumeId: string): Promise; * UnMount * * @since 9 + * @param volumeId that indicates the volume * @syscap SystemCapability.FileManagement.StorageService.Volume * @permission ohos.permission.MOUNT_UNMOUNT_MANAGER * @systemapi @@ -77,6 +81,7 @@ function unmount(volumeId: string): Promise; * Get the volume by uuid. * * @since 9 + * @param uuid of volume * @syscap SystemCapability.FileManagement.StorageService.Volume * @permission ohos.permission.STORAGE_MANAGER * @systemapi @@ -88,17 +93,20 @@ function getVolumeByUuid(uuid: string): Promise; * Get the volume by id. * * @since 9 + * @param volumeId that indicates the volume * @syscap SystemCapability.FileManagement.StorageService.Volume * @permission ohos.permission.STORAGE_MANAGER * @systemapi */ -function getVolumeById(id: string, callback: AsyncCallback): void; -function getVolumeById(id: string): Promise; +function getVolumeById(volumeId: string, callback: AsyncCallback): void; +function getVolumeById(volumeId: string): Promise; /** * Set the description of volume. * * @since 9 + * @param uuid of volume + * @param new description of volume * @syscap SystemCapability.FileManagement.StorageService.Volume * @permission ohos.permission.MOUNT_UNMOUNT_MANAGER * @systemapi @@ -110,24 +118,28 @@ function setVolumeDescription(uuid: string, description: string): Promise; * Format. * * @since 9 + * @param volumeId that indicates the volume + * @param the file system type after formatting * @syscap SystemCapability.FileManagement.StorageService.Volume * @permission ohos.permission.MOUNT_FORMAT_MANAGER * @systemapi */ -function format(volId: string, callback: AsyncCallback): void; -function format(volId: string): Promise; +function format(volumeId: string, fsType: string, callback: AsyncCallback): void; +function format(volumeId: string, fsType: string): Promise; /** * Partition. * * @since 9 + * @param diskId that indicates the disk + * @param type of partition such as private partition or publick partition * @syscap SystemCapability.FileManagement.StorageService.Volume * @permission ohos.permission.MOUNT_FORMAT_MANAGER * @systemapi */ -function partition(volId: string, fstype: string, callback: AsyncCallback): void; -function partition(volId: string, fstype: string): Promise; +function partition(diskId: string, type: number, callback: AsyncCallback): void; +function partition(diskId: string, type: number): Promise; } export default volumeManager; -- Gitee