未验证 提交 13a334f8 编写于 作者: O openharmony_ci 提交者: Gitee

!1895 update storage statistics api

Merge pull request !1895 from zhangxingxia/master
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
## 导入模块 ## 导入模块
```js ```js
import storagestatistics from "@ohos.storagestatistics"; import storagestatistics from "@ohos.storageStatistics";
``` ```
## 系统能力 ## 系统能力
...@@ -61,9 +61,10 @@ getTotalSizeOfVolume(volumeUuid: string, callback:AsyncCallback<number>):v ...@@ -61,9 +61,10 @@ getTotalSizeOfVolume(volumeUuid: string, callback:AsyncCallback<number>):v
let uuid = ""; let uuid = "";
storagestatistics.getTotalSizeOfVolume(uuid, function(error, number){ storagestatistics.getTotalSizeOfVolume(uuid, function(error, number){
// do something // do something
console.info("getTotalSizeOfVolume successfully:"+ number);
}); });
``` ```
## storagestatistics.getFreeSizeOfVolume ## storagestatistics.getFreeSizeOfVolume
...@@ -115,22 +116,22 @@ getFreeSizeOfVolume(volumeUuid: string, callback:AsyncCallback<number>):vo ...@@ -115,22 +116,22 @@ getFreeSizeOfVolume(volumeUuid: string, callback:AsyncCallback<number>):vo
let uuid = ""; let uuid = "";
storagestatistics.getFreeSizeOfVolume(uuid, function(error, number){ storagestatistics.getFreeSizeOfVolume(uuid, function(error, number){
// do something // do something
console.info("getFreeSizeOfVolume successfully:"+ number);
}); });
``` ```
## storagestatistics.getBundleStats ## storagestatistics.getBundleStats<sup>9+</sup>
getBundleStats(volumeUuid: string, packageName:String, ): Promise&lt;BundleStats&gt; getBundleStats(packageName:String, ): Promise&lt;BundleStats&gt;
异步获取指定卷上的应用存储状态,以promise方式返回。 异步获取应用存储状态,以promise方式返回。
- 参数 - 参数
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ----------- | ------ | ---- | -------- | | ----------- | ------ | ---- | -------- |
| volumeUuid | string | 是 | 卷id |
| packageName | string | 是 | 应用包名 | | packageName | string | 是 | 应用包名 |
- 返回值 - 返回值
| 类型 | 说明 | | 类型 | 说明 |
...@@ -140,35 +141,33 @@ getBundleStats(volumeUuid: string, packageName:String, ): Promise&lt;BundleStat ...@@ -140,35 +141,33 @@ getBundleStats(volumeUuid: string, packageName:String, ): Promise&lt;BundleStat
- 示例 - 示例
```js ```js
let uuid = "";
let packageName = ""; let packageName = "";
storagestatistics.getBundleStats(uuid, packageName).then(function(BundleStats){ storagestatistics.getBundleStats(packageName).then(function(BundleStats){
console.info("getBundleStats successfully:"+ JSON.stringify(BundleStats)); console.info("getBundleStats successfully:"+ JSON.stringify(BundleStats));
}).catch(function(err){ }).catch(function(err){
console.info("getBundleStats failed with error:"+ err); console.info("getBundleStats failed with error:"+ err);
}); });
``` ```
## storagestatistics.getBundleStats ## storagestatistics.getBundleStats<sup>9+</sup>
getBundleStats(volumeUuid: string, callback:AsyncCallback&lt;BundleStats&gt;):void getBundleStats(callback:AsyncCallback&lt;BundleStats&gt;):void
异步获取指定卷上的应用存储状态,以callback方式返回。 异步获取应用存储状态,以callback方式返回。
- 参数 - 参数
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ---------- | --------------------------------------------------------- | ---- | ------------------------------------ | | -------- | --------------------------------------------------------- | ---- | ------------------------------------ |
| volumeUuid | string | 是 | 卷id | | callback | callback:AsyncCallback&lt;[Bundlestats](#bundlestats)&gt; | 是 | 获取指定卷上的应用存储状态之后的回调 |
| callback | callback:AsyncCallback&lt;[Bundlestats](#bundlestats)&gt; | 是 | 获取指定卷上的应用存储状态之后的回调 |
- 示例 - 示例
```js ```js
let uuid = "";
let packageName = ""; let packageName = "";
storagestatistics.getBundleStats(uuid, packageName, function(error, BundleStats){ storagestatistics.getBundleStats(packageName, function(error, BundleStats){
// do something // do something
console.info("getBundleStats successfully:"+ JSON.stringify(BundleStats));
}); });
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册