> - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - API version 9 is a canary release for trial use. The APIs of this version may be unstable.
> - API version 9 is a canary version for trial use. The APIs of this version may be unstable.
Obtains storage space information, including the space of built-in and plug-in memory cards, space occupied by different types of data, and space of application data.
## Modules to Import
## Modules to Import
...
@@ -15,10 +17,14 @@ import storagestatistics from "@ohos.storageStatistics";
...
@@ -15,10 +17,14 @@ import storagestatistics from "@ohos.storageStatistics";
**System API**: This is a system API and cannot be called by third-party applications.
- Parameters
| Name | Type | Mandatory| Description|
| ---------- | ------ | ---- | ---- |
| userId | string | No | User ID.<br>- Set this parameter to the ID of the user to be queried.<br>- If no value is specified, information about the current user is queried.|
- Return value
| Type | Description |
| --------------------- | ---------------- |
| Promise<[StorageStats](#StorageStats)> | Promise used to return the information obtained.|
| userId | string | No | User ID.<br>- Set this parameter to the ID of the user to be queried.<br>- If no value is specified, information about the current user is queried. |
| callback | callback:AsyncCallback<[StorageStats](#StorageStats)> | Yes | Callback invoked to return the information obtained.|