diff --git a/api/@ohos.fileio.d.ts b/api/@ohos.fileio.d.ts index d074897db66b2d0b83bb97b2901da646653e741e..b78dc4ddc7e972ae29dad47cb47c850081713484 100644 --- a/api/@ohos.fileio.d.ts +++ b/api/@ohos.fileio.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -1048,6 +1048,27 @@ declare interface Dir { * @throws {TypedError | Error} read fail if read to end, Error.msg = "NoMore" */ readSync(): Dirent; + /** + * listFile. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + * @function listFile + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback return Promise otherwise return void + * @throws {BusinessError} Parameter check failed if read to end, Error.msg = "NoMore" + */ + listFile(): Promise; + listFile(callback: AsyncCallback): void; + /** + * listFileSync. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + * @function listFileSync + * @returns {Dirent} Dirent Object + * @throws {BusinessError | Error} read fail if read to end, Error.msg = "NoMore" + */ + listFileSync(): Dirent; /** * close. * @note N/A