1/* 2 * Copyright (C) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 */ 19 20import { AsyncCallback } from './@ohos.base'; 21 22/** 23 * Provides filesystem statistics APIs 24 * 25 * @namespace Statfs 26 * @syscap SystemCapability.FileManagement.File.FileIO 27 * @since 8 28 * @deprecated since 9 29 * @useinstead ohos.file.statvfs.statfs 30 */ 31declare namespace Statfs { 32 /** 33 * Get the number of free bytes on the specified path. 34 * 35 * @param { string } path 36 * @param { AsyncCallback<number> } callback - callback 37 * @syscap SystemCapability.FileManagement.File.FileIO 38 * @since 8 39 * @deprecated since 9 40 * @useinstead ohos.file.statvfs.getFreeSize 41 */ 42 function getFreeBytes(path: string, callback: AsyncCallback<number>): void; 43 44 /** 45 * Get the number of free bytes on the specified path. 46 * 47 * @param { string } path 48 * @returns { Promise<number> } return Promise 49 * @syscap SystemCapability.FileManagement.File.FileIO 50 * @since 8 51 * @deprecated since 9 52 * @useinstead ohos.file.statvfs.getFreeSize 53 */ 54 function getFreeBytes(path: string): Promise<number>; 55 /** 56 * Get the total number of bytes of the specified path. 57 * 58 * @param { string } path 59 * @param { AsyncCallback<number> } callback - callback 60 * @syscap SystemCapability.FileManagement.File.FileIO 61 * @since 8 62 * @deprecated since 9 63 * @useinstead ohos.file.statvfs.getTotalSize 64 */ 65 function getTotalBytes(path: string, callback: AsyncCallback<number>): void; 66 67 /** 68 * Get the total number of bytes of the specified path. 69 * 70 * @param { string } path 71 * @returns { Promise<number> } return Promise 72 * @syscap SystemCapability.FileManagement.File.FileIO 73 * @since 8 74 * @deprecated since 9 75 * @useinstead ohos.file.statvfs.getTotalSize 76 */ 77 function getTotalBytes(path: string): Promise<number>; 78} 79 80export default Statfs; 81