diff --git a/api/@ohos.file.storageStatistics.d.ts b/api/@ohos.file.storageStatistics.d.ts index 7d8cf858eb5476fb055b66d070211d0c8e662ec8..e98cebac0e81c2fcd52c244b27cbe87bacb352bc 100644 --- a/api/@ohos.file.storageStatistics.d.ts +++ b/api/@ohos.file.storageStatistics.d.ts @@ -221,6 +221,26 @@ parameters are left unspecified; */ function getBundleStats(packageName: string, index?: number): Promise; + /** + * @since 20 + * @arkts 1.2 + */ + overload getCurrentBundleStats { GetCurrentBundleStatsWithCallback, GetCurrentBundleStatsReturnsPromise }; + + /** + * Get the current bundle statistics. + * + * @param { AsyncCallback } callback - callback + * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:Mandatory +parameters are left unspecified; + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @since 20 + * @arkts 1.2 + */ + function GetCurrentBundleStatsWithCallback(callback: AsyncCallback): void; + /** * Get the current bundle statistics. * @@ -244,8 +264,21 @@ parameters are left unspecified; * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 13900042 - Unknown error. * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 + */ + function GetCurrentBundleStatsReturnsPromise(): Promise; + + /** + * Get the current bundle statistics. + * + * @returns { Promise } return Promise + * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:Mandatory +parameters are left unspecified; + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @since 9 */ function getCurrentBundleStats(): Promise; @@ -355,6 +388,36 @@ parameters are left unspecified; app: number; } + /** + * @since 20 + * @arkts 1.2 + */ + overload getUserStorageStats { + GetUserStorageStatsReturnsPromise, + GetUserStorageStatsWithCallback, + GetUserStorageStatsWithUserIdReturnsPromise, + GetUserStorageStatsWithUserIdCallback + }; + + /** + * Get the user storage statistics. + * + * @permission ohos.permission.STORAGE_MANAGER + * @returns { Promise } 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.Possible causes:1.Mandatory +parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function GetUserStorageStatsReturnsPromise(): Promise; + /** * Get the user storage statistics. * @@ -388,8 +451,26 @@ parameters are left unspecified; * @throws { BusinessError } 13900042 - Unknown error. * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 + */ + function GetUserStorageStatsWithCallback(callback: AsyncCallback): void; + + /** + * Get the user storage statistics. + * + * @permission ohos.permission.STORAGE_MANAGER + * @param { AsyncCallback } callback - callback + * @throws { BusinessError } 201 - Permission verification failed. + * @throws { BusinessError } 202 - The caller is not a system application. + * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory +parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @systemapi + * @since 9 */ function getUserStorageStats(callback: AsyncCallback): void; @@ -409,8 +490,28 @@ parameters are left unspecified; * @throws { BusinessError } 13900042 - Unknown error. * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 + */ + function GetUserStorageStatsWithUserIdReturnsPromise(userId: number): Promise; + + /** + * Get the user storage statistics. + * + * @permission ohos.permission.STORAGE_MANAGER + * @param { long } userId - The id of the user + * @returns { Promise } 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.Possible causes:1.Mandatory +parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13600009 - User if out of range. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @systemapi + * @since 9 */ function getUserStorageStats(userId: long): Promise; @@ -430,11 +531,51 @@ parameters are left unspecified; * @throws { BusinessError } 13900042 - Unknown error. * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 + */ + function GetUserStorageStatsWithUserIdCallback(userId: number, callback: AsyncCallback): void; + + /** + * Get the user storage statistics. + * + * @permission ohos.permission.STORAGE_MANAGER + * @param { long } userId - The id of the user + * @param { AsyncCallback } callback - callback + * @throws { BusinessError } 201 - Permission verification failed. + * @throws { BusinessError } 202 - The caller is not a system application. + * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory +parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13600009 - User if out of range. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @systemapi + * @since 9 */ function getUserStorageStats(userId: long, callback: AsyncCallback): void; + /** + * @since 20 + * @arkts 1.2 + */ + overload getTotalSize { GetTotalSizeWithCallback, GetTotalSizeReturnsPromise }; + + /** + * Get the total size. + * + * @param { AsyncCallback } callback - callback + * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:Mandatory +parameters are left unspecified; + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @since 20 + * @arkts 1.2 + */ + function GetTotalSizeWithCallback(callback: AsyncCallback): void; + /** * Get the total size. * @@ -464,6 +605,18 @@ parameters are left unspecified; */ function getTotalSize(callback: AsyncCallback): void; + /** + * Get the total size. + * + * @returns { Promise } return Promise + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @since 20 + * @arkts 1.2 + */ + function GetTotalSizeReturnsPromise(): Promise; + /** * Get the total size. * @@ -517,6 +670,26 @@ parameters are left unspecified; */ function getTotalSizeSync(): number; + /** + * @since 20 + * @arkts 1.2 + */ + overload getFreeSize { GetFreeSizeWithCallback, GetFreeSizeReturnsPromise }; + + /** + * Get the free size. + * + * @param { AsyncCallback } callback - callback + * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:Mandatory +parameters are left unspecified; + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @since 20 + * @arkts 1.2 + */ + function GetFreeSizeWithCallback(callback: AsyncCallback): void; + /** * Get the free size. * @@ -546,6 +719,18 @@ parameters are left unspecified; */ function getFreeSize(callback: AsyncCallback): void; + /** + * Get the free size. + * + * @returns { Promise } return Promise + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @since 20 + * @arkts 1.2 + */ + function GetFreeSizeReturnsPromise(): Promise; + /** * Get the free size. * diff --git a/api/@ohos.file.volumeManager.d.ts b/api/@ohos.file.volumeManager.d.ts index 1b90ba7c3f8e84830c3161ba288037868bbb7ff5..05c41969fd0026f9a82c5aae63c9570f939baeef 100644 --- a/api/@ohos.file.volumeManager.d.ts +++ b/api/@ohos.file.volumeManager.d.ts @@ -122,6 +122,31 @@ declare namespace volumeManager { */ fsType: string; } + + /** + * @since 20 + * @arkts 1.2 + */ + overload getAllVolumes { GetAllVolumesWithCallback, GetAllVolumesReturnsPromise }; + + /** + * Get All Volumes + * + * @permission ohos.permission.STORAGE_MANAGER + * @param { AsyncCallback> } callback - callback + * @throws { BusinessError } 201 - Permission verification failed. + * @throws { BusinessError } 202 - The caller is not a system application. + * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:Mandatory +parameters are left unspecified; + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.Volume + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function GetAllVolumesWithCallback(callback: AsyncCallback>): void; + /** * Get All Volumes * @@ -153,8 +178,25 @@ parameters are left unspecified; * @throws { BusinessError } 13900042 - Unknown error. * @syscap SystemCapability.FileManagement.StorageService.Volume * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 + */ + function GetAllVolumesReturnsPromise(): Promise>; + + /** + * Get All Volumes + * + * @permission ohos.permission.STORAGE_MANAGER + * @returns { Promise> } 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.Possible causes:Mandatory +parameters are left unspecified; + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.Volume + * @systemapi + * @since 9 */ function getAllVolumes(): Promise>; @@ -250,6 +292,33 @@ parameters are left unspecified; */ function unmount(volumeId: string): Promise; + /** + * @since 20 + * @arkts 1.2 + */ + overload getVolumeByUuid { GetVolumeByUuidWithCallback, GetVolumeByUuidReturnsPromise }; + + /** + * Get the volume by uuid. + * + * @permission ohos.permission.STORAGE_MANAGER + * @param { string } uuid - The uuid of volume + * @param { AsyncCallback } callback - callback + * @throws { BusinessError } 201 - Permission verification failed. + * @throws { BusinessError } 202 - The caller is not a system application. + * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:1.Mandatory +parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13600008 - No such object. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.Volume + * @systemapi + * @since 20 + * @arkts 1.2 + */ + function GetVolumeByUuidWithCallback(uuid: string, callback: AsyncCallback): void; + /** * Get the volume by uuid. * @@ -287,8 +356,28 @@ parameters are left unspecified; * @throws { BusinessError } 13900042 - Unknown error. * @syscap SystemCapability.FileManagement.StorageService.Volume * @systemapi - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 + */ + function GetVolumeByUuidReturnsPromise(uuid: string): Promise; + + /** + * Get the volume by uuid. + * + * @permission ohos.permission.STORAGE_MANAGER + * @param { string } uuid - The uuid of volume + * @returns { Promise } 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.Possible causes:1.Mandatory +parameters are left unspecified; + *
2.Incorrect parameter types. + * @throws { BusinessError } 13600001 - IPC error. + * @throws { BusinessError } 13600008 - No such object. + * @throws { BusinessError } 13900042 - Unknown error. + * @syscap SystemCapability.FileManagement.StorageService.Volume + * @systemapi + * @since 9 */ function getVolumeByUuid(uuid: string): Promise;