From 201b788fb3c75cf0814b21f0c7c84e08771abd0c Mon Sep 17 00:00:00 2001 From: haonan_7 Date: Tue, 8 Feb 2022 18:12:23 +0800 Subject: [PATCH 1/5] add @ohos.storageStatistics.d.ts Signed-off-by: haonan_7 --- api/@ohos.storageStatistics.d.ts | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 api/@ohos.storageStatistics.d.ts diff --git a/api/@ohos.storageStatistics.d.ts b/api/@ohos.storageStatistics.d.ts new file mode 100644 index 0000000000..9f77f86a05 --- /dev/null +++ b/api/@ohos.storageStatistics.d.ts @@ -0,0 +1,57 @@ +/* +* Copyright (C) 2021 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import {AsyncCallback, Callback} from "./basic"; + +/** + * Provides filesystem statistics APIs + * + * @since 8 + * @sysCap N/A + * @devices phone, tablet + */ +declare namespace storageStatistics { + /** + * Get the totalSize of volume. + * + * @since 8 + */ + function getTotalSizeOfVolume(volumeUuid: string, callback: AsyncCallback): void; + function getTotalSizeOfVolume(volumeUuid: string): Promise; + /** + * Get the free size Of volume. + * + * @since 8 + */ + function getFreeSizeOfVolume(volumeUuid: string, callback: AsyncCallback): void; + function getFreeSizeOfVolume(volumeUuid: string): Promise; + + /** + * Get the bundlestat + * + * @since 8 + */ + + export interface BundleStats { + appSize: number; + cacheSize: number; + dataSize: number; +} + function getBundleStats(volumeUuid: string, packageName: string, callback: AsyncCallback): void; + function getBundleStats(volumeUuid: string, packageName: string): Promise; + +} + +export default storageStatistics; -- Gitee From 899eb9d86deb2001957dc026c1e1fa7140c0db53 Mon Sep 17 00:00:00 2001 From: haonan_7 Date: Thu, 10 Feb 2022 11:08:04 +0800 Subject: [PATCH 2/5] add @ohos.volumeManager.d.ts Signed-off-by: haonan_7 --- api/@ohos.volumeManager.d.ts | 62 ++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 api/@ohos.volumeManager.d.ts diff --git a/api/@ohos.volumeManager.d.ts b/api/@ohos.volumeManager.d.ts new file mode 100644 index 0000000000..5baaf55276 --- /dev/null +++ b/api/@ohos.volumeManager.d.ts @@ -0,0 +1,62 @@ +/* +* Copyright (C) 2021 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import {AsyncCallback, Callback} from "./basic"; + +/** + * Provides volumemanager statistics APIs + * + * @since 8 + * @sysCap N/A + * @devices phone, tablet + */ +declare namespace VolumeManager { + +/** + * Get All Volumes + * + * @since 8 + */ + export interface Volume { + id: number; + uuid: string; + description: string; + removeAble: boolean; + state: number; + path: string; +} +function getAllVolumes(callback: AsyncCallback>): void; +function getAllVolumes(): Promise>; + + + /** + * Mount + * + * @since 8 + */ +function mount(volumeId: string, callback: AsyncCallback): void; +function mount(volumeId: string): Promise; + +/** + * UnMount + * + * @since 8 + */ +function unmount(volumeId: string, callback: AsyncCallback): void; +function unmount(volumeId: string): Promise; + +} + +export default VolumeManager; -- Gitee From dc45833c4211799da23d8416812fbe2b909a7c73 Mon Sep 17 00:00:00 2001 From: haonan_7 Date: Thu, 10 Feb 2022 15:39:50 +0800 Subject: [PATCH 3/5] fix @ohos.volumeManager.d.ts and @ohos.storageStatistics.d.ts Signed-off-by: haonan_7 --- api/@ohos.storageStatistics.d.ts | 2 +- api/@ohos.volumeManager.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.storageStatistics.d.ts b/api/@ohos.storageStatistics.d.ts index 9f77f86a05..8eb3197185 100644 --- a/api/@ohos.storageStatistics.d.ts +++ b/api/@ohos.storageStatistics.d.ts @@ -19,7 +19,7 @@ import {AsyncCallback, Callback} from "./basic"; * Provides filesystem statistics APIs * * @since 8 - * @sysCap N/A + * @sysCap SystemCapability.FileManagement.StorageService.SpatialStatistics * @devices phone, tablet */ declare namespace storageStatistics { diff --git a/api/@ohos.volumeManager.d.ts b/api/@ohos.volumeManager.d.ts index 5baaf55276..f30c1b9764 100644 --- a/api/@ohos.volumeManager.d.ts +++ b/api/@ohos.volumeManager.d.ts @@ -19,7 +19,7 @@ import {AsyncCallback, Callback} from "./basic"; * Provides volumemanager statistics APIs * * @since 8 - * @sysCap N/A + * @sysCap SystemCapability.FileManagement.StorageService.Volume * @devices phone, tablet */ declare namespace VolumeManager { -- Gitee From 3955649df77cc1f7fa71bb79e02661bfb653e044 Mon Sep 17 00:00:00 2001 From: haonan_7 Date: Thu, 10 Feb 2022 16:19:44 +0800 Subject: [PATCH 4/5] fix @ohos.volumeManager.d.ts and @ohos.storageStatistics.d.ts Signed-off-by: haonan_7 --- api/@ohos.storageStatistics.d.ts | 3 +-- api/@ohos.volumeManager.d.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/api/@ohos.storageStatistics.d.ts b/api/@ohos.storageStatistics.d.ts index 8eb3197185..7fb9e06aed 100644 --- a/api/@ohos.storageStatistics.d.ts +++ b/api/@ohos.storageStatistics.d.ts @@ -19,8 +19,7 @@ import {AsyncCallback, Callback} from "./basic"; * Provides filesystem statistics APIs * * @since 8 - * @sysCap SystemCapability.FileManagement.StorageService.SpatialStatistics - * @devices phone, tablet + * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics */ declare namespace storageStatistics { /** diff --git a/api/@ohos.volumeManager.d.ts b/api/@ohos.volumeManager.d.ts index f30c1b9764..633f0274c9 100644 --- a/api/@ohos.volumeManager.d.ts +++ b/api/@ohos.volumeManager.d.ts @@ -19,8 +19,7 @@ import {AsyncCallback, Callback} from "./basic"; * Provides volumemanager statistics APIs * * @since 8 - * @sysCap SystemCapability.FileManagement.StorageService.Volume - * @devices phone, tablet + * @syscap SystemCapability.FileManagement.StorageService.Volume */ declare namespace VolumeManager { -- Gitee From 0f467e2baa9e3e92e1e6521f81653eb6e5a9a93a Mon Sep 17 00:00:00 2001 From: haonan_7 Date: Fri, 11 Feb 2022 10:34:48 +0800 Subject: [PATCH 5/5] fix @ohos.volumeManager.d.ts and @ohos.storageStatistics.d.ts Signed-off-by: haonan_7 --- api/@ohos.volumeManager.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.volumeManager.d.ts b/api/@ohos.volumeManager.d.ts index 633f0274c9..0aa1f21277 100644 --- a/api/@ohos.volumeManager.d.ts +++ b/api/@ohos.volumeManager.d.ts @@ -21,7 +21,7 @@ import {AsyncCallback, Callback} from "./basic"; * @since 8 * @syscap SystemCapability.FileManagement.StorageService.Volume */ -declare namespace VolumeManager { +declare namespace volumeManager { /** * Get All Volumes @@ -58,4 +58,4 @@ function unmount(volumeId: string): Promise; } -export default VolumeManager; +export default volumeManager; -- Gitee